From report at bugs.python.org Sat Jun 1 00:13:41 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 31 May 2013 22:13:41 +0000 Subject: [issue17005] Add a topological sort algorithm In-Reply-To: <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za> Message-ID: <1370038421.57.0.914867643443.issue17005@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: +1 I had "tsort" in my own utilities library for so long that I thought it was in stdlib already. I found this issue after unsuccessfully searching docs.python.org. :-) I think functools will be a fine place for it. It is somewhat related to total ordering and solves the problem which is common when implementing functional mini-languages. Another possibility is shutil given that tsort is a standard POSIX command, , but I think this will be too obscure. ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 00:22:08 2013 From: report at bugs.python.org (Eric Wieser) Date: Fri, 31 May 2013 22:22:08 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail Message-ID: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> New submission from Eric Wieser: This code: class Sudoku(dict): COLUMNS = [ {(x, y) for y in xrange(9)} for x in xrange(9) ] When run on Python 2.7.5, fails with this traceback: Traceback (most recent call last): File "", line 1, in class Sudoku(object): File "", line 3, in Sudoku {(x, y) for y in xrange(9)} for x in xrange(9) File "", line 3, in {(x, y) for y in xrange(9)} for x in xrange(9) NameError: global name 'x' is not defined Yet `x` is clearly not a global - it's defined in the comprehension. Running the comprehension outside of the class gives no error: >>> [ {(x, y) for y in xrange(9)} for x in xrange(9) ] [set([...]), ...] Nor does using `set`: class Sudoku(dict): COLUMNS = [ set((x, y) for y in xrange(9)) for x in xrange(9) ] ---------- components: Interpreter Core messages: 190420 nosy: Eric.Wieser priority: normal severity: normal status: open title: Nested set comprehensions in class scope fail type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 00:45:22 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 31 May 2013 22:45:22 +0000 Subject: [issue18090] dict_contains first argument declared register, and shouldn't be In-Reply-To: <1369792194.1.0.0166087183245.issue18090@psf.upfronthosting.co.za> Message-ID: <1370040322.95.0.887335224851.issue18090@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Guido, do you still believe in using 'register' in C code in general or in particular, for function arguments. Many of the uses in dictobject.c go back to your rev1256 and rev5396. The one that caught Larry's eye for dict_contains appears to be from the latter. (Many other appearances are credited to Antoine as solipsis, though these may be from merges or something, and he has already said he thinks they could go.) ---------- nosy: +gvanrossum, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 00:57:44 2013 From: report at bugs.python.org (Dominik Richter) Date: Fri, 31 May 2013 22:57:44 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370041064.2.0.68152635104.issue18109@psf.upfronthosting.co.za> Dominik Richter added the comment: @dmi.baranov: You're right, according to: http://tools.ietf.org/html/rfc952 ::= *["."] ::= [*[]] http://tools.ietf.org/html/rfc1178 Don't use non-alphanumeric characters in a name. If you use posix definition of alphanumeric, that fits. What a shame ;) ---------- resolution: -> invalid type: behavior -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 00:57:55 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 31 May 2013 22:57:55 +0000 Subject: [issue18088] Create importlib.abc.Loader.init_module_attrs() In-Reply-To: <1369786095.97.0.622799229859.issue18088@psf.upfronthosting.co.za> Message-ID: <3bMgzk6lCsz7Lnn@mail.python.org> Roundup Robot added the comment: New changeset e873f2e67353 by Brett Cannon in branch 'default': Issues #18088, 18089: Introduce http://hg.python.org/cpython/rev/e873f2e67353 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 00:59:34 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 31 May 2013 22:59:34 +0000 Subject: [issue18088] Create importlib.abc.Loader.init_module_attrs() In-Reply-To: <1369786095.97.0.622799229859.issue18088@psf.upfronthosting.co.za> Message-ID: <1370041174.47.0.508004355158.issue18088@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 00:59:47 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 31 May 2013 22:59:47 +0000 Subject: [issue18089] Create importlib.abc.InspectLoader.load_module() In-Reply-To: <1369786184.33.0.5189689694.issue18089@psf.upfronthosting.co.za> Message-ID: <1370041187.91.0.030326520731.issue18089@psf.upfronthosting.co.za> Brett Cannon added the comment: New changeset e873f2e67353 by Brett Cannon in branch 'default': Issues #18088, 18089: Introduce http://hg.python.org/cpython/rev/e873f2e67353 ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:02:21 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 31 May 2013 23:02:21 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370041341.84.0.90362318903.issue18109@psf.upfronthosting.co.za> STINNER Victor added the comment: """ http://tools.ietf.org/html/rfc1178 Don't use non-alphanumeric characters in a name. """ This is a recommendation, it does not mean that it is forbidden. But on Fedora, I'm unable to set a non-ASCII hostname. Arch Linux may be different. Python should not fail with non-ASCII hostname, but I don't know which encoding should be used: ascii/surrogateescape (PEP 383)? the locale encoding + surrogateescape error handler? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:21:06 2013 From: report at bugs.python.org (Julian Berman) Date: Fri, 31 May 2013 23:21:06 +0000 Subject: [issue18111] Add a default argument to min & max Message-ID: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> New submission from Julian Berman: This has come up a number of times I'm aware, but no one has ever written a patch for it as far as a quick look uncovered. So here's one (written by Thomas Wouters but with permission to submit). Submitting without tests and docs, but those are incoming when I get a moment. The justification here is mostly related to being able to call min/max on an iterable of unknown length when there's a sensible default (which is usually going to be None, but that's not the default for backwards compat obviously). ---------- components: Interpreter Core messages: 190426 nosy: Julian, twouters priority: normal severity: normal status: open title: Add a default argument to min & max type: enhancement versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:29:07 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 31 May 2013 23:29:07 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1370042947.15.0.143515716751.issue13483@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested VirtualAlloc/VirtualFree versus malloc/free on Windows 7 SP1 64-bit. On my small test, when using VirtualAlloc/VirtualFree, the memory peak is lower (ex: 58.1 MB vs 59.0), and the memory usage is the same or sometimes lower. The difference is small, malloc() implementation on Windows 7 is efficient! But I am in favor of using VirtualAlloc/VirtualFree because it is the native API and the gain may be bigger on a real application. -- I used the following script for my test: https://bitbucket.org/haypo/misc/raw/98eb42a3ed2144141d62c75e3d07933839fe2a0c/python/python_memleak.py I reused get_process_mem_info() code from psutil to get current and peak memory usage (I failed to install psutil, I don't understand why). I also replace func() of my script with tuples.py to create many tuples. -- Python < 3.3 wastes a lot of memory with python_memleak.py. Python 3.3 behaves much better thanks to the usage of mmap() on Linux, and the fixed threshold on 64-bit (min=512 bytes, instead of 256). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:29:12 2013 From: report at bugs.python.org (Julian Berman) Date: Fri, 31 May 2013 23:29:12 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370042952.43.0.0548418575126.issue18111@psf.upfronthosting.co.za> Changes by Julian Berman : ---------- keywords: +patch Added file: http://bugs.python.org/file30437/minmaxdefault.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:30:49 2013 From: report at bugs.python.org (Dmi Baranov) Date: Fri, 31 May 2013 23:30:49 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail In-Reply-To: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> Message-ID: <1370043049.01.0.370974917431.issue18110@psf.upfronthosting.co.za> Changes by Dmi Baranov : ---------- nosy: +dmi.baranov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:33:54 2013 From: report at bugs.python.org (Dominik Richter) Date: Fri, 31 May 2013 23:33:54 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370043234.7.0.862313145041.issue18109@psf.upfronthosting.co.za> Dominik Richter added the comment: @haypo: You're right, RFC1178 is only a recommendation. RFC952 however is mandatory, although it doesn't seem to define explicitly (or at least i wasn't able to find it; thus referencing POSIX). Regarding Arch Linux's hostname: It is part of the package inetutils v1.9.1-5 [1], which is GNU inetutils packaged [2]. Unfortunately I don't know which encoding it uses. I agree with you: It would be great if python supported it. fyi: I opened a bug on Arch Linux [3] (thank you Dmi for the suggestion) [1] https://www.archlinux.org/packages/core/i686/inetutils/ [2] http://www.gnu.org/software/inetutils/ [3] https://bugs.archlinux.org/task/35580 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:35:53 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 31 May 2013 23:35:53 +0000 Subject: [issue18112] PEP 442 implementation Message-ID: <1370043353.45.0.859632508131.issue18112@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- components: Interpreter Core hgrepos: 194 nosy: pitrou priority: normal severity: normal stage: patch review status: open title: PEP 442 implementation type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:40:50 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 31 May 2013 23:40:50 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370043650.76.0.518033600652.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: > typedef void *(*PyCCP_Malloc_t)(size_t size, void *arg, const char *file, int line, const char *msg); I don't understand the purpose of the filename and line number. Python does not have such information. Is it just to have the API expected by Unreal engine? What is the message? How is it filled? -- I'm proposing a simpler prototype: void* (*malloc) (size_t); Just because Python does not use or have less or more. I'm not against adding an arbitrary void* argument, it should not hurt, and may be required by some other applications or libraries. @kristjan.jonsson: Can you adapt your tool to fit the following API? PyAPI_FUNC(int) Py_SetAllocators( char api, void* (*malloc) (size_t size, void *data), void* (*realloc) (void* ptr, size_t size, void *data), void (*free) (void* ptr, void *data) ); -- My pytracemalloc project hooks allocation functions and then use C Python functions to get the current filename and line number. No need to modify the C code to pass __FILE__ and __LINE__. It can produce such summary: 2013-02-28 23:40:18: Top 5 allocations per file #1: .../Lib/test/regrtest.py: 3998 KB #2: .../Lib/unittest/case.py: 2343 KB #3: .../ctypes/test/__init__.py: 513 KB #4: .../Lib/encodings/__init__.py: 525 KB #5: .../Lib/compiler/transformer.py: 438 KB other: 32119 KB Total allocated size: 39939 KB You can also configure it to display also the line number. https://pypi.python.org/pypi/pytracemalloc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 01:50:03 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 31 May 2013 23:50:03 +0000 Subject: [issue18104] Idle: make human-mediated GUI tests usable In-Reply-To: <1369961521.26.0.131640091288.issue18104@psf.upfronthosting.co.za> Message-ID: <1370044203.06.0.895744280816.issue18104@psf.upfronthosting.co.za> Terry J. Reedy added the comment: What I want is for the tests to be discovered when they should be and not when they should not ;-) -- without jumping through too many hoops. I probably once read 'recursing into subdirectories' but forgot. I like 'h_test...' for 'human test ...'. Thinking about it more, unittest does not not add much to this type of test. If dialogs maps dialog to test information used by h_test_dialog, then a first draft of testing all (there are 6 that I know of, 3 with display tests) could amount to def h_test_dialogs(): for dialog in dialogs: h_test_dialog(dialog) New entries to dialogs would be 'discovered' as added. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 03:30:04 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 01 Jun 2013 01:30:04 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370050204.25.0.691772253508.issue18109@psf.upfronthosting.co.za> R. David Murray added the comment: Issue 10097 may also have some relevant discussion, even though that issue originates from Windows. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 03:38:12 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 01 Jun 2013 01:38:12 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370050692.22.0.139657861377.issue18111@psf.upfronthosting.co.za> R. David Murray added the comment: Issue 7153 and the discussions linked therefrom is presumably relevant here. Do you have a concrete use case? ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 04:35:55 2013 From: report at bugs.python.org (Atsuo Ishimoto) Date: Sat, 01 Jun 2013 02:35:55 +0000 Subject: [issue18113] Memory leak in curses.panel Message-ID: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> New submission from Atsuo Ishimoto: Objects associated to the panel with panel.set_userptr() are never DECREF()ed. Attached file is script to reproduce the leak. Confirmed with Python2.7/3.3. ---------- files: userptr-leak.py messages: 190433 nosy: ishimoto priority: normal severity: normal status: open title: Memory leak in curses.panel versions: Python 2.7, Python 3.3 Added file: http://bugs.python.org/file30438/userptr-leak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 05:13:20 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 01 Jun 2013 03:13:20 +0000 Subject: [issue18114] Update PyImport_ImportFrozenModuleObject() to use importlib Message-ID: <1370056399.99.0.692031308648.issue18114@psf.upfronthosting.co.za> New submission from Brett Cannon: _imp.init_frozen is not really necessary; you can implement imports entirely using the other frozen-related functions. Because of that it's probably better to simply rewrite PyImport_ImportFrozenModuleObject() to use importlib to make the code easier to maintain and help guarantee consistency with other code. ---------- assignee: brett.cannon components: Interpreter Core messages: 190434 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Update PyImport_ImportFrozenModuleObject() to use importlib type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 05:15:34 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 01 Jun 2013 03:15:34 +0000 Subject: [issue18115] Use importlib.util.module_to_load in all loaders in importlib Message-ID: <1370056534.07.0.17129637302.issue18115@psf.upfronthosting.co.za> New submission from Brett Cannon: BuiltinImporter, FrozenImporter, and ExtensionFileLoader all have their own custom code to manage clearing sys.modules if something goes wrong. Should see if any of them would break if they used importlib.util.module_to_load. And if they would break thanks to any pre-existing module in sys.modules, then add a keyword argument to suppress creating a new module. ---------- assignee: brett.cannon components: Library (Lib) keywords: easy messages: 190435 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Use importlib.util.module_to_load in all loaders in importlib type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 05:18:48 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 01 Jun 2013 03:18:48 +0000 Subject: [issue18065] set __path__ = [] for frozen packages In-Reply-To: <1369524062.03.0.920595154239.issue18065@psf.upfronthosting.co.za> Message-ID: <3bMnmm0d9Vz7LyF@mail.python.org> Roundup Robot added the comment: New changeset 82db02a2e023 by Brett Cannon in branch 'default': Issue #18065: For frozen packages set __path__ to []. http://hg.python.org/cpython/rev/82db02a2e023 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 05:23:06 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 01 Jun 2013 03:23:06 +0000 Subject: [issue18065] set __path__ = [] for frozen packages In-Reply-To: <1369524062.03.0.920595154239.issue18065@psf.upfronthosting.co.za> Message-ID: <1370056986.09.0.874708036725.issue18065@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 05:25:18 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 01 Jun 2013 03:25:18 +0000 Subject: [issue18115] Use importlib.util.module_to_load in all loaders in importlib In-Reply-To: <1370056534.07.0.17129637302.issue18115@psf.upfronthosting.co.za> Message-ID: <1370057118.29.0.998090947162.issue18115@psf.upfronthosting.co.za> Brett Cannon added the comment: Turns out BuiltinImporter doesn't like having a pre-existing module, so a new keyword argument will be necessary to allow for only the cleanup code to run and not the construction of a new module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 05:30:04 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Jun 2013 03:30:04 +0000 Subject: [issue18104] Idle: make human-mediated GUI tests usable In-Reply-To: <1369961521.26.0.131640091288.issue18104@psf.upfronthosting.co.za> Message-ID: <1370057404.17.0.81353710638.issue18104@psf.upfronthosting.co.za> Terry J. Reedy added the comment: While improving the self-test for confixSectionNameDialog.py after fixing the error that stopped it from running, I discovered an error in the NameOk method: names were not really stripped before being tested. so duplicate section names were erroneously accepted if initially surrounded by whitespace. After fixing that, I removed unneeded code, including 5 pairs of parentheses in one statement, and added recommended spaces. I also centered the action buttons in the dialog. Attached is a drop-in replacement for the file (produced with Idle on my non-developement Win7 machine, so probably with the extra line end char). I think it is good enough to commit, but I am curious if the instructions added to the test are clear enough. (The dialog is the one seen if Save as New Custom Theme (Highlighting tab) or Save as New Custom Key Set (Key tab) are selected on the Options / Preferences dialog. For new custom test files, the root window should be open farther from the edge of the screen. ---------- stage: needs patch -> patch review Added file: http://bugs.python.org/file30439/configSectionNameDialog.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 05:50:15 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 01 Jun 2013 03:50:15 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail In-Reply-To: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> Message-ID: <1370058615.8.0.131046489787.issue18110@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- resolution: -> duplicate status: open -> closed superseder: -> improper scope in list comprehension, when used in class declaration _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 08:13:51 2013 From: report at bugs.python.org (Matt Wilkie) Date: Sat, 01 Jun 2013 06:13:51 +0000 Subject: [issue4636] bdist_wininst installer with install script raises exception In-Reply-To: <1229030167.98.0.0716327891895.issue4636@psf.upfronthosting.co.za> Message-ID: <1370067231.81.0.328408761603.issue4636@psf.upfronthosting.co.za> Matt Wilkie added the comment: I confirm this is happening with 3.2.4 from an installer generated in 2.7.4 (64bit Win7, 32bit python): https://pypi.python.org/pypi/leo/4.11.devel-build-5802 ---------- nosy: +Matt.Wilkie _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 08:14:17 2013 From: report at bugs.python.org (Matt Wilkie) Date: Sat, 01 Jun 2013 06:14:17 +0000 Subject: [issue13123] bdist_wininst uninstaller does not remove pycache directories In-Reply-To: <1318000960.21.0.140069466315.issue13123@psf.upfronthosting.co.za> Message-ID: <1370067257.62.0.0231390573891.issue13123@psf.upfronthosting.co.za> Changes by Matt Wilkie : ---------- nosy: +Matt.Wilkie _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 09:14:28 2013 From: report at bugs.python.org (Andy Chugunov) Date: Sat, 01 Jun 2013 07:14:28 +0000 Subject: [issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception In-Reply-To: <1368519577.93.0.961015588209.issue17973@psf.upfronthosting.co.za> Message-ID: <1370070868.43.0.633500105045.issue17973@psf.upfronthosting.co.za> Andy Chugunov added the comment: Thank you guys for all the efforts you put in solving and answering this. Just so that we're clear. It is perfectly legitimate to extend lists withing tuples. It just doesn't seem possible to make augmented assignment and simple assignment handle this particular operation correctly without unduly sacrificing their general efficiency. Use append() on the lists instead. Is that correct? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 10:06:26 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 01 Jun 2013 08:06:26 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370073986.57.0.163898256887.issue18109@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: To reproduce the issue, try this: # echo > /proc/sys/kernel/hostname > the locale encoding + surrogateescape error handler Sounds reasonable. ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 10:40:14 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Jun 2013 08:40:14 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1370076014.29.0.971899106814.issue18113@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: +Extension Modules keywords: +easy nosy: +serhiy.storchaka stage: -> needs patch type: -> behavior versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 10:43:58 2013 From: report at bugs.python.org (Dominik Richter) Date: Sat, 01 Jun 2013 08:43:58 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370076238.22.0.130287985558.issue18109@psf.upfronthosting.co.za> Dominik Richter added the comment: @neologix: (with current hostname showing at the left of my prompt) none:~ #> echo h?t > /proc/sys/kernel/hostname h?t:~ #> hostname h?t ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 10:47:33 2013 From: report at bugs.python.org (Dominik Richter) Date: Sat, 01 Jun 2013 08:47:33 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370076453.73.0.308698567067.issue18109@psf.upfronthosting.co.za> Dominik Richter added the comment: /off: nevermind, wasn't directed at me ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 10:54:23 2013 From: report at bugs.python.org (Eric Wieser) Date: Sat, 01 Jun 2013 08:54:23 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail In-Reply-To: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> Message-ID: <1370076863.18.0.187714211395.issue18110@psf.upfronthosting.co.za> Eric Wieser added the comment: This is not at first glance, a duplicate of 3692 - in that case, the list comprehension is referring to another class variable. Most notably, that describes a behavioural change introduced by python 3 - in this case, python 3 handles it correctly - there's a bug in the python 2 implementation. ---------- resolution: duplicate -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 10:54:43 2013 From: report at bugs.python.org (Eric Wieser) Date: Sat, 01 Jun 2013 08:54:43 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail In-Reply-To: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> Message-ID: <1370076883.21.0.414480467115.issue18110@psf.upfronthosting.co.za> Changes by Eric Wieser : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 15:17:32 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Jun 2013 13:17:32 +0000 Subject: [issue1772673] Replacing char* with const char* Message-ID: <1370092652.11.0.364657554558.issue1772673@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The patch is outdated. Some function prototypes were changed in issue9369, some were changed before. Here is a new patch. It adds const qualifier to following public functions: PyObject_DelAttrString, PyObject_HasAttrString, PyObject_GetAttrString, PyObject_SetAttrString, PyObject_DelItemString, PyMapping_DelItemString, PyMapping_HasKeyString, PyMapping_GetItemString, PyMapping_SetItemString, PyFile_FromFd, PyImport_ExecCodeModule, PyImport_ExecCodeModuleEx, PyImport_ExecCodeModuleWithPathnames, PyImport_ImportFrozenModule, PyLong_FromString, PyOS_strtoul, PyOS_strtol, PyOS_Readline, PyMarshal_ReadObjectFromString, PyParser_ParseFile, PyParser_ParseFileFlags, PyParser_ParseFileFlagsEx, PyTokenizer_FromFile. It also changes prototypes of some internal functions and structures and fixes documentation for PyDict_DelItemString. Some of functions already were documented with const qualifier. ---------- nosy: +brett.cannon, eric.snow, ncoghlan stage: needs patch -> patch review Added file: http://bugs.python.org/file30440/const_char_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 15:33:53 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 01 Jun 2013 13:33:53 +0000 Subject: [issue18020] html.escape 10x slower than cgi.escape In-Reply-To: <1369038098.34.0.795942514317.issue18020@psf.upfronthosting.co.za> Message-ID: <1370093633.68.0.327633711785.issue18020@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- assignee: -> ezio.melotti stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 16:02:21 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 01 Jun 2013 14:02:21 +0000 Subject: [issue17973] FAQ entry for: '+=' on a list inside tuple both succeeds and raises an exception In-Reply-To: <1368519577.93.0.961015588209.issue17973@psf.upfronthosting.co.za> Message-ID: <1370095341.27.0.532298278951.issue17973@psf.upfronthosting.co.za> R. David Murray added the comment: I believe that summary is correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 16:59:24 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 01 Jun 2013 14:59:24 +0000 Subject: [issue16450] test_missing_localfile masks problems in urlopen In-Reply-To: <1352558532.09.0.890578567494.issue16450@psf.upfronthosting.co.za> Message-ID: <3bN5K76CYhzSTD@mail.python.org> Roundup Robot added the comment: New changeset 60c195e89c88 by Senthil Kumaran in branch '2.7': Fix #16450 test_missing_localfile testcase fails on misconfigured hostname. http://hg.python.org/cpython/rev/60c195e89c88 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 17:03:13 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 01 Jun 2013 15:03:13 +0000 Subject: [issue16450] test_missing_localfile masks problems in urlopen In-Reply-To: <1352558532.09.0.890578567494.issue16450@psf.upfronthosting.co.za> Message-ID: <1370098993.83.0.580626031794.issue16450@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I noticed this only after I had a misconfigured hostname on my mac. Fixing my hostname of course solved the problem, but in any case, changed the tests so that we wont be baffled by the unexpected (and misdirected error msg) from test for misconfigured hostname. Thanks for bug report, Hans Mulder and sorry for taking long time to get to this. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 17:27:59 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 01 Jun 2013 15:27:59 +0000 Subject: [issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied In-Reply-To: <1368424209.99.0.52540499369.issue17967@psf.upfronthosting.co.za> Message-ID: <3bN5y65mmLzT0K@mail.python.org> Roundup Robot added the comment: New changeset 0a544bb539e6 by Senthil Kumaran in branch '2.7': Fix #17967: For ftp urls CWD to target instead of hopping to each directory http://hg.python.org/cpython/rev/0a544bb539e6 New changeset dbfbdf2b5c19 by Senthil Kumaran in branch '3.3': Fix #17967: For ftp urls CWD to target instead of hopping to each directory http://hg.python.org/cpython/rev/dbfbdf2b5c19 New changeset c1101f0d6c29 by Senthil Kumaran in branch 'default': merge from 3.3 http://hg.python.org/cpython/rev/c1101f0d6c29 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 17:42:25 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 01 Jun 2013 15:42:25 +0000 Subject: [issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied In-Reply-To: <1368424209.99.0.52540499369.issue17967@psf.upfronthosting.co.za> Message-ID: <1370101345.1.0.432876361188.issue17967@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Thanks Zhaoqifa for steps to configure the ftp with acl. I could reproduce it manually and fix it by changes to the urllib.request code. Unfortunately, we dont have rigorous tests for ftp handling in urllib module. That's noted in test_urllib2net module too. This bug is fixed in all branches. ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 19:02:43 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 01 Jun 2013 17:02:43 +0000 Subject: [issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied In-Reply-To: <1368424209.99.0.52540499369.issue17967@psf.upfronthosting.co.za> Message-ID: <1370106163.25.0.88116076594.issue17967@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Reopening: This change is seeing problems with Windows Buildbot http://buildbot.python.org/all/builders/x86%20XP-4%203.x/builds/8643/steps/test/logs/stdio ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 19:26:38 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 01 Jun 2013 17:26:38 +0000 Subject: [issue17683] socket.getsockname() inconsistent return type with AF_UNIX In-Reply-To: <1365555770.86.0.711874075927.issue17683@psf.upfronthosting.co.za> Message-ID: <1370107598.74.0.568109717767.issue17683@psf.upfronthosting.co.za> Changes by Charles-Fran?ois Natali : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 19:54:05 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 01 Jun 2013 17:54:05 +0000 Subject: [issue18066] Remove SGI-specific code from pty.py In-Reply-To: <1369571537.69.0.0137495343006.issue18066@psf.upfronthosting.co.za> Message-ID: <3bN9BK4jkSzNlB@mail.python.org> Roundup Robot added the comment: New changeset a678f139510b by Andrew Kuchling in branch 'default': #18066: remove vestigial code depending on the sgi module http://hg.python.org/cpython/rev/a678f139510b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 19:54:55 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 01 Jun 2013 17:54:55 +0000 Subject: [issue18066] Remove SGI-specific code from pty.py In-Reply-To: <1369571537.69.0.0137495343006.issue18066@psf.upfronthosting.co.za> Message-ID: <1370109295.56.0.446872891875.issue18066@psf.upfronthosting.co.za> Changes by A.M. Kuchling : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 20:12:39 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Jun 2013 18:12:39 +0000 Subject: [issue18106] There are unused variables in Lib/test/test_collections.py In-Reply-To: <1369988012.39.0.245549184475.issue18106@psf.upfronthosting.co.za> Message-ID: <1370110359.19.0.00261067002.issue18106@psf.upfronthosting.co.za> Terry J. Reedy added the comment: To me, there are two independent improvements: using i and hence msg to identify the erroneous dup, and using .subTest to test all dups. I would combine ideas from both the first two patches to do both. 1. a fancy formatted message would be more useful with less fluff and the two displays each on their own line. msg = "iteration %s\ncopy: %s\norig: %s" % (i, dup, words) # or od for OrderedDict test 2. within both loops, add msg to all asserts as in the first patch. If there is a failure, one would want to know both the source of the dup (indicated by i) and the content, and how it differed from the model. 3. wrap the bodies of both loops with 'with self.subTest():' to always test all dups. Unrolling the loops prevents doing this. Test the revised tests by temporarily adding both the original (failing the 'is' test) and a partial and therefore faulty copy of the original to both list of dups. Verify that both errors are reported for each and that the message formatting looks ok. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 21:06:40 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Jun 2013 19:06:40 +0000 Subject: [issue18106] There are unused variables in Lib/test/test_collections.py In-Reply-To: <1370110359.19.0.00261067002.issue18106@psf.upfronthosting.co.za> Message-ID: Serhiy Storchaka added the comment: subTest() serves two purposes: identify the test case and continue testing oother test cases after a fail. For first purpose subTest() is not well suitable in these tests, becouse we have no a string which determine a test. Second purpose is not relevant to original issue. 1. a fancy formatted message would be more useful with less fluff and the > two displays each on their own line. > > msg = "iteration %s\ncopy: %s\norig: %s" % (i, dup, words) > # or od for OrderedDict test > When the test fails, dup is not expected value and printing it can raise an exception and prevent formatting useful error message. Failure report should be succesful in any case. 3. wrap the bodies of both loops with 'with self.subTest():' to always test > all dups. Unrolling the loops prevents doing this. > Of course you can wrap a body of the check() function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 21:35:40 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Jun 2013 19:35:40 +0000 Subject: [issue18106] There are unused variables in Lib/test/test_collections.py In-Reply-To: <1369988012.39.0.245549184475.issue18106@psf.upfronthosting.co.za> Message-ID: <1370115340.27.0.231833871957.issue18106@psf.upfronthosting.co.za> Terry J. Reedy added the comment: > becouse we have no a string which determine a test. The original loop could be have been written as (or be changed to) for label, dup in [ ('odcopy', od.copy()), ('copycopy', copy.copy(words)), ] and the label used to identify the test, whether passed to assertX or subTest. The test author (Raymond H.) thought the sequence number enough in the off chance there ever were a failure. >When the test fails, dup is not expected value and printing it can raise an exception and prevent formatting useful error message. I do not understand this, unittest assumes that tested objects are printable. Indeed, assertEqual(dup, words/od) will do that (making the message redundant for this particular test. So I think the best fix would be to redo the loop header as above, pass label to subTest so it appears for any failure (which intertwines subTest with this issue), and only pass a message to assert where actually needed (like the len test). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 21:43:58 2013 From: report at bugs.python.org (Donald Stufft) Date: Sat, 01 Jun 2013 19:43:58 +0000 Subject: [issue14621] Hash function is not randomized properly In-Reply-To: <1334858289.64.0.441945117447.issue14621@psf.upfronthosting.co.za> Message-ID: <1370115838.22.0.844123767911.issue14621@psf.upfronthosting.co.za> Changes by Donald Stufft : ---------- nosy: +dstufft _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 22:12:09 2013 From: report at bugs.python.org (Vinay Sajip) Date: Sat, 01 Jun 2013 20:12:09 +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: <1370117529.15.0.543585267581.issue11959@psf.upfronthosting.co.za> Changes by Vinay Sajip : Added file: http://bugs.python.org/file30441/d7c50c15468d.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 22:20:02 2013 From: report at bugs.python.org (H Xu) Date: Sat, 01 Jun 2013 20:20:02 +0000 Subject: [issue18050] embedded interpreter or virtualenv fails with "ImportError: cannot import name MAXREPEAT" In-Reply-To: <1369417243.06.0.993082490408.issue18050@psf.upfronthosting.co.za> Message-ID: <1370118002.38.0.691557217487.issue18050@psf.upfronthosting.co.za> Changes by H Xu : ---------- nosy: +xuhdev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 1 22:20:32 2013 From: report at bugs.python.org (Vinay Sajip) Date: Sat, 01 Jun 2013 20:20:32 +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: <1370118032.11.0.666473223592.issue11959@psf.upfronthosting.co.za> Vinay Sajip added the comment: Patch now updated to revert asyncore changes. The changes are now: smtpd.py - changed SMTPChannel and SMTPServer to accept map argument test_logging.py - removed subclassed SMTPChannel, not needed since the base SMTPChannel class now accepts a map, and simplified TestSMTPServer, since the base SMTPServer class now accepts a map. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 01:23:24 2013 From: report at bugs.python.org (Dwight Guth) Date: Sat, 01 Jun 2013 23:23:24 +0000 Subject: [issue15903] Make rawiobase_read() read directly to bytes object In-Reply-To: <1347279783.86.0.217898740398.issue15903@psf.upfronthosting.co.za> Message-ID: <1370129004.08.0.648177275798.issue15903@psf.upfronthosting.co.za> Dwight Guth added the comment: I was programming something today and thought I should let you know I came across a situation where the current behavior of this function is able to expose what seems to be raw memory to the user. import io class A(io.RawIOBase): def readinto(self, b): return len(b) A().read(100) ---------- nosy: +dwight.guth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 01:50:07 2013 From: report at bugs.python.org (Nikolaus Rath) Date: Sat, 01 Jun 2013 23:50:07 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning Message-ID: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> New submission from Nikolaus Rath: [0] nikratio at vostro:~/tmp$ cat bugme.py #!python import getpass import warnings warnings.simplefilter('default') getpass.getpass("What's up?") [0] nikratio at vostro:~/tmp$ python3 --version Python 3.3.2 [0] nikratio at vostro:~/tmp$ python3 bugme.py /usr/lib/python3.3/os.py:1043: ResourceWarning: unclosed file <_io.FileIO name=3 mode='rb+'> return io.open(fd, *args, **kwargs) What's up? ---------- components: Library (Lib) messages: 190458 nosy: Nikratio priority: normal severity: normal status: open title: getpass.getpass() triggers ResourceWarning type: resource usage versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 01:56:56 2013 From: report at bugs.python.org (Alex Gaynor) Date: Sat, 01 Jun 2013 23:56:56 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370131016.25.0.140315326939.issue18116@psf.upfronthosting.co.za> Alex Gaynor added the comment: Attached patch should fix this issue. ---------- keywords: +patch nosy: +alex Added file: http://bugs.python.org/file30442/issue18116.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 02:01:48 2013 From: report at bugs.python.org (Nikolaus Rath) Date: Sun, 02 Jun 2013 00:01:48 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370131308.07.0.0616080653921.issue18116@psf.upfronthosting.co.za> Nikolaus Rath added the comment: No, it doesn't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 02:04:36 2013 From: report at bugs.python.org (Alex Gaynor) Date: Sun, 02 Jun 2013 00:04:36 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370131476.66.0.643609334474.issue18116@psf.upfronthosting.co.za> Alex Gaynor added the comment: Are you sure you applied it correctly? With and without: Alexanders-MacBook-Pro:cpython alex_gaynor$ ./python.exe x.py What's up? Alexanders-MacBook-Pro:cpython alex_gaynor$ hg revert --all --no-backup reverting Lib/getpass.py Alexanders-MacBook-Pro:cpython alex_gaynor$ ./python.exe x.py What's up? x.py:6: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 mode='w+' encoding='UTF-8'> getpass.getpass("What's up?") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 02:24:41 2013 From: report at bugs.python.org (Nikolaus Rath) Date: Sun, 02 Jun 2013 00:24:41 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370132681.53.0.16164639727.issue18116@psf.upfronthosting.co.za> Nikolaus Rath added the comment: Yes, I'm pretty sure: [0] nikratio at vostro:~/tmp$ cp /usr/lib/python3.3/getpass.py . [0] nikratio at vostro:~/tmp$ patch -p2 < issue18116.diff patching file getpass.py Hunk #1 succeeded at 57 (offset -1 lines). [0] nikratio at vostro:~/tmp$ python3 bugme.py /usr/lib/python3.3/os.py:1043: ResourceWarning: unclosed file <_io.FileIO name=3 mode='rb+'> return io.open(fd, *args, **kwargs) What's up? # Test if we're using the patched getpass.py... [0] nikratio at vostro:~/tmp$ vim getpass.py [0] nikratio at vostro:~/tmp$ python3 bugme.py Hello /usr/lib/python3.3/os.py:1043: ResourceWarning: unclosed file <_io.FileIO name=3 mode='rb+'> return io.open(fd, *args, **kwargs) What's up? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 03:28:59 2013 From: report at bugs.python.org (Brandon Craig Rhodes) Date: Sun, 02 Jun 2013 01:28:59 +0000 Subject: [issue17855] Implement introspection of logger hierarchy In-Reply-To: <1367066938.7.0.169657399656.issue17855@psf.upfronthosting.co.za> Message-ID: <1370136539.83.0.974257894721.issue17855@psf.upfronthosting.co.za> Brandon Craig Rhodes added the comment: Adding an entirely separate API for introspection strikes me as counter-productive ? instead of merely having to maintain the logging API that you already maintain, you will additionally now have an entirely separate and second API that also has to be maintained forever. Reading back over the current logging documentation, it looks like the problem is that the documentation only includes verbs ? the methods that can be invoked ? but not adjectives: the attributes that are attached to each logger, handler, and filter. This is contrary to modern Python APIs, which typically document their attributes and offer direct access to them; within the Standard Library, cf the threading.Thread object for one that has done a good job of moving into the modern world with directly-accessible attributes. So my guess would be that you should discard the idea of a separate introspection API, and simply document that attributes of each logger, handler, and filter that today are already perfectly introspectable. Check out the logging_tree code if you want to make sure that you are ?promoting? into document-hood all of the attributes that I needed in order to do my introspecting there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 03:42:06 2013 From: report at bugs.python.org (Julian Berman) Date: Sun, 02 Jun 2013 01:42:06 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370137326.04.0.450954321428.issue18111@psf.upfronthosting.co.za> Julian Berman added the comment: Thanks for finding that, I thought there was an issue that came out of that p-i thread but couldn't find it. I'd like to be more concrete, but "calling max on an iterable" seems concrete enough to me. If you'd like to know more though, personally I've wanted this at least twice in the past 4 or 5 months. Currently, I have code that looks like: def best_match(stuff): first = next(stuff, None) if first is None: return return max(itertools.chain([first], stuff)) which finds the best matching (error it happens to be) in the given stuff. A few months ago I had a similar need in a different application. The issues in that thread from 2009 revolved around a bunch of confusing and not so related things. And I definitely agree that `start` is a really bad name for this. But I don't find `default` to be at all confusing, and in fact this has come up in #python a few times and each time there hasn't really been a problem explaining to someone what `default` would do (or how it would interact with `key` for that matter, although if a precedent is desired, the default in `argparse` just returns the default, it doesn't call `type` or anything on it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 04:43:29 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 02 Jun 2013 02:43:29 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370141009.23.0.124894170407.issue18111@psf.upfronthosting.co.za> R. David Murray added the comment: So you aren't really asking for a default, you are asking for a version of max/min that returns a sentinel instead of raising an error on an empty list. You could just write utility function that has a try/except in it. I'm not sure it is worth complicating min and max for this use case. (I'm not sure it isn't, either.) I wonder if we have any other functions in python that have an argument that turns a ValueError into a sentinel-return instead? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 04:53:15 2013 From: report at bugs.python.org (Julian Berman) Date: Sun, 02 Jun 2013 02:53:15 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370141595.92.0.576645991386.issue18111@psf.upfronthosting.co.za> Julian Berman added the comment: Yes that's a good description. I'm not sure the type of exception is the thing to look at as much as the behavior, I.e. I think next() is a good precedent. And it's not really pleasant to do this with a try/except. Of course everything's possible, but to catch the ValueError sanely requires checking the text of the exception so that the except isn't too broad. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 05:08:40 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 02 Jun 2013 03:08:40 +0000 Subject: [issue18106] There are unused variables in Lib/test/test_collections.py In-Reply-To: <1369988012.39.0.245549184475.issue18106@psf.upfronthosting.co.za> Message-ID: <1370142520.54.0.745323196319.issue18106@psf.upfronthosting.co.za> Vajrasky Kok added the comment: I redo the test as Terry J. Reedy suggested. I use label in loop, utilize subTest receiving label parameter, and pass messages to only necessary asserts. So roughly if the test fails, we would get something like this: ====================================================================== FAIL: test_copying (__main__.TestOrderedDict) (label='OrderedDict(od)') ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_collections.py", line 1237, in test_copying self.assertTrue(dup is not dup, msg) AssertionError: False is not true : copy: OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]) od: OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]) ====================================================================== FAIL: test_copying (__main__.TestCounter) (label='Counter(words)') ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_collections.py", line 942, in test_copying self.assertEqual(type(dup), type(''), msg) AssertionError: != : copy: Counter({'which': 2, 'witches': 1, 'witch': 1, 'watch': 1, 'wrist': 1, 'had': 1}) words: Counter({'which': 2, 'witches': 1, 'had': 1, 'watch': 1, 'witch': 1, 'wrist': 1}) ---------- Added file: http://bugs.python.org/file30443/test_with_label_and_subTest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 05:26:46 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 02 Jun 2013 03:26:46 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370143606.61.0.440617085925.issue18116@psf.upfronthosting.co.za> Vajrasky Kok added the comment: This bug happens in Python 3.4 as well. [sky at localhost cpython]$ ./python --version Python 3.4.0a0 [sky at localhost cpython]$ ./python /tmp/bugme.py /home/sky/Code/python/programming_language/cpython/Lib/os.py:1025: ResourceWarning: unclosed file <_io.FileIO name=3 mode='rb+'> return io.open(fd, *args, **kwargs) What's up? I tried to apply the patch manually (by copying, cutting and pasting) from Alex but Nikolaus is right. The patch does not work. The bug still happens ---------- nosy: +vajrasky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 05:27:30 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 02 Jun 2013 03:27:30 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370143650.77.0.189156185745.issue18111@psf.upfronthosting.co.za> R. David Murray added the comment: I don't think there's any other way to get a ValueError out of min/max, but I haven't actually looked at the code to check. Of course, if we want people to rely on that, we'd need to document it. 'next's default is used to return a sentinel when the list is exhausted, not when it would otherwise raise a ValueError. It is a somewhat related case, but is not exactly parallel. The sentinel for next indicates the end of an ongoing process. The proposed argument to min/max would *replace* an error with a sentinel value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 05:37:12 2013 From: report at bugs.python.org (Julian Berman) Date: Sun, 02 Jun 2013 03:37:12 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370144232.28.0.136344695502.issue18111@psf.upfronthosting.co.za> Julian Berman added the comment: It's not exactly the same of course, but calling next on a thing that might be empty would be somewhat close, and also is replacing an exception with a sentinel (an exception that is much easier to differentiate). You can always get a ValueError out of min/max, they're going to be ultimately calling __lt__ on stuff which can do what it wants, but that's admittedly quite unlikely. It's not really that readable though on the other hand. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 09:24:10 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 02 Jun 2013 07:24:10 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370157850.52.0.207799162507.issue18116@psf.upfronthosting.co.za> Vajrasky Kok added the comment: I isolate the bug. It happens in these lines: # Always try reading and writing directly on the tty first. fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY) tty = os.fdopen(fd, 'w+', 1) So to produce the bug more specifically, you can try this python file: # bugme2.py import os fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY) os.fdopen(fd, 'w+', 1) # end of bugme2.py In Linux Fedora 18, I would get this error: /home/sky/Code/python/programming_language/cpython/Lib/os.py:1025: ResourceWarning: unclosed file <_io.FileIO name=3 mode='rb+'> return io.open(fd, *args, **kwargs) Traceback (most recent call last): File "/tmp/bugme2.py", line 4, in os.fdopen(fd, 'w+', 1) File "/home/sky/Code/python/programming_language/cpython/Lib/os.py", line 1025, in fdopen return io.open(fd, *args, **kwargs) io.UnsupportedOperation: File or stream is not seekable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 09:55:30 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 02 Jun 2013 07:55:30 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370159730.18.0.393781613915.issue18116@psf.upfronthosting.co.za> Vajrasky Kok added the comment: I have investigated this problem and come up with the patch to fix the problem. This patch does the job. Caution: only for Python 3.4. But translating this patch to Python 3.3 should be straightforward. I hope this patch could be the foundation for better programmers to create better patch. Some of the issues with this patch are: I am not sure how to handle encoding and where the best place to close tty is. Reference: https://github.com/stefanholek/term/issues/1 http://stackoverflow.com/questions/5471158/typeerror-str-does-not-support-the-buffer-interface ---------- Added file: http://bugs.python.org/file30444/getpass_fix_resourcewarning.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 10:09:05 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 02 Jun 2013 08:09:05 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370160545.96.0.443725604214.issue18116@psf.upfronthosting.co.za> Vajrasky Kok added the comment: Sorry, My previous patch breaks the test. This one should pass the test and fix the bug. Still, there are ugly code in the patch that I hope better programmers could fix. ---------- Added file: http://bugs.python.org/file30445/getpass_fix_resourcewarning_pass_the_test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 10:29:43 2013 From: report at bugs.python.org (Gavan Schneider) Date: Sun, 02 Jun 2013 08:29:43 +0000 Subject: [issue18117] Missing symlink:Currnet after Mac OS X 3.3.2 package installation Message-ID: <1370161783.39.0.437072519867.issue18117@psf.upfronthosting.co.za> New submission from Gavan Schneider: There is a missing symlink. Context: Installed package: with no apparent problems onto a 'clean' system, i.e., no other python packages other than OS X 10.8.3 defaults. Found the following in /Library/Frameworks/Python.framework: pendari:Python.framework postgres$ ls -las total 24 0 drwxr-xr-x 3 root wheel 204 14 May 06:49 . 0 drwxr-xr-x 8 root wheel 374 2 Jun 17:06 .. 8 lrwxr-xr-x 1 root wheel 24 2 Jun 17:06 Headers -> Versions/Current/Headers 8 lrwxr-xr-x 1 root wheel 23 2 Jun 17:06 Python -> Versions/Current/Python 8 lrwxr-xr-x 1 root wheel 26 2 Jun 17:06 Resources -> Versions/Current/Resources 0 drwxr-xr-x 3 root wheel 102 14 May 06:54 Versions However: pendari:Versions postgres$ ls -las total 0 0 drwxr-xr-x 3 root wheel 102 14 May 06:54 . 0 drwxr-xr-x 3 root wheel 204 14 May 06:49 .. 0 drwxrwxr-x 7 root admin 306 14 May 06:54 3.3 Specifically we are missing the following from .../Versions: 8 lrwxr-xr-x 1 root wheel 3 2 Jun 17:27 Current -> 3.3 to make all the other symlinks work as intended. This also implies the ~/.bash_profile patch would be improved if the existing: PATH="/Library/Frameworks/Python.framework/Versions/3.3/bin:${PATH}" was replaced by: PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" Apologies if this has already been reported. It is my first report so I could easily have missed something: I searched with terms "installer mac". Regards Gavan Schneider ---------- assignee: ronaldoussoren components: Installation, Macintosh messages: 190474 nosy: gavan, ronaldoussoren priority: normal severity: normal status: open title: Missing symlink:Currnet after Mac OS X 3.3.2 package installation type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 10:39:37 2013 From: report at bugs.python.org (Gavan Schneider) Date: Sun, 02 Jun 2013 08:39:37 +0000 Subject: [issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation In-Reply-To: <1370161783.39.0.437072519867.issue18117@psf.upfronthosting.co.za> Message-ID: <1370162377.6.0.891144440491.issue18117@psf.upfronthosting.co.za> Changes by Gavan Schneider : ---------- title: Missing symlink:Currnet after Mac OS X 3.3.2 package installation -> Missing symlink:Current after Mac OS X 3.3.2 package installation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 11:30:24 2013 From: report at bugs.python.org (Lukas Lueg) Date: Sun, 02 Jun 2013 09:30:24 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1352291929.32.0.895096534658.issue16427@psf.upfronthosting.co.za> Message-ID: <1370165424.0.0.537763885555.issue16427@psf.upfronthosting.co.za> Lukas Lueg added the comment: I was investigating a callgrind dump of my code, showing how badly unicode_hash() was affecting my performance. Using google's cityhash instead of the builtin algorithm to hash unicode objects improves overall performance by about 15 to 20 percent for my case - that is quite a thing. Valgrind shows that the number of instructions spent by unicode_hash() drops from ~20% to ~11%. Amdahl crunches the two-fold performance increase to the mentioned 15 percent. Cityhash was chosen because of it's MIT license and advertisement for performance on short strings. I've now found this bug and attached a log for haypo's benchmark which compares native vs. cityhash. Caching was disabled during the test. Cityhash was compiled using -O3 -msse4.2 (cityhash uses cpu-native crc instructions). CPython's unittests fail due to known_hash and gdb output; besides that, everything else seems to work fine. Cityhash is advertised for it's performance with short strings, which does not seem to show in the benchmark. However, longer strings perform *much* better. If people are insterested, i can repeat the test on a armv7l ---------- nosy: +ebfe Added file: http://bugs.python.org/file30446/cityhash.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 11:57:29 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 02 Jun 2013 09:57:29 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1352291929.32.0.895096534658.issue16427@psf.upfronthosting.co.za> Message-ID: <1370167049.22.0.389385893136.issue16427@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > I was investigating a callgrind dump of my code, showing how badly > unicode_hash() was affecting my performance. Can you tell us about your use case? There are several CityHash variants, which one did you use? CityHash64? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 12:04:16 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Jun 2013 10:04:16 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370167456.64.0.0911242218467.issue18111@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'm -1 on expanding this API further. It already is pushing the limits with the dual signature and with the key-function. Many languages have min/max functions. AFAICT, none of them have an API with a default argument. This suggests that this isn't an essential capability. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 12:10:32 2013 From: report at bugs.python.org (Lukas Lueg) Date: Sun, 02 Jun 2013 10:10:32 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1352291929.32.0.895096534658.issue16427@psf.upfronthosting.co.za> Message-ID: <1370167832.51.0.41018290878.issue16427@psf.upfronthosting.co.za> Lukas Lueg added the comment: It's a cache sitting between an informix db and and an internal web service. Stuff comes out of db, processed, json'ifed, cached and put on the wire. 10**6s of strings pass this process per request if uncached... I use CityHash64WithSeed, the seed being cpython's hash prefix (which I don't care about but found reassuring to put in anyway) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 12:14:02 2013 From: report at bugs.python.org (helmut) Date: Sun, 02 Jun 2013 10:14:02 +0000 Subject: [issue18118] curses utf8 output broken Message-ID: <1370168042.56.0.867946170074.issue18118@psf.upfronthosting.co.za> New submission from helmut: Consider the test case below. <<< #!/usr/bin/python # -*- encoding: utf8 -*- import curses def wrapped(screen): screen.addstr(0, 0, "?") screen.addstr(0, 1, "?") screen.addstr(0, 2, "?") screen.getch() if __name__ == "__main__": curses.wrapper(wrapped) >>> Expected output: "???" Output on py3.3: as expected Output on py2.7.3: "??" The actual bytes (as determined by strace) were "\303\303\303\274". Observe the inclusion of broken utf8 sequences. This issue was initially discovered on Debian sid, but independently confirmed on Arch Linux and two more unknown. ---------- components: Library (Lib) messages: 190479 nosy: helmut priority: normal severity: normal status: open title: curses utf8 output broken type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 12:22:10 2013 From: report at bugs.python.org (Shuhei Takahashi) Date: Sun, 02 Jun 2013 10:22:10 +0000 Subject: [issue18119] urllib.FancyURLopener does not treat URL fragments correctly Message-ID: <1370168530.11.0.609209040554.issue18119@psf.upfronthosting.co.za> New submission from Shuhei Takahashi: When urllib.FancyURLopener encounters 302 redirection to a URL with fragments, it sends wrong URL to servers. For example, if we run: urllib.urlopen('http://example.com/foo') and the server responds like following. HTTP/1.1 302 Found Location: /bar#test Then urllib tries next to fetch http://example.com/bar#test, instead of http://example.com/bar. Correctly, urllib should strip fragment part of URL before issuing requests. ---------- components: Library (Lib) messages: 190480 nosy: takahashi.shuhei priority: normal severity: normal status: open title: urllib.FancyURLopener does not treat URL fragments correctly type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 12:52:18 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 02 Jun 2013 10:52:18 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370170338.48.0.697242527877.issue18111@psf.upfronthosting.co.za> R. David Murray added the comment: That's a good point about the __lt__. It occurred to me as well just before I read your post :). Raymond, do any other languages have an iterator protocol as a core language feature? It's the fact that it is in Python, and that it is not simple to LBYL when dealing with iterators, that brings this issue up for min and max. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 12:55:41 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 02 Jun 2013 10:55:41 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370170541.93.0.4269522847.issue18111@psf.upfronthosting.co.za> R. David Murray added the comment: Oh, and I don't think Haskell counts, since you'd expect them to stick strictly to the mathematical definition, with no consideration of practicality :) Note that I'm not saying I'm +1 on adding this (I haven't decided), I'm just trying to clarify the argument. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 13:08:10 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 02 Jun 2013 11:08:10 +0000 Subject: [issue18118] curses utf8 output broken in Python2 In-Reply-To: <1370168042.56.0.867946170074.issue18118@psf.upfronthosting.co.za> Message-ID: <1370171290.83.0.477850747161.issue18118@psf.upfronthosting.co.za> R. David Murray added the comment: I believe this is one of a class of bugs that are fixed in Python3, and that are unlikely to be fixed in Python2. I'll defer to Victor, though, who made a number of curses unicode fixes in Python3. ---------- nosy: +haypo, r.david.murray title: curses utf8 output broken -> curses utf8 output broken in Python2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 14:26:40 2013 From: report at bugs.python.org (Stefan Krah) Date: Sun, 02 Jun 2013 12:26:40 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370176000.54.0.858181188514.issue18111@psf.upfronthosting.co.za> Stefan Krah added the comment: I'd use foldl() in functional languages, where the default is part of foldl() and not of max(). Translated to Python, I'm thinking of: it = iter([328, 28, 2989, 22]) functools.reduce(max, it, next(it, None)) 2989 I agree with Raymond that a default arg in max() looks out of place. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 14:45:36 2013 From: report at bugs.python.org (Matthias Klose) Date: Sun, 02 Jun 2013 12:45:36 +0000 Subject: [issue17998] internal error in regular expression engine In-Reply-To: <1368803354.84.0.768428094886.issue17998@psf.upfronthosting.co.za> Message-ID: <1370177136.12.0.942001608054.issue17998@psf.upfronthosting.co.za> Matthias Klose added the comment: what's the status on this one? Can the proposed patch be applied until the decision whether to backout the original change, or not? ---------- nosy: +doko, georg.brandl, larry priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 14:47:45 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Jun 2013 12:47:45 +0000 Subject: [issue17998] internal error in regular expression engine In-Reply-To: <1368803354.84.0.768428094886.issue17998@psf.upfronthosting.co.za> Message-ID: <1370177265.52.0.812966271474.issue17998@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm working on tests. No need to rush. ---------- stage: patch review -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 16:10:55 2013 From: report at bugs.python.org (Shriramana Sharma) Date: Sun, 02 Jun 2013 14:10:55 +0000 Subject: [issue17991] ctypes.c_char gives a misleading error when passed a one-character unicode string In-Reply-To: <1368674517.59.0.230555789399.issue17991@psf.upfronthosting.co.za> Message-ID: <1370182255.52.0.890953198333.issue17991@psf.upfronthosting.co.za> Shriramana Sharma added the comment: I came upon this too. In Python 2 it used to expect a one character string. Apparently the same error message has been carried forward to Python 3 too, though now the actual expected input is either a one character bytes type and not a str type, or an int corresponding to the ord() value of that char. Minimal demonstration: $ python Python 2.7.4 (default, Apr 19 2013, 18:28:01) [GCC 4.7.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> class test ( Structure ) : ... _fields_ = [ ( "ch", c_char ) ] ... >>> a = test() >>> a.ch = ord('a') Traceback (most recent call last): File "", line 1, in TypeError: one character string expected >>> a.ch = 'c' >>> a.ch 'c' >>> $ python3 Python 3.3.1 (default, Apr 17 2013, 22:30:32) [GCC 4.7.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> class test ( Structure ) : ... _fields_ = [ ( "ch", c_char ) ] ... >>> a = test() >>> a.ch = 'c' Traceback (most recent call last): File "", line 1, in TypeError: one character string expected >>> a.ch = b'c' >>> a.ch b'c' >>> a.ch = ord('c') >>> a.ch b'c' >>> ---------- nosy: +jamadagni _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 16:21:08 2013 From: report at bugs.python.org (Lukas Lueg) Date: Sun, 02 Jun 2013 14:21:08 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1352291929.32.0.895096534658.issue16427@psf.upfronthosting.co.za> Message-ID: <1370182868.14.0.102535831856.issue16427@psf.upfronthosting.co.za> Lukas Lueg added the comment: Here are some benchmarks for a arm7l on a rk30-board. CityHash was compiled with -mcpu=native -O3. CityHash is around half as fast as the native algorithm for small strings and way, way slower on larger ones. My guess would be that the complex arithmetic in cityhash outweights the gains of better scheduling. The results are somewhat inconclusive, as the performance increases again for very long strings. ---------- Added file: http://bugs.python.org/file30447/cityhash_arm.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 16:34:21 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 02 Jun 2013 14:34:21 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1370182868.14.0.102535831856.issue16427@psf.upfronthosting.co.za> Message-ID: <1370183653.2625.1.camel@fsol> Antoine Pitrou added the comment: > Here are some benchmarks for a arm7l on a rk30-board. CityHash was > compiled with -mcpu=native -O3. The results look unbelievable. If you take "Length 10 ** 4", it means arm7l is able to hash 20 GB/s using the default unicode hash function. (did you disable caching?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 18:16:30 2013 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 Jun 2013 16:16:30 +0000 Subject: [issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation In-Reply-To: <1370161783.39.0.437072519867.issue18117@psf.upfronthosting.co.za> Message-ID: <1370189790.4.0.0679539781789.issue18117@psf.upfronthosting.co.za> Ned Deily added the comment: That behavior of the OS X installer is by design. Currently, the "Current" link is only set for Python 2 installations, not Python 3 ones. While that may have made sense in the early days of Python 3 (assuming there would be mixed installations of both Python 3 and Python 2 to the same framework), that is probably no longer a good idea. Considering the difference between Python 2 and 3 at the API level and that one of the reasons for installing as a framework should be to simplify linking with Python libraries, I've been thinking that it might be a good idea to have Python 3 install in its own framework, say Python3. Or some other arrangement. As it stands today, 'cc ... -framework Python ...' isn't usable for Python 3 out of the box. ---------- nosy: +ned.deily versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 19:06:53 2013 From: report at bugs.python.org (Lukas Lueg) Date: Sun, 02 Jun 2013 17:06:53 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1352291929.32.0.895096534658.issue16427@psf.upfronthosting.co.za> Message-ID: <1370192813.22.0.423260665662.issue16427@psf.upfronthosting.co.za> Lukas Lueg added the comment: The 10**4-case is an error (see insane %), I've never been able to reproduce. Having done more tests with fixed cpu frequency and other daemons' process priority reduced, cityhash always comes out much slower on arm7l. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 19:11:07 2013 From: report at bugs.python.org (spresse1) Date: Sun, 02 Jun 2013 17:11:07 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process Message-ID: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> New submission from spresse1: [Code demonstrating issue attached] When overloading multiprocessing.Process and using pipes, a reference to a pipe spawned in the parent is not properly garbage collected in the child. This causes the write end of the pipe to be held open with no reference to it in the child process, and therefore no way to close it. Therefore, it can never throw EOFError. Expected behavior: 1. Create a pipe with multiprocessing.Pipe(False) 2. Pass read end to a class which subclasses multiprocessing.Process 3. Close write end in parent process 4. Receive EOFError from read end Actual behavior: 1. Create a pipe with multiprocessing.Pipe(False) 2. Pass read end to a class which subclasses multiprocessing.Process 3. Close write end in parent process 4. Never receive EOFError from read end Examining the processes in /proc/[pid]/fds/ indicates that a write pipe is still open in the child process, though none should be. Additionally, no write pipe is open in the parent process. It is my belief that this is the write pipe spawned in the parent, and is remaining around incorrectly in the child, though there are no references to it. Tested on 2.7.3 and 3.2.3 ---------- components: Library (Lib) files: bugon.tar.gz messages: 190492 nosy: spresse1 priority: normal severity: normal status: open title: multiprocessing: garbage collector fails to GC Pipe() end when spawning child process versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file30448/bugon.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 19:20:28 2013 From: report at bugs.python.org (Matthias Lee) Date: Sun, 02 Jun 2013 17:20:28 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370193628.56.0.0224225681238.issue18120@psf.upfronthosting.co.za> Changes by Matthias Lee : ---------- nosy: +madmaze _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 19:41:58 2013 From: report at bugs.python.org (spresse1) Date: Sun, 02 Jun 2013 17:41:58 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370194918.92.0.675428647133.issue18120@psf.upfronthosting.co.za> spresse1 added the comment: Now also tested with source-built python 3.3.2. Issue still exists, same example files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 20:18:54 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 Jun 2013 18:18:54 +0000 Subject: [issue18121] antigravity leaks subprocess.Popen object Message-ID: <1370197134.34.0.214224244916.issue18121@psf.upfronthosting.co.za> New submission from Christian Heimes: $ ./python Python 3.4.0a0 (default:801567d6302c+, May 23 2013, 14:22:00) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import gc >>> gc.set_debug(gc.DEBUG_UNCOLLECTABLE) >>> import antigravity >>> Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated. >>> gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc: uncollectable gc:0: ResourceWarning: gc: 1 uncollectable objects at shutdown [] platform: Ubuntu 12.10 AMD64 browser: Firefox 20.0 ---------- components: Library (Lib) messages: 190494 nosy: christian.heimes, pitrou priority: low severity: normal status: open title: antigravity leaks subprocess.Popen object type: resource usage versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 21:00:51 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 02 Jun 2013 19:00:51 +0000 Subject: [issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied In-Reply-To: <1368424209.99.0.52540499369.issue17967@psf.upfronthosting.co.za> Message-ID: <3bNpdG4jRzz7Llv@mail.python.org> Roundup Robot added the comment: New changeset e9d0fb934b46 by Senthil Kumaran in branch '2.7': Fix #17967 - Fix related to regression on Windows. http://hg.python.org/cpython/rev/e9d0fb934b46 New changeset f5906026a7e9 by Senthil Kumaran in branch '3.3': Fix #17967 - Fix related to regression on Windows. http://hg.python.org/cpython/rev/f5906026a7e9 New changeset adfec512fb32 by Senthil Kumaran in branch 'default': merge from 3.3 http://hg.python.org/cpython/rev/adfec512fb32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 21:49:10 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 02 Jun 2013 19:49:10 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370202550.87.0.688596881923.issue18120@psf.upfronthosting.co.za> Richard Oudkerk added the comment: The way to deal with this is to pass the write end of the pipe to the child process so that the child process can explicitly close it -- there is no reason to expect garbage collection to make this happen automatically. You don't explain the difference between functional.py and nonfunctional.py. The most obvious thing is the fact that nonfunctional.py seems to have messed up indentation: you have a while loop in the class declaration instead of in the run() method. ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 21:53:13 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Jun 2013 19:53:13 +0000 Subject: [issue17967] urllib2.open failed to access a url when a perent directory of the url is permission denied In-Reply-To: <1368424209.99.0.52540499369.issue17967@psf.upfronthosting.co.za> Message-ID: <1370202793.59.0.637457384094.issue17967@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:03:44 2013 From: report at bugs.python.org (spresse1) Date: Sun, 02 Jun 2013 20:03:44 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370203424.51.0.840462971683.issue18120@psf.upfronthosting.co.za> spresse1 added the comment: The difference is that nonfunctional.py does not pass the write end of the parent's pipe to the child. functional.py does, and closes it immediately after breaking into a new process. This is what you mentioned to me as a workaround. Corrected code (for indentation) attached. Why SHOULDN'T I expect this pipe to be closed automatically in the child? Per the documentation for multiprocessing.Connection.close(): "This is called automatically when the connection is garbage collected." The write end of that pipe goes out of scope and has no references in the child thread. Therefore, per my understanding, it should be garbage collected (in the child thread). Where am I wrong about this? ---------- Added file: http://bugs.python.org/file30449/bugon.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:07:13 2013 From: report at bugs.python.org (Armin Rigo) Date: Sun, 02 Jun 2013 20:07:13 +0000 Subject: [issue18122] RuntimeError: not holding the import lock Message-ID: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> New submission from Armin Rigo: A new bug, introduced in recent Python 2.7 (2.7.3 passes, 2.7 trunk fails): With the attached x.py, running "python -c 'import x'" fails with RuntimeError: not holding the import lock. It occurs when doing a fork() while holding the import lock, if the child process imports more things (here distutils, could be anything) before finally trying to release the import lock (here by returning from the original 'import x'). ---------- files: x.py messages: 190498 nosy: arigo priority: normal severity: normal status: open title: RuntimeError: not holding the import lock versions: Python 2.7 Added file: http://bugs.python.org/file30450/x.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:08:23 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sun, 02 Jun 2013 20:08:23 +0000 Subject: [issue18123] fnmatchicase for case insensitive file search Message-ID: <1370203703.41.0.79020240908.issue18123@psf.upfronthosting.co.za> New submission from anatoly techtonik: http://docs.python.org/2/library/glob.html and http://docs.python.org/2/library/fnmatch.html both lack ability to do case-insensitive search for filenames. Due to this difference, scripts that work ok on Windows start produce surprises on Linux. ---------- messages: 190499 nosy: techtonik priority: normal severity: normal status: open title: fnmatchicase for case insensitive file search versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:12:17 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 02 Jun 2013 20:12:17 +0000 Subject: [issue18118] curses utf8 output broken in Python2 In-Reply-To: <1370168042.56.0.867946170074.issue18118@psf.upfronthosting.co.za> Message-ID: <1370203937.7.0.380348756145.issue18118@psf.upfronthosting.co.za> STINNER Victor added the comment: Is your Python curses module linked to libncurses.so.5 or libncursesw.so.5? Example: $ ldd /usr/lib/python2.7/lib-dynload/_cursesmodule.so |grep curses libncursesw.so.5 => /lib/libncursesw.so.5 (0x00375000) libncursesw has a much better support of Unicode than libncurses. Since Python 3.3, the Python curses.window.addstr() method uses waddwstr() when the module is linked to libncursesw, which also improves the Unicode support. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:22:27 2013 From: report at bugs.python.org (helmut) Date: Sun, 02 Jun 2013 20:22:27 +0000 Subject: [issue18118] curses utf8 output broken in Python2 In-Reply-To: <1370168042.56.0.867946170074.issue18118@psf.upfronthosting.co.za> Message-ID: <1370204547.82.0.347478377682.issue18118@psf.upfronthosting.co.za> helmut added the comment: All reproducers confirmed that their _cursessomething.so is linked against libncursesw.so.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:34:53 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Sun, 02 Jun 2013 20:34:53 +0000 Subject: [issue18122] RuntimeError: not holding the import lock In-Reply-To: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> Message-ID: <1370205293.21.0.777054823766.issue18122@psf.upfronthosting.co.za> Changes by Amaury Forgeot d'Arc : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:38:09 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 02 Jun 2013 20:38:09 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370205489.84.0.374737142114.issue18120@psf.upfronthosting.co.za> Richard Oudkerk added the comment: > The write end of that pipe goes out of scope and has no references in the > child thread. Therefore, per my understanding, it should be garbage > collected (in the child thread). Where am I wrong about this? The function which starts the child process by (indirectly) invoking os.fork() never gets a chance to finish in the child process, so nothing "goes out of scope". Anyway, relying on garbage collection to close resources for you is always a bit dodgy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:45:42 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 02 Jun 2013 20:45:42 +0000 Subject: [issue18118] curses utf8 output broken in Python2 In-Reply-To: <1370168042.56.0.867946170074.issue18118@psf.upfronthosting.co.za> Message-ID: <1370205942.58.0.893383859797.issue18118@psf.upfronthosting.co.za> STINNER Victor added the comment: u"???" encoded to "utf-8" gives '\xc3\xa4\xc3\xb6\xc3\xbc' "\303\303\303\274" is '\xc3\xc3\xc3\xbc'. I guess that curses considers that '\xc3\xa4' is a string of 2 characters: screen.addstr(0, 1, "?") replaces the second "character", '\xa4'. I suppose that screen.addstr(0, 0, u"???".encode("utf-8")) works. If "_cursessomething.so" is already linked against libncursesw.so.5, the fix is to use waddwstr(), but such change cannot be done in a minor release like Python 2.7.6. So I'm closing this issue as wont fix => you have to move to Python 3.3. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 22:47:53 2013 From: report at bugs.python.org (spresse1) Date: Sun, 02 Jun 2013 20:47:53 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370206073.11.0.297010100096.issue18120@psf.upfronthosting.co.za> spresse1 added the comment: So you're telling me that when I spawn a new child process, I have to deal with the entirety of my parent process's memory staying around forever? I would have expected this to call to fork(), which gives the child plenty of chance to clean up, then call exec() which loads the new executable. Either that or the same instance of the python interpreter is used, just with the knowledge that it should execute the child function and then exit. Keeping all the state that will never be used in the second case seems sloppy on the part of python. The semantics in this case are much better if the pipe gets GC'd. I see no reason my child process should have to know about pipe ends it never uses in order to close them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 23:11:56 2013 From: report at bugs.python.org (Gavan Schneider) Date: Sun, 02 Jun 2013 21:11:56 +0000 Subject: [issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation In-Reply-To: <1370161783.39.0.437072519867.issue18117@psf.upfronthosting.co.za> Message-ID: <1370207516.84.0.0970353988109.issue18117@psf.upfronthosting.co.za> Gavan Schneider added the comment: Appreciate the comment about potential problems with mixed installations of python3 and python2. And note that along these lines there is no attempt by the installer to symlink python -> python3 (which could have nasty side effects if the full path was not specified in system applications). However there is still a problem: the installer is creating three dead symlinks, which is not correct. Agree putting Python3 into its own /Library/Frameworks/Python3.framework would be a better way to go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 2 23:34:54 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 02 Jun 2013 21:34:54 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370208894.56.0.167661064695.issue18120@psf.upfronthosting.co.za> Richard Oudkerk added the comment: > So you're telling me that when I spawn a new child process, I have to > deal with the entirety of my parent process's memory staying around > forever? With a copy-on-write implementation of fork() this quite likely to use less memory than starting a fresh process for the child process. And it is certainly much faster. > I would have expected this to call to fork(), which gives the child > plenty of chance to clean up, then call exec() which loads the new > executable. There is an experimental branch (http://hg.python.org/sandbox/sbt) which optionally behaves like that. Note that "clean up" means close all fds not explcitly passed, and has nothing to do with garbage collection. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 00:21:20 2013 From: report at bugs.python.org (Giampaolo Rodola') Date: Sun, 02 Jun 2013 22:21:20 +0000 Subject: [issue18123] fnmatchicase for case insensitive file search In-Reply-To: <1370203703.41.0.79020240908.issue18123@psf.upfronthosting.co.za> Message-ID: <1370211680.69.0.480855547911.issue18123@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 00:24:03 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 02 Jun 2013 22:24:03 +0000 Subject: [issue18121] antigravity leaks subprocess.Popen object In-Reply-To: <1370197134.34.0.214224244916.issue18121@psf.upfronthosting.co.za> Message-ID: <1370211843.43.0.0859544557624.issue18121@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Presumably this is caused by the fact that Popen.__del__() ressurects self by appending self to _active if the process is still alive. On Windows this is unnecessary. On Unix it would be more sensible to just append the *pid* to _active. ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 00:31:06 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 02 Jun 2013 22:31:06 +0000 Subject: [issue18121] antigravity leaks subprocess.Popen object In-Reply-To: <1370197134.34.0.214224244916.issue18121@psf.upfronthosting.co.za> Message-ID: <1370212265.99.0.0525713080678.issue18121@psf.upfronthosting.co.za> R. David Murray added the comment: See also issue 5993. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 00:59:43 2013 From: report at bugs.python.org (spresse1) Date: Sun, 02 Jun 2013 22:59:43 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370213983.09.0.096634309254.issue18120@psf.upfronthosting.co.za> spresse1 added the comment: >> So you're telling me that when I spawn a new child process, I have to >> deal with the entirety of my parent process's memory staying around >> forever? > > With a copy-on-write implementation of fork() this quite likely to use > less memory than starting a fresh process for the child process. And > it is certainly much faster. Fair enough. >> I would have expected this to call to fork(), which gives the child >> plenty of chance to clean up, then call exec() which loads the new >> executable. > > There is an experimental branch (http://hg.python.org/sandbox/sbt) > which optionally behaves like that. Note that "clean up" means close > all fds not explcitly passed, and has nothing to do with garbage > collection. I appreciate the pointer, but I am writing code intended for distribution - using an experimental branch isn't useful. What I'm still trying to grasp is why Python explicitly leaves the parent processes info around in the child. It seems like there is no benefit (besides, perhaps, speed) and that this choice leads to non-intuitive behavior - like this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 01:35:53 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sun, 02 Jun 2013 23:35:53 +0000 Subject: [issue18123] fnmatchicase for case insensitive file search In-Reply-To: <1370203703.41.0.79020240908.issue18123@psf.upfronthosting.co.za> Message-ID: <1370216153.44.0.192640939001.issue18123@psf.upfronthosting.co.za> anatoly techtonik added the comment: https://gist.github.com/techtonik/5694830 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 01:45:16 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 02 Jun 2013 23:45:16 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370213983.09.0.096634309254.issue18120@psf.upfronthosting.co.za> Message-ID: <51ABD904.70908@gmail.com> Richard Oudkerk added the comment: > What I'm still trying to grasp is why Python explicitly leaves the > parent processes info around in the child. It seems like there is > no benefit (besides, perhaps, speed) and that this choice leads to > non-intuitive behavior - like this. The Windows implementation does not use fork() but still exhibits the same behaviour in this respect (except in the experimental branch mentioned before). The real issue is that fds/handles will get inherited by the child process unless you explicitly close them. (Actually on Windows you need to find a way to inject specific handles from the parent to child process). The behaviour you call non-intuitive is natural to someone used to using fork() and pipes on Unix. multiprocessing really started as a cross-platform work-around for the lack of fork() on Windows. Using fork() is also a lot more flexible: many things that work fine on Unix will not work correctly on Windows because of pickle-issues. The main problem with fork() is that forking a process with multiple threads can be problematic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 02:02:00 2013 From: report at bugs.python.org (spresse1) Date: Mon, 03 Jun 2013 00:02:00 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370217720.42.0.761645508816.issue18120@psf.upfronthosting.co.za> spresse1 added the comment: I'm actually a nix programmer by trade, so I'm pretty familiar with that behavior =p However, I'm also used to inheriting some way to refer to these fds, so that I can close them. Perhaps I've just missed somewhere a call to ask the process for a list of open fds? This would, to me, be an acceptable workaround - I could close all the fds I didn't wish to inherit. Whats really bugging me is that it remains open and I can't fetch a reference. If I could do either of these, I'd be happy. Maybe this is more an issue with the semantics of multiprocessing? In that this behavior is perfectly reasonable with os.fork() but makes some difficulty here. Perhaps I really want to be implementing with os.fork(). Sigh, I was trying to save myself some effort... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 04:33:03 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Jun 2013 02:33:03 +0000 Subject: [issue2053] IDLE - standardize dialogs In-Reply-To: <1202515821.86.0.159216664847.issue2053@psf.upfronthosting.co.za> Message-ID: <1370226783.42.0.361125406607.issue2053@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The patch does two things. 1. It replaces the existing direct rebinding of messagebox functions as methods, such as self.showerror = tkMessageBox.showerror with binding of a double wrapping of the functions. The middle layer is useless and only serves to allow use of the decorator syntax. The 'old-fashioned' method of wrapping by function call should be used. self.showerror = _tk_dialog_wrapper(tkMessageBox.showerror) A single customized wrapping for the existing bindings seems like it might be a good idea. I do not understand the 'motivation' (of the existing and revised method bindings) of making Idle extensions 'cross-IDE'. How so? What IDEs other than Idle are we concerned with? The patch replaces both parent=self.text and master=self.text in current calls with parent=self.text in the wrapper. This seems to assume that parent==master in these contexts. I gather that this is nearly always the case. ( http://mail.python.org/pipermail/tutor/2010-June/076550.html based on Grayson's book) But I wonder if the choice could ever make a difference. 2. Currently, EditorWindow methods sometimes call a message function as a message module attribute and sometimes as one of the EditorWindow method. The patch makes these calls consistently be methods calls (to the wrappers). It also changes call in classes that are EditorWindow subclasses or containers. (askokcancel is addded to EditorWindow for patches to some of these other classes.) My current Idle concern is testing. The current inconsistency in EditorWindow is not good for that, so I will want to fix that one way or the other in any case. For automated non-gui testing, the message functions (or the message module) need to be replaced with mocks that a) save the args somewhere where they can be later retrieved and b) return without graphics system and user interaction. For modules with non-editor classes, this means monkey-patching the module. (I have done this once for one test.) I will experiment with also monkey-patching editor windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 05:43:44 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 Jun 2013 03:43:44 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370231024.09.0.83072484657.issue18111@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks Stephan. I'm going to close this one. The case for adding it is too weak and isn't worth making the API more complex. If someone wants a default with an iterable of arbitrary size including zero, there are already a number of ways to do it (using itertools.chain for example or just catching the exception). ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 06:06:05 2013 From: report at bugs.python.org (Julian Berman) Date: Mon, 03 Jun 2013 04:06:05 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370232365.39.0.559247516821.issue18111@psf.upfronthosting.co.za> Julian Berman added the comment: I don't really care to push this much harder, but I'll just repeat that I've already made an argument against catching the exception. Calling this making the API too complex also seems quite silly to me. It's a thing that someone looking for would find and someone who wasn't wouldn't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 07:40:52 2013 From: report at bugs.python.org (Dmi Baranov) Date: Mon, 03 Jun 2013 05:40:52 +0000 Subject: [issue18124] Broken build on target machine with incorrect hostname (non-ascii) Message-ID: <1370238052.82.0.116613237858.issue18124@psf.upfronthosting.co.za> New submission from Dmi Baranov: As a part of issue #18109 $ echo h?t | sudo tee /proc/sys/kernel/hostname $ hostname #Yes, I know about RFC952;-) h?t $ locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE=en_US.UTF-8 LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES=POSIX LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= $ make ... Consider setting $PYTHONHOME to [:] Traceback (most recent call last): File "/home/d9frog9n/workspace/cpython_default/Lib/runpy.py", line 160, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/home/d9frog9n/workspace/cpython_default/Lib/runpy.py", line 73, in _run_code exec(code, run_globals) File "/home/d9frog9n/workspace/cpython_default/Lib/sysconfig.py", line 700, in _main() File "/home/d9frog9n/workspace/cpython_default/Lib/sysconfig.py", line 688, in _main _generate_posix_vars() File "/home/d9frog9n/workspace/cpython_default/Lib/sysconfig.py", line 391, in _generate_posix_vars pybuilddir = 'build/lib.%s-%s' % (get_platform(), sys.version[:3]) File "/home/d9frog9n/workspace/cpython_default/Lib/sysconfig.py", line 632, in get_platform osname, host, release, version, machine = os.uname() UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128) make: *** [pybuilddir.txt] Error 1 ---------- components: Installation, Unicode messages: 190516 nosy: dmi.baranov, ezio.melotti priority: normal severity: normal status: open title: Broken build on target machine with incorrect hostname (non-ascii) type: compile error versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 07:47:37 2013 From: report at bugs.python.org (Dmi Baranov) Date: Mon, 03 Jun 2013 05:47:37 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370238457.98.0.723571966389.issue18109@psf.upfronthosting.co.za> Dmi Baranov added the comment: Thanks Charles - I'm reproduced Dominik's issue at default branch: $ python -c 'import os, sys;print(sys.version);print(os.uname())' 3.4.0a0 (default:adfec512fb32, Jun 3 2013, 08:09:43) [GCC 4.6.3] Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128) Lastest branches affected only, so - this a bug. $ python -c 'import os, sys;print(sys.version);print(os.uname())' 2.7.5+ (2.7:e9d0fb934b46, Jun 3 2013, 08:05:55) [GCC 4.6.3] ('Linux', 'h\xc3\xa2t', '3.2.0-32-generic', '#51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012', 'i686') $ python -c 'import os, sys;print(sys.version);print(os.uname())' 3.2.5 (3.2:b9b521efeba3, Jun 3 2013, 08:24:06) [GCC 4.6.3] ('Linux', 'h?t', '3.2.0-32-generic', '#51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012', 'i686') Env: $ hostname h?t $ locale LANG=en_US.UTF-8 ... BTW, that issue do not allow to compile from sources on hosts with similar names, I've created separate issue #18124 (possible a duplicate, but another behavior) ---------- components: +Library (Lib) type: crash -> behavior versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 07:56:31 2013 From: report at bugs.python.org (Dmi Baranov) Date: Mon, 03 Jun 2013 05:56:31 +0000 Subject: [issue18122] RuntimeError: not holding the import lock In-Reply-To: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> Message-ID: <1370238991.74.0.494445883472.issue18122@psf.upfronthosting.co.za> Dmi Baranov added the comment: Looks like old history from issue 7242 ---------- nosy: +dmi.baranov, gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 08:03:34 2013 From: report at bugs.python.org (helmut) Date: Mon, 03 Jun 2013 06:03:34 +0000 Subject: [issue18118] curses utf8 output broken in Python2 In-Reply-To: <1370168042.56.0.867946170074.issue18118@psf.upfronthosting.co.za> Message-ID: <1370239414.08.0.564548669949.issue18118@psf.upfronthosting.co.za> helmut added the comment: > I suppose that screen.addstr(0, 0, u"???".encode("utf-8")) works. It works as in "the output looks as the one expected". Long lines with utf8 characters will make it break again though. screen.addstr(0, 0, "???" * 20) # assuming COLUMNS=80 Will give two rows of characters of which the first row is 40 characters long. > If "_cursessomething.so" is already linked against libncursesw.so.5, the fix is to use waddwstr(), but such change cannot be done in a minor release like Python 2.7.6. So I'm closing this issue as wont fix => you have to move to Python 3.3. Sounds sensible. Are you aware of a workaround for this issue? I.e. is there any way to force Python2.7 to use the wide mode for outputting characters? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 09:02:55 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 03 Jun 2013 07:02:55 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370242975.08.0.34102591553.issue18116@psf.upfronthosting.co.za> Benjamin Peterson added the comment: This code is pretty broken. I don't think ttys are ever seekable, so the os.fdopen has probably been always failing since 3.0. It thus always leaks an fd to '/dev/tty' if the first os.open succeeds. The whole function should probably be rewriten to work with byte streams encoding the prompt with os.device_encoding(tty_fd) falling back on locale.getpreferredencoding(). ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 09:40:39 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jun 2013 07:40:39 +0000 Subject: [issue18118] curses utf8 output broken in Python2 In-Reply-To: <1370239414.08.0.564548669949.issue18118@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: "Sounds sensible. Are you aware of a workaround for this issue? I.e. is there any way to force Python2.7 to use the wide mode for outputting characters?" I don't think that it is possible to workaround this issue, it is a bug in the design of curses, related to Unicode. I suppose that libncursesw uses an array of wchar_t characters when the *_wch() and *wstr() functions are used, whereas your version looks to use an array of char* characters and so is unable to understand that a character is composed of two bytes (ex: b"\xc3\xa4" for u"?"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 10:05:00 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 03 Jun 2013 08:05:00 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370217720.42.0.761645508816.issue18120@psf.upfronthosting.co.za> Message-ID: <51AC4E27.3090205@gmail.com> Richard Oudkerk added the comment: On 03/06/2013 1:02am, spresse1 wrote: > Whats really bugging me is that it remains open and I can't fetch a reference. > If I could do either of these, I'd be happy. > ... > Perhaps I really want to be implementing with os.fork(). Sigh, I was trying to > save myself some effort... I don't see how using os.fork() would make things any easier. In either case you need to prepare a list of fds which the child process should close before it starts, or alternatively a list of fds *not* to close. The real issue is that there is no way for multiprocessing (or os.fork()) to automatically infer which fds the child process is going to use: if don't explicitly close unneeded ones then the child process will inherit all of them. It might be helpful if multiprocessing exposed a function to close all fds except those specified -- see close_all_fds_except() at http://hg.python.org/sandbox/sbt/file/5d4397a38445/Lib/multiprocessing/popen_spawn_posix.py#l81 Remembering not to close stdout (fd=1) and stderr (fd=2), you could use it like def foo(reader): close_all_fds_except([1, 2, reader.fileno()]) ... r, w = Pipe(False) p = Process(target=foo, args=(r,)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 10:18:46 2013 From: report at bugs.python.org (Armin Rigo) Date: Mon, 03 Jun 2013 08:18:46 +0000 Subject: [issue18122] RuntimeError: not holding the import lock In-Reply-To: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> Message-ID: <1370247526.1.0.0563763281861.issue18122@psf.upfronthosting.co.za> Armin Rigo added the comment: The bug is different, because it doesn't depend on details of the platform. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 10:53:15 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Mon, 03 Jun 2013 08:53:15 +0000 Subject: [issue18124] Broken build on target machine with incorrect hostname (non-ascii) In-Reply-To: <1370238052.82.0.116613237858.issue18124@psf.upfronthosting.co.za> Message-ID: <1370249595.83.0.745397465967.issue18124@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: Why open this issue, since it's obviously a duplicate of #18109? ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 11:17:43 2013 From: report at bugs.python.org (Paul "TBBle" Hampson) Date: Mon, 03 Jun 2013 09:17:43 +0000 Subject: [issue18125] Out-of-tree build cannot regenerate Makefile.pre Message-ID: <1370251063.05.0.0234543553399.issue18125@psf.upfronthosting.co.za> New submission from Paul "TBBle" Hampson: Noticed in Python 2.7 but a quick look in the repository suggests this is also true in Python 3 releases. The Makefile rule for Makefile.pre in Makefile.pre.in is: # 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 However, when built out-of-tree, Makefile.pre is in the build directory, as as config.status, but Makefile.pre.in is in the source directory. So the rule should be # Build the toplevel Makefile Makefile.pre: $(srcdir)/Makefile.pre.in config.status CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status $(MAKE) -f Makefile.pre Makefile Note that the recipe doesn't change, as config.status internally knows where Makefile.pre.in is found, so it's just the rule dependency that's wrong. This bug results in "No rule to create Makefile.pre.in" if Makefile.pre is somehow newer than Makefile or Modules/config.c in the build tree. ---------- components: Build messages: 190525 nosy: TBBle priority: normal severity: normal status: open title: Out-of-tree build cannot regenerate Makefile.pre versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 11:18:19 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 03 Jun 2013 09:18:19 +0000 Subject: [issue18122] RuntimeError: not holding the import lock In-Reply-To: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> Message-ID: <1370251099.76.0.466037041335.issue18122@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > 2.7.3 passes, 2.7 trunk fails Python 2.7.0, 2.7.2 and 2.6.8 all fail here. Dmi is right: it starts failing at 4afc50d15544. (note that Python 3 isn't affected) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 11:18:28 2013 From: report at bugs.python.org (Paul "TBBle" Hampson) Date: Mon, 03 Jun 2013 09:18:28 +0000 Subject: [issue18125] Out-of-tree build cannot regenerate Makefile.pre In-Reply-To: <1370251063.05.0.0234543553399.issue18125@psf.upfronthosting.co.za> Message-ID: <1370251108.68.0.0460325434463.issue18125@psf.upfronthosting.co.za> Changes by Paul "TBBle" Hampson : ---------- type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 11:20:22 2013 From: report at bugs.python.org (Paul "TBBle" Hampson) Date: Mon, 03 Jun 2013 09:20:22 +0000 Subject: [issue18125] Out-of-tree build cannot regenerate Makefile.pre In-Reply-To: <1370251063.05.0.0234543553399.issue18125@psf.upfronthosting.co.za> Message-ID: <1370251222.89.0.427505576651.issue18125@psf.upfronthosting.co.za> Paul "TBBle" Hampson added the comment: Forgot to mention, this is the only occurrence of a *.in file in Makefile.pre.in that isn't prefixed with $(srcdir)/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 11:37:49 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 03 Jun 2013 09:37:49 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370252269.58.0.0834052798738.issue3329@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Hi. the file and line arguments are for expanding from macros such as PyMem_MALLOC. I had them added because they provide the features of a comprehensive debugging API. Of course, I'm not showing you the entire set of modifications that we have made to the memory allocation scheme. They including more extensive versions of the memory allocation tools, in order to more easily monitor memory allocations from within C. For your information, I'm uploading pymemory.h from our 2.7 patch. The extent of our modifications can be gleaned from there. Basically, we have layered the macros into outer and inner versions, in order to better support internal diagnostics. I'm happy with the api you provide, with a small addition: PyAPI_FUNC(int) Py_SetAllocators( char api, void* (*malloc) (size_t size, void *data), void* (*realloc) (void* ptr, size_t size, void *data), void (*free) (void* ptr, void *data), void *data ); The 'data' pointer is pointless unless you can provide it as part of the api. This sort of extra indirection is necessary for C callbacks to provide instance specific context to statically compiled and linked callback functions. ---------- Added file: http://bugs.python.org/file30451/pymem.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 11:40:22 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Mon, 03 Jun 2013 09:40:22 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370252422.26.0.0658971610211.issue3329@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Also, our ccpmem.h, the interface to the ccpmem.cpp, internal flexible memory allocator framework. Again, just FYI. There are no trade secrets here, so please ask me for more details, if interested. One particular trick we have been using, which might be of interest, is to be able to tag each allocation with a "context" id. This is then set according to a global sys.memcontext variable, which the program will modify according to what it is doing. This can then be used to track memory usage by different parts of the program. ---------- Added file: http://bugs.python.org/file30452/ccpmem.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 11:50:51 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 03 Jun 2013 09:50:51 +0000 Subject: [issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation In-Reply-To: <1370161783.39.0.437072519867.issue18117@psf.upfronthosting.co.za> Message-ID: <1370253051.47.0.664713590182.issue18117@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Linking with "-framework Python" is always a bad idea because you have no control over which version of Python you link with other than by changing global system state (the Current link). Also: include files aren't included using the framework conventions (e.g. we use "#include ", not "#include "). I'd prefer to remove the Current link from "from source" installs instead adding them to the py3k installer, that makes is clearer that you are not supposed to use "-framework Python". I'm also not too keen on renaming the Python framework for Python 3.4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 12:13:02 2013 From: report at bugs.python.org (Dmi Baranov) Date: Mon, 03 Jun 2013 10:13:02 +0000 Subject: [issue18122] RuntimeError: not holding the import lock In-Reply-To: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> Message-ID: <1370254382.3.0.899843381976.issue18122@psf.upfronthosting.co.za> Dmi Baranov added the comment: My system python-2.7.3 affected too: python -c 'import sys;print(sys.version);import x' 2.7.3 (default, Aug 1 2012, 05:16:07) [GCC 4.6.3] Traceback (most recent call last): File "", line 1, in RuntimeError: not holding the import lock $ uname -a Linux d9frog9n-desktop 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012 i686 i686 i386 GNU/Linux Armin, at which system/architecture you passing that case on 2.7.3? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 12:22:56 2013 From: report at bugs.python.org (Andrew Stormont) Date: Mon, 03 Jun 2013 10:22:56 +0000 Subject: [issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe In-Reply-To: <1367934356.3.0.498041746077.issue17925@psf.upfronthosting.co.za> Message-ID: <1370254976.16.0.0413632869303.issue17925@psf.upfronthosting.co.za> Andrew Stormont added the comment: Great. Everybody's happy now, surely? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 12:24:43 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 03 Jun 2013 10:24:43 +0000 Subject: [issue18122] RuntimeError: not holding the import lock In-Reply-To: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> Message-ID: <1370255083.92.0.225857361837.issue18122@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Forking as a side effect of importing a module is evil. I think raising a RuntimeError is preferable to trying to make it Just Work. But maybe one could do void _PyImport_ReInitLock(void) { if (import_lock != NULL) { import_lock = PyThread_allocate_lock(); PyThread_acquire_lock(import_lock, WAIT_LOCK); } import_lock_thread = PyThread_get_thread_ident(); _PyImport_ReleaseLock(); } ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 12:25:02 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jun 2013 10:25:02 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370255102.96.0.643435881551.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: """ I'm happy with the api you provide, with a small addition: PyAPI_FUNC(int) Py_SetAllocators( char api, void* (*malloc) (size_t size, void *data), void* (*realloc) (void* ptr, size_t size, void *data), void (*free) (void* ptr, void *data), void *data ); """ Oops, I forgot "void *data". Yeah, each group of allocator functions (malloc, free and realloc) will get its own "data" pointer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 12:35:32 2013 From: report at bugs.python.org (Giampaolo Rodola') Date: Mon, 03 Jun 2013 10:35:32 +0000 Subject: [issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe In-Reply-To: <1367934356.3.0.498041746077.issue17925@psf.upfronthosting.co.za> Message-ID: <1370255732.07.0.801989607681.issue17925@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: patch plus "self.producer_fifo.extendleft([data, first])" seems legit and I verified pyftpdlib tests pass. Last thing missing from the patch is a test case. Pierrick can you merge test_initiate_send.py into Lib/test_asynchat.py and provide a new patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 13:05:18 2013 From: report at bugs.python.org (Gavan Schneider) Date: Mon, 03 Jun 2013 11:05:18 +0000 Subject: [issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation In-Reply-To: <1370161783.39.0.437072519867.issue18117@psf.upfronthosting.co.za> Message-ID: <1370257518.06.0.574467953415.issue18117@psf.upfronthosting.co.za> Gavan Schneider added the comment: A lot of this is past my level but speaking from my level I just want packages to be consistent, i.e., if there is a symlink it should point to something (preferably useful) not dangle as is the case now. Also I want an installed version to "look the same" no matter what version it might be. Specifically the version number should only occur once in the file tree. This then allows me to specify ***at the system level*** what I want when invoking (via a Current or similar link) my postgres and other build scripts, specifically so they don't need to be hand crafted just so they build against new new and latest install. If I ever get to the stage where I am building to a specific version that's not the global selection I can do that by taking proper steps (but that's not what I usually want to do after installing a new version). Continuing in the vein of one only mention of the version number in the package tree: why is there a python3.3 folder inside .../Pyton.framework/Versions/3.3/lib? Won't lib/Python3.4 stuff get put in its own Version? As for the reluctance to rename the package for 3.4. Wont it be Python3 and the rename could just as logically be done for the current release: /Library/Frameworks/ Python.framework/... # all the Pyton 2 stuff Python3.famework Versions 3.3/... 3.4/... Current -> 3.4 ... Finally there seems to be a convention with all the other installed packages for a "Current" symlink (note especially Tcl/Tk) to do something useful within their respective "Versions" folder. Is it too much to suggest that Python just follow this convention (albeit with the package name changed to pyton3 to prevent potential conflicts)? Anyway, please excuse my drifting so far from a simple report of a broken and/or missing installer link :) Regards Gavan Schneider ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 13:43:07 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 03 Jun 2013 11:43:07 +0000 Subject: [issue18117] Missing symlink:Current after Mac OS X 3.3.2 package installation In-Reply-To: <1370161783.39.0.437072519867.issue18117@psf.upfronthosting.co.za> Message-ID: <1370259787.82.0.592285242119.issue18117@psf.upfronthosting.co.za> Ronald Oussoren added the comment: There is a python3.3 in .../Python.framework/Versions/3.3/lib because .../Python.framework/Versions/3.3 is basicly a regular unix install with some trivial changes (in particular, there is a Python shared library in the root of the tree, there is a Python.app and bin/python isn't the real interpreter but a stub). Keeping the framework close to a regular unix install is an explicit design choice, it minimizes the difference from those unix installs and reduces the amount of needless incompatibilities (for example with scripts that run on unix-like systems and assume a particular layout of sys.prefix) I try to avoid relying on the Current symlink because it depends on the order in which packages are installed, for example when you have two version of Python installed and update one of them the Current link may change even if you might not want to. Futhermore the Current link can only be changed by users with elevated privileges (an "admin" account or root). Again, I don't think renaming the framework for Python 3 would be useful and even if it were done it could only be done for Python 3.4 al existing releases of Py3k would still use Python.framework because changing the framework name will break existing installations when installing an update with a changed framework name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 13:48:11 2013 From: report at bugs.python.org (Thomas Wouters) Date: Mon, 03 Jun 2013 11:48:11 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370260091.89.0.628244267201.issue18111@psf.upfronthosting.co.za> Thomas Wouters added the comment: For the record, Raymond, I think you're wrong about this. Itertools isn't always a solution to every problem, and it makes for a very awkward way around a silly limitation in min() and max(). Their API is already awkward -- because they already take a keyword argument as well as *args or an iterable -- and this does not make it worse in any way. It's trivial to add this, it's trivial to explain -- return a specific value instead of raising a particular exception -- and it's wasteful, complex, fragile or unreadable (except if you have itertools on the mind, I guess) to do the same thing in another way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 14:03:05 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jun 2013 12:03:05 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370260985.44.0.0464798496801.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: New patch (version 2), more complete: * add "void *data" argument to all allocator functions * add "block" API used for pymalloc allocator to allocate arenas. Use mmap or malloc, but may use VirtualAlloc in a near future (see #13483). Callbacks prototype: - void block_malloc (size_t, void*); - void block_free (void*, size_t, void*); * remove PY_ALLOC_SYSTEM_API Main API: --- #define PY_ALLOC_MEM_API 'm' /* PyMem_Malloc() API */ #define PY_ALLOC_OBJECT_API 'o' /* PyObject_Malloc() API */ PyAPI_FUNC(int) Py_GetAllocators( char api, void* (**malloc_p) (size_t size, void *user_data), void* (**realloc_p) (void *ptr, size_t size, void *user_data), void (**free_p) (void *ptr, void *user_data), void **user_data_p ); PyAPI_FUNC(int) Py_SetAllocators( char api, void* (*malloc) (size_t size, void *user_data), void* (*realloc) (void *ptr, size_t size, void *user_data), void (*free) (void *ptr, void *user_data), void *user_data ); PyAPI_FUNC(void) Py_GetBlockAllocators( void* (**malloc_p) (size_t size, void *user_data), void (**free_p) (void *ptr, size_t size, void *user_data), void **user_data_p ); PyAPI_FUNC(int) Py_SetBlockAllocators( void* (*malloc) (size_t size, void *user_data), void (*free) (void *ptr, size_t size, void *user_data), void *user_data ); --- I see the following use cases using allocators: * Don't use malloc nor mmap but your own allocator: replace PyMem and PyObject allocators * Track memory leaks (my pytracemalloc project, or Antoine's simple _Py_AllocatedBlocks counter): hook PyMem and PyObject allocators * Fill newly allocated memory with a pattern and check for buffer underflow and overflow: hook PyMem and PyObject allocators "Hook" means adding extra code before and/or after calling the original function. The final API should allow to hook the APIS multiple times and replacing allocators. So it should be possible to track memory leaks, detect buffer overflow and our your own allocators. It is not yet possible with the patch 2, because _PyMem_DebugMalloc() calls directly malloc(). _PyMem_DebugMalloc is no more used by PyObject_Malloc. This code should be rewritten to use the hook approach instead of replacing memory allocators. Example tracing PyMem calls using the hook approach: ----------------------------------- typedef struct { void* (*malloc) (size_t, void*); void* (*realloc) (void*, size_t, void*); void (*free) (void*, void*); void *data; } allocators_t; allocators_t pymem, pyobject; void* trace_malloc (size_t size, void* data) { allocators_t *alloc = (allocators_t *)data; printf("malloc(%z)\n", size); return alloc.malloc(size, alloc.data); } void* trace_realloc (void* ptr, size_t size, void* data) { allocators_t *alloc = (allocators_t *)data; printf("realloc(%p, %z)\n", ptr, size); return alloc.realloc(ptr, size, alloc.data); } void trace_free (void* ptr, void* data) { allocators_t *alloc = (allocators_t *)data; printf("free(%p)\n", ptr); alloc.free(ptr, alloc.data); } void hook_pymem(void) { Py_GetAllocators(PY_ALLOC_MEM_API, &pymem.malloc, &pymem.realloc, &pymem.free, &pymem.data); Py_SetAllocators(PY_ALLOC_MEM_API, trace_malloc, trace_realloc, trace_free, &pymem); Py_GetAllocators(PY_ALLOC_OBJECT_API, &pyobject.malloc, &pyobject.realloc, &pyobject.free, &pyobject.data); Py_SetAllocators(PY_ALLOC_OBJECT_API, trace_malloc, trace_realloc, trace_free, &pyobject); } ----------------------------------- I didn't try the example :-p It is just to give you an idea of the API and how to use it. ---------- Added file: http://bugs.python.org/file30453/py_setallocators-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 14:21:29 2013 From: report at bugs.python.org (Dmi Baranov) Date: Mon, 03 Jun 2013 12:21:29 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370262089.5.0.700141167971.issue18109@psf.upfronthosting.co.za> Dmi Baranov added the comment: There is patch. Test is non-LGTM, because having a side effect for hostname and requires root's permissions for manipulations with hostname[*]. Someone having ideas how I can "mock" system `uname` call? [*] But this way is OK for Lib/test/test_sockets.py. I'm overheading here? (-: ---------- keywords: +patch Added file: http://bugs.python.org/file30454/issue18109.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 14:23:16 2013 From: report at bugs.python.org (Dmi Baranov) Date: Mon, 03 Jun 2013 12:23:16 +0000 Subject: [issue18124] Broken build on target machine with incorrect hostname (non-ascii) In-Reply-To: <1370238052.82.0.116613237858.issue18124@psf.upfronthosting.co.za> Message-ID: <1370262196.5.0.861480258985.issue18124@psf.upfronthosting.co.za> Dmi Baranov added the comment: Just a another behavior. My mistake, sorry. ---------- resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 14:51:44 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 03 Jun 2013 12:51:44 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370263904.88.0.902374192219.issue18111@psf.upfronthosting.co.za> Nick Coghlan added the comment: +1 for adding this. It's simple to implement, simple to explain and the alternatives for dealing with the empty iterable case (or even the fact it may need to be handled at all) are definitely not obvious. The relationship to next() is straightforward: the supplied value is effectively used as the default value for the first next call when iterating and then ignored thereafter. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 14:54:09 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 03 Jun 2013 12:54:09 +0000 Subject: [issue18045] get_python_version is not import in bdist_rpm.py In-Reply-To: <1369355842.75.0.290813933305.issue18045@psf.upfronthosting.co.za> Message-ID: <1370264049.07.0.770736840985.issue18045@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 15:31:26 2013 From: report at bugs.python.org (Yury V. Zaytsev) Date: Mon, 03 Jun 2013 13:31:26 +0000 Subject: [issue18126] Update links to NumPy resources in documentation Message-ID: <1370266286.34.0.85536188421.issue18126@psf.upfronthosting.co.za> New submission from Yury V. Zaytsev: Hi, The links to NumPy sites and documentation are outdated. I replaced them with www.numpy.org, and also the canonical location for documentation (docs.scipy.org). I removed the explicit mention of the PDF file, because the documentation has been split in several guides, so I think it no longer makes sense, and it's better to link docs.scipy.org instead. Thanks! ---------- assignee: docs at python components: Documentation files: doc-numpy.patch keywords: patch messages: 190543 nosy: docs at python, eric.araujo, ezio.melotti, georg.brandl, zaytsev priority: normal severity: normal status: open title: Update links to NumPy resources in documentation type: enhancement Added file: http://bugs.python.org/file30455/doc-numpy.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 16:07:01 2013 From: report at bugs.python.org (spresse1) Date: Mon, 03 Jun 2013 14:07:01 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370268421.27.0.00754344198025.issue18120@psf.upfronthosting.co.za> spresse1 added the comment: > I don't see how using os.fork() would make things any easier. In either > case you need to prepare a list of fds which the child process should > close before it starts, or alternatively a list of fds *not* to close. With fork() I control where the processes diverge much more readily. I could create the pipe in the main process, fork, close unnecessary fds, then call into the class that represents the operation of the subprocess. (ie: do it the c way). This way the class never needs to know about pipes it doesnt care about and I can ensure that unnecessary pipes get closed. So I get the clean, understandable semantics I was after and my pipes get closed. The only thing I lose is windows interoperability. I could reimplement the close_all_fds_except() call (in straight python, using os.closerange()). That seems like a reasonable solution, if a bit of a hack. However, given that pipes are exposed by multiprocessing, it might make sense to try to get this function incorperated into the main version of it? I also think that with introspection it would be possible for the subprocessing module to be aware of which file descriptors are still actively referenced. (ie: 0,1,2 always referenced, introspect through objects in the child to see if they have the file.fileno() method) However, I can't state this as a certainty without going off and actually implementing such a version. Additionally, I can make absolutely no promises as to the speed of this. Perhaps, if it functioned, it would be an option one could turn on for cases like mine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 16:13:20 2013 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 03 Jun 2013 14:13:20 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370268800.14.0.939574665441.issue18111@psf.upfronthosting.co.za> Ned Batchelder added the comment: I find the workarounds mentioned here to be baroque and confusing. The concept of a default value to return in the case of an empty iterator is straightforward. I'm +1 on adding this as well. ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 16:33:24 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 03 Jun 2013 14:33:24 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370268421.27.0.00754344198025.issue18120@psf.upfronthosting.co.za> Message-ID: <51ACA930.5050802@gmail.com> Richard Oudkerk added the comment: On 03/06/2013 3:07pm, spresse1 wrote: > I could reimplement the close_all_fds_except() call (in straight python, using > os.closerange()). That seems like a reasonable solution, if a bit of a hack. > However, given that pipes are exposed by multiprocessing, it might make sense > to try to get this function incorperated into the main version of it? close_all_fds_except() is already pure python: try: MAXFD = os.sysconf("SC_OPEN_MAX") except: MAXFD = 256 def close_all_fds_except(fds): fds = list(fds) + [-1, MAXFD] fds.sort() for i in range(len(fds) - 1): os.closerange(fds[i]+1, fds[i+1]) > I also think that with introspection it would be possible for the subprocessing > module to be aware of which file descriptors are still actively referenced. > (ie: 0,1,2 always referenced, introspect through objects in the child to see if > they have the file.fileno() method) However, I can't state this as a certainty > without going off and actually implementing such a version. Additionally, I can > make absolutely no promises as to the speed of this. Perhaps, if it functioned, > it would be an option one could turn on for cases like mine. So you want a way to visit all objects directly or indirectly referenced by the process object, so you can check whether they have a fileno() method? At the C level all object types which support GC define a tp_traverse function, so maybe that could be made available from pure Python. But really, this sounds rather fragile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 16:57:59 2013 From: report at bugs.python.org (spresse1) Date: Mon, 03 Jun 2013 14:57:59 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370271479.22.0.60151610944.issue18120@psf.upfronthosting.co.za> spresse1 added the comment: Oooh, thanks. I'll use that. > But really, this sounds rather fragile. Absolutely. I concur there is no good way to do this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 17:27:27 2013 From: report at bugs.python.org (Doug Hellmann) Date: Mon, 03 Jun 2013 15:27:27 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370273247.37.0.869082707294.issue18111@psf.upfronthosting.co.za> Doug Hellmann added the comment: +1 on adding this I found today via @dabeaz's cookbook that iter() has a sentinel-detection use case. Having one in min/max seems *far* more obviously useful. It's also consistent with quite a few methods on builtin types where we provide a way to deal with unknown data safely by having a default instead of catching exceptions directly. ---------- nosy: +doughellmann _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 17:45:17 2013 From: report at bugs.python.org (Armin Rigo) Date: Mon, 03 Jun 2013 15:45:17 +0000 Subject: [issue18122] RuntimeError: not holding the import lock In-Reply-To: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> Message-ID: <1370274317.05.0.675635445114.issue18122@psf.upfronthosting.co.za> Armin Rigo added the comment: Indeed, no clue: it seems I don't get the error only on my system-installed 2.7.3 on Linux 32. I do get it on any other Python I tried, like 2.6.x, or the system-installed 2.7.1 on Linux 64. So it's not actually a new bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 18:18:58 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 03 Jun 2013 16:18:58 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370276338.14.0.0285494985857.issue18021@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 18:19:10 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 03 Jun 2013 16:19:10 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370276350.0.0.650924517926.issue18021@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 19:03:50 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 03 Jun 2013 17:03:50 +0000 Subject: [issue18120] multiprocessing: garbage collector fails to GC Pipe() end when spawning child process In-Reply-To: <1370193067.61.0.466524662319.issue18120@psf.upfronthosting.co.za> Message-ID: <1370279030.85.0.603177310632.issue18120@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Actually, you can use gc.get_referents(obj) which returns the direct children of obj (and is presumably implemented using tp_traverse). I will close. ---------- resolution: -> rejected stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 19:13:08 2013 From: report at bugs.python.org (Madison May) Date: Mon, 03 Jun 2013 17:13:08 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370279588.91.0.0233334083156.issue18021@psf.upfronthosting.co.za> Madison May added the comment: The attached patch updates the urls on the Documenting and Doc Quality pages to reference the new Apple Style Guide. ---------- keywords: +patch Added file: http://bugs.python.org/file30456/apple_style_guide.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 20:15:55 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 03 Jun 2013 18:15:55 +0000 Subject: [issue13647] Python SSL stack doesn't securely validate certificate (as client) In-Reply-To: <1324564490.24.0.352449270187.issue13647@psf.upfronthosting.co.za> Message-ID: <1370283355.37.0.823490573804.issue13647@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 20:16:23 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 03 Jun 2013 18:16:23 +0000 Subject: [issue13655] Python SSL stack doesn't have a default CA Store In-Reply-To: <1324635534.55.0.434420251569.issue13655@psf.upfronthosting.co.za> Message-ID: <1370283383.15.0.0109911693167.issue13655@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 20:22:38 2013 From: report at bugs.python.org (Dmi Baranov) Date: Mon, 03 Jun 2013 18:22:38 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370283758.23.0.00696600611705.issue18021@psf.upfronthosting.co.za> Dmi Baranov added the comment: That link will be outdated in next few months (I believe :-)). What about https://help.apple.com/asg/mac ? ---------- nosy: +dmi.baranov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 20:30:29 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Jun 2013 18:30:29 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370284229.47.0.58792649993.issue18021@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The latter link redirects to the current online searchable html version, http://help.apple.com/asg/mac/2013/ and presumably always will. I think this is better than the 200 page pdf. ---------- nosy: +terry.reedy stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 20:33:20 2013 From: report at bugs.python.org (Alexandre Vassalotti) Date: Mon, 03 Jun 2013 18:33:20 +0000 Subject: [issue17810] Implement PEP 3154 (pickle protocol 4) In-Reply-To: <1366526938.19.0.00976593994103.issue17810@psf.upfronthosting.co.za> Message-ID: <1370284400.42.0.329388659197.issue17810@psf.upfronthosting.co.za> Alexandre Vassalotti added the comment: Stefan, could you address my review comments soon? The improved support for globals is the only big piece missing from the implementation of PEP, which I would like to get done and submitted by the end of the month. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 20:50:46 2013 From: report at bugs.python.org (Madison May) Date: Mon, 03 Jun 2013 18:50:46 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370285446.16.0.500285428826.issue18021@psf.upfronthosting.co.za> Madison May added the comment: Updated patch to link instead to http://help.apple.com/asg/mac. Thanks for that catch, Dmi and Terry. I have to agree that its a much better alternative. ---------- Added file: http://bugs.python.org/file30457/apple_style_guide_v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 20:56:37 2013 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Mon, 03 Jun 2013 18:56:37 +0000 Subject: [issue18078] threading.Condition to allow notify on a specific waiter In-Reply-To: <1369712419.12.0.434704480843.issue18078@psf.upfronthosting.co.za> Message-ID: <1370285797.52.0.402641534443.issue18078@psf.upfronthosting.co.za> Jo?o Bernardo added the comment: Hi, This code is working quite well on my system, but I'm still not sure if the behavior of multiple predicates is the one other people want. So, for the thread start running again: - Should it test only the predicates from the awakened Conditions an accept if one of them is true? - Or any of the predicates must be true (current implementation)? - Or all of them must be true (less likely, but possible)? Another option is that we allow the behavior to be configurable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 21:38:11 2013 From: report at bugs.python.org (Poul-Henning Kamp) Date: Mon, 03 Jun 2013 19:38:11 +0000 Subject: [issue18127] Strange behaviour with default list argument Message-ID: <1370288291.84.0.212306741385.issue18127@psf.upfronthosting.co.za> New submission from Poul-Henning Kamp: I'd like to nominate this piece of code as candidate for the next round of "Most unexpected python behaviour" awards: def foo(a, x = []): x.append(a) return x print(foo(1)) print(foo(2)) I expected the output to be: [1] [2] but I get: [1] [1, 2] Bug? (If not, I'd *love* to read the rationale for this behaviour...) ---------- messages: 190557 nosy: bsdphk priority: normal severity: normal status: open title: Strange behaviour with default list argument type: behavior versions: Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 21:58:45 2013 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 Jun 2013 19:58:45 +0000 Subject: [issue18127] Strange behaviour with default list argument In-Reply-To: <1370288291.84.0.212306741385.issue18127@psf.upfronthosting.co.za> Message-ID: <1370289525.65.0.363007761713.issue18127@psf.upfronthosting.co.za> Eric V. Smith added the comment: It's by design. Search for "mutable default arguments", for example http://docs.python-guide.org/en/latest/writing/gotchas.html#mutable-default-arguments ---------- nosy: +eric.smith resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 22:15:06 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 03 Jun 2013 20:15:06 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <3bPSDT18Vkz7LkJ@mail.python.org> Roundup Robot added the comment: New changeset ffdee6b36305 by Victor Stinner in branch '3.3': Close #18109: os.uname() now decodes fields from the locale encoding, and http://hg.python.org/cpython/rev/ffdee6b36305 New changeset 2472603af83e by Victor Stinner in branch 'default': (Merge 3.3) Close #18109: os.uname() now decodes fields from the locale http://hg.python.org/cpython/rev/2472603af83e ---------- nosy: +python-dev resolution: invalid -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 22:25:17 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jun 2013 20:25:17 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370291117.17.0.400248861192.issue18109@psf.upfronthosting.co.za> STINNER Victor added the comment: issue18109.patch is not correct: it uses the locale encoding in strict mode, the surrogateescape error handler should be used instead. I rewrote the patch. I removed the unit test because changing a hostname is really unexpected and may break (crash?) running desktop applications. The hostname is something too critical IMO. I ran the test manually on my Linux box at least ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 22:36:20 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jun 2013 20:36:20 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370291780.44.0.229477150163.issue18109@psf.upfronthosting.co.za> STINNER Victor added the comment: test_logging is failing with a non-ASCII hostname because of the following error: error: uncaptured python exception, closing channel (:'ascii' codec can't encode character '\xe9' in position 6: ordinal not in range(128) [/home/haypo/prog/python/default/Lib/asyncore.py|read|83] [/home/haypo/prog/python/default/Lib/asyncore.py|handle_read_event|436] [/home/haypo/prog/python/default/Lib/asyncore.py|handle_accept|513] [/home/haypo/prog/python/default/Lib/test/test_logging.py|handle_accepted|746] [/home/haypo/prog/python/default/Lib/test/test_logging.py|__init__|692] [/home/haypo/prog/python/default/Lib/smtpd.py|push|276]) SMTPChannel.push() uses explicitly the ASCII encoding, whereas test_logging pass the FQDN to push(). I'm not interested to work on this issue. Please open a new issue if you consider important enough. -- More tests are also failing with *undecodable* hostnames (ex: "a??\udcff" with UTF-8 locale encoding): test_socket test_urllib test_urllib2 test_logging test_pydoc test_smtplib. I fixed and closed the issue, even I still think that you should only use ASCII for your hostname ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 22:38:40 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jun 2013 20:38:40 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370291920.38.0.0889717692501.issue18109@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, by the way, I also changed socket.gethostname(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 22:51:02 2013 From: report at bugs.python.org (Jakub Wilk) Date: Mon, 03 Jun 2013 20:51:02 +0000 Subject: [issue18128] pygettext: non-standard timestamp format in POT-Creation-Date Message-ID: <1370292662.79.0.797202814422.issue18128@psf.upfronthosting.co.za> New submission from Jakub Wilk: pygettext uses non-standard timestamp format in the POT-Creation-Date field. For example: POT-Creation-Date: 2013-06-03 22:31+CEST whereas xgettext uses this format: POT-Creation-Date: 2013-06-03 22:31+0200 You could use this code to generate timestamps in the same format as xgettext: from time import time, localtime, strftime from calendar import timegm def gettext_timestamp(): now = int(time()) nowtuple = localtime(now) offset = timegm(nowtuple) - now sign = '-' if offset < 0 else '+' hour, minute = divmod(abs(offset) // 60, 60) return strftime('%Y-%m-%d %H:%M', nowtuple) + sign + '%02d%02d' % (hour, minute) ---------- messages: 190563 nosy: jwilk priority: normal severity: normal status: open title: pygettext: non-standard timestamp format in POT-Creation-Date _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 22:53:49 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 03 Jun 2013 20:53:49 +0000 Subject: [issue18128] pygettext: non-standard timestamp format in POT-Creation-Date In-Reply-To: <1370292662.79.0.797202814422.issue18128@psf.upfronthosting.co.za> Message-ID: <1370292829.78.0.623965891384.issue18128@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 22:54:38 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 03 Jun 2013 20:54:38 +0000 Subject: [issue18128] pygettext: non-standard timestamp format in POT-Creation-Date In-Reply-To: <1370292662.79.0.797202814422.issue18128@psf.upfronthosting.co.za> Message-ID: <1370292878.32.0.690278171524.issue18128@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: It's probably worth changing. My only concern would be backwards compatibility issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 23:00:47 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Jun 2013 21:00:47 +0000 Subject: [issue18123] fnmatchicase for case insensitive file search In-Reply-To: <1370203703.41.0.79020240908.issue18123@psf.upfronthosting.co.za> Message-ID: <1370293247.41.0.123166817697.issue18123@psf.upfronthosting.co.za> STINNER Victor added the comment: The bug tracker is not the best place to discuss adding new features to the standard library. It's better to discuss them first on the python-ideas mailing list. You should also give an use case, explain why do you consider that Python needs this feature, etc. For example, I don't need such functionn and why not converting filenames to lowercase? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 23:07:40 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 03 Jun 2013 21:07:40 +0000 Subject: [issue18127] Strange behaviour with default list argument In-Reply-To: <1370288291.84.0.212306741385.issue18127@psf.upfronthosting.co.za> Message-ID: <20130603170728.4c5b5dba@anarchist> Barry A. Warsaw added the comment: While it's true that it can be confusing to users, it's not a bug. http://docs.python.org/2/reference/compound_stmts.html#function and a nice treatise on the subject by the Effbot: http://effbot.org/zone/default-values.htm ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 3 23:34:02 2013 From: report at bugs.python.org (Ned Deily) Date: Mon, 03 Jun 2013 21:34:02 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370295242.64.0.56667490839.issue18021@psf.upfronthosting.co.za> Ned Deily added the comment: Has anyone looked at the current Apple style guide to determine whether it is still an appropriate reference for Python doc usage? It appears to have undergone some major changes over the years as Apple's docs have changed. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 00:18:52 2013 From: report at bugs.python.org (Oscar Benjamin) Date: Mon, 03 Jun 2013 22:18:52 +0000 Subject: [issue18129] Fatal Python error: Cannot recover from stack overflow. Message-ID: <1370297932.54.0.350896209872.issue18129@psf.upfronthosting.co.za> New submission from Oscar Benjamin: This is from a thread on python-list that started here: http://mail.python.org/pipermail/python-list/2013-May/647895.html There are situations in which the Python 3.2 and 3.3 interpreters crash with "Fatal Python error: Cannot recover from stack overflow." when I believe the correct response is a RuntimeError (as happens in 2.7). I've attached a file crash.py that demonstrates the problem. The following gives the same behaviour in 2.7, 3.2 and 3.3: $ cat tmp.py def loop(): loop() loop() $ py -3.2 tmp.py Traceback (most recent call last): File "tmp.py", line 4, in loop() File "tmp.py", line 2, in loop loop() File "tmp.py", line 2, in loop loop() File "tmp.py", line 2, in loop loop() File "tmp.py", line 2, in loop ... However the following leads to a RuntimeError in 2.7 but different fatal stack overflow errors in 3.2 and 3.3 (tested on Windows XP using 32-bit python.org installers): $ cat tmp.py def loop(): try: (lambda: None)() except RuntimeError: pass loop() loop() $ py -2.7 tmp.py Traceback (most recent call last): File "tmp.py", line 8, in loop() File "tmp.py", line 6, in loop loop() File "tmp.py", line 6, in loop loop() File "tmp.py", line 6, in loop loop() File "tmp.py", line 6, in loop ... RuntimeError: maximum recursion depth exceeded $ py -3.2 tmp.py Fatal Python error: Cannot recover from stack overflow. This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. $ py -3.3 tmp.py Fatal Python error: Cannot recover from stack overflow. Current thread 0x000005c4: File "tmp.py", line 3 in loop File "tmp.py", line 6 in loop File "tmp.py", line 6 in loop File "tmp.py", line 6 in loop File "tmp.py", line 6 in loop File "tmp.py", line 6 in loop File "tmp.py", line 6 in loop ... Also tested on stock Python 3.2.3 on Ubuntu (2.7 gives RuntimeError): $ python3 tmp.py Fatal Python error: Cannot recover from stack overflow. Aborted (core dumped) I would expect this to give "RuntimeError: maximum recursion depth exceeded" in all cases. Oscar ---------- components: Interpreter Core files: crash.py messages: 190568 nosy: oscarbenjamin priority: normal severity: normal status: open title: Fatal Python error: Cannot recover from stack overflow. type: crash versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file30458/crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 00:25:12 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 03 Jun 2013 22:25:12 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370298312.14.0.254013548573.issue18111@psf.upfronthosting.co.za> Nick Coghlan added the comment: As stated, I don't agree with the closure of this one. min/max deserve a more elegant mechanism for dealing with the empty iterable edge case. ---------- resolution: rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 00:44:37 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 03 Jun 2013 22:44:37 +0000 Subject: [issue18053] Add checks for Misc/NEWS in make patchcheck In-Reply-To: <1369453600.75.0.470507945427.issue18053@psf.upfronthosting.co.za> Message-ID: <1370299477.91.0.607385173818.issue18053@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 00:47:03 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 03 Jun 2013 22:47:03 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1370299623.02.0.806640045539.issue18054@psf.upfronthosting.co.za> Ezio Melotti added the comment: What about adding a "recipes" section in the docs with sample implementation of specific assertMethods? ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 00:47:22 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 03 Jun 2013 22:47:22 +0000 Subject: [issue18101] Tk.split() doesn't work with nested Unicode strings In-Reply-To: <1369922361.42.0.622055843561.issue18101@psf.upfronthosting.co.za> Message-ID: <1370299642.38.0.479588304294.issue18101@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 00:47:44 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 03 Jun 2013 22:47:44 +0000 Subject: [issue18102] except-clause with own exception class inside generator can lead to confusing warning on termination In-Reply-To: <1369928159.24.0.947067999583.issue18102@psf.upfronthosting.co.za> Message-ID: <1370299664.35.0.608211300847.issue18102@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 00:48:38 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 03 Jun 2013 22:48:38 +0000 Subject: [issue18104] Idle: make human-mediated GUI tests usable In-Reply-To: <1369961521.26.0.131640091288.issue18104@psf.upfronthosting.co.za> Message-ID: <1370299718.11.0.293820741733.issue18104@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 00:50:10 2013 From: report at bugs.python.org (David Beazley) Date: Mon, 03 Jun 2013 22:50:10 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370299810.72.0.652120016181.issue18111@psf.upfronthosting.co.za> David Beazley added the comment: I could have used this feature myself somewhat recently. It was in some code involving document matching where zero or more possible candidates were assigned a score and I was trying to find the max score. The fact that an empty list was a possibility complicated everything because I had to add extra checks for it. max(scores, default=0) would have been a lot simpler. ---------- nosy: +dabeaz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 02:15:20 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Jun 2013 00:15:20 +0000 Subject: [issue18130] idlelib.configSectionNameDialog: fix and add tests and mocks Message-ID: <1370304919.98.0.573433611159.issue18130@psf.upfronthosting.co.za> New submission from Terry J. Reedy: The patch to configSectionNameDialog.py fixes the human test (adds required arg) so it runs, adds instructions to the test, fixes a bug in name_ok, removes redundant code, adds needed spaces, de-camelcases internal names, and changes the master for the two StringVars so they can be collected [sys:1: ResourceWarning: gc: 2 uncollectable objects at shutdown [, _______________________________________ From report at bugs.python.org Tue Jun 4 02:15:43 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Jun 2013 00:15:43 +0000 Subject: [issue18130] idlelib.configSectionNameDialog: fix and add tests and mocks In-Reply-To: <1370304919.98.0.573433611159.issue18130@psf.upfronthosting.co.za> Message-ID: <1370304943.13.0.229386085823.issue18130@psf.upfronthosting.co.za> Changes by Terry J. Reedy : Added file: http://bugs.python.org/file30460/config_name27.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 02:24:22 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Jun 2013 00:24:22 +0000 Subject: [issue18104] Idle: make human-mediated GUI tests usable In-Reply-To: <1369961521.26.0.131640091288.issue18104@psf.upfronthosting.co.za> Message-ID: <1370305462.72.0.170328055973.issue18104@psf.upfronthosting.co.za> Changes by Terry J. Reedy : Removed file: http://bugs.python.org/file30439/configSectionNameDialog.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 02:33:13 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Jun 2013 00:33:13 +0000 Subject: [issue18104] Idle: make human-mediated GUI tests usable In-Reply-To: <1369961521.26.0.131640091288.issue18104@psf.upfronthosting.co.za> Message-ID: <1370305993.74.0.0627498933537.issue18104@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I opened #18130 for an updated configSectionNameDialog.py patch. It also adds to idle_tests two files, mock_tk.py and test_config_name.py. The latter uses the former for gui-free automated tests of some of the dialog methods. I plan to commit in a couple of days. The fixed human test is required for this issue. ---------- dependencies: +idlelib.configSectionNameDialog: fix and add tests and mocks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 03:13:00 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Jun 2013 01:13:00 +0000 Subject: [issue18131] Tkinter Variables require a proper master Message-ID: <1370308379.98.0.744218229266.issue18131@psf.upfronthosting.co.za> New submission from Terry J. Reedy: The signature for tkinter class Variable and its subclasses StringVar, IntVar, DoubleVar, BooleanVar is def __init__(self, master=None, value=None, name=None): However, the None default is invalid because of self._tk = master.tk The preceding lines if not master: master = _default_root might suggest that None is acceptible. But _default_root is set to None at the top of the file, so that just replaces None with None. If Variables must have a gui widget parent, then they cannot be used in gui-free tests, even though they have no graphic representation. Moveover, not everything is a proper master. configSectionNameDialog.py . GetCfgSectionNameDialog(Toplevel) . Create.Widgets(self) has these lines: self.name = StringVar(self) self.fontSize = StringVar(self) However, these are not (always) garbage collectable. After fixing the dialog test at the bottom of the file, and running it with 3.3 python_d -m idlelib.configSectionNameDialog (#18130), and adding the gc flag, I repeatedly got [sys:1: ResourceWarning: gc: 2 uncollectable objects at shutdown [, _______________________________________ From report at bugs.python.org Tue Jun 4 03:29:40 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Jun 2013 01:29:40 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370309380.83.0.139943816937.issue18111@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I still think complicating the API isn't worth it. Of late, we've gotten in the habit of a complexity to even the simplest of things. In the case of sequences, we already have a reasonable solution: low = min(seq) if seq else default In the rarer case of non-sequence iterables, catching a Value error is the traditional solution -- not pretty, but not difficult either. In the past, Guido has rejected that notion of "add a default value to every function than can raise an exception". For example, someone wanted to add a get() method to lists so they could avoid catching an IndexError, something like s.get(index, default). IIRC, his motivation was that "avoiding API clutter" was more important than supporting an uncommon use case that already had viable solutions using plain Python. My own principle is that it is okay to add an initial extra feature to function, but not multiple extra features. This becomes more important when the function already has API issues. The min() / max() functions started-out with an API problem because of their dual signature: min(s) versus min(a, b, c). That creates an ambiguity in that case of min(*t) where the result depends on the length of the input. IMO, that issue would be exacerbated by the addition of a default argument (i.e. it would tend to hide the error from test cases): for t in [(10, 20, 30), (10, 20), (10,), ()]: print min(*t, default=100) Also, I don't think we should forget the lessons learned about adding unnecessary arguments to functions. For example, we let someone add start and end arguments to str.startswith() and str.endswith() because "it seemed more parallel with str.find()" and because "someone wanted it once a piece of code somewhere". The downside only became apparent later when there was a legitimate real use case for another feature request: searching multiple prefixes and suffixes. Because we had wasted the positional arguments, we ended-up with the awkward str.startswith(str-or-tuple [,start [,end]]) signature. That is why we have to write, filename.endswith(('.py', '.pyc')). The double parens are part of the cost of API bloat. Lastly, when it comes to common-place functions like min() and max(), we can assess needs easily by looking at what other languages have done. Looking at Excel, SQL, Java, Haskell, C# etc, I don't see a precedent for this feature request. Grepping for min/max in my own code and third-party libraries, I don't see any cases where the code had a need for this feature. If the need arises, it certainly doesn't come of very often. If you guys all think this is an good feature request, then by all means, go ahead and add it. My recommendation is to show design restraint and refuse the temptation to grow this already awkward API when you don't have to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 03:35:56 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Jun 2013 01:35:56 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1370309756.18.0.815635930954.issue18103@psf.upfronthosting.co.za> Terry J. Reedy added the comment: My experiments and some web postings indicate that if a tkinter class has a master or parent option, it may not really be an option, regardless of what our docs imply. If tkinter.Tk is called either directly or indirectly, the graphics system is initiated and something is displayed. This appears to includes the seemingly non-graphics Variable (Var) classes such as IntVar (#18131). I started idle_lib/mock_tk.py as part of #18130. This will allow non-gui unit testing of any method whose tkinter use is limited to Vars and message boxes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 03:48:01 2013 From: report at bugs.python.org (Julian Berman) Date: Tue, 04 Jun 2013 01:48:01 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370310481.95.0.241816485595.issue18111@psf.upfronthosting.co.za> Julian Berman added the comment: Raymond, I respect that in your opinion this seems to be overcomplexity, but you haven't addressed any of the arguments made, nor responded to any of the arguments against this being added complexity. I really don't understand the parallels you're making to str.*with, but as for other languages, as David pointed out already, you are looking at things in a vacuum. This is needed because min and max are already silly. In languages like Ruby and Clojure, which were the quickest I had handy, of course you don't need this, because calling min and max *by default* returns None. I'd bet Python 2's silly type comparison history had something to do with the return value not defaulting to None, but what's done is done. I don't like hard-fast rules, but I don't think APIs should ever be penalized for their own mistakes. We should make sane things possible in pleasant ways. If it's OK then (turning back to the patch), unless anyone has something additional to add I'm going to carve up some tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 04:41:35 2013 From: report at bugs.python.org (Madison May) Date: Tue, 04 Jun 2013 02:41:35 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370313695.21.0.375296097821.issue18021@psf.upfronthosting.co.za> Madison May added the comment: I actually had a bit of a hard time even locating a copy of the 2009 version. Thanks to the Wayback Machine, here's the 2009 version of the pdf for reference: http://web.archive.org/web/20121221004340/https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 04:53:55 2013 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 04 Jun 2013 02:53:55 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370314435.48.0.449376576017.issue18111@psf.upfronthosting.co.za> Nick Coghlan added the comment: To me, the Python-specific difference that makes this useful for us but not for others is *precisely* the fact that the simple idiom: x = min(seq) if seq else default is broken for iterators that don't provide __len__ or __bool__, while the even simpler: x = min(seq) is broken for the empty iterable. However, I think we should explicitly disallow the combination of multiple positional arguments *and* the new default argument. If you don't know the length of the input iterable, you should *not* be using the multiple argument form. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 05:03:55 2013 From: report at bugs.python.org (Julian Berman) Date: Tue, 04 Jun 2013 03:03:55 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370315035.59.0.325100859312.issue18111@psf.upfronthosting.co.za> Julian Berman added the comment: Personally I don't care either way, I basically never use the multiple positional arg form, but what are we trying to prevent exactly? It's bad code, but it (would) do what the person was expecting. Am I not getting the point that's being made about that case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 05:26:18 2013 From: report at bugs.python.org (Julian Berman) Date: Tue, 04 Jun 2013 03:26:18 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1370316378.95.0.221134755193.issue18054@psf.upfronthosting.co.za> Julian Berman added the comment: Can I throw in, and hopefully not in a way that's too out of place, that I think that unittest might want to rethink it's strategy re: assertion methods? The fact that the object that has all the assertions and the object that has the logic for running a test, and the thing that holds all the tests on it, makes things difficult. For a concrete example, subclasses of unittest.TestCase like e.g. trial.unittest.TestCase do not have easy ways of allowing pluggable assertions, by which I mean you can't show up and say "Here I have a thing with some assertions, use this". So, for trial, if we want to support unittest2 assertions (which I'd personally like), we have to put code in trial to do so. It would seem to me that it'd be nicer to (obviously keep what we have for backwards compatibility) but rather than adding a bunch of mixins, have an API that decouples things holding assertion methods from a TestCase, and mix those in by calling a method on the TestCase rather than mixing in a bunch of assertion mixins. (also, in a slightly lighter note, I might like an assertEqualAndAlsoNotUnequal method :D) ---------- nosy: +Julian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 05:34:19 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Jun 2013 03:34:19 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370316859.0.0.0897383377164.issue18111@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Guido, this is your language. What would you like to do? The OP wants a default argument on min() and max() so he won't have to use an "except ValueError" for non-sequence iterables that are potentially empty. At first, I thought the functions were already as complex as we would want to get, but several proponents have emerged, so I'm stepping aside. The proposed patch would allow: max(iterable, key=somefunc, default=sentinel) and would return sentinel_value when len(list(iterable))==0. It would not allow: max(*iterable, key=somefunc, default=sentinel_value) where s is an empty iterable. ---------- assignee: -> gvanrossum nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 05:37:03 2013 From: report at bugs.python.org (Stefan Mihaila) Date: Tue, 04 Jun 2013 03:37:03 +0000 Subject: [issue17810] Implement PEP 3154 (pickle protocol 4) In-Reply-To: <1370284400.42.0.329388659197.issue17810@psf.upfronthosting.co.za> Message-ID: <51AD60D6.4070004@gmail.com> Stefan Mihaila added the comment: On 6/3/2013 9:33 PM, Alexandre Vassalotti wrote: > Alexandre Vassalotti added the comment: > > Stefan, could you address my review comments soon? The improved support for globals is the only big piece missing from the implementation of PEP, which I would like to get done and submitted by the end of the month. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > Yes, I apologize for the delay again. Today is my last exam this semester, so I'll do my best to get it done as soon as possible (hopefully this weekend). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 05:43:12 2013 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 04 Jun 2013 03:43:12 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370317392.57.0.818979518878.issue18111@psf.upfronthosting.co.za> Guido van Rossum added the comment: +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 05:44:48 2013 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 04 Jun 2013 03:44:48 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370317487.99.0.906939124712.issue18111@psf.upfronthosting.co.za> Changes by Guido van Rossum : ---------- assignee: gvanrossum -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 05:48:20 2013 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 04 Jun 2013 03:48:20 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370317700.71.0.101641651733.issue18111@psf.upfronthosting.co.za> Nick Coghlan added the comment: Just one final design philosophy comment from me (I know it isn't needed since Guido already ack'ed the suggestion): As far as the lessons learned from the historical startswith() case go, avoiding taking up the positional slots with optional flags and configuration parameters is one of the big reasons we added keyword only arguments (with the other being readability at the call site). I agree we need to be cautious with API complexity, I just think in this case clean handling of empty iterators is a net win (so long as we rule out the conceptually broken case of combining the new parameter with multiple positional arguments). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 06:02:29 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Jun 2013 04:02:29 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370318549.1.0.881418458255.issue18111@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Julian, when your tests are ready, I'll be happy to review and apply the patch. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 06:30:40 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Jun 2013 04:30:40 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1370320240.61.0.635202687632.issue18054@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 to what Michael said. The current API is way too big, but these proposed methods aren't trivially easy to get right. It would be nice to have them done once and done well. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 07:11:53 2013 From: report at bugs.python.org (Dominik Richter) Date: Tue, 04 Jun 2013 05:11:53 +0000 Subject: [issue18109] os.uname() crashes if hostname contains non-ascii characters In-Reply-To: <1370030320.3.0.429673365201.issue18109@psf.upfronthosting.co.za> Message-ID: <1370322713.68.0.282890772751.issue18109@psf.upfronthosting.co.za> Dominik Richter added the comment: Thank you all for your help, works great! @Victor: fully agree on the ascii hostname ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 07:43:54 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Tue, 04 Jun 2013 05:43:54 +0000 Subject: [issue13647] Python SSL stack doesn't securely validate certificate (as client) In-Reply-To: <1324564490.24.0.352449270187.issue13647@psf.upfronthosting.co.za> Message-ID: <1370324634.47.0.167312762114.issue13647@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 08:08:50 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 04 Jun 2013 06:08:50 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1370326130.12.0.714629989348.issue16991@psf.upfronthosting.co.za> Eric Snow added the comment: Without too many optimzations, the C implementation of OrderedDict is basically between 1x and 4x the performance of raw dict. This contrasts with the pure Python OrderedDict, which falls in roughly between 4x and 100x. I've attached an addition to pybench, not intended to be committed, that compares the 3. Run any of these commands to get timing: ./python Tools/pybench/pybench.py -t ODict ./python Tools/pybench/pybench.py -t ODict -t _Py ./python Tools/pybench/pybench.py -t ODict -t _C ./python Tools/pybench/pybench.py -t ODict -t _Dict I tuned the # rounds for each test such that the raw dict results all come out to just about the same value (2ms on my computer). That way it's easy to compare the pure Python or C results to the dict results. ---------- Added file: http://bugs.python.org/file30461/odict-speed.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 08:11:02 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 04 Jun 2013 06:11:02 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1370326262.71.0.86230027656.issue16991@psf.upfronthosting.co.za> Changes by Eric Snow : Removed file: http://bugs.python.org/file30357/cOrderedDict.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 08:13:24 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 04 Jun 2013 06:13:24 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1370326404.91.0.637864616607.issue16991@psf.upfronthosting.co.za> Eric Snow added the comment: Here's an updated patch that has fixes for recursive pickles and for a couple memory-related segfaults that I missed before. That leaves the following to be done: * handle the case where a node is deleted during iteration * check for any reference cycles (should be fine) * validate reentrancy (make sure everything is thread-safe around calls into Python) * make sure subclassing is okay * address any remaining TODOs in the code ---------- Added file: http://bugs.python.org/file30462/cOrderedDict.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 09:01:03 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 04 Jun 2013 07:01:03 +0000 Subject: [issue18078] threading.Condition to allow notify on a specific waiter In-Reply-To: <1370285797.52.0.402641534443.issue18078@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: I'm not convinced it's really useful. Furthermore, the complexity is rather bad: if T is the average number of waiting threads, an C the number of conditions being waited on, the wait is O(C) (appending to C wait queues) and wakeup is O(CT) (C removal from a T-length deque). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 10:49:52 2013 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 04 Jun 2013 08:49:52 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1370335792.97.0.263492659915.issue18054@psf.upfronthosting.co.za> Nick Coghlan added the comment: I like the idea of using the strategy pattern to at least decouple the assertion API from the main testcase API. I also like it better than the mixin suggested earlier. We would obviously have to keep the existing methods for backwards compatibility, but could avoid adding new ones. I'm not sure what such an API would look like, though :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 11:47:10 2013 From: report at bugs.python.org (Madison May) Date: Tue, 04 Jun 2013 09:47:10 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370339230.44.0.889722826544.issue18021@psf.upfronthosting.co.za> Madison May added the comment: So I've done a quick comparison of the two, and for the most part each entry is an identical copy of the 2009 version. Some dated entries have been removed, which I would consider a plus -- who realistically needs to know how to refer to a 56K modems these day, anyhow :) Aside from this kind of removal, a slightly modified layout, and a few updated images, I haven't noticed any significant differences. What caught your eye, Ned? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 13:01:26 2013 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Tue, 04 Jun 2013 11:01:26 +0000 Subject: [issue18078] threading.Condition to allow notify on a specific waiter In-Reply-To: <1369712419.12.0.434704480843.issue18078@psf.upfronthosting.co.za> Message-ID: <1370343686.8.0.625095757928.issue18078@psf.upfronthosting.co.za> Jo?o Bernardo added the comment: > I'm not convinced it's really useful. It doesn't seem a lot useful until you *really* need it. I've got 2 highly parallel programs that took advantage of this pattern. > the wait is O(C) (appending to C wait queues) and wakeup > is O(CT) (C removal from a T-length deque). That's another thing that I wanted to address, but I didn't want to change the data structure in this patch. The complexity for `notify` and `notify_all` is the same as before. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 13:43:57 2013 From: report at bugs.python.org (David Beazley) Date: Tue, 04 Jun 2013 11:43:57 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370346237.82.0.226875514921.issue18111@psf.upfronthosting.co.za> David Beazley added the comment: To me, the fact that m = max(s) if s else default doesn't work with iterators alone makes this worthy of consideration. I would also note that min/max are the only reduction functions that don't have the ability to work with a possibly empty sequence. For example: >>> sum([]) 0 >>> any([]) False >>> all([]) True >>> functools.reduce(lambda x,y: x+y, [], 0) 0 >>> math.fsum([]) 0.0 >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 15:46:45 2013 From: report at bugs.python.org (Jan Kanis) Date: Tue, 04 Jun 2013 13:46:45 +0000 Subject: [issue18132] buttons in turtledemo disappear on small screens Message-ID: <1370353605.18.0.929519765734.issue18132@psf.upfronthosting.co.za> New submission from Jan Kanis: If the window of the turtledemo is small enough, the start/stop/clear buttons disappear. This is specifically a problem when running on a netbook with a small screen, because the buttons are never shown. For a newcommer checking out the demo app this could be very confusing as there is no indication on what went wrong, and the notification area just says 'press start button'. ---------- messages: 190596 nosy: JanKanis priority: normal severity: normal status: open title: buttons in turtledemo disappear on small screens versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 15:47:24 2013 From: report at bugs.python.org (Jan Kanis) Date: Tue, 04 Jun 2013 13:47:24 +0000 Subject: [issue18132] buttons in turtledemo disappear on small screens In-Reply-To: <1370353605.18.0.929519765734.issue18132@psf.upfronthosting.co.za> Message-ID: <1370353644.5.0.881959003685.issue18132@psf.upfronthosting.co.za> Changes by Jan Kanis : ---------- components: +Demos and Tools type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 16:06:39 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Tue, 04 Jun 2013 14:06:39 +0000 Subject: [issue18078] threading.Condition to allow notify on a specific waiter In-Reply-To: <1369712419.12.0.434704480843.issue18078@psf.upfronthosting.co.za> Message-ID: <1370354799.69.0.572004998472.issue18078@psf.upfronthosting.co.za> Richard Oudkerk added the comment: > Furthermore, the complexity is rather bad: if T is the average number > of waiting threads, an C the number of conditions being waited on, the > wait is O(C) (appending to C wait queues) and wakeup is O(CT) (C > removal from a T-length deque). Which just means that waiting on C conditions is C times more expensive than waiting on 1 currently is. That seems reasonable enough to me, and anyway, I would expect C to be fairly small. Note that the alternative is to use a single condition and use notify_all() instead of notify(). That is likely to be much more expensive because every waiting thread must wake up to see if it should continue. But I am still not sure it is worth it. BTW, I think it would be better to have wait_for_any() return a list of ready conditions rather than a boolean. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 16:15:53 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 04 Jun 2013 14:15:53 +0000 Subject: [issue17269] getaddrinfo segfaults on OS X when provided with invalid arguments combinations In-Reply-To: <1361489513.5.0.894275569557.issue17269@psf.upfronthosting.co.za> Message-ID: <1370355353.41.0.753877997106.issue17269@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I've tested a patch for the 2.7 branch on a 10.5 machine (which also failed to build without the patch), and will commit once I've finished running the testsuite on the 3.3 branch as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 16:39:00 2013 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Tue, 04 Jun 2013 14:39:00 +0000 Subject: [issue18078] threading.Condition to allow notify on a specific waiter In-Reply-To: <1369712419.12.0.434704480843.issue18078@psf.upfronthosting.co.za> Message-ID: <1370356740.45.0.95590392442.issue18078@psf.upfronthosting.co.za> Jo?o Bernardo added the comment: > BTW, I think it would be better to have wait_for_any() > return a list of ready conditions rather than a boolean. That was the original idea until I realized `wait` and `wait_for` were just specializations of `wait_for_any`. This can probably be done with another helper function. (BTW: There are 2 commented lines in the patch that can be used to see the ready Conditions). Any suggestions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 16:44:23 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 04 Jun 2013 14:44:23 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1370357063.71.0.141608968682.issue17222@psf.upfronthosting.co.za> Brett Cannon added the comment: I'm going to toss Armin's request over to core-mentorship since the fix is easy. Is all you are after, Armin, a ``not os.path.isfile(cfile) or os.path.islink(cfile)`` check which if true raises an exception? ---------- assignee: brett.cannon -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 16:46:09 2013 From: report at bugs.python.org (Julian Berman) Date: Tue, 04 Jun 2013 14:46:09 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1370357169.28.0.538258509565.issue18054@psf.upfronthosting.co.za> Julian Berman added the comment: I don't either really off the top of my head, though I've toyed with some things. If there's support for some exploration I wouldn't mind attempting a POC externally though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 16:48:11 2013 From: report at bugs.python.org (Michael Foord) Date: Tue, 04 Jun 2013 14:48:11 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1370357291.58.0.490615458869.issue18054@psf.upfronthosting.co.za> Michael Foord added the comment: There's always (almost) support for exploration... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 16:58:45 2013 From: report at bugs.python.org (Mher Movsisyan) Date: Tue, 04 Jun 2013 14:58:45 +0000 Subject: [issue18119] urllib.FancyURLopener does not treat URL fragments correctly In-Reply-To: <1370168530.11.0.609209040554.issue18119@psf.upfronthosting.co.za> Message-ID: <1370357925.11.0.972385263411.issue18119@psf.upfronthosting.co.za> Changes by Mher Movsisyan : ---------- nosy: +mher.movsisyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 17:09:13 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Tue, 04 Jun 2013 15:09:13 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370358553.73.0.948551310156.issue18116@psf.upfronthosting.co.za> Vajrasky Kok added the comment: Based on the input from Benjamin Peterson, I grab encoding from the os module in the getpass module. I put some test as well. Until the whole function is rewritten, I hope this patch will suffice and do the job properly. ---------- Added file: http://bugs.python.org/file30463/getpass_tty_with_test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 17:46:44 2013 From: report at bugs.python.org (Aaron Meurer) Date: Tue, 04 Jun 2013 15:46:44 +0000 Subject: [issue18005] faster modular exponentiation in some cases In-Reply-To: <1368871639.93.0.89718215484.issue18005@psf.upfronthosting.co.za> Message-ID: <1370360804.3.0.0996016761193.issue18005@psf.upfronthosting.co.za> Changes by Aaron Meurer : ---------- nosy: +Aaron.Meurer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 18:25:18 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Tue, 04 Jun 2013 16:25:18 +0000 Subject: [issue18078] threading.Condition to allow notify on a specific waiter In-Reply-To: <1370354799.69.0.572004998472.issue18078@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: > Which just means that waiting on C conditions is C times more expensive than > waiting on 1 currently is. That seems reasonable enough to me, and anyway, > I would expect C to be fairly small. Waking up a single thread (through notify()) is currently O(1) (since it's unqueued from the head of the deque). Here, removing a thread from a wait queue other than the one from which it was signalled is O(waiting threads). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 19:01:54 2013 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Tue, 04 Jun 2013 17:01:54 +0000 Subject: [issue18078] threading.Condition to allow notify on a specific waiter In-Reply-To: <1369712419.12.0.434704480843.issue18078@psf.upfronthosting.co.za> Message-ID: <1370365314.37.0.276072863691.issue18078@psf.upfronthosting.co.za> Jo?o Bernardo added the comment: > Here, removing a thread > from a wait queue other than the one from which it was signalled is > O(waiting threads). To be fair, You will probably never have more than a few hundred/thousand threads on a process. Usually you'll work under a few dozen threads. To reduce the complexity on average, you could use a set, but `notify` no longer will be able to follow insertion order. I was hoping it could be done later... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 19:10:34 2013 From: report at bugs.python.org (Joshua) Date: Tue, 04 Jun 2013 17:10:34 +0000 Subject: [issue18133] Modulus not calculating properly? Message-ID: <1370365834.5.0.461885033032.issue18133@psf.upfronthosting.co.za> New submission from Joshua: The Modulus doesn't seem to pull the proper remainder from simple calculations. Look at the difference below between the remainder of a regular division calculation and the modulus: Am I missing something??? >>> print (str(10.2 / 2)) 5.1 >>> print (str(10.2 % 2)) 0.1999999999999993 >>> ---------- components: Windows messages: 190606 nosy: pccreator25 priority: normal severity: normal status: open title: Modulus not calculating properly? type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 19:20:59 2013 From: report at bugs.python.org (Berker Peksag) Date: Tue, 04 Jun 2013 17:20:59 +0000 Subject: [issue18132] buttons in turtledemo disappear on small screens In-Reply-To: <1370353605.18.0.929519765734.issue18132@psf.upfronthosting.co.za> Message-ID: <1370366459.83.0.944853160125.issue18132@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- versions: -Python 2.6, Python 3.1, Python 3.2, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 19:44:11 2013 From: report at bugs.python.org (Joshua) Date: Tue, 04 Jun 2013 17:44:11 +0000 Subject: [issue18133] Modulus not calculating properly? In-Reply-To: <1370365834.5.0.461885033032.issue18133@psf.upfronthosting.co.za> Message-ID: <1370367851.13.0.067485350726.issue18133@psf.upfronthosting.co.za> Joshua added the comment: never mind, long day sorry! ---------- resolution: -> works for me status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 21:49:21 2013 From: report at bugs.python.org (Ned Deily) Date: Tue, 04 Jun 2013 19:49:21 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370375361.21.0.890684489139.issue18021@psf.upfronthosting.co.za> Ned Deily added the comment: "Documenting Python" references to the Apple Style Guide go back to at least Python 2.3.5's documentation, at that time to the 2001 version of the Apple Style Guide. I was more curious if the Apple Style Guide was still being actively consulted by the documentation team or if this had become a vestigial link, being updated by rote. So, I'd say update the link unless Georg or someone else says it is no longer relevant. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 22:04:14 2013 From: report at bugs.python.org (Ezio Melotti) Date: Tue, 04 Jun 2013 20:04:14 +0000 Subject: [issue18021] Update broken link to Apple Publication Style Guide In-Reply-To: <1369055538.2.0.556134337366.issue18021@psf.upfronthosting.co.za> Message-ID: <1370376254.78.0.223815942301.issue18021@psf.upfronthosting.co.za> Ezio Melotti added the comment: I don't think I ever read/consulted that page, except maybe the first time I came across that link. I consult http://docs.python.org/devguide/documenting.html regularly, but that is mostly for the rst markup. Usually I just try to be consistent with the document I'm working on. Removing the link altogether would be fine with me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 22:24:26 2013 From: report at bugs.python.org (Benedict Kwok) Date: Tue, 04 Jun 2013 20:24:26 +0000 Subject: [issue18134] zipfile extractall accepts wrong password Message-ID: <1370377466.33.0.877137256378.issue18134@psf.upfronthosting.co.za> New submission from Benedict Kwok: Steps to reproduce: 1) create a ssn.txt file with social security numbers of customers 2) create a zip file with a password: zip -P secret ssn ssn.txt 3) create a python script to extract the zipfile by: import=zipfile zFile=zipfile.ZipFile("ssn.zip") try: zFile.extractall(pwd="secret") except Exception, e: print e This will extract the ssn.txt into the directory by using the right password "secret"different 4) However, by using a wrong password "proa" this does not get the exception. Instead create a ssn.txt file which is corrupted. 5) Other wrong password will get the exception but not the one descripted in step 4. ---------- messages: 190610 nosy: benedictkwok priority: normal severity: normal status: open title: zipfile extractall accepts wrong password type: security versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 22:37:23 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Jun 2013 20:37:23 +0000 Subject: [issue18134] zipfile extractall accepts wrong password In-Reply-To: <1370377466.33.0.877137256378.issue18134@psf.upfronthosting.co.za> Message-ID: <1370378243.9.0.385550430444.issue18134@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 22:56:53 2013 From: report at bugs.python.org (Ned Deily) Date: Tue, 04 Jun 2013 20:56:53 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1370379413.22.0.589797488084.issue18103@psf.upfronthosting.co.za> Ned Deily added the comment: Terry: FYI, I just noticed the languishing patches in Issue4343 which *might* be of some use here. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:03:04 2013 From: report at bugs.python.org (Armin Rigo) Date: Tue, 04 Jun 2013 21:03:04 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1370379784.24.0.305271443622.issue17222@psf.upfronthosting.co.za> Armin Rigo added the comment: That's not really what I'm after, but that's a workaround I proposed to avoid the worst breakage. I don't have an opinion about what to do with symlinks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:03:13 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 21:03:13 +0000 Subject: [issue17932] Win64: possible integer overflow in iterobject.c In-Reply-To: <1367966315.05.0.262623510238.issue17932@psf.upfronthosting.co.za> Message-ID: <3bQ5FV1bFbz7LjT@mail.python.org> Roundup Robot added the comment: New changeset 757a121a27c2 by Victor Stinner in branch 'default': Close #17932: Fix an integer overflow issue on Windows 64-bit in iterators: http://hg.python.org/cpython/rev/757a121a27c2 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:04:36 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Jun 2013 21:04:36 +0000 Subject: [issue17932] Win64: possible integer overflow in iterobject.c In-Reply-To: <1367966315.05.0.262623510238.issue17932@psf.upfronthosting.co.za> Message-ID: <1370379876.9.0.953507641826.issue17932@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- stage: committed/rejected -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:34:39 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Jun 2013 21:34:39 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) Message-ID: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> New submission from STINNER Victor: Our Windows 64-bit buildbot has interesting warnings: ..\Modules\_ssl.c(493): warning C4244: 'function' : conversion from 'SOCKET_T' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\_ssl.vcxproj] ..\Modules\_ssl.c(1304): warning C4244: 'function' : conversion from 'SOCKET_T' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\_ssl.vcxproj] ..\Modules\_ssl.c(1306): warning C4244: 'function' : conversion from 'SOCKET_T' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\_ssl.vcxproj] ..\Modules\_ssl.c(1360): warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\_ssl.vcxproj] ..\Modules\_ssl.c(1655): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\_ssl.vcxproj] ..\Modules\_ssl.c(1659): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\_ssl.vcxproj] ..\Modules\_ssl.c(2109): warning C4244: 'return' : conversion from 'Py_ssize_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\_ssl.vcxproj] http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/2042/steps/compile/logs/warnings%20%28532%29 It looks like the _ssl.c module does mix int and size_t types. Attached patch should fix 3 warnings. I didn't test my patch except running test_ssl (with success on my Linux x64 box). ---------- files: ssl_int.patch keywords: patch messages: 190614 nosy: haypo, pitrou priority: normal severity: normal status: open title: _ssl module: possible integer overflow for very long strings (+2^31 bytes) versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30464/ssl_int.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:41:30 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 04 Jun 2013 21:41:30 +0000 Subject: [issue18136] test_distutils failing under OS X 10.8 w/ clang Message-ID: <1370382090.88.0.902200330561.issue18136@psf.upfronthosting.co.za> New submission from Brett Cannon: I have not had test_distutils succeed in ages. It looks like various header files are not being passed to the compiler properly as all three test failures stem from PyModuleDef_HEAD_INIT supposedly not existing or some other macro. Below is an example failure test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase) ... /var/folders/00/030sr000h01000cxqpysvccm000c37/T/tmpx392aa/xxmodule.c:341:5: error: use of undeclared identifier 'PyModuleDef_HEAD_INIT' PyModuleDef_HEAD_INIT, ^ /var/folders/00/030sr000h01000cxqpysvccm000c37/T/tmpx392aa/xxmodule.c:340:27: error: variable has incomplete type 'struct PyModuleDef' static struct PyModuleDef xxmodule = { ^ /var/folders/00/030sr000h01000cxqpysvccm000c37/T/tmpx392aa/xxmodule.c:340:15: note: forward declaration of 'struct PyModuleDef' static struct PyModuleDef xxmodule = { ^ /var/folders/00/030sr000h01000cxqpysvccm000c37/T/tmpx392aa/xxmodule.c:370:9: warning: implicit declaration of function 'PyModule_Create' is invalid in C99 [-Wimplicit-function-declaration] m = PyModule_Create(&xxmodule); ^ /var/folders/00/030sr000h01000cxqpysvccm000c37/T/tmpx392aa/xxmodule.c:392:5: error: void function 'PyInit_xx' should not return a value [-Wreturn-type] return m; ^ ~ /var/folders/00/030sr000h01000cxqpysvccm000c37/T/tmpx392aa/xxmodule.c:395:5: error: void function 'PyInit_xx' should not return a value [-Wreturn-type] return NULL; ^ ~~~~ 1 warning and 4 errors generated. ERROR ---------- assignee: eric.araujo components: Distutils, Macintosh messages: 190615 nosy: brett.cannon, eric.araujo, tarek priority: normal severity: normal stage: needs patch status: open title: test_distutils failing under OS X 10.8 w/ clang type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:52:30 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 04 Jun 2013 21:52:30 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1370382750.77.0.999985802884.issue17222@psf.upfronthosting.co.za> Brett Cannon added the comment: Armin: I'm going off of http://bugs.python.org/msg189428 where you say you want an exception raised. If there is something else you want to suggest that's fine as long as it's not to revert the semantics since I'm not willing to do that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:55:12 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 04 Jun 2013 21:55:12 +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: <1370382912.0.0.199538585348.issue11959@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: The changes to smtpd.py seem reasonable to me. I see no reason not to make this change, so +1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:57:56 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 21:57:56 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <3bQ6Sf4g4pz7Ljs@mail.python.org> Roundup Robot added the comment: New changeset 2298bcba6ec9 by Victor Stinner in branch 'default': Close #17931: Fix PyLong_FromPid() on Windows 64-bit: processes are identified http://hg.python.org/cpython/rev/2298bcba6ec9 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 4 23:57:56 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 21:57:56 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bQ6Sg3FQWz7Ljq@mail.python.org> Roundup Robot added the comment: New changeset 46401ce03547 by Victor Stinner in branch 'default': Issue #9566: Fix compiler warning on Windows 64-bit in _bz2module.c http://hg.python.org/cpython/rev/46401ce03547 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:14:04 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 22:14:04 +0000 Subject: [issue17932] Win64: possible integer overflow in iterobject.c In-Reply-To: <1367966315.05.0.262623510238.issue17932@psf.upfronthosting.co.za> Message-ID: <3bQ6qH1BhnzQWm@mail.python.org> Roundup Robot added the comment: New changeset 52075f60719e by Victor Stinner in branch 'default': Issuse #17932: Fix an integer overflow issue on Windows 64-bit in tuple http://hg.python.org/cpython/rev/52075f60719e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:14:04 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 22:14:04 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bQ6qH6flwzSTg@mail.python.org> Roundup Robot added the comment: New changeset 93f4b32fc95c by Victor Stinner in branch 'default': Issue #9566: Fix a compiler warning on Windows 64-bit in namespace_init() http://hg.python.org/cpython/rev/93f4b32fc95c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:25:14 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 22:25:14 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bQ74972hfzQJt@mail.python.org> Roundup Robot added the comment: New changeset 5dcbd5d8d004 by Victor Stinner in branch 'default': Issue #9566: Fix compiler warning on Windows 64-bit http://hg.python.org/cpython/rev/5dcbd5d8d004 New changeset 41b8be55b160 by Victor Stinner in branch 'default': Issue #9566: Fix compiler warning on Windows 64-bit http://hg.python.org/cpython/rev/41b8be55b160 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:29:43 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Jun 2013 22:29:43 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1370384983.48.0.00941581315622.issue17206@psf.upfronthosting.co.za> STINNER Victor added the comment: "AMD64 Windows7 SP1 3.x" buildbot is crashing in test_marshal. It looks like a regression introduced by the changeset aff41a6421c2: [ 88/375] test_marshal Traceback (most recent call last): File "../lib/test/regrtest.py", line 1611, in main_in_temp_cwd() File "../lib/test/regrtest.py", line 1586, in main_in_temp_cwd main() File "../lib/test/regrtest.py", line 774, in main raise Exception("Child error on {}: {}".format(test, result[1])) Exception: Child error on test_marshal: Exit code 3221225725 http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/2009/steps/test/logs/stdio ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:32:17 2013 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 04 Jun 2013 22:32:17 +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: <1370385137.85.0.183352697802.issue11959@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Changes to Doc/library/asyncore.rst should be reverted. Also I would do: - asynchat.async_chat.__init__(self, conn, map) + asynchat.async_chat.__init__(self, conn, map=map) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:36:04 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 22:36:04 +0000 Subject: [issue13772] listdir() doesn't work with non-trivial symlinks In-Reply-To: <1326312074.88.0.322514160628.issue13772@psf.upfronthosting.co.za> Message-ID: <3bQ7Jh1600zQyb@mail.python.org> Roundup Robot added the comment: New changeset f431cd0edd85 by Victor Stinner in branch 'default': Issue #13772: Fix compiler warnings on Windows http://hg.python.org/cpython/rev/f431cd0edd85 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:37:25 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 22:37:25 +0000 Subject: [issue13772] listdir() doesn't work with non-trivial symlinks In-Reply-To: <1326312074.88.0.322514160628.issue13772@psf.upfronthosting.co.za> Message-ID: <3bQ7LF0RxgzRBB@mail.python.org> Roundup Robot added the comment: New changeset c351591f1f63 by Victor Stinner in branch 'default': Issue #13772: fix _check_dirA(): call *A() functions, not *W() functions http://hg.python.org/cpython/rev/c351591f1f63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:38:36 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Jun 2013 22:38:36 +0000 Subject: [issue13772] listdir() doesn't work with non-trivial symlinks In-Reply-To: <1326312074.88.0.322514160628.issue13772@psf.upfronthosting.co.za> Message-ID: <1370385516.59.0.415437798339.issue13772@psf.upfronthosting.co.za> STINNER Victor added the comment: @Jason R. Coombs: Can you please review my following commit? It looks like you made a copy/paste failure in _check_dirA() :-) > New changeset c351591f1f63 by Victor Stinner in branch 'default': > Issue #13772: fix _check_dirA(): call *A() functions, not *W() functions > http://hg.python.org/cpython/rev/c351591f1f63 ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 00:48:45 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Tue, 04 Jun 2013 22:48:45 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1370386125.67.0.981963716727.issue17206@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Hum, a stack overflow? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 01:11:30 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Jun 2013 23:11:30 +0000 Subject: [issue18137] format(float, str): integer overflow for huge precision Message-ID: <1370387490.7.0.925760036374.issue18137@psf.upfronthosting.co.za> New submission from STINNER Victor: format(1.2, ".%sf" % (2**32 + 2)) returns "1.20": the integer overflow is not catced. Attached patch fixes the issue. ---------- components: Interpreter Core files: float_format_precision.patch keywords: patch messages: 190629 nosy: haypo, mark.dickinson priority: normal severity: normal status: open title: format(float, str): integer overflow for huge precision versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30465/float_format_precision.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 01:18:31 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 23:18:31 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bQ8Ff6SCqz7LjP@mail.python.org> Roundup Robot added the comment: New changeset 36c35a1893fe by Victor Stinner in branch 'default': Issue #9566: Fix compiler warning on Windows 64-bit http://hg.python.org/cpython/rev/36c35a1893fe New changeset 88a21c5a97ef by Victor Stinner in branch 'default': Issue #9566: Fix compiler warning on Windows 64-bit http://hg.python.org/cpython/rev/88a21c5a97ef New changeset aeebbae8c74c by Victor Stinner in branch 'default': Issue #9566: Fix compilater warnings on Windows 64-bit http://hg.python.org/cpython/rev/aeebbae8c74c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 01:22:55 2013 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 04 Jun 2013 23:22:55 +0000 Subject: [issue13772] listdir() doesn't work with non-trivial symlinks In-Reply-To: <1326312074.88.0.322514160628.issue13772@psf.upfronthosting.co.za> Message-ID: <1370388175.64.0.998466462455.issue13772@psf.upfronthosting.co.za> Jason R. Coombs added the comment: @Victor Stinner Thanks for fixing this. You're absolutely right. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 01:59:30 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Jun 2013 23:59:30 +0000 Subject: [issue13772] listdir() doesn't work with non-trivial symlinks In-Reply-To: <1326312074.88.0.322514160628.issue13772@psf.upfronthosting.co.za> Message-ID: <3bQ98x472nz7LjV@mail.python.org> Roundup Robot added the comment: New changeset e024236ea253 by Victor Stinner in branch 'default': Issue #13772: Fix a compiler warning on Windows http://hg.python.org/cpython/rev/e024236ea253 New changeset d9f3ea27f826 by Victor Stinner in branch 'default': Issue #13772: Mark helper functions as private (static) http://hg.python.org/cpython/rev/d9f3ea27f826 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 02:08:01 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 05 Jun 2013 00:08:01 +0000 Subject: [issue13772] listdir() doesn't work with non-trivial symlinks In-Reply-To: <1326312074.88.0.322514160628.issue13772@psf.upfronthosting.co.za> Message-ID: <3bQ9Lm5mgyzSgY@mail.python.org> Roundup Robot added the comment: New changeset c8212fca8747 by Victor Stinner in branch 'default': Issue #13772: Use syntax for literal wchar_t character http://hg.python.org/cpython/rev/c8212fca8747 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 02:10:11 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Jun 2013 00:10:11 +0000 Subject: [issue4343] New function in Tkinter.py: setup_master In-Reply-To: <1227011959.0.0.968897886388.issue4343@psf.upfronthosting.co.za> Message-ID: <1370391011.13.0.497948968214.issue4343@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I am still confused about the master/parent business and why required args are documented as optional. (Besides #18131, I also discovered that messageboxes usually, but not always, require parent=something passed, to be collected into **options. I need to read more before I can really review and think about applying this. Why isn't _default_root initialized to something useful instead of None. If it were, _support_default_root would not be needed. The new function is slightly different from the code it replaces. The main difference I see with Misc.setup is that your code does *not* stash Tk() in _default_root. Since every Tk() call creates a new screen window, I do not see how this is correct. On the plus side, I believe your patch would fix part of the problem I reported in #18131. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 02:35:47 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jun 2013 00:35:47 +0000 Subject: [issue17628] str==str: compare the first character before calling memcmp() In-Reply-To: <1365024552.84.0.0461498193244.issue17628@psf.upfronthosting.co.za> Message-ID: <1370392547.64.0.0752626149622.issue17628@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: str==str: compare the first and last character before calling memcmp() -> str==str: compare the first character before calling memcmp() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 02:48:34 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jun 2013 00:48:34 +0000 Subject: [issue18129] Fatal Python error: Cannot recover from stack overflow. In-Reply-To: <1370297932.54.0.350896209872.issue18129@psf.upfronthosting.co.za> Message-ID: <1370393314.51.0.295174803749.issue18129@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 02:49:19 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jun 2013 00:49:19 +0000 Subject: [issue17991] ctypes.c_char gives a misleading error when passed a one-character unicode string In-Reply-To: <1368674517.59.0.230555789399.issue17991@psf.upfronthosting.co.za> Message-ID: <1370393359.01.0.380579271457.issue17991@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 03:24:13 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Jun 2013 01:24:13 +0000 Subject: [issue4343] New function in Tkinter.py: setup_master In-Reply-To: <1227011959.0.0.968897886388.issue4343@psf.upfronthosting.co.za> Message-ID: <1370395453.94.0.856336733302.issue4343@psf.upfronthosting.co.za> Terry J. Reedy added the comment: After searching through tkinter.py for '_default_root', the patch looks better. The point I missed before is that Tk().__init__(self,...) normally calls _loadtk(self) which installs self as _default_tk if it was None before. So the new function will return the same Tk object each call after the first (unless _default_tk is somehow reset to None.) This also means that the assignment in BaseWidget.setup, "_default_root = Tk()", which the patch deletes, is redundant and misleading, and should go. I think 'getmaster' or 'get_master' would be a better name than 'setup_master' as setting up a new master is the 2nd backup choice and will happen only once in a session. Most call will get an existing master -- either the one passed in or the once stored as _default_root The patch needs to be updated for 3.4 and run with current tests. ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 03:28:21 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Jun 2013 01:28:21 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1370395701.01.0.553264928348.issue18103@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thanks Ned. I commented on the issue. The code in the proposed function will fix one of the two problems with tkinter.Variable that I noted in #18131. I can imagine there might be situations in which it would also be useful for testing, as GP claims. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 03:50:34 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jun 2013 01:50:34 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() Message-ID: <1370397033.84.0.295479011719.issue18138@psf.upfronthosting.co.za> New submission from Christian Heimes: The patch implements an add_cert(pem_or_der_data) method for the ssl.SSLContext() object. On success the method adds a trusted CA cert to the context's internal cert store. The CA certificate can either be an ASCII unicode string (PEM format) or buffer object (DER / ASN1 format). The patch also implements a get_cert_count() method for debugging. I'm going to remove that function eventually as it doesn't give correct answers when the object table contains CRLs, too. A correct implementation might be useful to verify set_default_verify_paths(). I've split up the functions so I can re-use _add_cert() in my upcoming patch for an interface to crypt32.dll on Windows. ---------- components: Extension Modules files: sslctx_add_cert.patch keywords: patch messages: 190637 nosy: christian.heimes priority: normal severity: normal stage: patch review status: open title: ssl.SSLContext.add_cert() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30466/sslctx_add_cert.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 03:55:55 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 05 Jun 2013 01:55:55 +0000 Subject: [issue18134] zipfile extractall accepts wrong password In-Reply-To: <1370377466.33.0.877137256378.issue18134@psf.upfronthosting.co.za> Message-ID: <1370397355.68.0.882796852631.issue18134@psf.upfronthosting.co.za> R. David Murray added the comment: This is a duplicate of issue 10876. According to that issue it is a bug in the zipfile format. ---------- nosy: +r.david.murray resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> Zipfile sometimes considers a false password to be correct _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 04:26:36 2013 From: report at bugs.python.org (Eric Snow) Date: Wed, 05 Jun 2013 02:26:36 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1370399196.86.0.182556683196.issue16991@psf.upfronthosting.co.za> Eric Snow added the comment: Here's one solution to the deletion-during-iteration problem. It makes the iterators track the key rather than the node, at the expense of a sliver of speed on __iter__() and keys(). ---------- Added file: http://bugs.python.org/file30467/cOrderedDict-iterators-by-key.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 04:57:47 2013 From: report at bugs.python.org (Eric Snow) Date: Wed, 05 Jun 2013 02:57:47 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1370401067.45.0.752639742459.issue16991@psf.upfronthosting.co.za> Eric Snow added the comment: The concern about reference cycles here lies in their existence in the linked-list. To see what I mean, check out the use of weakrefs in the pure Python implementation at Lib/collections/__init__.py. As the current implementation does not use PyObjects for the linked-list, I'm going to call this a non-issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 06:33:38 2013 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 05 Jun 2013 04:33:38 +0000 Subject: [issue11470] Flag inappropriate uses of callable class attributes In-Reply-To: <1299871329.74.0.464645573136.issue11470@psf.upfronthosting.co.za> Message-ID: <1370406818.29.0.555776945818.issue11470@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 06:35:54 2013 From: report at bugs.python.org (Kiran Bandla) Date: Wed, 05 Jun 2013 04:35:54 +0000 Subject: [issue18139] email module's add_header appends instead of inserting Message-ID: <1370406954.57.0.95690715483.issue18139@psf.upfronthosting.co.za> New submission from Kiran Bandla: This issue is in message.py in the email module. The add_header method should insert the new header on the top of the existing headers. The current function implementation appends the header at the end of the existing headers. ---------- components: Library (Lib) messages: 190641 nosy: kbandla priority: normal severity: normal status: open title: email module's add_header appends instead of inserting type: behavior versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 06:41:30 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Jun 2013 04:41:30 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1370407290.98.0.114548390393.issue18135@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 06:43:00 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Jun 2013 04:43:00 +0000 Subject: [issue18137] format(float, str): integer overflow for huge precision In-Reply-To: <1370387490.7.0.925760036374.issue18137@psf.upfronthosting.co.za> Message-ID: <1370407380.39.0.623450593986.issue18137@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 06:48:41 2013 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 05 Jun 2013 04:48:41 +0000 Subject: [issue4331] Add functools.partialmethod In-Reply-To: <1226817180.09.0.841012218041.issue4331@psf.upfronthosting.co.za> Message-ID: <1370407721.25.0.439734049545.issue4331@psf.upfronthosting.co.za> Nick Coghlan added the comment: I don't believe it is reasonable to change the behaviour of partial at this late stage of the game. It's documented as behaving like staticmethod (albeit by not implementing the descriptor protocol at all), so that's no longer something we can change. If issue 11470 is added, then we'll just implement the staticmethod-like behaviour explicitly rather than leaving it as implicit. More importantly, the acceptance of PEP 443's functools.singledispatch makes it more desirable than ever to support partial binding for method implementations *even when the descriptor protocol is not involved*. Accordingly, I suggest converting this proposal to a separate functools.partialmethod API that: 1. When called directly, passes the first positional argument as the first positional argument of the underlying function (providing call time binding of self, just like a normal function) 2. When retrieved from a class, returns itself 3. When retrieved from an instance, returns an appropriate bound method object (providing method lookup time binding of self, just like a normal function) functools.partial will then continue to behave as it always has (thus posing no backwards compatibility risks), while the new partialmethod implementation should work with both class descriptor protocol based dispatch (through point 3) *and* the new functools.singledispatch mechanism (through point 1). ---------- components: +Library (Lib) nosy: +ncoghlan title: Can't use _functools.partial() created function as method -> Add functools.partialmethod versions: -Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 08:48:54 2013 From: report at bugs.python.org (Eric Snow) Date: Wed, 05 Jun 2013 06:48:54 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1370414934.74.0.07877581439.issue16991@psf.upfronthosting.co.za> Changes by Eric Snow : Removed file: http://bugs.python.org/file30467/cOrderedDict-iterators-by-key.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 08:48:58 2013 From: report at bugs.python.org (Eric Snow) Date: Wed, 05 Jun 2013 06:48:58 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1370414938.96.0.639203155775.issue16991@psf.upfronthosting.co.za> Changes by Eric Snow : Removed file: http://bugs.python.org/file30462/cOrderedDict.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 08:49:43 2013 From: report at bugs.python.org (Eric Snow) Date: Wed, 05 Jun 2013 06:49:43 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1370414983.02.0.786294098762.issue16991@psf.upfronthosting.co.za> Eric Snow added the comment: Here's what I feel is a nearly complete patch. The only outstanding issues that I feel need to be answered are 4 spots where calls into the interpreter may result in unexpected changes to the object or make the current function state out-of-date. 1. _odict_clear_nodes() while iterating over the nodes. 2. _odict_keys_equal() while iterating over the nodes. 3. odict_sizeof() -- I'm not too worried about this one. 4. _odict_copy() while iterating over the nodes. Once I feel comfortable with some resolution for those, I'm going to consider the patch ready to go, pending reviews. ---------- Added file: http://bugs.python.org/file30468/cOrderedDict.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 09:05:08 2013 From: report at bugs.python.org (Ned Deily) Date: Wed, 05 Jun 2013 07:05:08 +0000 Subject: [issue18136] test_distutils failing under OS X 10.8 w/ clang In-Reply-To: <1370382090.88.0.902200330561.issue18136@psf.upfronthosting.co.za> Message-ID: <1370415908.38.0.105289618526.issue18136@psf.upfronthosting.co.za> Ned Deily added the comment: Brett, what configure options are you using and what version of clang? I don't see these errors with the current Apple clang (Xcode 4.6.2): $ clang --version Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.4.0 Thread model: posix ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 09:42:14 2013 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 05 Jun 2013 07:42:14 +0000 Subject: [issue4331] Add functools.partialmethod In-Reply-To: <1226817180.09.0.841012218041.issue4331@psf.upfronthosting.co.za> Message-ID: <1370418134.29.0.850057334421.issue4331@psf.upfronthosting.co.za> Nick Coghlan added the comment: Any associated tests may also want check that wrapping classmethod around a partialmethod generates a well behaved class method, and ditto for property. If singledispath, classmethod, partialmethod and class and instance attribute access all work correctly, then we can be absolutely certain the results is behaving just like an ordinary function does :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 11:45:03 2013 From: report at bugs.python.org (anh le) Date: Wed, 05 Jun 2013 09:45:03 +0000 Subject: [issue18140] urlparse.urlsplit confused to fragment when password include # Message-ID: <1370425503.35.0.436511643169.issue18140@psf.upfronthosting.co.za> New submission from anh le: >>> u = 'http://auser:secr#et at 192.168.0.1:8080/a/b/c.html' >>> urlparse.urlsplit(u) SplitResult(scheme='http', netloc='auser:secr', path='', query='', fragment='et at 192.168.0.1:8080/a/b/c.html') ---------- components: Library (Lib) messages: 190646 nosy: anh.le priority: normal severity: normal status: open title: urlparse.urlsplit confused to fragment when password include # type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 11:59:24 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Jun 2013 09:59:24 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1370426364.74.0.0172403221163.issue18135@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The patch contains a lot of unrelated trailing spaces changes. Could you please commit they separately? See also issue15550. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 12:00:50 2013 From: report at bugs.python.org (Matt Joiner) Date: Wed, 05 Jun 2013 10:00:50 +0000 Subject: [issue4331] Add functools.partialmethod In-Reply-To: <1226817180.09.0.841012218041.issue4331@psf.upfronthosting.co.za> Message-ID: <1370426450.94.0.392779046503.issue4331@psf.upfronthosting.co.za> Matt Joiner added the comment: This sounds excellent Nick. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 12:06:39 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 05 Jun 2013 10:06:39 +0000 Subject: [issue18136] test_distutils failing under OS X 10.8 w/ clang In-Reply-To: <1370382090.88.0.902200330561.issue18136@psf.upfronthosting.co.za> Message-ID: <1370426799.53.0.183028046118.issue18136@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Does the compiler use the correct header files? The error messages seem to indicate that the 2.7 headers are used instead of the 3.4 ones (all missing identifiers were introduced in py3k and are not in 2.x) FWIW, the distutils tests work fine on my machine (OSX 10.8, latest Xcode 4, framework build) ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 12:29:17 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 05 Jun 2013 10:29:17 +0000 Subject: [issue1512124] OSX: debugger hangs IDLE Message-ID: <1370428157.61.0.408432416379.issue1512124@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The problem appears to be gone in current releases (at least on OSX 10.8 with Tk 8.5) and I therefore propose to close the issue. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 13:14:30 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Wed, 05 Jun 2013 11:14:30 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <1370430870.91.0.875902192786.issue17931@psf.upfronthosting.co.za> Richard Oudkerk added the comment: > pid_t is HANDLE on Windows, which is a pointer. I think this is wrong. The signature of getpid() is int _getpid(void); so pid_t should be equivalent to int. The complication is that the return values of spawn*() etc are process handles (cast to intptr_t), not pids: intptr_t _spawnv(int mode, const char *cmdname, const char *const *argv); See http://msdn.microsoft.com/en-us/library/t2y34y40%28v=vs.100%29.aspx http://msdn.microsoft.com/en-us/library/7zt1y878%28v=vs.80%29.aspx ---------- nosy: +sbt status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 13:34:01 2013 From: report at bugs.python.org (Jan Kanis) Date: Wed, 05 Jun 2013 11:34:01 +0000 Subject: [issue18132] buttons in turtledemo disappear on small screens In-Reply-To: <1370353605.18.0.929519765734.issue18132@psf.upfronthosting.co.za> Message-ID: <1370432041.59.0.866775279086.issue18132@psf.upfronthosting.co.za> Jan Kanis added the comment: I've created a patch, replacing the packed layout by a gridded layout ---------- hgrepos: +195 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 13:34:39 2013 From: report at bugs.python.org (Jan Kanis) Date: Wed, 05 Jun 2013 11:34:39 +0000 Subject: [issue18132] buttons in turtledemo disappear on small screens In-Reply-To: <1370353605.18.0.929519765734.issue18132@psf.upfronthosting.co.za> Message-ID: <1370432079.7.0.472536073431.issue18132@psf.upfronthosting.co.za> Changes by Jan Kanis : ---------- keywords: +patch Added file: http://bugs.python.org/file30469/7cdaf0223e67.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 13:49:56 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jun 2013 11:49:56 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <1370432996.84.0.942483694352.issue17931@psf.upfronthosting.co.za> STINNER Victor added the comment: > The complication is that the return values of spawn*() etc are process handles (cast to intptr_t), not pids: I opened this issue because of a compiler warning in os.waitpid(). On Windows, the C function _cwait() is used and it expects a intptr_t ("handle to the process to wait on") and returns a intptr_t ("returns the handle of the specified process").... But os.waitpid() uses PyLong_FromPid() to convert the C intptr_t to a Python int, which may loose most significant bits (sizeof(void*) > sizeof(int) on Windows x64). I see that PC/pyconfig.h defines "typedef int pid_t;". Because intptr_t is bigger than int, using intptr_t is compatible with pid_t, at least for PyLong_FromPid(). It may be a problem in the other direction: PyLong_AsPid(). Python code using Windows HANDLE is not consistent. Sometimes, intptr_t is used, sometimes long is used. Examples: - msvcrt.open_osfhandle() parses an handle with "l" (long) format, whereas it should uses a wider type. - msvcrt.get_osfhandle() uses PyLong_FromVoidPtr() to convert an C Py_intptr_t to a Python int, with the following comment: /* technically 'handle' is not a pointer, but a integer as large as a pointer, Python's *VoidPtr interface is the most appropriate here */ -- @sbt: Would you like to have a strict separation between UNIX-like pid (pid_t) and Windows process identifier (HANDLE)? Can we consider that HANDLE is a pointer? Or can we consider that HANDLE is intptr_t or intmax_t? See the issue #17870 which proposes an API to handle intmax_t. If we want to be more explicit, we should add functions to handle the C HANDLE type. Example: - PyLong_FromHandle(): C HANDLE to Python int - PyLong_AsHandle(): Python int to C HANDLE - "P" format (or another letter): PyArg_Parse*() format ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 13:57:36 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 05 Jun 2013 11:57:36 +0000 Subject: [issue18140] urlparse.urlsplit confused to fragment when password include # In-Reply-To: <1370425503.35.0.436511643169.issue18140@psf.upfronthosting.co.za> Message-ID: <1370433456.32.0.26434989593.issue18140@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- assignee: -> orsenthil nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 14:09:36 2013 From: report at bugs.python.org (Jan Kanis) Date: Wed, 05 Jun 2013 12:09:36 +0000 Subject: [issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order Message-ID: <1370434176.62.0.932474289882.issue18141@psf.upfronthosting.co.za> New submission from Jan Kanis: While fixing #18132 I noticed that when closing the turtledemo window an exception is thrown (and ignored) because the __del__ tries to catch a TclError exception, but the TclError global has already been deleted and set to None. I could only reproduce this in my self built pydebug build, at least on revision dfcb64f51f7b, but not on the v3.3.2 tag. (compiled with --with-pydebug on linux x86-64) traceback: me at mymachine ~/d/cpython> ./python -m turtledemo BYE! Exception ignored in: > Traceback (most recent call last): File "~/devel/cpython/Lib/tkinter/__init__.py", line 3330, in __del__ TypeError: catching classes that do not inherit from BaseException is not allowed ---------- components: Tkinter messages: 190654 nosy: JanKanis priority: normal severity: normal status: open title: tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 14:21:01 2013 From: report at bugs.python.org (Jan Kanis) Date: Wed, 05 Jun 2013 12:21:01 +0000 Subject: [issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order In-Reply-To: <1370434176.62.0.932474289882.issue18141@psf.upfronthosting.co.za> Message-ID: <1370434861.81.0.159723031645.issue18141@psf.upfronthosting.co.za> Jan Kanis added the comment: added a fix ---------- hgrepos: +196 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 14:21:26 2013 From: report at bugs.python.org (Jan Kanis) Date: Wed, 05 Jun 2013 12:21:26 +0000 Subject: [issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order In-Reply-To: <1370434176.62.0.932474289882.issue18141@psf.upfronthosting.co.za> Message-ID: <1370434886.89.0.402500943424.issue18141@psf.upfronthosting.co.za> Changes by Jan Kanis : ---------- keywords: +patch Added file: http://bugs.python.org/file30470/3fdd418be9f8.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 14:24:56 2013 From: report at bugs.python.org (Jan Kanis) Date: Wed, 05 Jun 2013 12:24:56 +0000 Subject: [issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order In-Reply-To: <1370434176.62.0.932474289882.issue18141@psf.upfronthosting.co.za> Message-ID: <1370435096.16.0.997236767596.issue18141@psf.upfronthosting.co.za> Jan Kanis added the comment: Oops, the diff includes patches for both this issue and #18132, that should be just commit 3fdd418be9f8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 15:15:33 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Wed, 05 Jun 2013 13:15:33 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <1370438133.0.0.869262940076.issue17931@psf.upfronthosting.co.za> Richard Oudkerk added the comment: > @sbt: Would you like to have a strict separation between UNIX-like pid > (pid_t) and Windows process identifier (HANDLE)? Yes. And would I certainly like SIZEOF_PID_T == sizeof(pid_t) ;-) Note that _winapi takes the policy of treating HANDLE as an unsigned quantity (as PyLong_*VoidPtr() does for pointers). I am not sure if signed or unsigned is better, but I lean towards unsigned. It is easy enough to cast to intptr_t if we need to. I think it is enough to treat HANDLE as void*, but adding PyLong_*Handle() is easy enough. There does not seem to be a format character for void* (or size_t), and adding one would be useful. Or maybe rather than adding ever more format characters which are aliases for old ones, we could just create macros like #define PY_PARSE_INT "i" #define PY_PARSE_UINTPTR_T "K" #define PY_PARSE_VOID_PTR PY_PARSE_UINTPTR_T #define PY_PARSE_HANDLE PY_PARSE_UINTPTR_T #define PY_PARSE_PID_T PY_PARSE_INT ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 15:21:12 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 05 Jun 2013 13:21:12 +0000 Subject: [issue18139] email module should have a way to prepend and insert headers In-Reply-To: <1370406954.57.0.95690715483.issue18139@psf.upfronthosting.co.za> Message-ID: <1370438472.52.0.669708775898.issue18139@psf.upfronthosting.co.za> R. David Murray added the comment: This is by design. I agree, however, that there should be a way to do this when an application needs it, so I'm changing this to a feature request. ---------- components: +email nosy: +barry, r.david.murray stage: -> needs patch title: email module's add_header appends instead of inserting -> email module should have a way to prepend and insert headers type: behavior -> enhancement versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 15:22:58 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Wed, 05 Jun 2013 13:22:58 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <1370438578.25.0.518730841853.issue17931@psf.upfronthosting.co.za> Richard Oudkerk added the comment: I see _Py_PARSE_PID already exists but no others ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 15:24:56 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 05 Jun 2013 13:24:56 +0000 Subject: [issue18141] tkinter.Image.__del__ can throw an exception if module globals are destroyed in the wrong order In-Reply-To: <1370434176.62.0.932474289882.issue18141@psf.upfronthosting.co.za> Message-ID: <1370438696.59.0.866134625403.issue18141@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 15:45:34 2013 From: report at bugs.python.org (Armin Rigo) Date: Wed, 05 Jun 2013 13:45:34 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1370439934.2.0.329374282521.issue17222@psf.upfronthosting.co.za> Armin Rigo added the comment: Brett: I don't really have a constructive opinion on this matter. I could suggest putting a bit more logic in py_compile.compile(cfile=...) to revert to the old behavior if we specify an already-existing target, in order to fix the other reported issue that custom permissions set on the target file are lost. But I would understand if you decide that this is not compatible with the gains of atomic file creations. I only have a problem with replacing block devices with regular files. I don't have a particular opinion if the target file is a symlink (as long, of course, as it doesn't lead to whatever it points to being replaced, but it shouldn't). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 16:07:49 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 05 Jun 2013 14:07:49 +0000 Subject: [issue18139] email module should have a way to prepend and insert headers In-Reply-To: <1370406954.57.0.95690715483.issue18139@psf.upfronthosting.co.za> Message-ID: <1370441269.36.0.0801853619294.issue18139@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: In a somewhat similar vein, replace_header() retains the original header order. Not quite what the OP wants, but useful. The problem I had originally with a position-aware method is getting the API right. I didn't want to add a position argument to add_header() (and still don't). So I think a position-aware API would have to be a different method, perhaps with an API somewhat like list.insert()? It doesn't look like OrderedDict provides any guidance here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 16:26:38 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 05 Jun 2013 14:26:38 +0000 Subject: [issue18139] email module should have a way to prepend and insert headers In-Reply-To: <1370406954.57.0.95690715483.issue18139@psf.upfronthosting.co.za> Message-ID: <1370442398.57.0.883606529011.issue18139@psf.upfronthosting.co.za> R. David Murray added the comment: My preliminary thought (and I haven't checked the code yet to make sure this will actually work), is that under the new email policies we are dealing with full-blown header objects, meaning that they can know the header name they represent. This should theoretically make it possible to have a 'create header' function to create a header object (there may be one already...it's been way too long since I've worked on this code) and then have: message[:0] = [my_new_header] do the right thing. As well as all the other list methods working as expected. We'd also want a 'find_header' method that takes the header name and returns the index of the header in the list. But, as I say, this is just a preliminary thought, it needs careful consideration before we decide to actually do something. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 16:35:15 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 14:35:15 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1370442915.97.0.979444340249.issue17222@psf.upfronthosting.co.za> Brett Cannon added the comment: Thanks for the clarification, Armin! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 16:46:03 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 14:46:03 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1370443563.15.0.213100821208.issue17222@psf.upfronthosting.co.za> Brett Cannon added the comment: OK, so here was what a patch will need: * Change py_compile to raise an exception when ``not os.path.isfile(cfile) or os.path.islink(cfile)``; probably raise ValueError and mention that import itself would replace the file w/o raising an exception * Add tests * Update the docs for py_compile * Update What's New for 3.4 since this is not backwards-compatible ---------- components: +Library (Lib) -Documentation resolution: fixed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 17:20:22 2013 From: report at bugs.python.org (Shlomi Fish) Date: Wed, 05 Jun 2013 15:20:22 +0000 Subject: [issue18142] Tests fail on Mageia Linux Cauldron x86-64 with some configure flags Message-ID: <1370445621.52.0.671437694015.issue18142@psf.upfronthosting.co.za> New submission from Shlomi Fish: After I build Python-3.3.2 from the .tar.xz using the following script (on Mageia Linux Cauldron x86-64): <<< #!/bin/bash ./configure --prefix="$HOME/apps/python3" --with-threads \ --enable-ipv6 --with-dbmliborder=gdbm \ --with-system-expat \ --with-system-ffi \ --enable-shared \ --with-valgrind shlomif at telaviv1:~/Download/unpack/prog/python/Python-3.3.2$ >>> I get many test failures in make test (in the file attached to this repository). Can you look into fixing them? This is a precursor for fixing this bug: https://bugs.mageia.org/show_bug.cgi?id=9395 Regards, -- Shlomi Fish ---------- components: Tests files: python-make-test-output.txt messages: 190665 nosy: shlomif priority: normal severity: normal status: open title: Tests fail on Mageia Linux Cauldron x86-64 with some configure flags versions: Python 3.3 Added file: http://bugs.python.org/file30471/python-make-test-output.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 17:29:05 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Wed, 05 Jun 2013 15:29:05 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <1370446145.31.0.399796456316.issue17931@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Attached is a patch that adds _Py_PARSE_INTPTR and _Py_PARSE_UINTPTR to Include/longobject.h. It also uses _Py_PARSE_INTPTR in Modules/posixmodule.c and PC/msvcrtmodule.c and removes the definition for SIZEOF_PID. ---------- Added file: http://bugs.python.org/file30472/py_parse_intptr.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 17:42:30 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 05 Jun 2013 15:42:30 +0000 Subject: [issue17636] Modify IMPORT_FROM to fallback on sys.modules In-Reply-To: <1365124502.39.0.727243640375.issue17636@psf.upfronthosting.co.za> Message-ID: <1370446950.36.0.322649612816.issue17636@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: One question. when doing "Programmatic" import, i.e. using the __import__ function, how do we do the same? #module foo.B A = __import__(".", fromlist=["A"]).A #module foo.A B = __import__(".", fromlist=["B"]).B Clearly the above won't work. Can we extend __import__ to allow a full path, including relative? The objection about which name to bind to is no longer valid, since the binding is explicit. So, could we do: #module foo.B A = __import__(".A") #module foo.A B = __import__(".B") ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 17:44:03 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 05 Jun 2013 15:44:03 +0000 Subject: [issue18142] Tests fail on Mageia Linux Cauldron x86-64 with some configure flags In-Reply-To: <1370445621.52.0.671437694015.issue18142@psf.upfronthosting.co.za> Message-ID: <1370447043.69.0.109983351742.issue18142@psf.upfronthosting.co.za> R. David Murray added the comment: This is not the sort of bug report that is likely to get much action. Our tests pass normally (we have a buildbot fleet to ensure that they do before we cut a release), so it will be necessary to figure out why they are failing for your particular setup. Probably we don't have a buildbot that runs with your particular selection of config flags (or your particular system libraries), but that may or may not be relevant to the issues you are seeing. Reporting individual test failures as separate issues and working with us to resolve them is more likely to produce a useful result. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 17:44:20 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jun 2013 15:44:20 +0000 Subject: [issue18143] ssl.get_default_verify_paths() Message-ID: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> New submission from Christian Heimes: The patch implements a get_default_verify_paths() function for the ssl module. It returns the env vars and paths that are used by openssl's set_default_verify_paths() to load CA certs from default locations. I think it makes a useful addition for debugging purposes. On my system: >>> import ssl >>> ssl.get_default_verify_paths() (None, '/usr/lib/ssl/certs') >>> ssl.get_default_verify_paths(raw=True) ('SSL_CERT_FILE', '/usr/lib/ssl/cert.pem', 'SSL_CERT_DIR', '/usr/lib/ssl/certs') SSL_CTX_set_default_verify_paths() first tries the env var. If the env var is set the second element is ignored. ---------- files: sslverifypath.patch keywords: patch messages: 190669 nosy: christian.heimes, pitrou priority: normal severity: normal stage: patch review status: open title: ssl.get_default_verify_paths() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30473/sslverifypath.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 17:49:57 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 05 Jun 2013 15:49:57 +0000 Subject: [issue17636] Modify IMPORT_FROM to fallback on sys.modules In-Reply-To: <1365124502.39.0.727243640375.issue17636@psf.upfronthosting.co.za> Message-ID: <1370447397.71.0.901297845513.issue17636@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: sorry, the last example really needs to be: #module foo.B A = __import__(".A", fromlist=["dummy"]) to invoke the "return final module" behaviour. Hm, maybe this simply works... I didn't test.... Nope, I get ValueError: Empty module name (in 2.7) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 17:57:03 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 15:57:03 +0000 Subject: [issue17636] Modify IMPORT_FROM to fallback on sys.modules In-Reply-To: <1365124502.39.0.727243640375.issue17636@psf.upfronthosting.co.za> Message-ID: <1370447823.84.0.786198987219.issue17636@psf.upfronthosting.co.za> Brett Cannon added the comment: You use importlib.import_module to do programmatic imports (and FYI dots never go into the first argument of __import__). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 17:59:55 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 15:59:55 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370447995.16.0.69091190879.issue18143@psf.upfronthosting.co.za> Brett Cannon added the comment: I have no clue what is being returned by this function. Any chance of using types.SimpleNamespace to give meaningful names to the returned values instead of a tuple? ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:07:26 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 05 Jun 2013 16:07:26 +0000 Subject: [issue17636] Modify IMPORT_FROM to fallback on sys.modules In-Reply-To: <1365124502.39.0.727243640375.issue17636@psf.upfronthosting.co.za> Message-ID: <1370448446.13.0.874645486784.issue17636@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Interesting. And I can report that it works, in 2.7, with code such as b = importlib.import_module("..b", __name__) and a = importlib.import_module("..a", __name__) Still, it seems odd that a whole "importlib" is requried ot resolve the relative import, and that it doesn"t work with __import__, given how "supposedly" the import statement is supposed to translate to a __import__ call internally. One would think that __import__ had access to the relative path machinery somehow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:15:46 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jun 2013 16:15:46 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370448946.41.0.405701597318.issue18143@psf.upfronthosting.co.za> Christian Heimes added the comment: Sure! I can add SimpleNamespace. The C function returns four elements: * environment var that is used to look up the path to a CA cert file * path to a CA cert file * environment var that is used to look up the path to a CA cert directory * path to a CA cert directory SSLContext.set_default_verify_paths() is unable to return information if it was able to load any CA certs. With get_default_verify_paths() a developer is able to debug which file or directory is used by OpenSSL. The code is based on OpenSSL's X509_STORE_set_default_paths(). If you want to read up on it: http://cvs.openssl.org/fileview?f=openssl/crypto/x509/x509_d2.c&v=1.7 http://cvs.openssl.org/fileview?f=openssl/crypto/x509/x509_def.c&v=1.5 http://cvs.openssl.org/fileview?f=openssl/crypto/x509/by_file.c&v=1.12.4.4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:25:59 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jun 2013 16:25:59 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370449559.97.0.920655409778.issue18143@psf.upfronthosting.co.za> Christian Heimes added the comment: I forgot that a SimpleNamespace is an unorder collection. However the order is significant. OpenSSL uses the cafile first and ignores capath if a cert in cafile matches. The path to cafile or capath is ignored when the environment key exists -- even when it doesn't point to any existing file or directory. I think a named tuple is better here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:30:04 2013 From: report at bugs.python.org (Lukas Lueg) Date: Wed, 05 Jun 2013 16:30:04 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1352291929.32.0.895096534658.issue16427@psf.upfronthosting.co.za> Message-ID: <1370449804.31.0.800313752699.issue16427@psf.upfronthosting.co.za> Lukas Lueg added the comment: Here are more benchmarks of vanilla 3.4 vs. cityhash vs. fast_hash_3 on both arm7l and x86-64. The patch was applied varbatim, only caching disabled. On arm7l, the cpu was fixed to maximum freq (it seems to take ages to switch frequencies, at least there is a lot of jitter with ondemand). The cityhash implementation was compiled with -O3 on both platforms and -msse4.2 on x86-64. CityHash and fh3 come out much better than vanilla on x86-64 with cityhash being slightly faster (which is surprising). On ARM7 CityHash performs much worse than vanilla and fh3 significantly better. ---------- Added file: http://bugs.python.org/file30474/cityhash_fashhash3_arm.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:30:17 2013 From: report at bugs.python.org (Lukas Lueg) Date: Wed, 05 Jun 2013 16:30:17 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1352291929.32.0.895096534658.issue16427@psf.upfronthosting.co.za> Message-ID: <1370449817.1.0.699452857174.issue16427@psf.upfronthosting.co.za> Changes by Lukas Lueg : Added file: http://bugs.python.org/file30475/cityhash_fasthast3.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:33:45 2013 From: report at bugs.python.org (Madison May) Date: Wed, 05 Jun 2013 16:33:45 +0000 Subject: [issue18140] urlparse.urlsplit confused to fragment when password include # In-Reply-To: <1370425503.35.0.436511643169.issue18140@psf.upfronthosting.co.za> Message-ID: <1370450025.29.0.0425584954617.issue18140@psf.upfronthosting.co.za> Madison May added the comment: urllib.parse.urlsplit() in Python3.3 behaves the same way. Since urlsplit takes an optional param "allow_fragments", I don't think it should be a high priority issue. The relevant code from Python3.3 is below, however: if allow_fragments and '#' in url: url, fragment = url.split('#', 1) if '?' in url: url, query = url.split('?', 1) Note that passwords containing '?' would produce a similar result, which is perhaps mildly more concerning, as there is no flag to ignore the query portion of the url. That being said, I'm against making any changes to urlsplit at this point, since that would also require modifying urlunsplit and may in fact make it much more difficult (or impossible) to rejoin a url. The strength of the very simple implementation we have currently is that it's always reversible. ---------- nosy: +madison.may _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:44:29 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jun 2013 16:44:29 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370450669.69.0.355835771783.issue18143@psf.upfronthosting.co.za> Christian Heimes added the comment: How about that output, Brett? cafile is None because /usr/lib/ssl/cert.pem doesn't exist on my system. >>> import ssl >>> ssl.get_default_verify_paths() DefaultVerifyPaths(cafile=None, capath='/usr/lib/ssl/certs') >>> ssl.get_default_verify_paths(raw=True) RawDefaultVerifyPaths(cafile_env_key='SSL_CERT_FILE', cafile='/usr/lib/ssl/cert.pem', capath_env_key='SSL_CERT_DIR', capath='/usr/lib/ssl/certs') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:45:20 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 16:45:20 +0000 Subject: [issue17636] Modify IMPORT_FROM to fallback on sys.modules In-Reply-To: <1365124502.39.0.727243640375.issue17636@psf.upfronthosting.co.za> Message-ID: <1370450720.12.0.733889111449.issue17636@psf.upfronthosting.co.za> Brett Cannon added the comment: If you look at the importlib source code in 2.7 it's actually really small and simply translates the call into an __import__ call under the hood. So __import__ can completely handle relative imports, but you were not using the level argument to __import__ nor passing the necessary globals to make the relative name computation work (see the importlib source if you want to see how it works). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:47:28 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 16:47:28 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370450848.5.0.727696155952.issue18143@psf.upfronthosting.co.za> Brett Cannon added the comment: That's better. As long as you use result[1::2] then the tuple is reasonable to use for the order need and still make sense as an iterable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 18:49:45 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 16:49:45 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1370450985.25.0.276790573214.issue17222@psf.upfronthosting.co.za> Brett Cannon added the comment: I'm going to resolve this issue myself, but "blog" about it on core-mentorship so others can follow along with how I resolve the bug. ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 19:31:05 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jun 2013 17:31:05 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370453465.7.0.16855788213.issue18143@psf.upfronthosting.co.za> Changes by Christian Heimes : Removed file: http://bugs.python.org/file30473/sslverifypath.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 19:31:30 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 05 Jun 2013 17:31:30 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370453490.43.0.424187898042.issue18143@psf.upfronthosting.co.za> Christian Heimes added the comment: New patch with tests and documentation. ---------- Added file: http://bugs.python.org/file30476/sslverifypath2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 19:35:41 2013 From: report at bugs.python.org (ddvento@ucar.edu) Date: Wed, 05 Jun 2013 17:35:41 +0000 Subject: [issue17085] test_socket crashes the whole test suite In-Reply-To: <1368970395.11.0.481398717555.issue17085@psf.upfronthosting.co.za> Message-ID: <51AF76F3.3040708@ucar.edu> ddvento at ucar.edu added the comment: The problem is that test_sendall_interrupted and test_sendall_interrupted_with_timeout make an assumption which is false on my hw, namely that it will take a long time for sendall() to complete. In fact, the following snippet: from timeit import default_timer import socket c,s=socket.socketpair() start = default_timer() c.sendall("x" * (1024**2)) end= default_timer() print end-start probably fits some cache and runs in well less than 1ms (prints something between 0.000797 and 0.000876) on the server where this test is crashing (it takes forever on my laptop). Sending 1024**3 instead takes forever on the server too and makes the test pass. So the following patch is the least different for what you have now and it works on my server: --- original/Python-2.7.5/Lib/test/test_socket.py 2013-05-11 21:32:47.000000000 -0600 +++ Python-2.7.5/Lib/test/test_socket.py 2013-06-05 11:20:59.390516537 -0600 @@ -685,11 +685,11 @@ c.settimeout(1.5) with self.assertRaises(ZeroDivisionError): signal.alarm(1) - c.sendall(b"x" * (1024**2)) + c.sendall(b"x" * (1024**3)) if with_timeout: signal.signal(signal.SIGALRM, ok_handler) signal.alarm(1) - self.assertRaises(socket.timeout, c.sendall, b"x" * (1024**2)) + self.assertRaises(socket.timeout, c.sendall, b"x" * (1024**3)) finally: signal.signal(signal.SIGALRM, old_alarm) c.close() However this is just waiting for a failure when a different hw will make the sendall faster again. I believe two more robust tests should be designed, without making assumptions about timing. Not sure it's possible, but it's certainly desirable. Regards, Davide Del Vento, NCAR Computational & Information Services Laboratory Consulting Services Software Engineer http://www2.cisl.ucar.edu/uss/csg/ SEA Chair http://sea.ucar.edu/ office: Mesa Lab, Room 55G office: (303) 497-1233 mobile: (303) 720-6338 On 05/19/2013 07:33 AM, Antoine Pitrou wrote: > Antoine Pitrou added the comment: > > ddvento, I'm afraid you'll have to diagnose a bit more by tracing what happens during test_sendall_interrupted and test_sendall_interrupted_with_timeout. These test cases have a legitimate use for arming an alarm signal, but for some reason it seems the signal is triggered after those tests finish. Try printing exactly what happens at each step in those tests. > > Etienne, I'm not sure what the issue specifically is. Is Linux TIPC has a memory leak issue, it isn't really Python's problem. If any case, it is a separate issue and therefore should be discussed on a separate bug entry. > > ---------- > nosy: +pitrou > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 20:07:17 2013 From: report at bugs.python.org (ddvento@ucar.edu) Date: Wed, 05 Jun 2013 18:07:17 +0000 Subject: [issue17085] test_socket crashes the whole test suite In-Reply-To: <51AF76F3.3040708@ucar.edu> Message-ID: <51AF7E5B.5080403@ucar.edu> ddvento at ucar.edu added the comment: Note that the previous patch would still let the test suite crash if the sendall() takes a short enough time. Having the test suite crash is so bad that I believe this should be the first issue to be fixed! The following patch prevents the test suite from crashing (however, without the previous patch, it lets this particular test fail on my machine). --- Python-2.7.5/Lib/test/test_socket.py 2013-05-11 21:32:47.000000000 -0600 +++ Python-2.7.5-socket-fix/Lib/test/test_socket.py 2013-06-05 12:05:41.038089911 -0600 @@ -691,6 +691,15 @@ signal.alarm(1) self.assertRaises(socket.timeout, c.sendall, b"x" * (1024**2)) finally: + # If c.sendall finishes before this process receives SIGALRM and + # the original signal handler is restored, the process will receive + # it and execute its default behavior of killing the + # interpreter. Make sure this doesn't happen by sleeping before + # restoring the original signal handler. Since only one alarm + # handler can be registered at once, we only need to sleep for 1 + # second since both have been called with the same 1 second time + # argument. + time.sleep(1) signal.signal(signal.SIGALRM, old_alarm) c.close() s.close() Regards, Davide Del Vento, NCAR Computational & Information Services Laboratory Consulting Services Software Engineer http://www2.cisl.ucar.edu/uss/csg/ SEA Chair http://sea.ucar.edu/ office: Mesa Lab, Room 55G ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 20:36:40 2013 From: report at bugs.python.org (Ned Deily) Date: Wed, 05 Jun 2013 18:36:40 +0000 Subject: [issue1512124] OSX: debugger hangs IDLE Message-ID: <1370457400.59.0.377934839547.issue1512124@psf.upfronthosting.co.za> Ned Deily added the comment: Undoubtedly, it was a bug in an earlier version of Aqua Tk; it doesn't appear to occur with current Tk's. ---------- resolution: accepted -> out of date stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 20:41:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 05 Jun 2013 18:41:10 +0000 Subject: [issue18130] idlelib.configSectionNameDialog: fix and add tests and mocks In-Reply-To: <1370304919.98.0.573433611159.issue18130@psf.upfronthosting.co.za> Message-ID: <3bQf396lGhzSb8@mail.python.org> Roundup Robot added the comment: New changeset db4ecaf852e3 by Terry Jan Reedy in branch '3.3': Issue18130: Test class idlelib.configSectionNameDialog.GetCfgSectionNameDialog. http://hg.python.org/cpython/rev/db4ecaf852e3 New changeset 31a67a0194ec by Terry Jan Reedy in branch '2.7': Issue18130: Test class idlelib.configSectionNameDialog.GetCfgSectionNameDialog. http://hg.python.org/cpython/rev/31a67a0194ec New changeset 382f4718e765 by Terry Jan Reedy in branch '3.3': Issue 18130: delete extra spaces http://hg.python.org/cpython/rev/382f4718e765 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 21:10:23 2013 From: report at bugs.python.org (Claudio Freire) Date: Wed, 05 Jun 2013 19:10:23 +0000 Subject: [issue18144] FD leak in urllib2 Message-ID: <1370459423.62.0.313188871142.issue18144@psf.upfronthosting.co.za> New submission from Claudio Freire: While other issues already exist about this problem, this particular case is unlike other issues, and I didn't think it a good idea to merge with those. Under some very specific circumstances (sending a POST request with more data than an unknown threshold), at least one socket remains unclosed after calling close() on urllib2.urlopen's returned file object. While I marked the only versions I could confirm exhibit the issue, I believe this is an issue on all versions. This started in pypy[0], although it applies to CPython as well (albeit the reference counting GC is less likely to delay closing of the FD as much as in pypy). I'm attaching the same server used to trigger this issue in pypy, works the same with CPython. To trigger the leak, open an interpreter and do this (copypaste from pypy, CPython does not cause the leak because decref immediately closes the leak, but it will issue a wraning if ran with -Wall). See pypy's issue tracker[0] for detilas. >>>> import os, urllib2 >>>> req = """{"imp": [{"h": 50, "battr": ["9", "10", "12"], "api": 3, "w": 320, "instl": 0, "impid": "5d6dedf3-17bb-11e2-b5c0-1040f38b83e0"}]""" * 10 >>>> r = urllib2.Request("http://localhost:8000/bogus?src=1", req) >>>> u = urllib2.urlopen(r) >>>> v = u.read() >>>> u.close() >>>> os.system("ls -alh /proc/%d/fd/*" % os.getpid()) lrwx------ 1 claudiofreire users 64 Jun 4 15:08 /proc/26203/fd/0 -> /dev/pts/5 lrwx------ 1 claudiofreire users 64 Jun 4 15:08 /proc/26203/fd/1 -> /dev/pts/5 lrwx------ 1 claudiofreire users 64 Jun 4 15:08 /proc/26203/fd/2 -> /dev/pts/5 lrwx------ 1 claudiofreire users 64 Jun 4 15:08 /proc/26203/fd/3 -> socket:[2086998] lrwx------ 1 claudiofreire users 64 Jun 4 15:08 /proc/26203/fd/5 -> /dev/pts/5 lrwx------ 1 claudiofreire users 64 Jun 4 15:08 /proc/26203/fd/6 -> /dev/pts/5 0 >>>> [0] https://bugs.pypy.org/issue867 ---------- components: Library (Lib) files: bogus.py messages: 190687 nosy: Claudio.Freire priority: normal severity: normal status: open title: FD leak in urllib2 type: behavior versions: Python 2.7, Python 3.1, Python 3.2 Added file: http://bugs.python.org/file30477/bogus.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 21:17:53 2013 From: report at bugs.python.org (Antoine Pietri) Date: Wed, 05 Jun 2013 19:17:53 +0000 Subject: [issue18145] Strange behavior when importing internal modules in the __init__.py of a submodule Message-ID: <1370459873.38.0.323655253605.issue18145@psf.upfronthosting.co.za> New submission from Antoine Pietri: I just found a very strange bug today, and it took me like two hours to figure out the problem. We first create a package "package", which contains an __init__.py, which makes an absolute import of package/foo.py (import package.foo), which makes an absolute import of package/bar.py (import package.bar). Everything works fine as expected, the modules are imported correctly in the __init__.py and we can use them. Now, if we move everything in a subpackage, the behavior is complete nonsense. We then have package/subpackage/{foo,bar,__init__}.py and an empty package/__init__.py. We can import package.subpackage.foo and use it, but when we import package.subpackage.bar, the "import" statement works as expected but we CAN'T use the imported package: >>> import package.subpackage.bar # works fine >>> dir(package.subpackage.bar) # WAT AttributeError: 'module' object has no attribute 'subpackage' You can find a tarball attached to this bug report that contains the working case and the failing case: package1 ??? bar.py ??? foo.py ??? __init__.py package2 ??? subpackage ??? bar.py ??? foo.py ??? __init__.py $ python3 >>> import package1.foo __init__: importing package1.foo foo.py: importing package1.bar foo.py: package1.bar.__name__: package1.bar __init__: package1.foo.__name__: package1.foo >>> import package2.subpackage.foo __init__: importing package2.subpackage.foo foo.py: importing package2.subpackage.bar Traceback (most recent call last): File "", line 1, in File "./package2/subpackage/__init__.py", line 2, in import package2.subpackage.foo File "./package2/subpackage/foo.py", line 3, in print(' foo.py: package2.subpackage.bar.__name__:', package2.subpackage.bar.__name__) AttributeError: 'module' object has no attribute 'subpackage' tl;dr: you can use only relative imports to refer to modules of a package inside a module imported by the __init__.py of this package except if the package is not a subpackage. Else, the package will be successfully imported but trying to use it will lead to a weird AttributeError. (Wat.) ---------- components: Interpreter Core files: lolpython.tar.xz messages: 190688 nosy: seirl priority: normal severity: normal status: open title: Strange behavior when importing internal modules in the __init__.py of a submodule type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file30478/lolpython.tar.xz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 21:52:33 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 19:52:33 +0000 Subject: [issue18145] Strange behavior when importing internal modules in the __init__.py of a submodule In-Reply-To: <1370459873.38.0.323655253605.issue18145@psf.upfronthosting.co.za> Message-ID: <1370461953.94.0.880358069869.issue18145@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- versions: +Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 22:11:43 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 20:11:43 +0000 Subject: [issue18145] Strange behavior when importing internal modules in the __init__.py of a submodule In-Reply-To: <1370459873.38.0.323655253605.issue18145@psf.upfronthosting.co.za> Message-ID: <1370463103.08.0.174229858596.issue18145@psf.upfronthosting.co.za> Brett Cannon added the comment: It's because you have a nested circular import. When you import package2.subpackage from within package2.subpackage you're in package2 importing package2 and also in package2.subpackage importing package2.subpackage. You can solve your problem by doing either ``from package2.subpackage import foo`` for ``from . import foo`` as that lets package2.subpackage be imported entirely on its own before attempting package2.subpackage.foo and thus letting the circular loop unroll and have the right attributes set since the attributes of a module for a package are set after the import completes. Might be annoying, but tweaking this would probably break code if changed as it's very old semantics to set the attribute of a module on a package after other imports complete. This is also not a problem as long as you don't do this in an __init__ (e.g. importing package2.subpackage.bar from package2.subpackage.foo is not a problem). ---------- nosy: +brett.cannon resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 22:19:08 2013 From: report at bugs.python.org (Dmi Baranov) Date: Wed, 05 Jun 2013 20:19:08 +0000 Subject: [issue18140] urlparse.urlsplit confused to fragment when password include # In-Reply-To: <1370425503.35.0.436511643169.issue18140@psf.upfronthosting.co.za> Message-ID: <1370463548.34.0.962149392509.issue18140@psf.upfronthosting.co.za> Dmi Baranov added the comment: anh, nice catch. Madison, I'm not see any terrible consequences, only urlsplit is affected now: >>> urlsplit('http://user:password at domain.com:80/path?query#fragment') SplitResult(scheme='http', netloc='user:password at domain.com:80', path='/path', query='query', fragment='fragment') >>> urlunsplit(_) 'http://user:password at domain.com:80/path?query#fragment' >>> urlunsplit(('http', 'user:pass#ord at domain.com:80', '/path', 'query', 'fragment')) 'http://user:pass#ord at domain.com:80/path?query#fragment' ---------- nosy: +dmi.baranov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 22:20:53 2013 From: report at bugs.python.org (Antoine Pietri) Date: Wed, 05 Jun 2013 20:20:53 +0000 Subject: [issue18145] Strange behavior when importing internal modules in the __init__.py of a submodule In-Reply-To: <1370459873.38.0.323655253605.issue18145@psf.upfronthosting.co.za> Message-ID: <1370463653.06.0.867035954382.issue18145@psf.upfronthosting.co.za> Antoine Pietri added the comment: Okay, maybe my message was unclear. I figured out on my own how to work around this issue (for instance using relative imports), the main problem for me is that this issue is very difficult to debug. The "import" statement should at least fail with a more explicit error, imho. ---------- resolution: wont fix -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 22:42:30 2013 From: report at bugs.python.org (Madison May) Date: Wed, 05 Jun 2013 20:42:30 +0000 Subject: [issue18140] urlparse.urlsplit confused to fragment when password include # In-Reply-To: <1370425503.35.0.436511643169.issue18140@psf.upfronthosting.co.za> Message-ID: <1370464950.04.0.350620750963.issue18140@psf.upfronthosting.co.za> Madison May added the comment: My apologies -- that was an oversight on my part. Now that I look at the issue again, it's plain that it most likely won't be an issue. Problems only arise when you allow '#' to occur before '?' and then treat portion of the url between the '#' and '?' as a fragment. In this scenario, when the url is rejoined, the order of the fragment and query is switched by urlunsplit(). However, since the portion of the url with a hashtag would be treated as a the netloc, this isn't any cause for concern. We only need to ensure that the order of the components is maintained. Thanks for the heads up, Dmi. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 23:35:01 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jun 2013 21:35:01 +0000 Subject: [issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function In-Reply-To: <1367269025.02.0.400879045482.issue17870@psf.upfronthosting.co.za> Message-ID: <1370468101.16.0.563815402427.issue17870@psf.upfronthosting.co.za> STINNER Victor added the comment: Another place where PyLong_FromIntMax_t() would help, _elementtree.c: id = PyLong_FromSsize_t((Py_uintptr_t) self); selectmodule.c defines PyLong_AsUintptr_t() with: #if (SIZEOF_UINTPTR_T != SIZEOF_VOID_P) # error uintptr_t does not match void *! #elif (SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG) # define T_UINTPTRT T_ULONGLONG # define T_INTPTRT T_LONGLONG # define PyLong_AsUintptr_t PyLong_AsUnsignedLongLong # define UINTPTRT_FMT_UNIT "K" # define INTPTRT_FMT_UNIT "L" #elif (SIZEOF_UINTPTR_T == SIZEOF_LONG) # define T_UINTPTRT T_ULONG # define T_INTPTRT T_LONG # define PyLong_AsUintptr_t PyLong_AsUnsignedLong # define UINTPTRT_FMT_UNIT "k" # define INTPTRT_FMT_UNIT "l" #elif (SIZEOF_UINTPTR_T == SIZEOF_INT) # define T_UINTPTRT T_UINT # define T_INTPTRT T_INT # define PyLong_AsUintptr_t PyLong_AsUnsignedLong # define UINTPTRT_FMT_UNIT "I" # define INTPTRT_FMT_UNIT "i" #else # error uintptr_t does not match int, long, or long long! #endif ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 23:39:29 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 05 Jun 2013 21:39:29 +0000 Subject: [issue18145] Strange behavior when importing internal modules in the __init__.py of a submodule In-Reply-To: <1370459873.38.0.323655253605.issue18145@psf.upfronthosting.co.za> Message-ID: <1370468369.16.0.980640822555.issue18145@psf.upfronthosting.co.za> Brett Cannon added the comment: It can't. The AttributeError is in the executing module code, not import itself so there is no reasonable way to tell that the failure was because of a circular loop in the import and not simply because you tried to get at an attribute that doesn't exist for some other reason. ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 23:40:09 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Jun 2013 21:40:09 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <1370468409.93.0.205361547573.issue17931@psf.upfronthosting.co.za> STINNER Victor added the comment: -/* The size of `pid_t' (HANDLE). */ -#define SIZEOF_PID_T SIZEOF_VOID_P I would prefer to have SIZEOF_PID_T defined: #define SIZEOF_PID_T SIZEOF_INT win32_kill() uses DWORD type, not pid_t. Except these nits, your patch looks good and is more correct than my patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 5 23:42:00 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Jun 2013 21:42:00 +0000 Subject: [issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function In-Reply-To: <1367269025.02.0.400879045482.issue17870@psf.upfronthosting.co.za> Message-ID: <1370468520.15.0.263336240755.issue17870@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > Another place where PyLong_FromIntMax_t() would help, _elementtree.c: > > id = PyLong_FromSsize_t((Py_uintptr_t) self); I think PyLong_FromVoidPtr() should be used here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:05:48 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 05 Jun 2013 22:05:48 +0000 Subject: [issue17267] datetime.time support for '+' and 'now' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1370469948.13.0.0145008149013.issue17267@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I left a few minor comments on rietveld for the last patch. I did not see code for time.now() and I don't think adding now() should be combined with time +/- timedelta patch. Let's do one thing at a time. I think time + timedelta addition is fairly uncontroversial. In the past, I argued against using detached time objects, but it is not really a valid reason for rejecting a good feature. On subtraction, if we add time - timedelta -> time, I think users would expect time - time -> timedelta as well. This, however, is ambiguous if we stay with mod 24h arithmetic. The ambiguity can be lifted by requiring days=0 in the result. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:09:43 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 05 Jun 2013 22:09:43 +0000 Subject: [issue17267] datetime.time support for '+' and 'now' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1370470183.03.0.506785029308.issue17267@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: This was proposed before and rejected in issue1118748, but I think current proposal addresses the ambiguity that was sited as a reason for rejection. ---------- nosy: +skip.montanaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:17:55 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 05 Jun 2013 22:17:55 +0000 Subject: [issue17267] datetime.time support for '+' and 'now' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1370470675.17.0.726561889018.issue17267@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: See also issue 3250. If we add mod 24h arithmetics, I would like to see something like time.add_with_carry(timedelta) -> (int, time) method. With it, users who need a specific overflow behavior will be able to implement it easily: def check_add(t, td): carry, result = t.add_with_carry(tf) if carry: raise ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:22:41 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 05 Jun 2013 22:22:41 +0000 Subject: [issue17267] datetime.time support for '+' and '-' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1370470961.06.0.214018362069.issue17267@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I am changing the title to focus this issue on arithmetics. Lack of time.now() is adressed in #8902. ---------- title: datetime.time support for '+' and 'now' -> datetime.time support for '+' and '-' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:23:37 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 05 Jun 2013 22:23:37 +0000 Subject: [issue8902] add datetime.time.now() for consistency In-Reply-To: <1275719789.45.0.168425659941.issue8902@psf.upfronthosting.co.za> Message-ID: <1370471017.45.0.756882349208.issue8902@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- resolution: wont fix -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:23:44 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 05 Jun 2013 22:23:44 +0000 Subject: [issue8902] add datetime.time.now() for consistency In-Reply-To: <1275719789.45.0.168425659941.issue8902@psf.upfronthosting.co.za> Message-ID: <1370471024.6.0.14006110028.issue8902@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:31:40 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 05 Jun 2013 22:31:40 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <3bQl982DCzz7LjP@mail.python.org> Roundup Robot added the comment: New changeset 0410bf251e10 by Richard Oudkerk in branch 'default': Issue #17931: Resolve confusion on Windows between pids and process handles. http://hg.python.org/cpython/rev/0410bf251e10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:42:04 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Jun 2013 22:42:04 +0000 Subject: [issue16715] Get rid of IOError. Use OSError instead In-Reply-To: <3YW0Xs2j15zRkN@mail.python.org> Message-ID: <1370472124.76.0.139934613035.issue16715@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Now that 3.2 is off of maintenance and Idle patches are being applied to both 3.3 and 3.4 (and usually 2.7), I plan to backport the Idle subset of changes to 3.3 so patches are more likely to merge forward without incident. (I have already done one where this change was the only problem.) ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 00:57:32 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Jun 2013 22:57:32 +0000 Subject: [issue18130] idlelib.configSectionNameDialog: fix and add tests and mocks In-Reply-To: <1370304919.98.0.573433611159.issue18130@psf.upfronthosting.co.za> Message-ID: <1370473052.72.0.888161339041.issue18130@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 01:56:01 2013 From: report at bugs.python.org (Julian Berman) Date: Wed, 05 Jun 2013 23:56:01 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370476560.99.0.352299032319.issue18111@psf.upfronthosting.co.za> Julian Berman added the comment: Thanks for the offer Raymond. Here's a patch with some tests and doc updates, incorporating Nick's suggestion (but without a note in the docs, I didn't feel it's notable). Please let me know if anything needs tidying. ---------- Added file: http://bugs.python.org/file30479/minmax.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 02:48:54 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 00:48:54 +0000 Subject: [issue16427] Faster hash implementation In-Reply-To: <1352291929.32.0.895096534658.issue16427@psf.upfronthosting.co.za> Message-ID: <1370479734.34.0.405861767995.issue16427@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm not sure that micro-benchmarks are revelant for this issue. Hash collisions may have an higher cost than the gain of a faster hash function. Some people feel also concerned by the dict denial of service issue. It would be interesting to compare performances using the benchmark suite: http://hg.python.org/benchmarks/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 06:16:09 2013 From: report at bugs.python.org (hanks) Date: Thu, 06 Jun 2013 04:16:09 +0000 Subject: [issue18146] Document miss, Stats objects has no method called "print_results" Message-ID: <1370492169.32.0.572100165636.issue18146@psf.upfronthosting.co.za> New submission from hanks: link: http://docs.python.org/2/library/profile.html The example in this page: import cProfile, pstats, io pr = cProfile.Profile() pr.enable() ... do something ... pr.disable() s = io.StringIO() ps = pstats.Stats(pr, stream=s) ps.print_results() # actually Stats objects has no method called "print_results" ---------- assignee: docs at python components: Documentation messages: 190705 nosy: docs at python, hanks priority: normal severity: normal status: open title: Document miss, Stats objects has no method called "print_results" type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 10:50:59 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jun 2013 08:50:59 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370508659.4.0.703728641876.issue18116@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: >>> getpass.getpass('Password: ', sys.stdout) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/getpass.py", line 72, in unix_getpass passwd = _raw_input(prompt, stream, input=input) File "/home/serhiy/py/cpython/Lib/getpass.py", line 146, in _raw_input stream.write(bytes(prompt, tty_encoding)) TypeError: must be str, not bytes >>> getpass.getpass('Password: ', io.StringIO()) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/getpass.py", line 72, in unix_getpass passwd = _raw_input(prompt, stream, input=input) File "/home/serhiy/py/cpython/Lib/getpass.py", line 146, in _raw_input stream.write(bytes(prompt, tty_encoding)) TypeError: string argument expected, got 'bytes' ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 11:00:40 2013 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Jun 2013 09:00:40 +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: <1370509240.22.0.851619020982.issue11959@psf.upfronthosting.co.za> Changes by Vinay Sajip : Added file: http://bugs.python.org/file30480/34974b9bc4d0.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 11:08:56 2013 From: report at bugs.python.org (Dmi Baranov) Date: Thu, 06 Jun 2013 09:08:56 +0000 Subject: [issue18146] Document miss, Stats objects has no method called "print_results" In-Reply-To: <1370492169.32.0.572100165636.issue18146@psf.upfronthosting.co.za> Message-ID: <1370509736.28.0.799950604602.issue18146@psf.upfronthosting.co.za> Dmi Baranov added the comment: Duplication of issue 18033 ---------- nosy: +dmi.baranov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 11:13:51 2013 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 06 Jun 2013 09:13:51 +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: <1370510031.45.0.186868692664.issue11959@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: LGTM now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 11:14:13 2013 From: report at bugs.python.org (hanks) Date: Thu, 06 Jun 2013 09:14:13 +0000 Subject: [issue18146] Document miss, Stats objects has no method called "print_results" In-Reply-To: <1370492169.32.0.572100165636.issue18146@psf.upfronthosting.co.za> Message-ID: <1370510053.78.0.237673874141.issue18146@psf.upfronthosting.co.za> Changes by hanks : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 11:40:47 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 06 Jun 2013 09:40:47 +0000 Subject: [issue18146] Document miss, Stats objects has no method called "print_results" In-Reply-To: <1370492169.32.0.572100165636.issue18146@psf.upfronthosting.co.za> Message-ID: <1370511647.38.0.0393418136205.issue18146@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- resolution: -> duplicate stage: -> committed/rejected superseder: -> Example for Profile Module shows incorrect method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 12:19:29 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 06 Jun 2013 10:19:29 +0000 Subject: [issue18147] SSL: diagnostic functions to list loaded CA certs Message-ID: <1370513969.26.0.776855011912.issue18147@psf.upfronthosting.co.za> New submission from Christian Heimes: The patch adds two methods to SSLContext which return information about loaded x509 certs, CRL and CAs. Example: >>> ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) >>> ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT) >>> ctx.cert_store_stats() {'crl': 0, 'x509': 1} >>> ctx.get_ca_list() [{'issuer': ((('organizationName', 'Root CA'),), (('organizationalUnitName', 'http://www.cacert.org'),), (('commonName', 'CA Cert Signing Authority'),), (('emailAddress', 'support at cacert.org'),)), 'notAfter': 'Mar 29 12:29:49 2033 GMT', 'notBefore': 'Mar 30 12:29:49 2003 GMT', 'serialNumber': '00', 'subject': ((('organizationName', 'Root CA'),), (('organizationalUnitName', 'http://www.cacert.org'),), (('commonName', 'CA Cert Signing Authority'),), (('emailAddress', 'support at cacert.org'),)), 'version': 3}] ---------- components: Extension Modules files: ssl_ca_stats.patch keywords: patch messages: 190709 nosy: brett.cannon, christian.heimes, pitrou priority: normal severity: normal stage: patch review status: open title: SSL: diagnostic functions to list loaded CA certs type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30481/ssl_ca_stats.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 12:26:00 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jun 2013 10:26:00 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370514360.03.0.463460050051.issue18116@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The problem is in io.open, not in getpass. Here is a test script. $ ./python buffered_open_fd_leak.py buffered_open_fd_leak.py:7: ResourceWarning: unclosed file <_io.FileIO name=3 mode='rb+'> tty = io.open(fd, 'w+', 1) ---------- versions: +Python 3.4 Added file: http://bugs.python.org/file30482/buffered_open_fd_leak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 12:26:58 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jun 2013 10:26:58 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370514418.9.0.508332780629.issue18116@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: +IO nosy: +hynek, pitrou, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 12:40:41 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Thu, 06 Jun 2013 10:40:41 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370515241.98.0.188220130587.issue18116@psf.upfronthosting.co.za> Vajrasky Kok added the comment: So the correct fix should be: 1. Make sure we can open /dev/tty in non-binary mode, 2. We can write string to /dev/tty, 3. Close the leak if we can not open /dev/tty. Is it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 13:03:37 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 06 Jun 2013 11:03:37 +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: <1370516617.43.0.843114071557.issue11959@psf.upfronthosting.co.za> R. David Murray added the comment: Looks good to me too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 14:49:37 2013 From: report at bugs.python.org (Donal Duane) Date: Thu, 06 Jun 2013 12:49:37 +0000 Subject: [issue18148] Make of Python 3.2.2 fails on Solaris SPARC Message-ID: <1370522977.23.0.850120192524.issue18148@psf.upfronthosting.co.za> New submission from Donal Duane: Hi, I am trying to configure/make/make install Python 3.2.2 on Solaris SPARC. The configure goes ok, but I am getting an error when doing make. I am using GCC 3.4.6. Error: make/usr/local/bin/gcc -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.cIn file included from Include/Python.h:50,from ./Modules/python.c:3:Include/pyport.h:257:13: #error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG"*** Error code 1make: Fatal error: Command failed for target `Modules/python.o' Regards, Donal ---------- components: Cross-Build messages: 190713 nosy: eeiddne priority: normal severity: normal status: open title: Make of Python 3.2.2 fails on Solaris SPARC type: compile error versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 15:48:39 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Thu, 06 Jun 2013 13:48:39 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370526519.66.0.217698195779.issue18116@psf.upfronthosting.co.za> Vajrasky Kok added the comment: Fixing IO leak resource would fix this bug but leave another bug opened which I try to fix as well. These statements with Python3 under Linux will always fail because we need to open /dev/tty file in binary mode (for whatever reason). fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY) tty = os.fdopen(fd, 'w+', 1) So I guess the correct fix would be to open /dev/tty in binary mode (and set buffering off) and go on from there. Of course, one can argue whether this bug should be separated from the original bug (resource warning). I am not sure either. Anyway, here is the patch that will work with stream StringIO and stdout. Thank you for Serhiy for pointing out my mistakes. ---------- Added file: http://bugs.python.org/file30483/getpass_fix_works_with_stringio_and_stdout_stream.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 16:07:35 2013 From: report at bugs.python.org (=?utf-8?q?Matej_Fr=C3=B6be?=) Date: Thu, 06 Jun 2013 14:07:35 +0000 Subject: [issue18149] filecmp.cmp() - cache invalidation fails when file modification times haven't changed Message-ID: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> New submission from Matej Fr?be: Example: with open('file1', 'w') as f: f.write('a') with open('file2', 'w') as f: f.write('a') print filecmp.cmp('file1', 'file2', shallow=False) # true with open('file2', 'w') as f: f.write('b') print filecmp.cmp('file1', 'file2', shallow=False) # true Because of the caching, both calls to filecmp.cmp() return true on my system. When retrieving value from cache, the function filecmp.cmp() checks the signatures of the files: s1 = _sig(os.stat(f1)) s2 = _sig(os.stat(f2)) ... outcome = _cache.get((f1, f2, s1, s2)) But the signatures in cache are the same, if the file sizes and times of modification (os.stat().st_mtime) haven't changed from the last call, even if the content has changed. The buffer is mentioned in the documentation, but there isn't any documented way to clear it. It also isn't nice IMO, that one has to worry about the file system's resolution of the file modification time when calling a simple file comparison. ---------- components: Library (Lib) messages: 190715 nosy: fbm priority: normal severity: normal status: open title: filecmp.cmp() - cache invalidation fails when file modification times haven't changed type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 16:17:53 2013 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 06 Jun 2013 14:17:53 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1370528273.8.0.321062047416.issue13483@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 16:32:39 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jun 2013 14:32:39 +0000 Subject: [issue18116] getpass.getpass() triggers ResourceWarning In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370529159.64.0.556954939527.issue18116@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: >>> getpass.getpass('Password: ', open('/dev/stdout', 'w')) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/getpass.py", line 72, in unix_getpass passwd = _raw_input(prompt, stream, input=input) File "/home/serhiy/py/cpython/Lib/getpass.py", line 143, in _raw_input stream.write(bytes(prompt, tty_encoding)) TypeError: must be str, not bytes It seems that you are moving in the wrong direction. No need to test explicitly for stdout/stderr/etc, the code should work with arbitrary text stream. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 17:18:12 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Thu, 06 Jun 2013 15:18:12 +0000 Subject: [issue18150] Duplicate test inside TestSingleDispatch Message-ID: <1370531892.77.0.178198886311.issue18150@psf.upfronthosting.co.za> New submission from Vajrasky Kok: There is a duplicate test inside TestSingleDispatch in file Lib/test/test_functools.py. The method test_mro and test_classic_classes are not different at all. ---------- components: Tests files: duplicate_test_for_testsingledispatch.diff keywords: patch messages: 190717 nosy: lukasz.langa, vajrasky priority: normal severity: normal status: open title: Duplicate test inside TestSingleDispatch versions: Python 3.4 Added file: http://bugs.python.org/file30484/duplicate_test_for_testsingledispatch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 19:02:32 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 06 Jun 2013 17:02:32 +0000 Subject: [issue18151] Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) Message-ID: <1370538152.36.0.501706446334.issue18151@psf.upfronthosting.co.za> New submission from Terry J. Reedy: This issue is about uniformly updating the old idiom try: f = open('file') to the current idiom try: with open('file') as f: #16715 changed 'IOError' to 'OSError' everywhere in Lib/* for 3.4 only. I ran into this issue (again) because GrepDialog.Grepdialog.grep_it uses open without close. Consequently, with debug builds, 'Find in files' raises a ResourceWarning for each file opened. Because of the 3.4-only change, there will be a merge conflict. To avoid this, now and in the future, I plan to backport the idlelib subset of the Svetlov's patch to 3.3 (it applied with only one fix). Currently, all 3.x patches are being applied to both 3.3 and 3.4 and any 3.3 patch with 'IOError' will have a merge conflict. Any 3.4 patch with 'OSError' will not apply to 3.3. There is no longer an issue with breaking 3.2 to 3.3 merges. This change will break existing 3.3 patches with 'IOError', but they would break anyway on the merge. ---------- components: IDLE files: idle33.io2os.diff keywords: patch messages: 190718 nosy: Todd.Rovito, roger.serwy, terry.reedy priority: normal severity: normal stage: commit review status: open title: Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30485/idle33.io2os.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 20:29:51 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 06 Jun 2013 18:29:51 +0000 Subject: [issue18152] Idle: add 2.7 backport script Message-ID: <1370543391.75.0.919797325796.issue18152@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Backporting Idle patches from 3.x to 2.7 would be easier with a canned edit script. Below are the substitutions I can think of immediately. Do any of you know of others? Easy (str.replace): tkinter -> Tkinter import tkinter.messagebox as tkMessageBox -> import tkMessageBox A bit tricky (but still use str.replace): OSError -> IOError This presumes that IOError become OSError in 3.3 as well as 3.4 (#18151). But there are a few existig OSErrors is 3.3 (and that pre-existed the change in 3.4). So there would would need to be a check that a changed line matched an existing 2.7 line. Harder (2to3 parser?): print(arglist) -> print arglist # but what if keyword args? Outputting "fix print on line nn" would be easiest. README needed (python -m) test -> (python -m) test.regrtest in the test instructions, but this should be the only place that occurs. I might put 'edit_patch' or whatever in idle_test. ---------- messages: 190719 nosy: Todd.Rovito, asvetlov, ned.deily, roger.serwy, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Idle: add 2.7 backport script type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 20:30:43 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 06 Jun 2013 18:30:43 +0000 Subject: [issue18151] Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) In-Reply-To: <1370538152.36.0.501706446334.issue18151@psf.upfronthosting.co.za> Message-ID: <1370543443.2.0.0957121240335.issue18151@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Here is the 'OS' version of the fix and update to grep_it. Change 'OS' to 'IO' on line 17 to apply to current 3.3, without the io2os patch. Besides using 'with', it iterates the files directly instead of iterating blocks of readlines. The two changes make the code simpler and cleaner. The changed summary looks better to me, besides avoiding the hit/hits problem. As can be seen in the io2os patch, there are other opens to be updated in another patch. OutputWindow.OutputWindow._file_line_helper has this one: f = open(filename, "r") f.close() which would become: with open(filename, "r"): pass This tests whether the filename extracted from a traceback or grep report is correct (can be opened). (Each of several patterns are tried until one works.) The opened file is discarded because the filename is returned to be passes to editwin's flist.open. I believe this could be replaced by an os.stat() call. Backportint to 2.7 is the subject of #18152 ---------- keywords: +needs review Added file: http://bugs.python.org/file30486/grep_it.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 20:33:49 2013 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 06 Jun 2013 18:33:49 +0000 Subject: [issue18152] Idle: add 2.7 backport script In-Reply-To: <1370543391.75.0.919797325796.issue18152@psf.upfronthosting.co.za> Message-ID: <1370543628.99.0.698429140287.issue18152@psf.upfronthosting.co.za> Ezio Melotti added the comment: Are you planning to use this on the patches instead of using "hg graft"? These things should be easy to fix during the 3-way merge, so I'm not sure if it's worth adding a specific script. If you think it's necessary, consider making it a mercurial extension that can be run automatically during the graft. ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 20:43:39 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jun 2013 18:43:39 +0000 Subject: [issue18152] Idle: add 2.7 backport script In-Reply-To: <1370543391.75.0.919797325796.issue18152@psf.upfronthosting.co.za> Message-ID: <1370544219.85.0.42592682718.issue18152@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Please regenerate your patches without --git for review. Rietveld doesn't like git-style patches. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 20:46:35 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Thu, 06 Jun 2013 18:46:35 +0000 Subject: [issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit In-Reply-To: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za> Message-ID: <1370544395.94.0.977442213925.issue17931@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 20:49:27 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jun 2013 18:49:27 +0000 Subject: [issue18152] Idle: add 2.7 backport script In-Reply-To: <1370543391.75.0.919797325796.issue18152@psf.upfronthosting.co.za> Message-ID: <1370544567.92.0.0300014578828.issue18152@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- Removed message: http://bugs.python.org/msg190722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 20:49:37 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jun 2013 18:49:37 +0000 Subject: [issue18151] Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) In-Reply-To: <1370538152.36.0.501706446334.issue18151@psf.upfronthosting.co.za> Message-ID: <1370544577.22.0.335587241656.issue18151@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Please regenerate your patches without --git for review. Rietveld doesn't like git-style patches. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 21:52:11 2013 From: report at bugs.python.org (Steve Ward) Date: Thu, 06 Jun 2013 19:52:11 +0000 Subject: [issue12932] filecmp.dircmp does not allow non-shallow comparisons In-Reply-To: <1315411296.33.0.213336425163.issue12932@psf.upfronthosting.co.za> Message-ID: <1370548331.96.0.502078930641.issue12932@psf.upfronthosting.co.za> Changes by Steve Ward : ---------- nosy: +planet36 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:16:32 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:16:32 +0000 Subject: [issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370549792.19.0.904781437057.issue12545@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I just reproduced the issue on my gdb.py program, which is part of the python-ptrace program. When searching for a pattern in the memory of another process, /proc/pid/maps is used to get the list of all memory mappings of this process. On Linux x64, the last mapping is "ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]", machine code used for system calls. gdb.py opens /proc/pid/mem in binary mode and tries to seek at 0xffffffffff600000 but FileIO.seek() fails because it gets an offset bigger than 2^63, which is seen as a negative number and FileIO.seek() considers a negative number as an error. Attached patch fixes this issue by checking not only the result of lseek(), but also errno: errno = 0; Py_BEGIN_ALLOW_THREADS #if defined(MS_WIN64) || defined(MS_WINDOWS) res = _lseeki64(fd, pos, how); #else res = lseek(fd, pos, how); #endif Py_END_ALLOW_THREADS if (res == (off_t)-1 && errno) return posix_error(); PyLong_AsUnsignedLong() is tried if PyLong_AsLong() failed with an OverflowError. I kept PyLong_AsLong() for relative seek with a negative offset, and I prefer to try first PyLong_AsLong() because the overflow case is very unlikely compared to negative offsets for relative seek. The result is always casted to an unsigned number. I never seen a device or file descriptor supporting negative offset. I don't know how to test this code path automatically. I only know the "[vsyscall]" mapping use case on Linux, and it requires to parse /proc/self/maps which is not trivial and I would prefer sometimes simpler (more reliable with less maintenance). I propose to not add an unit test, except someone find how to write a simple and reliable test. > This is not true of a regular file where I get errno=22 > when seeking to an offset greater than or equal to 2^63. Same behaviour on Linux: OSError(22, "Invalid argument") when I try file.seek(1 << 63) on a regular file. ---------- Added file: http://bugs.python.org/file30487/lseek_unsigned.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:17:32 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:17:32 +0000 Subject: [issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370549852.03.0.424359744553.issue12545@psf.upfronthosting.co.za> STINNER Victor added the comment: About the version field: If we decide to change os.lseek() and FileIO.seek(), it is safer to only do it in Python 3.4. ---------- versions: +Python 3.4 -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:17:55 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:17:55 +0000 Subject: [issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1 In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370549875.02.0.751898783602.issue12545@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Incorrect handling of return codes in the posix_lseek function in posixmodule.c -> os.lseek() and FileIO.seek() does not support offset larger than 2^63-1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:18:20 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:18:20 +0000 Subject: [issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1 In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370549900.33.0.0901214990115.issue12545@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file22641/unnamed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:18:21 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:18:21 +0000 Subject: [issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1 In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370549901.83.0.826889944418.issue12545@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file22645/unnamed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:18:23 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:18:23 +0000 Subject: [issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1 In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370549903.58.0.787066123868.issue12545@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file22721/unnamed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:21:30 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 06 Jun 2013 20:21:30 +0000 Subject: [issue18151] Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) In-Reply-To: <1370538152.36.0.501706446334.issue18151@psf.upfronthosting.co.za> Message-ID: <1370550090.45.0.584114379663.issue18151@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Serhiy: I don't care about patch style but I read somewhere that I 'should' set the hg options file to automatically produce git style diff. However, since the hg doc says that this setting does not affect pushes, I don't know why, and I cannot find where I read that. Is it obsolete? Are you suggesting that all patches should never be git style? I turned git off and will leave it off until someone complains. ---------- Added file: http://bugs.python.org/file30488/idle33.io2os.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:24:22 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 06 Jun 2013 20:24:22 +0000 Subject: [issue18151] Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) In-Reply-To: <1370538152.36.0.501706446334.issue18151@psf.upfronthosting.co.za> Message-ID: <1370550262.25.0.439380245606.issue18151@psf.upfronthosting.co.za> Changes by Terry J. Reedy : Added file: http://bugs.python.org/file30489/grep_it.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:27:58 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:27:58 +0000 Subject: [issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1 In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370550478.63.0.911569737359.issue12545@psf.upfronthosting.co.za> STINNER Victor added the comment: lseek_negative.diff is not correct: 0x8000000000000000 is a valid offset for a /proc/pid/mem file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:29:35 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:29:35 +0000 Subject: [issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1 In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370550575.18.0.051758697716.issue12545@psf.upfronthosting.co.za> STINNER Victor added the comment: lseek_unsigned_test.py: script to test manually the patch on Linux. It may work on Solaris, I didn't try. ---------- Added file: http://bugs.python.org/file30490/lseek_unsigned_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:32:25 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Jun 2013 20:32:25 +0000 Subject: [issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1 In-Reply-To: <1310527759.4.0.117442331882.issue12545@psf.upfronthosting.co.za> Message-ID: <1370550745.76.0.339032548742.issue12545@psf.upfronthosting.co.za> STINNER Victor added the comment: The patch is not complete: _iomodule.h defines PyLong_AsOff_t() and PyLong_FromOff_t(), but these functions don't support unsigned off_t (larger than 2^63-1). #if defined(MS_WIN64) || defined(MS_WINDOWS) /* Windows uses long long for offsets */ typedef PY_LONG_LONG Py_off_t; # define PyLong_AsOff_t PyLong_AsLongLong # define PyLong_FromOff_t PyLong_FromLongLong # define PY_OFF_T_MAX PY_LLONG_MAX # define PY_OFF_T_MIN PY_LLONG_MIN # define PY_OFF_T_COMPAT PY_LONG_LONG /* type compatible with off_t */ # define PY_PRIdOFF "lld" /* format to use for that type */ #else /* Other platforms use off_t */ typedef off_t Py_off_t; #if (SIZEOF_OFF_T == SIZEOF_SIZE_T) # define PyLong_AsOff_t PyLong_AsSsize_t # define PyLong_FromOff_t PyLong_FromSsize_t # define PY_OFF_T_MAX PY_SSIZE_T_MAX # define PY_OFF_T_MIN PY_SSIZE_T_MIN # define PY_OFF_T_COMPAT Py_ssize_t # define PY_PRIdOFF "zd" #elif (HAVE_LONG_LONG && SIZEOF_OFF_T == SIZEOF_LONG_LONG) # define PyLong_AsOff_t PyLong_AsLongLong # define PyLong_FromOff_t PyLong_FromLongLong # define PY_OFF_T_MAX PY_LLONG_MAX # define PY_OFF_T_MIN PY_LLONG_MIN # define PY_OFF_T_COMPAT PY_LONG_LONG # define PY_PRIdOFF "lld" #elif (SIZEOF_OFF_T == SIZEOF_LONG) # define PyLong_AsOff_t PyLong_AsLong # define PyLong_FromOff_t PyLong_FromLong # define PY_OFF_T_MAX LONG_MAX # define PY_OFF_T_MIN LONG_MIN # define PY_OFF_T_COMPAT long # define PY_PRIdOFF "ld" #else # error off_t does not match either size_t, long, or long long! #endif #endif My patch fixes FileIO.seek(), but no BufferedReader & friends. So seek() works on open("/proc/self/mem", "rb", 0), but not on open("/proc/self/mem", "rb"). I didn't notice immediatly because I'm using an unbuffered file in my python-pytrace project. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 22:53:53 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Jun 2013 20:53:53 +0000 Subject: [issue18151] Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) In-Reply-To: <1370538152.36.0.501706446334.issue18151@psf.upfronthosting.co.za> Message-ID: <1370552033.62.0.488832849741.issue18151@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you. AFAIK you need git style diff only when moving/renaming files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 6 23:22:28 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 06 Jun 2013 21:22:28 +0000 Subject: [issue18152] Idle: add 2.7 backport script In-Reply-To: <1370543391.75.0.919797325796.issue18152@psf.upfronthosting.co.za> Message-ID: <1370553748.0.0.651604054921.issue18152@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Ezio: yes. Once I have written a working-directory diff to a file for upload (non-trivial on Windows), 'Import' is as easy to use as Graft and as far as I know, the result when successful is the same. I know I 'should' learn to use kdiff3 effectively, but it seldom works right for me, and the live repository is the wrong place to learn by failure. (This gives me an idea for another forum.) A third always correct import substitution pair: import tkinter.simpledialog as tkSimpleDialog <-> import tkSimpleDialog I am not sure if a script will be used until I try one. I do not know anything about writing extensions. A lists of Idle-specific conversions may be enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 00:33:48 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Thu, 06 Jun 2013 22:33:48 +0000 Subject: [issue17486] datetime.timezone returns the wrong tzname() In-Reply-To: <1363725360.78.0.545184964359.issue17486@psf.upfronthosting.co.za> Message-ID: <1370558028.52.0.819022694723.issue17486@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: This is not a bug in datetime.timezone. The value returned by timezone.tzname() is documented and the code works correctly. %Z should not be used to produce machine-readable timestamps and for a human reader 'UTC+03:00+0300' should not be confusing. Note that calling the astimezone() method (without arguments) will return local time with tzname set: >>> os.putenv('TZ', 'XYZ-3') >>> time.tzset() >>> utctime = datetime.datetime.now(datetime.timezone.utc) >>> localtime = utctime.astimezone() >>> localtime.strftime('%Z%z') 'XYZ+0300' ---------- nosy: +belopolsky resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 02:20:42 2013 From: report at bugs.python.org (tahnoon pasha) Date: Fri, 07 Jun 2013 00:20:42 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' Message-ID: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> New submission from tahnoon pasha: Hi I've suddenly encountered an error using imaplib on some code that worked fine before. import imaplib m = imaplib.IMAP4('myserver','port') m.login(r'username','password') m.select() gives me the error Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/imaplib.py", line 649, in select typ, dat = self._simple_command(name, mailbox) File "/usr/lib/python2.7/imaplib.py", line 1070, in _simple_command return self._command_complete(name, self._command(name, *args)) File "/usr/lib/python2.7/imaplib.py", line 899, in _command_complete raise self.abort('command: %s => %s' % (name, val)) imaplib.abort: command: SELECT => unexpected response: '* 1520 EXISTS' I'm not sure what it means. Emails are otherwise coming through fine, and I'm using davmail as a server. The program in its entirety saves attachments with a certain name in a specific folder. I've stepped through it and its definitely the `m.select()` that is where its falling over. This same program worked absolutely fine until recently. What am I doing wrong, and how do I fix it? The log of activity is as follows >>> import imaplib >>> m = imaplib.IMAP4('server','port') >>> Debug=4 >>> m.debug 0 >>> m.debug=4 >>> m.debug 4 >>> m.login(r'username','password') 01:26.55 > HLFI1 LOGIN "username" "password" 01:30.76 < HLFI1 OK Authenticated ('OK', ['Authenticated']) >>> m.list() 01:56.33 > HLFI2 LIST "" * 02:00.04 < * LIST (\HasNoChildren) "/" "Trash/Sent Messages" 02:00.04 < * LIST (\HasNoChildren) "/" "Sync Issues/Server Failures" 02:00.04 < * LIST (\HasNoChildren) "/" "Sync Issues/Local Failures" 02:00.04 < * LIST (\HasNoChildren) "/" "Sync Issues/Conflicts" 02:00.04 < * LIST (\HasChildren) "/" "Sync Issues" 02:00.04 < * LIST (\HasNoChildren) "/" "Junk E-mail" 02:00.04 < * LIST (\HasNoChildren) "/" "Drafts" 02:00.04 < * LIST (\HasChildren) "/" "Trash" 02:00.04 < * LIST (\HasNoChildren) "/" "Sent" 02:00.04 < * LIST (\HasNoChildren) "/" "Outbox" 02:00.04 < * LIST (\HasNoChildren) "/" "INBOX" 02:00.04 < HLFI2 OK LIST completed ('OK', ['(\\HasNoChildren) "/" "Trash/Sent Messages"', '(\\HasNoChildren) "/" "Sync Issues/Server Failures"', '(\\HasNoChildren) "/" "Sync Issues/Local Failures"', '(\\HasNoChildren) "/" "Sync Issues/Conflicts"', '(\\HasChildren) "/" "Sync Issues"', '(\\HasNoChildren) "/" "Junk E-mail"', '(\\HasNoChildren) "/" "Drafts"', '(\\HasChildren) "/" "Trash"', '(\\HasNoChildren) "/" "Sent"', '(\\HasNoChildren) "/" "Outbox"', '(\\HasNoChildren) "/" "INBOX"']) >>> m.select() 02:21.37 > HLFI3 SELECT INBOX 02:30.87 < * 1548 EXISTS 02:30.87 last 4 IMAP4 interactions: 00:16.73 < * OK [CAPABILITY IMAP4REV1 AUTH=LOGIN MOVE] IMAP4rev1 DavMail 4.3.0-2125 server ready 00:16.73 > HLFI0 CAPABILITY 00:16.74 < * CAPABILITY IMAP4REV1 AUTH=LOGIN MOVE 00:16.77 < HLFI0 OK CAPABILITY completed Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/imaplib.py", line 649, in select typ, dat = self._simple_command(name, mailbox) File "/usr/lib/python2.7/imaplib.py", line 1070, in _simple_command return self._command_complete(name, self._command(name, *args)) File "/usr/lib/python2.7/imaplib.py", line 899, in _command_complete raise self.abort('command: %s => %s' % (name, val)) imaplib.abort: command: SELECT => unexpected response: '* 1548 EXISTS' I understand that this seems to be occurring because of the extra spaces in the final RETURN from a query on stack overflow http://stackoverflow.com/questions/16911238/python-imaplib-error-unexpected-repsonse and it was suggested I file an issue report. I'm using Davmail as the server on Ubuntu 13.04 and the server works fine with Thunderbird, Fetchmail and Evolution My first attempt at filing an issue so apologies if I've done something wrong. ---------- components: email messages: 190733 nosy: barry, r.david.murray, tahnoon priority: normal severity: normal status: open title: python imaplib - error 'unexpected repsonse' type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 03:13:59 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 07 Jun 2013 01:13:59 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1370567639.08.0.17414110772.issue18153@psf.upfronthosting.co.za> R. David Murray added the comment: I think that technically the server is out of spec with the RFC. It isn't 100% clear, though since while the RFC says extra spaces are invalid, it also says that an untagged response is formed by "prefixing the token '*'", without otherwise mentioning it in the BNF. So one assumes, based on the rest of the document, that a single space follows the '*', and anything else is invalid. Now, the RFC says the server MUST reject malformed commands from the client, but does not speak to what the client should do given malformed responses from the server. So, it might indeed be reasonable to "fix" imaplib to handle an arbitrary number of spaces after the '*'. IMO Davmail should be fixed, though. IMAP is a finicky protocol. ---------- versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 07:56:35 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 07 Jun 2013 05:56:35 +0000 Subject: [issue18150] Duplicate test inside TestSingleDispatch In-Reply-To: <1370531892.77.0.178198886311.issue18150@psf.upfronthosting.co.za> Message-ID: <1370584595.08.0.325944587834.issue18150@psf.upfronthosting.co.za> Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file30484/duplicate_test_for_testsingledispatch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 07:58:56 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 07 Jun 2013 05:58:56 +0000 Subject: [issue18150] Duplicate test inside TestSingleDispatch In-Reply-To: <1370531892.77.0.178198886311.issue18150@psf.upfronthosting.co.za> Message-ID: <1370584736.95.0.0426917204728.issue18150@psf.upfronthosting.co.za> Vajrasky Kok added the comment: I think to test the mro case, we have to test the multiple inheritance with the same ancestor case. Attached my guess of the correct test should be. ---------- Added file: http://bugs.python.org/file30491/test_mro.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 09:45:20 2013 From: report at bugs.python.org (Palm Kevin) Date: Fri, 07 Jun 2013 07:45:20 +0000 Subject: [issue13843] Python doesn't compile anymore on our Solaris buildbot: undefined libintl_* symbols In-Reply-To: <1327354335.3.0.0960870172041.issue13843@psf.upfronthosting.co.za> Message-ID: <1370591120.86.0.0970373795717.issue13843@psf.upfronthosting.co.za> Palm Kevin added the comment: The `-lintl` fix did not work in my case. But I succeeded to compile Python using the CC compiler (/usr/bin/cc) instead of GCC compiler. (cc: Sun C 5.12 SunOS_sparc 2011/11/16) ---------- nosy: +palm.kevin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 09:50:11 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Jun 2013 07:50:11 +0000 Subject: [issue13843] Python doesn't compile anymore on our Solaris buildbot: undefined libintl_* symbols In-Reply-To: <1370591120.86.0.0970373795717.issue13843@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > But I succeeded to compile Python using the CC compiler (/usr/bin/cc) instead of GCC compiler. I may be interesting to check if CC searchs header files in the same directories than GCC. Same question for libraries. Using GCC, it can be seen in the command line: -I and -L options. But GCC has also a builtin list of directories, I don't know how to get this list. 2013/6/7 Palm Kevin : > > Palm Kevin added the comment: > > The `-lintl` fix did not work in my case. > But I succeeded to compile Python using the CC compiler (/usr/bin/cc) instead of GCC compiler. > > (cc: Sun C 5.12 SunOS_sparc 2011/11/16) > > ---------- > nosy: +palm.kevin > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 10:08:37 2013 From: report at bugs.python.org (Palm Kevin) Date: Fri, 07 Jun 2013 08:08:37 +0000 Subject: [issue18154] make install failed on solaris Message-ID: <1370592517.54.0.994664040442.issue18154@psf.upfronthosting.co.za> New submission from Palm Kevin: On Solaris, make install fails on target altbininstall. This is due to the fact than on Solaris you man not create a symlink using `ln -sf` -> You have to use `ln -f -s`. (SunOS sol1 5.10 Generic_147440-09 sun4u sparc SUNW,Sun-Fire-V240) ---------- components: Build messages: 190738 nosy: palm.kevin priority: normal severity: normal status: open title: make install failed on solaris versions: Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 10:20:26 2013 From: report at bugs.python.org (Palm Kevin) Date: Fri, 07 Jun 2013 08:20:26 +0000 Subject: [issue18154] make install failed on solaris In-Reply-To: <1370592517.54.0.994664040442.issue18154@psf.upfronthosting.co.za> Message-ID: <1370593226.25.0.850427704101.issue18154@psf.upfronthosting.co.za> Palm Kevin added the comment: fixing patch attached ---------- keywords: +patch Added file: http://bugs.python.org/file30492/Makefile.pre.in.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 10:25:38 2013 From: report at bugs.python.org (Palm Kevin) Date: Fri, 07 Jun 2013 08:25:38 +0000 Subject: [issue18154] make install failed on solaris In-Reply-To: <1370592517.54.0.994664040442.issue18154@psf.upfronthosting.co.za> Message-ID: <1370593538.21.0.822069189534.issue18154@psf.upfronthosting.co.za> Changes by Palm Kevin : Removed file: http://bugs.python.org/file30492/Makefile.pre.in.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 10:25:48 2013 From: report at bugs.python.org (Palm Kevin) Date: Fri, 07 Jun 2013 08:25:48 +0000 Subject: [issue18154] make install failed on solaris In-Reply-To: <1370592517.54.0.994664040442.issue18154@psf.upfronthosting.co.za> Message-ID: <1370593548.51.0.4686139691.issue18154@psf.upfronthosting.co.za> Changes by Palm Kevin : Added file: http://bugs.python.org/file30493/Makefile.pre.in.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 11:05:22 2013 From: report at bugs.python.org (Palm Kevin) Date: Fri, 07 Jun 2013 09:05:22 +0000 Subject: [issue18154] make install failed on solaris In-Reply-To: <1370592517.54.0.994664040442.issue18154@psf.upfronthosting.co.za> Message-ID: <1370595922.35.0.0144404445473.issue18154@psf.upfronthosting.co.za> Changes by Palm Kevin : Added file: http://bugs.python.org/file30494/Makefile.pre.in.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 11:05:30 2013 From: report at bugs.python.org (Palm Kevin) Date: Fri, 07 Jun 2013 09:05:30 +0000 Subject: [issue18154] make install failed on solaris In-Reply-To: <1370592517.54.0.994664040442.issue18154@psf.upfronthosting.co.za> Message-ID: <1370595930.25.0.419484984377.issue18154@psf.upfronthosting.co.za> Changes by Palm Kevin : Removed file: http://bugs.python.org/file30493/Makefile.pre.in.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 11:26:33 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Jun 2013 09:26:33 +0000 Subject: [issue18116] getpass.unix_getpass() always fallback to sys.stdin In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370597193.6.0.523934877356.issue18116@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Here is a patch which fixes getpass bug: unix_getpass() always fallback to sys.stdin. As side effect it also fixes resource warning in getpass(). I'm not sure I have correctly changed tests. David, could you please review the patch? ---------- nosy: +gregory.p.smith, r.david.murray stage: -> patch review title: getpass.getpass() triggers ResourceWarning -> getpass.unix_getpass() always fallback to sys.stdin type: resource usage -> behavior Added file: http://bugs.python.org/file30495/getpass_tty.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 11:33:06 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 07 Jun 2013 09:33:06 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370597586.37.0.838756515155.issue3329@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: I'd like to add some argument to providing a "file" and "line number" to the allocation api. I know that currently this is not provided e.g. by the PyMem_Allocate() functions, but I think it would be wise to provide a "debug" version of these functions that pass in the call sites. An allocator api that then also allows for these values to be provided to the malloc/realloc/free routines is then future-proof in that respect. Case in point: We have a memory profiler running which uses a allocator hook system similar to what Victor is proposing. But in addition, it provides a "file " and "line" argument to every function. Now, the profiler is currently not using this code. Here how the "malloc" function looks: static void * PyMalloc(size_t size, void *arg, const char *file, int line, const char *msg) { void *r = DustMalloc(size); if (r) { tmAllocEx(g_telemetryContext, file, line, r, size, "Python alloc: %s", msg); ReportAllocInfo(AllocEvent, 0, r, size); } return r; } tmAllocEx is calling the Telemetry memory profiles and passing in the allocation site. (http://www.radgametools.com/telemetry.htm, also my blog about using it: http://cosmicpercolator.com/2012/05/25/optimizing-python-condition-variables-with-telemetry/ But our profiler, called with ReportAllocInfo, isn't using this. It relies solely on extracting the python callstack. Today, I got this email (see attached file Capture.jpg) Basically, the profiler sees a lot of allocated memory with no python call stack. Now it would be useful if we had the C call site information, to know where it came from. So: My suggestion is that the allocator api be 1) a struct, which allows for a cleaner api function 2) Include C filename and line number. Even though the current python memory API (e.g. PyMem_Malloc(), PyObject_Malloc()) do not currently support it, this would allow us to internally have _extended_ versions of these apis that do support it and macros that pass in that information. This can be added at a later stage. Having it in the allcoator api function would make it more future proof. See also my "pymem.h" and "ccpmem.h" files attached to this defect for examples on how we have tweaked python's internal memory apis to support this information. ---------- Added file: http://bugs.python.org/file30496/Capture.JPG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 13:09:19 2013 From: report at bugs.python.org (Dave Challis) Date: Fri, 07 Jun 2013 11:09:19 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex Message-ID: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> New submission from Dave Challis: When attempting to detect the presence of CSV headers, delimiters are passed to a regex function without escaping, which causes an exception if a delimiter which has meaning in a regex (e.g. '+', '*' etc.) is used. Code to reproduce: import csv s = csv.Sniffer() s.has_header('"x"+"y"') Trace: Traceback (most recent call last): File "t.py", line 4, in s.has_header('"x"+"y"') File "/usr/lib64/python3.3/csv.py", line 393, in has_header rdr = reader(StringIO(sample), self.sniff(sample)) File "/usr/lib64/python3.3/csv.py", line 183, in sniff self._guess_quote_and_delimiter(sample, delimiters) File "/usr/lib64/python3.3/csv.py", line 268, in _guess_quote_and_delimiter {'delim':delim, 'quote':quotechar}, re.MULTILINE) File "/home/dsc/venv/p3compat/lib64/python3.3/re.py", line 214, in compile return _compile(pattern, flags) File "/home/dsc/venv/p3compat/lib64/python3.3/re.py", line 281, in _compile p = sre_compile.compile(pattern, flags) File "/home/dsc/venv/p3compat/lib64/python3.3/sre_compile.py", line 494, in compile p = sre_parse.parse(p, flags) File "/home/dsc/venv/p3compat/lib64/python3.3/sre_parse.py", line 748, in parse p = _parse_sub(source, pattern, 0) File "/home/dsc/venv/p3compat/lib64/python3.3/sre_parse.py", line 360, in _parse_sub itemsappend(_parse(source, state)) File "/home/dsc/venv/p3compat/lib64/python3.3/sre_parse.py", line 696, in _parse p = _parse_sub(source, state) File "/home/dsc/venv/p3compat/lib64/python3.3/sre_parse.py", line 360, in _parse_sub itemsappend(_parse(source, state)) File "/home/dsc/venv/p3compat/lib64/python3.3/sre_parse.py", line 696, in _parse p = _parse_sub(source, state) File "/home/dsc/venv/p3compat/lib64/python3.3/sre_parse.py", line 360, in _parse_sub itemsappend(_parse(source, state)) File "/home/dsc/venv/p3compat/lib64/python3.3/sre_parse.py", line 569, in _parse raise error("nothing to repeat") sre_constants.error: nothing to repeat ---------- components: Library (Lib) messages: 190742 nosy: davechallis priority: normal severity: normal status: open title: csv.Sniffer.has_header doesn't escape characters used in regex type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 13:47:29 2013 From: report at bugs.python.org (Jean-Paul Calderone) Date: Fri, 07 Jun 2013 11:47:29 +0000 Subject: [issue17134] Use Windows' certificate store for CA certs In-Reply-To: <1360078143.8.0.938168290854.issue17134@psf.upfronthosting.co.za> Message-ID: <1370605649.68.0.0307377559609.issue17134@psf.upfronthosting.co.za> Jean-Paul Calderone added the comment: > Sounds promising. Do you think this should be hooked into SSLContext.set_default_verify_paths, or be exposed as a separate method? If there were an API which exposed the certificate material, then this would be more useful to libraries trying to do other things (present debugging information, use an alternate SSL implementation *wink*, etc). If this is *only* wrapped up inside set_default_verify_paths then many of these extra things are impossible with a seconding binding to the same API. ---------- nosy: +exarkun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 14:56:22 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jun 2013 12:56:22 +0000 Subject: [issue17134] Use Windows' certificate store for CA certs In-Reply-To: <1360078143.8.0.938168290854.issue17134@psf.upfronthosting.co.za> Message-ID: <1370609782.54.0.243719663111.issue17134@psf.upfronthosting.co.za> Christian Heimes added the comment: Yes, I'm planing to expose the low level API. I prefer to do as much work in Python space as possible. The information is just too useful to 3rd parties, too. I'm thinking about one low level function that interfaces Windows's cert store. The rest can be build on top of this function and #18138. enum_system_store(store_name, cert_type="certificate") -> [(cert_data, encoding_type), ...] store_name: name of the store (e.g. "CA", "MY", "ROOT"), see http://msdn.microsoft.com/en-us/library/windows/desktop/aa376560%28v=vs.85%29.aspx cert_type: "certificate" or "crl" data: certificate bytes (as far as I know the certs are stored in DER format) encoding_type: integer encoding X509_ASN_ENCODING or PKCS_7_ASN_ENCODING ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 15:21:53 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 07 Jun 2013 13:21:53 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <1370611313.53.0.713742427183.issue18155@psf.upfronthosting.co.za> R. David Murray added the comment: I doubt this is a regression, so I'm marking the others versions as well without actually testing it. Should be an easy fix. ---------- keywords: +easy nosy: +r.david.murray stage: -> needs patch versions: +Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 15:29:08 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 07 Jun 2013 13:29:08 +0000 Subject: [issue18116] getpass.unix_getpass() always fallback to sys.stdin In-Reply-To: <1370130607.39.0.486408621645.issue18116@psf.upfronthosting.co.za> Message-ID: <1370611748.26.0.589134257034.issue18116@psf.upfronthosting.co.za> R. David Murray added the comment: The test changes look correct to me, but it sure would be nice to come up with less fragile tests. For a function like this, though, it probably isn't possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 16:21:55 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Jun 2013 14:21:55 +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: <3bRmC61kgRzSLb@mail.python.org> Roundup Robot added the comment: New changeset ed498f477549 by Vinay Sajip in branch 'default': Closes #11959: SMTPServer and SMTPChannel now take an optional map, use of which avoids affecting global state. http://hg.python.org/cpython/rev/ed498f477549 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 16:37:49 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Jun 2013 14:37:49 +0000 Subject: [issue17903] Python launcher for windows should search path for #!/usr/bin/env In-Reply-To: <1367662362.6.0.575670511803.issue17903@psf.upfronthosting.co.za> Message-ID: <3bRmYT0hVdzSbY@mail.python.org> Roundup Robot added the comment: New changeset a174d79cef2e by Vinay Sajip in branch 'default': Issue #17903: Added path search changes to launcher. http://hg.python.org/cpython/rev/a174d79cef2e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 16:42:01 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 07 Jun 2013 14:42:01 +0000 Subject: [issue17342] datetime.strptime does not implement %z In-Reply-To: <1362320710.15.0.670090383938.issue17342@psf.upfronthosting.co.za> Message-ID: <1370616121.62.0.386853158281.issue17342@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Python 2.x is in maintenance mode and will not receive new features. In 3.x this is already implemented: Python 3.3.2 (default, May 24 2013, 22:46:58) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from datetime import * >>> print(datetime.strptime('20010101 010101 -0400', '%Y%m%d %H%M%S %z')) 2001-01-01 01:01:01-04:00 ---------- nosy: +belopolsky resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 16:54:09 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 14:54:09 +0000 Subject: [issue18136] test_distutils failing under OS X 10.8 w/ clang In-Reply-To: <1370382090.88.0.902200330561.issue18136@psf.upfronthosting.co.za> Message-ID: <1370616849.11.0.310709338221.issue18136@psf.upfronthosting.co.za> Brett Cannon added the comment: > echo $CPPFLAGS -I /Users/bcannon/Developer/include -I/Users/bcannon/Developer/Cellar/readline/6.2.4/include > echo $LDFLAGS -L /Users/bcannon/Developer/lib -L/Users/bcannon/Developer/Cellar/readline/6.2.4/lib > echo $CFLAGS -Wno-unused-value -Wno-empty-body -Qunused-arguments So ~/Developer/include does have Python installations in there (it's my homebrew include directory) along with sqlite3 and any other packages I have installed to be able to test more. Chances are the headers in homebrew are taking precedence over what's in the build directory during test_distutils run and that's where the conflict is coming in. If that's true, does this simply mean I need to build Python without any installed libraries to avoid this conflict? Or does this go away if I don't have Homebrew in a non-standard location? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:01:01 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 07 Jun 2013 15:01:01 +0000 Subject: [issue18136] test_distutils failing under OS X 10.8 w/ clang In-Reply-To: <1370616849.11.0.310709338221.issue18136@psf.upfronthosting.co.za> Message-ID: Ronald Oussoren added the comment: On 7 Jun, 2013, at 16:54, Brett Cannon wrote: > > If that's true, does this simply mean I need to build Python without any installed libraries to avoid this conflict? That's correct. There are other bugreports about other python installations influencing the build, although I'd have to search for the bug number. IMHO the root cause for this is that the source/build directories for Python's build are inserted at the wrong location in the compiler search path. Fixing that should be fairly easy, but does require search through the makefile and configure script, which is why I haven't actually tried to fix this yet. > Or does this go away if I don't have Homebrew in a non-standard location? Doesn't homebrew use /usr/local as the default location? That would be worse, as there is no easy way to tell the compiler to exclude /usr/local from its default search path. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:20:45 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 15:20:45 +0000 Subject: [issue18136] Put local build paths before system build paths in configure.ac and Makefile.pre.in In-Reply-To: <1370382090.88.0.902200330561.issue18136@psf.upfronthosting.co.za> Message-ID: <1370618445.97.0.381510282092.issue18136@psf.upfronthosting.co.za> Brett Cannon added the comment: I'll change the title to make it more obvious what the problem is. And yes, Homebrew by default uses /usr/local if I remember correctly. ---------- title: test_distutils failing under OS X 10.8 w/ clang -> Put local build paths before system build paths in configure.ac and Makefile.pre.in _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:28:19 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jun 2013 15:28:19 +0000 Subject: [issue17134] Use Windows' certificate store for CA certs In-Reply-To: <1360078143.8.0.938168290854.issue17134@psf.upfronthosting.co.za> Message-ID: <1370618899.28.0.193729739789.issue17134@psf.upfronthosting.co.za> Christian Heimes added the comment: First patch. I have not yet verified that the return data can be loaded by openssl. Also I need to verify the error paths and add some tests, too. ---------- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file30497/enumcertstore.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:31:50 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 15:31:50 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError Message-ID: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> New submission from Brett Cannon: Much like ImportError now has 'name' and 'path', AttributeError should get an 'attr' attribute that can only be set through a keyword argument or after creating an instance. That would make the common ``try/except AttributeError`` uses much more robust by not accidentally swallowing an AttributeError that has nothing to do with the attribute in question:: try: cls.meth() except AttributeError as exc: if exc.attr != 'meth': raise ---------- components: Interpreter Core messages: 190754 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Add an 'attr' attribute to AttributeError type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:36:43 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 07 Jun 2013 15:36:43 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <1370619403.62.0.911195885426.issue18155@psf.upfronthosting.co.za> Vajrasky Kok added the comment: Attached the patch to fix the problem. ---------- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file30498/csv_has_header.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:38:13 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 07 Jun 2013 15:38:13 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <1370619493.7.0.512035027164.issue18155@psf.upfronthosting.co.za> Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file30498/csv_has_header.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:40:53 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 07 Jun 2013 15:40:53 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <1370619653.37.0.033248557057.issue18155@psf.upfronthosting.co.za> Vajrasky Kok added the comment: Sorry. This one is correct. Attached the patch to fix the problem. ---------- Added file: http://bugs.python.org/file30499/csv_has_header.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:44:40 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 07 Jun 2013 15:44:40 +0000 Subject: [issue17134] Use Windows' certificate store for CA certs In-Reply-To: <1360078143.8.0.938168290854.issue17134@psf.upfronthosting.co.za> Message-ID: <1370619880.5.0.0850715398517.issue17134@psf.upfronthosting.co.za> Christian Heimes added the comment: I fixed a ref leak and added some tests. ---------- Added file: http://bugs.python.org/file30500/enumcertstore2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:45:50 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Jun 2013 15:45:50 +0000 Subject: [issue17314] Stop using imp.find_module() in multiprocessing In-Reply-To: <1361994994.99.0.625564916049.issue17314@psf.upfronthosting.co.za> Message-ID: <3bRp3x3n3YzQMK@mail.python.org> Roundup Robot added the comment: New changeset 97adaa820353 by Brett Cannon in branch 'default': Issue #17314: Stop using imp in multiprocessing.forking and move over http://hg.python.org/cpython/rev/97adaa820353 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 17:46:09 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 15:46:09 +0000 Subject: [issue17314] Stop using imp.find_module() in multiprocessing In-Reply-To: <1361994994.99.0.625564916049.issue17314@psf.upfronthosting.co.za> Message-ID: <1370619969.03.0.442481202214.issue17314@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 18:11:37 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 07 Jun 2013 16:11:37 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <1370621497.95.0.833551344729.issue18155@psf.upfronthosting.co.za> Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file30499/csv_has_header.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 18:12:19 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Fri, 07 Jun 2013 16:12:19 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <1370621539.72.0.300140133486.issue18155@psf.upfronthosting.co.za> Vajrasky Kok added the comment: Added test to sniffer double quote. ---------- Added file: http://bugs.python.org/file30501/csv_has_header.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:18:46 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Jun 2013 17:18:46 +0000 Subject: [issue18055] Stop using imp in IDLE In-Reply-To: <1369496414.51.0.562875229152.issue18055@psf.upfronthosting.co.za> Message-ID: <3bRr793Cp9zQxq@mail.python.org> Roundup Robot added the comment: New changeset a0d8ae880ae6 by Brett Cannon in branch '3.3': Issue #18055: Move to importlib from imp for IDLE. http://hg.python.org/cpython/rev/a0d8ae880ae6 New changeset 3a3ec484ce95 by Brett Cannon in branch 'default': merge w/ 3.3 for issue #18055 http://hg.python.org/cpython/rev/3a3ec484ce95 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:19:17 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 17:19:17 +0000 Subject: [issue18055] Stop using imp in IDLE In-Reply-To: <1369496414.51.0.562875229152.issue18055@psf.upfronthosting.co.za> Message-ID: <1370625557.1.0.282349621887.issue18055@psf.upfronthosting.co.za> Brett Cannon added the comment: Thanks for the help everyone! ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:27:01 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Jun 2013 17:27:01 +0000 Subject: [issue7732] imp.find_module crashes Python if there exists a directory named "__init__.py" In-Reply-To: <1263816426.99.0.320342241745.issue7732@psf.upfronthosting.co.za> Message-ID: <3bRrJh6gyWzR8x@mail.python.org> Roundup Robot added the comment: New changeset bf882390713c by Brett Cannon in branch 'default': Issue #7732: Move an imp.find_module test from test_import to http://hg.python.org/cpython/rev/bf882390713c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:29:01 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 17:29:01 +0000 Subject: [issue14797] Deprecate imp.find_module()/load_module() In-Reply-To: <1336926729.01.0.715234386918.issue14797@psf.upfronthosting.co.za> Message-ID: <1370626141.0.0.681034166585.issue14797@psf.upfronthosting.co.za> Brett Cannon added the comment: Current status (with test_imp stripped out): > ack "imp\.(find|load)_module" Lib Lib/modulefinder.py 482: return imp.find_module(name, path) Lib/pkgutil.py 189: file, filename, etc = imp.find_module(subname, path) 251: mod = imp.load_module(fullname, self.file, self.filename, self.etc) Lib/pydoc.py 47:# - imp.load_module() cannot be prevented from clobbering existing 280: module = imp.load_module(name, file, path, (ext, 'r', kind)) Lib/test/test_importhooks.py 118: file, filename, stuff = imp.find_module(subname, path) 132: mod = imp.load_module(fullname, self.file, self.filename, self.stuff) ---------- versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:40:55 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 17:40:55 +0000 Subject: [issue14797] Deprecate imp.find_module()/load_module() In-Reply-To: <1336926729.01.0.715234386918.issue14797@psf.upfronthosting.co.za> Message-ID: <1370626855.37.0.239288639868.issue14797@psf.upfronthosting.co.za> Brett Cannon added the comment: The modulefinder usage is directly exposed in its API as the return value of a find_module method, which makes removal a pain. Adding Thomas Heller to see what he has to say. The pkgutil usage is in classes that have been deprecated, so don't care. The rest should be workable and I will file separate bugs. ---------- nosy: +theller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:41:54 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 17:41:54 +0000 Subject: [issue18157] remove usage of imp.load_module() from pydoc Message-ID: <1370626914.2.0.873203030907.issue18157@psf.upfronthosting.co.za> New submission from Brett Cannon: ---------- assignee: brett.cannon components: Library (Lib) messages: 190765 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: remove usage of imp.load_module() from pydoc type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:43:10 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 17:43:10 +0000 Subject: [issue18158] Delete test_importhooks Message-ID: <1370626990.67.0.389270737108.issue18158@psf.upfronthosting.co.za> New submission from Brett Cannon: Tests don't serve much of a purpose with test_importlib covering the uses, plus the tests are old and are not worth updating. ---------- assignee: brett.cannon components: Tests messages: 190766 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Delete test_importhooks versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:43:36 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 17:43:36 +0000 Subject: [issue14797] Deprecate imp.find_module()/load_module() In-Reply-To: <1336926729.01.0.715234386918.issue14797@psf.upfronthosting.co.za> Message-ID: <1370627016.61.0.817929238548.issue14797@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- dependencies: +Delete test_importhooks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:43:50 2013 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Fri, 07 Jun 2013 17:43:50 +0000 Subject: [issue18159] ConfigParser getters not available on SectionProxy Message-ID: <1370627030.12.0.961792763365.issue18159@psf.upfronthosting.co.za> New submission from Jo?o Bernardo: The configparser.RawConfigParser class implements some `get` methods: get, getint, getfloat, getboolean but if any of these get overridden on a subclass(with other arguments) or new ones are added (e.g. getlist), there's no way a SectionProxy instance will be able to use them. class DemoParser(ConfigParser): def getlist(self, section, option): return self.get(section, option).split() parser = DemoParser() parser.read(some_file) # These 2 lines should be equivalent, like "getint", but the # second doesn't work because of the SectionProxy instance parser.getlist('some_section', 'foo') parser['some_section'].getlist('foo') Reading the code, for SectionProxy, it redefines all the get* methods from RawConfigParser, and that looks pretty bad... A more elegant approach would be to fetch the function on the parser instance and bound to the section name with `lambda` or `functools.partial`... Something like: class SectionProxy(...): ... def __getattr__(self, attr): if not attr.startswith('get'): raise AttributeError(attr) fn = getattr(self._parser, attr) return lambda *args, **kw: fn(self._name, *args, **kw) ---------- components: Library (Lib) messages: 190767 nosy: JBernardo priority: normal severity: normal status: open title: ConfigParser getters not available on SectionProxy type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 19:44:14 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 17:44:14 +0000 Subject: [issue14797] Deprecate imp.find_module()/load_module() In-Reply-To: <1336926729.01.0.715234386918.issue14797@psf.upfronthosting.co.za> Message-ID: <1370627054.46.0.257807796196.issue14797@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- dependencies: +remove usage of imp.load_module() from pydoc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 20:14:36 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 07 Jun 2013 18:14:36 +0000 Subject: [issue18159] ConfigParser getters not available on SectionProxy In-Reply-To: <1370627030.12.0.961792763365.issue18159@psf.upfronthosting.co.za> Message-ID: <1370628876.2.0.942321432516.issue18159@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 20:27:56 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 07 Jun 2013 18:27:56 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1370629676.78.0.971529711007.issue18156@psf.upfronthosting.co.za> Changes by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 20:44:58 2013 From: report at bugs.python.org (=?utf-8?q?Tambet_V=C3=A4li?=) Date: Fri, 07 Jun 2013 18:44:58 +0000 Subject: [issue18160] Packaging more coherent Python Message-ID: <1370630698.76.0.469541388091.issue18160@psf.upfronthosting.co.za> New submission from Tambet V?li: Hello! First the issue: my usual way of installing programming environments, languages and platforms is to install all the available modules from standard repositories, or if there is some "all-good" or "batteries-included" metapackage, I sure install this. I surely favor installing Python packages through standard Linux repositories. In last year or so, the number of available libraries has grown 'exponentially' for Python in the Linux Mint (Debian) repositories. Some of them are not trivial to install - by simply installing python-prefixed packages, I got my Ubuntu broken, because Window Manager of this version of Linux won't display window borders, menus or anything to navigate around if it does not have OpenGL working - it just displays window content and one can do almost anything with it. I did not trust this installation anymore and I did install a new Linux, Debian Mint. To avoid this kind of problems, there should be python-prefixed metapackages, which contain library collections for different kinds of tasks (for example, web programming should interface me with all apache, mysql, postgres, etc., whereas game programming should give nice collection for sound and video). These collections should be safe and work well together, where possible, or be usable - because for good programming language, predefined set of good libraries is critical. So that I could choose all those metapackages, know that I can play around and still my system is safe. ---------- components: Installation messages: 190768 nosy: Tambet.V?li priority: normal severity: normal status: open title: Packaging more coherent Python type: enhancement versions: 3rd party, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 20:59:29 2013 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 07 Jun 2013 18:59:29 +0000 Subject: [issue18160] Packaging more coherent Python In-Reply-To: <1370630698.76.0.469541388091.issue18160@psf.upfronthosting.co.za> Message-ID: <1370631569.53.0.690473368423.issue18160@psf.upfronthosting.co.za> Ezio Melotti added the comment: This bug tracker is not the best place for this kind of requests. Those packages are made by the maintainers of the several distributions, so you should suggest this to them. If you want some kind of feedback from Python users/devs you could try the python-list or perhaps python-ideas mailing lists. (Also having e.g. a python-web package which contains all the possible web frameworks doesn't sound like a good idea, since I will likely just use only one of them.) ---------- nosy: +ezio.melotti resolution: -> invalid stage: -> committed/rejected status: open -> closed versions: -3rd party, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 21:40:42 2013 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Fri, 07 Jun 2013 19:40:42 +0000 Subject: [issue18161] call fchdir if subprocess.Popen(cwd=integer|fileobject) Message-ID: <1370634042.31.0.748329507458.issue18161@psf.upfronthosting.co.za> New submission from ???? ?????????: Today, subprocess allow to change directory only by using its name. What if I have only file descriptor referring to that dir? It will be nice if such feture will be implemented. Now, I use preexc_fn to call os.fchdir() by hand. We should handle close_fds *AFTER* calling fchdir() :) ---------- components: Library (Lib) messages: 190770 nosy: mmarkk priority: normal severity: normal status: open title: call fchdir if subprocess.Popen(cwd=integer|fileobject) type: enhancement versions: Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 21:53:29 2013 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Jun 2013 19:53:29 +0000 Subject: [issue18148] Make of Python 3.2.2 fails on Solaris SPARC In-Reply-To: <1370522977.23.0.850120192524.issue18148@psf.upfronthosting.co.za> Message-ID: <1370634809.9.0.214431897247.issue18148@psf.upfronthosting.co.za> Ned Deily added the comment: Issue15050, which was closed without resolution, reported a similar issue. Also, Issue15963 documents some suggestions and proposed changes to make builds easier to configure on legacy platforms like Solaris SPARC. Perhaps they may be of help. Also, Python 3.2.2 is quite out-of-date. The current and final bug fix release of 3.2 is 3.2.5. The current maintenance release for Python 3 is 3.3.2. Please retry with these. (I note you selected "Cross-Build" as a component; for python-dev, that refers to building a Python on one platform that is targeted to run on a different type of platform. I assume that this is not the case here, e.g. you are building on Solaris SPARC to run on Solaris SPARC, and so Cross-Build does not apply.) ---------- components: +Build -Cross-Build nosy: +ned.deily, trent _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 21:57:22 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 07 Jun 2013 19:57:22 +0000 Subject: [issue18159] ConfigParser getters not available on SectionProxy In-Reply-To: <1370627030.12.0.961792763365.issue18159@psf.upfronthosting.co.za> Message-ID: <1370635042.84.0.804383645102.issue18159@psf.upfronthosting.co.za> ?ukasz Langa added the comment: This is a reasonable feature request. Overriding __getattr__ doesn't look like the best solution, though. Let me think this over. ---------- assignee: -> lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:09:35 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 07 Jun 2013 20:09:35 +0000 Subject: [issue5135] Expose simplegeneric function in functools module In-Reply-To: <1233604660.52.0.0984436233806.issue5135@psf.upfronthosting.co.za> Message-ID: <1370635775.9.0.0217903034845.issue5135@psf.upfronthosting.co.za> ?ukasz Langa added the comment: For the record, this has been implemented as PEP 443. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:26:29 2013 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Jun 2013 20:26:29 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <1370636789.36.0.471935511661.issue18149@psf.upfronthosting.co.za> Ned Deily added the comment: It seems like this would be a fairly rare situation and, as you note, dependent on the underlying file system. But it would be easy to add a new function to the module to clear its cache in cases where it is known this might be a problem. In fact, in Issue11802 a clear_cache function was proposed to solve the problem of the cache growing without bounds but that problem was solved by the simpler solution of discarding the cache when it gets above 100 entries. ---------- keywords: +easy nosy: +nadeem.vawda, ned.deily, rhettinger stage: -> needs patch title: filecmp.cmp() - cache invalidation fails when file modification times haven't changed -> filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution versions: +Python 3.4 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:26:30 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Jun 2013 20:26:30 +0000 Subject: [issue18150] Duplicate test inside TestSingleDispatch In-Reply-To: <1370531892.77.0.178198886311.issue18150@psf.upfronthosting.co.za> Message-ID: <3bRwHp1NkBzQxq@mail.python.org> Roundup Robot added the comment: New changeset a16bebe653b1 by ?ukasz Langa in branch 'default': Fixed #18150: duplicate test inside TestSingleDispatch http://hg.python.org/cpython/rev/a16bebe653b1 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:29:01 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 07 Jun 2013 20:29:01 +0000 Subject: [issue18150] Duplicate test inside TestSingleDispatch In-Reply-To: <1370531892.77.0.178198886311.issue18150@psf.upfronthosting.co.za> Message-ID: <1370636941.79.0.867105160577.issue18150@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Good catch. Thanks for the patch, Vajrasky. ---------- assignee: -> lukasz.langa resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:51:00 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 20:51:00 +0000 Subject: [issue18162] Add index attribute to IndexError Message-ID: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> New submission from Brett Cannon: Give IndexError an index attribute to store the index it was raised for. Since it is typically an integer there is no reason to worry about GC and thus using a regex. ---------- components: Interpreter Core messages: 190777 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Add index attribute to IndexError type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:51:56 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 20:51:56 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError Message-ID: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> New submission from Brett Cannon: KeyError could grow a 'key' attribute for the key that triggered the exception. Since keys are expected to be immutable (in order to be hashable) there is no GC issue to worry about. ---------- components: Interpreter Core messages: 190778 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Add a 'key' attribute to KeyError type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:52:24 2013 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Jun 2013 20:52:24 +0000 Subject: [issue18164] Embedding Python doc incorrectly refers to LINKFORSHARED Message-ID: <1370638344.32.0.268021495329.issue18164@psf.upfronthosting.co.za> New submission from Ned Deily: This is in reference to section 5.6 of the "Extending and Embedding Python" doc. This has come up recently where third-party projects are using LINKEDFORHARED instead of the results of python-config when linking an embedded Python into their projects. See discussion in Issue3588. Also, the updates to section 5.6 made for Python 3 should be backported to the Python 2.7 doc. http://docs.python.org/3/extending/embedding.html#compiling-and-linking-under-unix-like-systems http://docs.python.org/2/extending/embedding.html#linking-requirements ---------- assignee: ned.deily components: Documentation messages: 190779 nosy: ned.deily priority: normal severity: normal stage: needs patch status: open title: Embedding Python doc incorrectly refers to LINKFORSHARED versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:55:26 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 20:55:26 +0000 Subject: [issue18165] Add 'unexpected_type' to TypeError Message-ID: <1370638526.17.0.473449662068.issue18165@psf.upfronthosting.co.za> New submission from Brett Cannon: TypeError could grow an 'unexpected_type' attribute to store the type of the argument that was used to trigger the exception. Since types are expected to not be deleted there is no GC worry. Having an 'expected' attribute makes no sense in the face of a union of types, etc. (unless the assumption of a frozenset is made for the attribute). Plus exceptions typically do not contain info on what would have been acceptable (although in this instance it may make sense). ---------- components: Interpreter Core messages: 190780 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Add 'unexpected_type' to TypeError type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:56:29 2013 From: report at bugs.python.org (Wichert Akkerman) Date: Fri, 07 Jun 2013 20:56:29 +0000 Subject: [issue18164] Embedding Python doc incorrectly refers to LINKFORSHARED In-Reply-To: <1370638344.32.0.268021495329.issue18164@psf.upfronthosting.co.za> Message-ID: <1370638589.59.0.684837746248.issue18164@psf.upfronthosting.co.za> Changes by Wichert Akkerman : ---------- nosy: +wichert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 22:56:56 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 07 Jun 2013 20:56:56 +0000 Subject: [issue18166] 'value' attribute for ValueError Message-ID: <1370638616.72.0.719325929736.issue18166@psf.upfronthosting.co.za> New submission from Brett Cannon: A 'value attribute for ValueError could store a weakref to the value which triggered the exception. It should be a weakref so at to prevent accidental prevention of GC of the value. ---------- components: Interpreter Core messages: 190781 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: 'value' attribute for ValueError type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 23:11:01 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 07 Jun 2013 21:11:01 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1370639461.41.0.351834249755.issue18163@psf.upfronthosting.co.za> R. David Murray added the comment: I don't see how the fact that keys are immutable implies there are no GC issues. A tuple can be involved in a cycle, for example. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 23:23:14 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 07 Jun 2013 21:23:14 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1370640194.11.0.170644025987.issue18163@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 23:23:35 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 07 Jun 2013 21:23:35 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1370640215.64.0.532396888999.issue18162@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 23:23:57 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 07 Jun 2013 21:23:57 +0000 Subject: [issue18166] 'value' attribute for ValueError In-Reply-To: <1370638616.72.0.719325929736.issue18166@psf.upfronthosting.co.za> Message-ID: <1370640237.39.0.0643627996389.issue18166@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 7 23:24:11 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 07 Jun 2013 21:24:11 +0000 Subject: [issue18165] Add 'unexpected_type' to TypeError In-Reply-To: <1370638526.17.0.473449662068.issue18165@psf.upfronthosting.co.za> Message-ID: <1370640251.67.0.175945782658.issue18165@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 01:01:12 2013 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Jun 2013 23:01:12 +0000 Subject: [issue17903] Python launcher for windows should search path for #!/usr/bin/env In-Reply-To: <1367662362.6.0.575670511803.issue17903@psf.upfronthosting.co.za> Message-ID: <1370646072.89.0.492895510723.issue17903@psf.upfronthosting.co.za> Changes by Vinay Sajip : ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 02:03:34 2013 From: report at bugs.python.org (Alex Gaynor) Date: Sat, 08 Jun 2013 00:03:34 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1370649814.21.0.627394735679.issue18156@psf.upfronthosting.co.za> Alex Gaynor added the comment: +1 on this, but it's worth noting that that fix is not 100% correct (though it's obviously better than most existing equivilants), it's potentially wrong with custom __getattr__, __getattribute__, descriptors. ---------- nosy: +alex _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 02:46:59 2013 From: report at bugs.python.org (Chris AtLee) Date: Sat, 08 Jun 2013 00:46:59 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines Message-ID: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> New submission from Chris AtLee: cgi.FieldStorage uses fp.readline(1 << 16) to read in POSTed file data if no content length has been specified. All HTTP clients I've looked at terminate the file body with CRLF and then the final MIME boundary. If the file body is 65,535 bytes, and doesn't contain \n or \r\n, then fp.readline(1 << 16) will return the original 65,535 bytes of the file plus the \r from the final \r\n sequence before the final boundary string. Since \r isn't considered a line ending, it gets considered as part of the POSTed file data, and you end up with an extra \r at the end of the file data. ---------- components: Library (Lib) files: cgi-test-cpython.patch keywords: patch messages: 190784 nosy: catlee priority: normal severity: normal status: open title: cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file30502/cgi-test-cpython.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 02:52:33 2013 From: report at bugs.python.org (Chris AtLee) Date: Sat, 08 Jun 2013 00:52:33 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1370652753.2.0.115220958335.issue18167@psf.upfronthosting.co.za> Chris AtLee added the comment: This is a possible fix to this issue. It's not as clean as I'd like, but the simpler versions I tried could end up with the entire file contents in memory for degenerate (or malicious) inputs. The trick is handling the case where the current line ends with \r. We can't know if this is just a normal character in the file, or represents the end of a line until we see the start of the next line. ---------- Added file: http://bugs.python.org/file30503/cgi-cpython.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 03:43:43 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 08 Jun 2013 01:43:43 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1370655823.66.0.876015054521.issue18163@psf.upfronthosting.co.za> Brett Cannon added the comment: So are you arguing it should be a weakref, or just saying you view the statement as false? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 03:47:09 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 08 Jun 2013 01:47:09 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1370656029.25.0.0885721785785.issue18156@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Such custom implementations should be updated to support this wonderful new attr. :) ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 03:54:05 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 08 Jun 2013 01:54:05 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1370656445.2.0.556359201672.issue18156@psf.upfronthosting.co.za> Brett Cannon added the comment: What Benjamin said. Adding something like this is mostly about a nicer constructor (``AttributeError(attr='meth')``) and automatically creating the message for the exception (although that would require another argument like 'object' or something to be able to do e.g. "'dict' object has no attribute 'asdfdsff'" or "type object 'dict' has no attribute 'asdfdsf'"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 03:54:37 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 08 Jun 2013 01:54:37 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1370656477.14.0.462963366343.issue18156@psf.upfronthosting.co.za> Brett Cannon added the comment: And standardizing on an attribute name, of course. =) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 03:56:51 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 08 Jun 2013 01:56:51 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <1370656611.96.0.696515636069.issue18149@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 for a cache clearing function like the one in re.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 04:18:37 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 08 Jun 2013 02:18:37 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1370657917.29.0.326747210926.issue18163@psf.upfronthosting.co.za> R. David Murray added the comment: I'm arguing that the statement is false. I think that whether or not it should be a weakref in this and the other cases depends on whether you think an exception object should keep an object alive or not. It is fairly unlikely that a key would get into a cycle with an error message, though certainly not impossible. The "keep alive" question probably boils down to whether or not we want it to be the case that clearing the traceback attribute releases all the "extra" pointers an exception holds on to, or if it is acceptable that an arbitrary number of additional attributes might do so. I'm inclined to think that using weakrefs would make using the attributes more complicated for relatively little gain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 05:41:22 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 08 Jun 2013 03:41:22 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1370662882.96.0.212634276172.issue18167@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 05:52:16 2013 From: report at bugs.python.org (halfjuice) Date: Sat, 08 Jun 2013 03:52:16 +0000 Subject: [issue18168] plistlib output self-sorted dictionary Message-ID: <1370663536.42.0.663795573436.issue18168@psf.upfronthosting.co.za> New submission from halfjuice: Even with OrderedDict, the plistlib will still output the dict in its own order. Search for sorted(d.items()) in plistlib.py and you will know why. It is certainly warm-hearted to sort this before putting it into plist file but I think sometimes we just want a customized order. ---------- components: Library (Lib) messages: 190792 nosy: halfjuice priority: normal severity: normal status: open title: plistlib output self-sorted dictionary type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 06:38:09 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 08 Jun 2013 04:38:09 +0000 Subject: [issue18151] Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) In-Reply-To: <1370538152.36.0.501706446334.issue18151@psf.upfronthosting.co.za> Message-ID: <3bS7C45bkdzQxq@mail.python.org> Roundup Robot added the comment: New changeset 2fe64ce5da05 by Terry Jan Reedy in branch '3.3': #18151, part 1: Backport idlelilb portion of Andrew Svetlov's 3.4 patch http://hg.python.org/cpython/rev/2fe64ce5da05 New changeset 0be613638523 by Terry Jan Reedy in branch 'default': #18151 null merge with 3.3. http://hg.python.org/cpython/rev/0be613638523 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 06:38:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 08 Jun 2013 04:38:10 +0000 Subject: [issue16715] Get rid of IOError. Use OSError instead In-Reply-To: <3YW0Xs2j15zRkN@mail.python.org> Message-ID: <3bS7C53pxZzQxq@mail.python.org> Roundup Robot added the comment: New changeset 2fe64ce5da05 by Terry Jan Reedy in branch '3.3': #18151, part 1: Backport idlelilb portion of Andrew Svetlov's 3.4 patch http://hg.python.org/cpython/rev/2fe64ce5da05 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 10:36:13 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jun 2013 08:36:13 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370680573.47.0.911099794216.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: Hopefully the final bit of code, plus docs. Code changes: _names_ are reserved Doc changes (different from the PEP): examples of AutoEnum, UniqueEnum, and OrderedEnum ---------- Added file: http://bugs.python.org/file30504/pep-0435.08.stoneleaf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 10:38:01 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jun 2013 08:38:01 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370680681.9.0.706956263482.issue17947@psf.upfronthosting.co.za> Changes by Ethan Furman : Removed file: http://bugs.python.org/file30504/pep-0435.08.stoneleaf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 10:38:44 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jun 2013 08:38:44 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370680724.17.0.885505156394.issue17947@psf.upfronthosting.co.za> Changes by Ethan Furman : Added file: http://bugs.python.org/file30505/pep-0435.08.stoneleaf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 10:39:34 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jun 2013 08:39:34 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370680774.66.0.846366445456.issue17947@psf.upfronthosting.co.za> Changes by Ethan Furman : Removed file: http://bugs.python.org/file30505/pep-0435.08.stoneleaf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 10:41:08 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jun 2013 08:41:08 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370680868.28.0.36333500032.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: Apologies for the noise -- was having trouble getting the correct patch attached. :/ ---------- Added file: http://bugs.python.org/file30506/pep-0435.09.stoneleaf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 11:29:49 2013 From: report at bugs.python.org (Phil Connell) Date: Sat, 08 Jun 2013 09:29:49 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370683789.68.0.777109578041.issue18111@psf.upfronthosting.co.za> Changes by Phil Connell : ---------- nosy: +pconnell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 11:31:48 2013 From: report at bugs.python.org (Phil Connell) Date: Sat, 08 Jun 2013 09:31:48 +0000 Subject: [issue18112] PEP 442 implementation Message-ID: <1370683908.0.0.349447645502.issue18112@psf.upfronthosting.co.za> Changes by Phil Connell : ---------- nosy: +isoschiz, pconnell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 11:33:54 2013 From: report at bugs.python.org (Phil Connell) Date: Sat, 08 Jun 2013 09:33:54 +0000 Subject: [issue18129] Fatal Python error: Cannot recover from stack overflow. In-Reply-To: <1370297932.54.0.350896209872.issue18129@psf.upfronthosting.co.za> Message-ID: <1370684034.4.0.391073067602.issue18129@psf.upfronthosting.co.za> Changes by Phil Connell : ---------- nosy: +pconnell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 11:37:01 2013 From: report at bugs.python.org (koobs) Date: Sat, 08 Jun 2013 09:37:01 +0000 Subject: [issue16715] Get rid of IOError. Use OSError instead In-Reply-To: <3YW0Xs2j15zRkN@mail.python.org> Message-ID: <1370684221.72.0.145475630706.issue16715@psf.upfronthosting.co.za> koobs added the comment: Commit to 3.3 broke at least my FreeBSD buildbot: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%20dtrace%203.3/builds/641/steps/test/logs/stdio Also setting +Version: Python 3.3 on this. ---------- nosy: +koobs versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 11:46:05 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 08 Jun 2013 09:46:05 +0000 Subject: [issue15528] Better support for finalization with weakrefs In-Reply-To: <1343837927.06.0.561023898829.issue15528@psf.upfronthosting.co.za> Message-ID: <1370684765.06.0.407921555542.issue15528@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Your patch leaks references with subinterpreters, which was exposed by functools.singledispatch using weakref. While the actual bug is in atexit (which doesn't properly unregister on subinterpreter termination), now all uses of weakref leak. Context: http://mail.python.org/pipermail/python-dev/2013-June/126755.html PJE suggests importing atexit and registering finalize only when it's actually used. I guess this would be the easiest workaround. ---------- assignee: -> sbt nosy: +lukasz.langa resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 11:58:40 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 Jun 2013 09:58:40 +0000 Subject: [issue16715] Get rid of IOError. Use OSError instead In-Reply-To: <3YW0Xs2j15zRkN@mail.python.org> Message-ID: <1370685520.51.0.60312993302.issue16715@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I don't think so. The idle test, test_idle, passed. The patch did not even affect any of the three idle files that it currently tests. Just because a commit triggers a test does not mean that it is the cause of any failure that happens. The log says the failure was in test_subprocess. ''' FAIL: test_wait_timeout (test.test_subprocess.ProcessTestCaseNoPoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.3.koobs-freebsd/build/Lib/test/test_subprocess.py", line 953, in test_wait_timeout p.wait(timeout=0.0001) AssertionError: TimeoutExpired not raised ''' As I interpret the traceback, this did not fail is the re-run. I did not set 3.3, nor reopen, because this patch is primarily part of a new issue, #18151. I cross-referenced this one so that if anyone else thought of backporting some of the mega patch, this backport would be recorded here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 12:12:49 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Jun 2013 10:12:49 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370686369.0.0.94317887813.issue18111@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> patch review versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 12:49:59 2013 From: report at bugs.python.org (koobs) Date: Sat, 08 Jun 2013 10:49:59 +0000 Subject: [issue16715] Get rid of IOError. Use OSError instead In-Reply-To: <3YW0Xs2j15zRkN@mail.python.org> Message-ID: <1370688599.41.0.778650113504.issue16715@psf.upfronthosting.co.za> koobs added the comment: Apologies for the noise Terry, rebuilding passes. Unsetting versions: 3.3 Is the failure on the build I reported worth opening an issue for? ---------- versions: -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 13:34:30 2013 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 08 Jun 2013 11:34:30 +0000 Subject: [issue17343] Add a version of str.split which returns an iterator In-Reply-To: <1362359066.58.0.311917237277.issue17343@psf.upfronthosting.co.za> Message-ID: <1370691270.34.0.736056956288.issue17343@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 16:04:34 2013 From: report at bugs.python.org (Eric Snow) Date: Sat, 08 Jun 2013 14:04:34 +0000 Subject: [issue7796] No way to find out if an object is an instance of a namedtuple In-Reply-To: <1264608669.85.0.379125118171.issue7796@psf.upfronthosting.co.za> Message-ID: <1370700274.54.0.592500319053.issue7796@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 17:21:37 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 08 Jun 2013 15:21:37 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370704897.48.0.34254381983.issue18143@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Your "raw" parameter is one too many IMO. You should find a way to present all relevant information in a single API call. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 17:53:59 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 08 Jun 2013 15:53:59 +0000 Subject: [issue15528] Better support for finalization with weakrefs In-Reply-To: <1343837927.06.0.561023898829.issue15528@psf.upfronthosting.co.za> Message-ID: <3bSQBt0yZqzNk8@mail.python.org> Roundup Robot added the comment: New changeset d6ad9d7468f7 by Richard Oudkerk in branch 'default': Issue #15528: Delay importing atexit until weakref.finalize() used. http://hg.python.org/cpython/rev/d6ad9d7468f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 17:55:42 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jun 2013 15:55:42 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370706942.8.0.57690941379.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: So, which is better? To have a @unique class decorator as part of the module, or to have a UniqueEnum recipe in the docs? A decorator is immediately usable, but requires remembering an extra line of code. An example requires being put into a local utility module, but also serves as a guide to customising Enums. (Took be about five tries to get it right. :/ ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 17:56:47 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 08 Jun 2013 15:56:47 +0000 Subject: [issue17375] Add docstrings to methods in the threading module In-Reply-To: <1362648255.88.0.520762515957.issue17375@psf.upfronthosting.co.za> Message-ID: <1370707007.98.0.654423062901.issue17375@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: -eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 17:57:00 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 08 Jun 2013 15:57:00 +0000 Subject: [issue1772673] Replacing char* with const char* Message-ID: <1370707020.47.0.0385136919376.issue1772673@psf.upfronthosting.co.za> Changes by Eli Bendersky : ---------- nosy: -eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 18:00:19 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 08 Jun 2013 16:00:19 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370707219.47.0.187037191393.issue17947@psf.upfronthosting.co.za> Eli Bendersky added the comment: Nick prudently moved the unique discussion to its own issue - 18042. Let's get the initial implementation & docs committed first (without unique in the implementation, although it's fine to have it as an example in the docs for now), close this issue, and then discuss in 18042 whether unique should be part of the stdlib-provided API or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 18:05:17 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 08 Jun 2013 16:05:17 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370707517.87.0.517944875566.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: Good idea, thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 18:20:11 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 08 Jun 2013 16:20:11 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370708411.43.0.0989171078931.issue17947@psf.upfronthosting.co.za> Eli Bendersky added the comment: I sent a fresh review - nothing major; it's very near commit readiness now. Additional changes can be done after the initial commit. We have time until 3.4 beta (November 2013) to tweak stuff (and the documentation whenever...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 18:37:05 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 08 Jun 2013 16:37:05 +0000 Subject: [issue18042] Provide enum.unique class decorator In-Reply-To: <1369299378.37.0.789518154232.issue18042@psf.upfronthosting.co.za> Message-ID: <1370709425.76.0.842342556783.issue18042@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 18:38:03 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 08 Jun 2013 16:38:03 +0000 Subject: [issue18042] Provide enum.unique class decorator In-Reply-To: <1369299378.37.0.789518154232.issue18042@psf.upfronthosting.co.za> Message-ID: <1370709483.38.0.457346139878.issue18042@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: +1 for the decorator! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 18:43:53 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 Jun 2013 16:43:53 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1370709833.17.0.530824562425.issue18143@psf.upfronthosting.co.za> Christian Heimes added the comment: How about a single return value: DefaultVerifyPaths = collections.namedtuple("DefaultVerifyPaths", "cafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capath") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 18:54:33 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sat, 08 Jun 2013 16:54:33 +0000 Subject: [issue15528] Better support for finalization with weakrefs In-Reply-To: <1343837927.06.0.561023898829.issue15528@psf.upfronthosting.co.za> Message-ID: <1370710473.04.0.0869936678613.issue15528@psf.upfronthosting.co.za> Richard Oudkerk added the comment: > PJE suggests importing atexit and registering finalize only when it's > actually used. I guess this would be the easiest workaround. Done. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:39:05 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 17:39:05 +0000 Subject: [issue8902] add datetime.time.now() for consistency In-Reply-To: <1275719789.45.0.168425659941.issue8902@psf.upfronthosting.co.za> Message-ID: <1370713145.66.0.390105983278.issue8902@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:39:54 2013 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Sat, 08 Jun 2013 17:39:54 +0000 Subject: [issue18159] ConfigParser getters not available on SectionProxy In-Reply-To: <1370627030.12.0.961792763365.issue18159@psf.upfronthosting.co.za> Message-ID: <1370713194.59.0.759802277566.issue18159@psf.upfronthosting.co.za> Jo?o Bernardo added the comment: > Overriding __getattr__ doesn't look like the best solution Another idea would be to allow the proxy class to be selectable, but this would require the user to do much more coding for this simple thing... I believe a proxy should be dynamic enough to avoid having to duplicate every function definition. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:40:37 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 17:40:37 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail In-Reply-To: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> Message-ID: <1370713237.04.0.259286354417.issue18110@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:41:57 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 17:41:57 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1370713317.21.0.302163155917.issue18113@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:42:30 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 17:42:30 +0000 Subject: [issue18119] urllib.FancyURLopener does not treat URL fragments correctly In-Reply-To: <1370168530.11.0.609209040554.issue18119@psf.upfronthosting.co.za> Message-ID: <1370713350.29.0.332138701989.issue18119@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti, orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:49:54 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 17:49:54 +0000 Subject: [issue18152] Idle: add 2.7 backport script In-Reply-To: <1370543391.75.0.919797325796.issue18152@psf.upfronthosting.co.za> Message-ID: <1370713794.31.0.563382188339.issue18152@psf.upfronthosting.co.za> Ezio Melotti added the comment: > 'Import' is as easy to use as Graft and as far as I know, the result > when successful is the same. I use import while importing patches from the tracker, but once I committed on 2.x it's easier to just graft instead of importing again (importing often requires you to generate a new patch and possibly you have to commit manually again after the import). > I know I 'should' learn to use kdiff3 effectively, but it seldom works > right for me, That's what learning it is supposed to avoid :) > and the live repository is the wrong place to learn by failure. As long as you check the result before pushing there shouldn't be any problems. If the merge goes wrong you can always rollback and try again (or try a different approach). You can also use "hg diff -c tip" to see the diff of the last commit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:50:41 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 08 Jun 2013 17:50:41 +0000 Subject: [issue14015] surrogateescape largely missing from documentation In-Reply-To: <1329245790.15.0.430373154575.issue14015@psf.upfronthosting.co.za> Message-ID: <1370713841.72.0.805899828204.issue14015@psf.upfronthosting.co.za> Changes by A.M. Kuchling : ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:51:30 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 17:51:30 +0000 Subject: [issue18156] Add an 'attr' attribute to AttributeError In-Reply-To: <1370619110.26.0.980030189702.issue18156@psf.upfronthosting.co.za> Message-ID: <1370713890.85.0.427686711346.issue18156@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- keywords: +easy nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 19:51:44 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 Jun 2013 17:51:44 +0000 Subject: [issue17134] Use Windows' certificate store for CA certs In-Reply-To: <1360078143.8.0.938168290854.issue17134@psf.upfronthosting.co.za> Message-ID: <1370713904.77.0.854011219209.issue17134@psf.upfronthosting.co.za> Christian Heimes added the comment: New patch with fixed doc string and indention. http://msdn.microsoft.com/en-us/library/windows/desktop/aa377189%28v=vs.85%29.aspx explains how encoding type shall be interpreted. I haven't seen PKCS#7 certs on my Windows system, though. Instead of a flag I could also return a string: "CERTIFICATE" for X509_ASN_ENCODING cert, "X509 CRL" for X509_ASN_ENCODING CRL or "PKCS7" for PKCS#7 encoded certs. ---------- Added file: http://bugs.python.org/file30507/enumcertstore3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 20:02:04 2013 From: report at bugs.python.org (Thomas Heller) Date: Sat, 08 Jun 2013 18:02:04 +0000 Subject: [issue14797] Deprecate imp.find_module()/load_module() In-Reply-To: <1370626855.37.0.239288639868.issue14797@psf.upfronthosting.co.za> Message-ID: <51B37243.5060305@ctypes.org> Thomas Heller added the comment: > The modulefinder usage is directly exposed in its API as the return > value of a find_module method, which makes removal a pain. Adding > Thomas Heller to see what he has to say. Some months ago, I have started to implement a brand-new modulefinder, which is based on importlib. It has a different API, but the (barely) documented API functions remain the same or could be made compatible. The advantage against the current modulefinder is that it finds modules in zipfiles, for example in zipped eggs. IMO it is not yet ready for inclusion into Python 3.4, but given the plans for the first alpha release in August I will hopefully find time to work on it a little bit more. If someone wants to read the code, or try it out: Modulefinder: http://code.google.com/p/ctypes-stuff/source/browse/trunk/mf/mf4.py Test: http://code.google.com/p/ctypes-stuff/source/browse/trunk/mf/maketest.py Thomas ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 20:02:56 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 08 Jun 2013 18:02:56 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370709833.17.0.530824562425.issue18143@psf.upfronthosting.co.za> Message-ID: <51B371D4.1050405@free.fr> Antoine Pitrou added the comment: > How about a single return value: > > DefaultVerifyPaths = collections.namedtuple("DefaultVerifyPaths", > "cafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capath") Sounds good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 20:28:28 2013 From: report at bugs.python.org (Mher Movsisyan) Date: Sat, 08 Jun 2013 18:28:28 +0000 Subject: [issue18168] plistlib output self-sorted dictionary In-Reply-To: <1370663536.42.0.663795573436.issue18168@psf.upfronthosting.co.za> Message-ID: <1370716108.58.0.820879051945.issue18168@psf.upfronthosting.co.za> Mher Movsisyan added the comment: I think this is not a bug. plistlib api accepts dict (not OrderedDict) and sorted output is a valid output. plistlib sorts dictionaries to be consistent with Apple's tools. property list format [1] uses CFDictionary [2] with CFString keys. CFDictionary is unordered and the plist example in the format [1] is unordered too. But plutil [3] command sorts dictionaries. It is easy to observe by self-converting plist files with "plutil -convert xml1 test.plist" command. 1. https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html 2. http://developer.apple.com/library/mac/#documentation/CoreFoundation/Reference/CFDictionaryRef/Reference/reference.html 3. https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/plutil.1.html ---------- nosy: +mher.movsisyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 20:29:13 2013 From: report at bugs.python.org (Eric Snow) Date: Sat, 08 Jun 2013 18:29:13 +0000 Subject: [issue7796] No way to find out if an object is an instance of a namedtuple In-Reply-To: <1264608669.85.0.379125118171.issue7796@psf.upfronthosting.co.za> Message-ID: <1370716153.6.0.0230113341009.issue7796@psf.upfronthosting.co.za> Eric Snow added the comment: It may not enough, but the use of namedtuples (vs. plain tuples) with functools.singledispatch() would be messier without a NamedTuple ABC (or other base type). Of course, when would you want to dispatch specifically on namedtuple? I can think of a few relatively weak uses, but not enough to justify the cost of establishing a common base class for namedtuple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 21:01:13 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Jun 2013 19:01:13 +0000 Subject: [issue18168] plistlib output self-sorted dictionary In-Reply-To: <1370663536.42.0.663795573436.issue18168@psf.upfronthosting.co.za> Message-ID: <1370718073.03.0.103627206141.issue18168@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +hynek, ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 21:05:23 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 19:05:23 +0000 Subject: [issue10652] test___all_ + test_tcl fails (Windows installed binary) In-Reply-To: <1291819198.8.0.493152862608.issue10652@psf.upfronthosting.co.za> Message-ID: <1370718323.71.0.430161708948.issue10652@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 21:22:48 2013 From: report at bugs.python.org (Roman Zeyde) Date: Sat, 08 Jun 2013 19:22:48 +0000 Subject: [issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux Message-ID: <1370719368.01.0.165210926264.issue18169@psf.upfronthosting.co.za> New submission from Roman Zeyde: Reproduction: Python 2.7.4 (default, Apr 19 2013, 18:28:01) [GCC 4.7.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import struct >>> struct.pack('!L', 0x01020304) '\x01\x02\x03\x04' >>> struct.pack('>L', 0x01020304) '\x01\x02\x03\x04' >>> struct.pack('>> struct.pack('L', 0x01020304) '\x04\x03\x02\x01\x00\x00\x00\x00' ### WAT??? ### >>> As far as I see at the source code (http://hg.python.org/releasing/2.7.4/file/9290822f2280/Modules/_struct.c#l703), sizeof(long) is used as the size of 'L', which is equal to 8 at 64bit Linux... The problem is that the results of packing with 'L' returns 8 bytes, instead of 4 - as was expected from the documentation... ---------- components: Interpreter Core messages: 190817 nosy: Roman.Zeyde priority: normal severity: normal status: open title: struct.pack() behaves strangely for 'L' on 64bit Linux type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 21:33:25 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 19:33:25 +0000 Subject: [issue18041] mention issues with code churn in the devguide In-Reply-To: <1369280251.47.0.219323501066.issue18041@psf.upfronthosting.co.za> Message-ID: <1370720005.13.0.635277506607.issue18041@psf.upfronthosting.co.za> Ezio Melotti added the comment: > I?ve actually seen two contrary kinds of advice and the best approach is most of the times something in between. Doing minor cleanups while touching the code is fine, but if most of the changes are cleanups then it gets distracting. In that case it's better to do the cleanups in a separate commit (either before or after). Regarding rewrapping paragraphs in the docs the situation is a bit different. There are 3 options: 1) change and rewrap in the same commit; 2) change but avoid rewrapping so that the changes are easier to detect; 3) like 2, but then add the rewrapping in a separate commit; 3) is overkill IMHO, and I don't think I've seen it used very often. 2) makes the diff more readable, but leaves the code unwrapped making it less readable for everyone else (and I would argue that reading code happens more often than reading diffs). 1) makes the diff less readable, but leaves wrapped code and it's IMHO the best compromise, and thus what I usually do. However, I think that the actual problem pointed out in the linked issue is about mass changes, rather than cleanups while touching code for other reasons. Even for that it depends on the case: how many files/lines are affected, what benefits are brought by the change, how complex are the changes, how likely is to introduce new bugs while doing them and so on. A couple of generic guidelines could be added to the devguide, but there's no hard rule for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 21:45:59 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 19:45:59 +0000 Subject: [issue18034] Last two entries in the programming FAQ are out of date (import related) In-Reply-To: <1369244115.61.0.298181094271.issue18034@psf.upfronthosting.co.za> Message-ID: <1370720759.93.0.936600677809.issue18034@psf.upfronthosting.co.za> Ezio Melotti added the comment: imp.reload() doesn't seem to be deprecated, and importlib.reload() doesn't exist. Is there another alternative or it just hasn't been moved somewhere else? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 21:46:46 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 08 Jun 2013 19:46:46 +0000 Subject: [issue4153] Unicode HOWTO up to date? In-Reply-To: <1224525840.81.0.649106205615.issue4153@psf.upfronthosting.co.za> Message-ID: <1370720806.39.0.18517395828.issue4153@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Continuing my tour of the howtos, here's a patch making many of the changes discussed here and on issue13997. Changes made: * state that python3 source encoding is UTF-8, and give examples * mention surrogateescape in the 'tips and tricks' section, and backslashreplace in the "Python's Unicode Support" section. * default filesystem encoding is now UTF-8, not ascii. * link to Nick Coghlan's and Ned Batchelder's notes/presentations. * remove revision history * remove usage of "I think", "I'm not going to", etc. * update acks section Things I did *not* do, though they were suggested: * Move tip "Software should only work with Unicode strings internally" from the last section to somewhere earlier and more prominent. Perhaps it could go somewhere in the "Python's Unicode Support" section. * mention codecs.StreamRecoder and StreamReaderWriter (I could put this in 'tips and tricks'). * Examples should be properly marked up to allow sphinx to run them and check the output. (May not be possible.) * mention unicode support in re module * clarify some more terms (e.g. codepoints, code units, characters, possibly scalar values etc.) -- I don't see why they matter, since we don't use them. ---------- Added file: http://bugs.python.org/file30508/unicode-howto.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 21:47:28 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 19:47:28 +0000 Subject: [issue18036] "How do I create a .pyc file?" FAQ entry is out of date In-Reply-To: <1369244271.04.0.495588356743.issue18036@psf.upfronthosting.co.za> Message-ID: <1370720848.58.0.811985108148.issue18036@psf.upfronthosting.co.za> Ezio Melotti added the comment: FTR here's a link to the FAQ: http://docs.python.org/3/faq/programming.html#how-do-i-create-a-pyc-file ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 21:48:40 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 19:48:40 +0000 Subject: [issue18034] Last two entries in the programming FAQ are out of date (import related) In-Reply-To: <1369244115.61.0.298181094271.issue18034@psf.upfronthosting.co.za> Message-ID: <1370720920.52.0.00645459340538.issue18034@psf.upfronthosting.co.za> Ezio Melotti added the comment: FTR here is a link to the FAQs: http://docs.python.org/3/faq/programming.html#import-x-y-z-returns-module-x-how-do-i-get-z ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 22:26:52 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 20:26:52 +0000 Subject: [issue18033] Example for Profile Module shows incorrect method In-Reply-To: <1369235558.14.0.532987051887.issue18033@psf.upfronthosting.co.za> Message-ID: <1370723212.4.0.844275738785.issue18033@psf.upfronthosting.co.za> Ezio Melotti added the comment: Thanks for the patches, however the Python 2 example doesn't work. I think a BytesIO should be used instead of a StringIO, and print_stats() only returns a pstats.Stats instance, without actually printing any result. I wonder if print_results was an old method that has been removed and if now there's another way to print the results. I haven't tried on Python 3 yet, but the same comment might apply there too. ---------- stage: needs patch -> patch review versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 22:30:48 2013 From: report at bugs.python.org (Stefan Krah) Date: Sat, 08 Jun 2013 20:30:48 +0000 Subject: [issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux In-Reply-To: <1370719368.01.0.165210926264.issue18169@psf.upfronthosting.co.za> Message-ID: <1370723448.88.0.659874326711.issue18169@psf.upfronthosting.co.za> Stefan Krah added the comment: The docs say: "Native size and alignment are determined using the C compiler?s sizeof expression. This is always combined with native byte order." sizeof(long) is 8 on your platform, so I don't see anything wrong here. Or is another part of the documentation unclear? ---------- nosy: +skrah status: open -> pending type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 23:10:24 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 08 Jun 2013 21:10:24 +0000 Subject: [issue17691] Fix test discovery for test_univnewlines.py In-Reply-To: <1365621545.24.0.445008426691.issue17691@psf.upfronthosting.co.za> Message-ID: <3bSYD01NJJzRgM@mail.python.org> Roundup Robot added the comment: New changeset a2e093e98d45 by Ezio Melotti in branch '3.3': #17691: test_univnewlines now works with unittest test discovery. Patch by Zachary Ware. http://hg.python.org/cpython/rev/a2e093e98d45 New changeset d1b5e41acf28 by Ezio Melotti in branch 'default': #17691: merge with 3.3. http://hg.python.org/cpython/rev/d1b5e41acf28 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 23:10:55 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 21:10:55 +0000 Subject: [issue17691] Fix test discovery for test_univnewlines.py In-Reply-To: <1365621545.24.0.445008426691.issue17691@psf.upfronthosting.co.za> Message-ID: <1370725855.77.0.518877541622.issue17691@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the patch! ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 23:41:34 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 21:41:34 +0000 Subject: [issue18048] Merging test_pep263.py and test_coding.py In-Reply-To: <1369387812.98.0.236232283698.issue18048@psf.upfronthosting.co.za> Message-ID: <1370727694.35.0.579151254727.issue18048@psf.upfronthosting.co.za> Ezio Melotti added the comment: > e.g. test_source_encoding This SGTM. I particularly dislike test_pep*, especially when I can't remember the pep number. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 23:46:04 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sat, 08 Jun 2013 21:46:04 +0000 Subject: [issue12226] use HTTPS by default for uploading packages to pypi In-Reply-To: <1306860665.45.0.32361907398.issue12226@psf.upfronthosting.co.za> Message-ID: <1370727964.92.0.477239518394.issue12226@psf.upfronthosting.co.za> anatoly techtonik added the comment: This should have been backported to Python 2. I expect some related attacks on EuroPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 8 23:51:15 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 21:51:15 +0000 Subject: [issue18124] Broken build on target machine with incorrect hostname (non-ascii) In-Reply-To: <1370238052.82.0.116613237858.issue18124@psf.upfronthosting.co.za> Message-ID: <1370728275.48.0.982321361314.issue18124@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- stage: -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:05:37 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 08 Jun 2013 22:05:37 +0000 Subject: [issue18126] Update links to NumPy resources in documentation In-Reply-To: <1370266286.34.0.85536188421.issue18126@psf.upfronthosting.co.za> Message-ID: <3bSZRh2ZkSz7LlH@mail.python.org> Roundup Robot added the comment: New changeset dacd8f430e0e by Ezio Melotti in branch '2.7': #18126: update NumPy links in the documentation. Patch by Yury V. Zaytsev. http://hg.python.org/cpython/rev/dacd8f430e0e New changeset aafa11c1dd61 by Ezio Melotti in branch '3.3': #18126: update NumPy links in the documentation. Patch by Yury V. Zaytsev. http://hg.python.org/cpython/rev/aafa11c1dd61 New changeset 1f0b6462ea3c by Ezio Melotti in branch 'default': #18126: merge with 3.3. http://hg.python.org/cpython/rev/1f0b6462ea3c ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:07:19 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 22:07:19 +0000 Subject: [issue18126] Update links to NumPy resources in documentation In-Reply-To: <1370266286.34.0.85536188421.issue18126@psf.upfronthosting.co.za> Message-ID: <1370729239.44.0.00117214720138.issue18126@psf.upfronthosting.co.za> Ezio Melotti added the comment: Fixed, thanks for the report and the patch! ---------- assignee: docs at python -> ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:09:12 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 22:09:12 +0000 Subject: [issue17691] Fix test discovery for test_univnewlines.py In-Reply-To: <1365621545.24.0.445008426691.issue17691@psf.upfronthosting.co.za> Message-ID: <1370729352.51.0.24774966329.issue17691@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- assignee: -> ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:15:51 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 22:15:51 +0000 Subject: [issue18053] Add checks for Misc/NEWS in make patchcheck In-Reply-To: <1369453600.75.0.470507945427.issue18053@psf.upfronthosting.co.za> Message-ID: <1370729751.93.0.53100305789.issue18053@psf.upfronthosting.co.za> Ezio Melotti added the comment: Not sure it's worth making the logic more complicated just to save one line in some occasions. Hiding the messages about configure and pyconfig.h.in when they are not needed would save two lines and it should be simpler to do, but if you have something specific in mind feel free to propose a patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:18:08 2013 From: report at bugs.python.org (Donald Stufft) Date: Sat, 08 Jun 2013 22:18:08 +0000 Subject: [issue12226] use HTTPS by default for uploading packages to pypi In-Reply-To: <1306860665.45.0.32361907398.issue12226@psf.upfronthosting.co.za> Message-ID: <1370729888.8.0.70110138241.issue12226@psf.upfronthosting.co.za> Donald Stufft added the comment: I would +! backporting this, but It's not massively required since it only protects against passive attacks. It would however make things a little nicer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:26:19 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sat, 08 Jun 2013 22:26:19 +0000 Subject: [issue12226] use HTTPS by default for uploading packages to pypi In-Reply-To: <1306860665.45.0.32361907398.issue12226@psf.upfronthosting.co.za> Message-ID: <1370730379.74.0.295773644647.issue12226@psf.upfronthosting.co.za> anatoly techtonik added the comment: If somebody sponsor my visit to EuroPython, I will dedicate some time to prepare a demo uploading rogue packages using sniffed credentials over WiFi without owner's consent. After moving to CDN no upload logs are available, so it is even more secure for attacker to do this stuff. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:28:41 2013 From: report at bugs.python.org (Donald Stufft) Date: Sat, 08 Jun 2013 22:28:41 +0000 Subject: [issue12226] use HTTPS by default for uploading packages to pypi In-Reply-To: <1306860665.45.0.32361907398.issue12226@psf.upfronthosting.co.za> Message-ID: <1370730521.36.0.23914109908.issue12226@psf.upfronthosting.co.za> Donald Stufft added the comment: Uploading always hits the backend servers and thus has the same logging as before Merely switching to HTTPS only provides protections against passive attacks. You need verification to protect against active attacks (which are simple and easy to do as well). Like I said, not a bad move and I'd be in agreement on doing it but if the powers that be decide it's too big of a change it's not going to massively decrease the security. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:33:21 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 08 Jun 2013 22:33:21 +0000 Subject: [issue4153] Unicode HOWTO up to date? In-Reply-To: <1224525840.81.0.649106205615.issue4153@psf.upfronthosting.co.za> Message-ID: <1370730801.53.0.909538014442.issue4153@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Updated version of my patch, which adds two more todo items and handles Ezio's review comments: * Switch from Greek examples to French, and remove non-Latin-1 characters. * Change language for bytes.decode to "but supports a few more possible handlers". * Describe Unicode support in the re module. * Describe StreamRecoder. I don't see why StreamReaderWriter would need to be mentioned. I do not intend to do the remaining items on the todo list (clarify some more terms; make it work with doctest). ---------- Added file: http://bugs.python.org/file30509/unicode-howto.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:35:23 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 08 Jun 2013 22:35:23 +0000 Subject: [issue18034] Last two entries in the programming FAQ are out of date (import related) In-Reply-To: <1369244115.61.0.298181094271.issue18034@psf.upfronthosting.co.za> Message-ID: <1370730923.28.0.482557266698.issue18034@psf.upfronthosting.co.za> Brett Cannon added the comment: Hasn't been moved yet. And the __import__ question should probably be rephrased as "don't do this". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:35:29 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 08 Jun 2013 22:35:29 +0000 Subject: [issue18034] Last two entries in the programming FAQ are out of date (import related) In-Reply-To: <1369244115.61.0.298181094271.issue18034@psf.upfronthosting.co.za> Message-ID: <1370730929.51.0.544810966022.issue18034@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- dependencies: +Document/deprecate imp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:49:35 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Jun 2013 22:49:35 +0000 Subject: [issue18106] There are unused variables in Lib/test/test_collections.py In-Reply-To: <1369988012.39.0.245549184475.issue18106@psf.upfronthosting.co.za> Message-ID: <1370731775.61.0.721036009125.issue18106@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:51:10 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Jun 2013 22:51:10 +0000 Subject: [issue18038] Unhelpful error message on invalid encoding specification In-Reply-To: <1369262596.73.0.912726466313.issue18038@psf.upfronthosting.co.za> Message-ID: <1370731870.7.0.163455969047.issue18038@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 00:55:47 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Jun 2013 22:55:47 +0000 Subject: [issue18101] Tk.split() doesn't work with nested Unicode strings In-Reply-To: <1369922361.42.0.622055843561.issue18101@psf.upfronthosting.co.za> Message-ID: <1370732147.57.0.326521059992.issue18101@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 01:34:24 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 08 Jun 2013 23:34:24 +0000 Subject: [issue6632] Include more fullwidth chars in the decimal codec In-Reply-To: <1249317285.35.0.709481915004.issue6632@psf.upfronthosting.co.za> Message-ID: <1370734464.35.0.064594816195.issue6632@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 01:54:59 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 08 Jun 2013 23:54:59 +0000 Subject: [issue18170] define built-in exceptions in Python code Message-ID: <1370735699.37.0.350073873785.issue18170@psf.upfronthosting.co.za> New submission from Brett Cannon: This quite possibly won't work because of performance, but I have been wondering how feasible it would be to define as many core exception types as possible in pure Python code and then freeze the module for loading. It would have the benefit of making maintenance easier (e.g. all of the PEP 3151 exceptions would have been simpler to add). It also would make it easier on other VMs by minimizing the number of exceptions that have to be written in their implementation language. Implementation-wise, it's probably easiest to start with leaf exceptions in the inheritance hierarchy and then slowly port more and more. Any exceptions ported to pure Python would have their PyExc_* variable set to their parent so that the variable is initialized to some exception before any Python code is touched. The real trick will come down to dealing with situations where some specific C API has been exposed (e.g. UnicodeError). Even if this experiment turns out to be feasible and reasonable in terms of simplifying C code, the other question is performance. If this costs more than a couple percent of overall performance (and quite possibly not even at that expense) this would not be worth it. ---------- components: Interpreter Core messages: 190837 nosy: brett.cannon priority: low severity: normal stage: needs patch status: open title: define built-in exceptions in Python code type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 03:51:41 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 09 Jun 2013 01:51:41 +0000 Subject: [issue18053] Add checks for Misc/NEWS in make patchcheck In-Reply-To: <1369453600.75.0.470507945427.issue18053@psf.upfronthosting.co.za> Message-ID: <1370742701.68.0.333765956331.issue18053@psf.upfronthosting.co.za> R. David Murray added the comment: It's not about saving lines in the output, it's about saving space in the developer's brain/workflow efficiency. That said, it is only valuable if it is reasonably reliable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 04:08:13 2013 From: report at bugs.python.org (Julian Berman) Date: Sun, 09 Jun 2013 02:08:13 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1370743693.41.0.948540968126.issue18111@psf.upfronthosting.co.za> Julian Berman added the comment: New patchset addressing review. Not sure why upload.py isn't working for me (I assume it should?) ---------- Added file: http://bugs.python.org/file30510/minmax.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 05:45:12 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sun, 09 Jun 2013 03:45:12 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1370749512.16.0.119422889599.issue18162@psf.upfronthosting.co.za> ?ric Araujo added the comment: regex? do you mean weakref? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 06:06:14 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Jun 2013 04:06:14 +0000 Subject: [issue4153] Unicode HOWTO up to date? In-Reply-To: <1370730801.53.0.909538014442.issue4153@psf.upfronthosting.co.za> Message-ID: Nick Coghlan added the comment: amk's latest patch looks like a very nice improvement to me. One suggested wording tweak for the aside about the simplified history: s/The average Python programmer doesn't need to know the historical details/The precise historical details aren't relevant to understanding how to use Unicode effectively/ (and then continue with "; if you're curious ..." as it does now) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 06:46:00 2013 From: report at bugs.python.org (Ethan Furman) Date: Sun, 09 Jun 2013 04:46:00 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370753160.18.0.800531127113.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: Doc updates are in. I removed the 'unique, constant' from the first line of the intro, as neither of those things are necessarily true. ---------- Added file: http://bugs.python.org/file30511/pep-0435.10.stoneleaf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 06:46:20 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 09 Jun 2013 04:46:20 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1370753180.96.0.988771622593.issue18081@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 07:11:18 2013 From: report at bugs.python.org (Robert Collins) Date: Sun, 09 Jun 2013 05:11:18 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1370754678.17.0.881454238147.issue18054@psf.upfronthosting.co.za> Robert Collins added the comment: Hey, feel free to +nosy me on unittest things :). Julian pinged me on IRC about this - Jml and I would be delight to prepare a patchset for assertThat for unittest and as much of the core of Matchers as makes sense. The bare core can come in without any of the things that Michael is concerned about vis-a-vis unneeded complexity in testtools [e.g. nothing about arbitrary attachments is needed]. We can state from experience - both ours and users that have adopted it - that the decoupling assertThat brings is very effective at ending the forced-hierarchy-or-mixin mess that self-homed assertions brings. A while back we rewrote the entire core of testtools own assertions to be Matcher based :). https://testtools.readthedocs.org/en/latest/for-test-authors.html#matchers has the documentation on the Matcher protocol and what it looks like for users. Structurally, we decouple the raising of AssertionError from the act of determining whether a particular condition is met - this frees one from needing to have a reference to a test case to honour failureException, and from needing to subclass to share condition logic - unrelated test classes can how share condition logic by sharing a matcher definition. It also lends itself rather naturally to higher order definitions of matchers, as matchers are now standalone objects with no required connection to a test case : you can curry and compose matchers easily. We make matchers have a nice __str__, so that their structure can be printed out by assertThat when an error has occurred even if they have been curried or compose or defined much earlier. So - is there some interest in this? If so, I can put together a patchset with just the core, and let you see what it looks like. ---------- nosy: +rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 07:25:16 2013 From: report at bugs.python.org (Ethan Furman) Date: Sun, 09 Jun 2013 05:25:16 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370755516.35.0.641275115605.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: Hmm -- I was confusing member names with member values; I'll put 'unique' back in. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 08:03:13 2013 From: report at bugs.python.org (halfjuice) Date: Sun, 09 Jun 2013 06:03:13 +0000 Subject: [issue18168] plistlib output self-sorted dictionary In-Reply-To: <1370663536.42.0.663795573436.issue18168@psf.upfronthosting.co.za> Message-ID: <1370757793.36.0.330870555694.issue18168@psf.upfronthosting.co.za> halfjuice added the comment: Thanks for giving out docs and start a detail discussion on this Mher! Sorry I'm not familiar with Apple plist tool (I'm using cocos2d-x on win32 for the moment...) Are you saying that plutil is used everytime we output a valid plist? Another thing is whether the example in [1] is valid or not? If it is, I think we should provide unordered functionality. The OrderedDict is subclass of dict and thus is acceptable as plistlib input. Actually when I remove the line for sort, the plist output as expected (with not order). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 08:16:59 2013 From: report at bugs.python.org (Roman Zeyde) Date: Sun, 09 Jun 2013 06:16:59 +0000 Subject: [issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux In-Reply-To: <1370719368.01.0.165210926264.issue18169@psf.upfronthosting.co.za> Message-ID: <1370758619.4.0.206937010847.issue18169@psf.upfronthosting.co.za> Roman Zeyde added the comment: You are correct - the documentation is right: "Format characters have the following meaning; the conversion between C and Python values should be obvious given their types. The ?Standard size? column refers to the size of the packed value in bytes when using standard size; that is, when the format string starts with one of '<', '>', '!' or '='. When using native size, the size of the packed value is platform-dependent." So indeed, there is no problem - just my own misinterpretation of the docs... ---------- status: pending -> open type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 08:17:28 2013 From: report at bugs.python.org (Roman Zeyde) Date: Sun, 09 Jun 2013 06:17:28 +0000 Subject: [issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux In-Reply-To: <1370719368.01.0.165210926264.issue18169@psf.upfronthosting.co.za> Message-ID: <1370758648.07.0.637467808096.issue18169@psf.upfronthosting.co.za> Changes by Roman Zeyde : ---------- resolution: -> works for me status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 08:20:42 2013 From: report at bugs.python.org (Ethan Furman) Date: Sun, 09 Jun 2013 06:20:42 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370758842.14.0.0876247145752.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: Hopefully the last update. :) ---------- Added file: http://bugs.python.org/file30512/pep-0435.11.stoneleaf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 09:12:45 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 09 Jun 2013 07:12:45 +0000 Subject: [issue18170] define built-in exceptions in Python code In-Reply-To: <1370735699.37.0.350073873785.issue18170@psf.upfronthosting.co.za> Message-ID: <1370761965.69.0.156146539121.issue18170@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I suppose you'd better hope that there are no errors loading said frozen module. :) ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 10:29:35 2013 From: report at bugs.python.org (Florent Xicluna) Date: Sun, 09 Jun 2013 08:29:35 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1370766575.49.0.320180774925.issue18167@psf.upfronthosting.co.za> Changes by Florent Xicluna : ---------- nosy: +flox _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 11:44:18 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Jun 2013 09:44:18 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1370771058.09.0.657817304603.issue18054@psf.upfronthosting.co.za> Nick Coghlan added the comment: I think something like "assertThat" could address the problem nicely. Probably best to propose it as a separate issue, then we can make this one depend on that one if we decide to go that way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 12:51:10 2013 From: report at bugs.python.org (Pascal Garcia) Date: Sun, 09 Jun 2013 10:51:10 +0000 Subject: [issue18171] os.path.expanduser does not use the system encoding Message-ID: <1370775070.3.0.708484887412.issue18171@psf.upfronthosting.co.za> New submission from Pascal Garcia: The name of the user contains accents under windows. This error occurs when using the function. expaduser("~") UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 10: ordinal not in range(128) ascii is the default encoding as sys.getdefaultencoding() If in site.py "I enable Enable the support locale" then de defaultencoding become cp1252 and the function works. Expand user should use the encoding used by the system (may be locale.getdefaultlocale()) to decode path given by the system instead of the default encoding the should be the target encoding. I do beleave some other functions may be concerned by this problem. I detect the problem on Windows (WP and 7), but I do beleave the problem may happen on Linux also. ---------- components: Library (Lib) messages: 190850 nosy: plgarcia priority: normal severity: normal status: open title: os.path.expanduser does not use the system encoding versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 14:47:38 2013 From: report at bugs.python.org (flying sheep) Date: Sun, 09 Jun 2013 12:47:38 +0000 Subject: [issue18172] New easter egg: insecure string pickle Message-ID: <1370782058.78.0.671693022573.issue18172@psf.upfronthosting.co.za> New submission from flying sheep: the second meaning of the error message ?insecure string pickle? inspired at least two different people independently of drawing it. i?d wish for a link to one of those pics in the docstring or message of the error. picture: http://i.imgur.com/To3DQ6J.jpg thread: http://www.reddit.com/r/Python/comments/1fymy0/i_got_a_funny_error_trying_to_open_a_file_and/ we?d have to host the pic ourselves since imgur isn?t guaranteed to retain the picture (although that?d need many consecutive months of no one following the link) ---------- components: Library (Lib) messages: 190851 nosy: flying sheep priority: normal severity: normal status: open title: New easter egg: insecure string pickle type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 14:58:28 2013 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 09 Jun 2013 12:58:28 +0000 Subject: [issue18106] There are unused variables in Lib/test/test_collections.py In-Reply-To: <1369988012.39.0.245549184475.issue18106@psf.upfronthosting.co.za> Message-ID: <1370782708.82.0.299216803147.issue18106@psf.upfronthosting.co.za> Vajrasky Kok added the comment: Fixed the test based on Ezio Melotti's advice. However, Ezio did not comment specifically about whether we should cut or keep this line. self.assertEqual(list(dup.items()), list(od.items())) After studying the OrderedDict source code, I came to conclusion that if "self.assertEqual(dup, od)" is true, so is "self.assertEqual(list(dup.items()), list(od.items()))". But if "self.assertEqual(dup, od)" is false, so is "self.assertEqual(list(dup.items()), list(od.items()))". This is how OrderedDict tests the equality: def __eq__(self, other): if isinstance(other, OrderedDict): return dict.__eq__(self, other) and all(map(_eq, self, other)) return dict.__eq__(self, other) So I think it should be safe to remove: self.assertEqual(list(dup.items()), list(od.items())) ---------- Added file: http://bugs.python.org/file30513/test_copying_trimmed.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 15:36:58 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 13:36:58 +0000 Subject: [issue18172] New easter egg: insecure string pickle In-Reply-To: <1370782058.78.0.671693022573.issue18172@psf.upfronthosting.co.za> Message-ID: <1370785018.18.0.747191935665.issue18172@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +alexandre.vassalotti, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 15:47:19 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 09 Jun 2013 13:47:19 +0000 Subject: [issue18171] os.path.expanduser does not use the system encoding In-Reply-To: <1370775070.3.0.708484887412.issue18171@psf.upfronthosting.co.za> Message-ID: <1370785639.62.0.671643212536.issue18171@psf.upfronthosting.co.za> R. David Murray added the comment: I could not reproduce this error on Linux with python2.7. ---------- nosy: +haypo, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 15:48:19 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 09 Jun 2013 13:48:19 +0000 Subject: [issue18171] os.path.expanduser does not use the system encoding In-Reply-To: <1370775070.3.0.708484887412.issue18171@psf.upfronthosting.co.za> Message-ID: <1370785698.99.0.1429246247.issue18171@psf.upfronthosting.co.za> R. David Murray added the comment: Also, it would be helpful for you to show a full traceback, since there can be spurrious sources of unicode errors on Windows depending on how you execute your code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 15:54:32 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Jun 2013 13:54:32 +0000 Subject: [issue18173] Add MixedTypeKey to reprlib Message-ID: <1370786072.61.0.824503392112.issue18173@psf.upfronthosting.co.za> New submission from Nick Coghlan: Armin Ronacher pointed out that one downside of the removal of implicit cross-type comparisons in Python 3 is that it makes it harder to produce a stable repr for mixed-type containers. This seems like a valid point to me, so I propose adding a suitable "MixedTypeKey" definition to reprlib. Passing "key=reprlib.MixedTypeKey" would then reproduce the old Python 2. sorting behaviour. We can actually improve on the Python 2 approach by basing the fallback comparison on fully qualified type names rather than on the type id. Proposed implementation (see https://gist.github.com/ncoghlan/5743523): >>> class MixedTypeKey: ... """Sort key for mixed type lists in Python 3 ... ... >>> sorted([None, ..., 1, 1j, "", (), {}, []]) ... Traceback (most recent call last): ... File "", line 1, in ... TypeError: unorderable types: ellipsis() < NoneType() ... >>> sorted([None, ..., 1, 1j, "", (), {}, []], key=MixedTypeKey) ... [None, Ellipsis, 1, 1j, '', (), {}, []] ... """ ... def __init__(self, k): ... self._sort_key = k ... self._type_name = self._get_fully_qualified_name(k) ... def _get_fully_qualified_name(self, k): ... k_type = type(k) ... # Use __qualname__ if available, __name__ otherwise ... try: ... k_name = k_type.__qualname__ ... except AttributeError: ... k_name = k_type.__name__ ... return k_type.__module__ + "." + k_name ... def __lt__(self, other): ... # Try standard sorting first ... sort_key = self._sort_key ... try: ... other_sort_key = other._sort_key ... except AttributeError: ... other_sort_key = other ... try: ... return sort_key < other_sort_key ... except TypeError: ... pass ... # If that fails, sort by the fully qualified type names ... try: ... other_type_name = other._type_name ... except AttributeError: ... other_type_name = self._get_fully_qualified_name(other) ... return self._type_name < other_type_name ... >>> sorted([None, ..., 1, 1j, "", (), {}, []]) Traceback (most recent call last): File "", line 1, in TypeError: unorderable types: ellipsis() < NoneType() >>> sorted([None, ..., 1, 1j, "", (), {}, []], key=MixedTypeKey) [None, 1j, {}, Ellipsis, 1, [], '', ()] >>> MixedTypeKey(None) < ... True The stdlib version could omit the fallback to __name__ (since it doesn't need to cope with old versions of Python) Support for other comparisons could theoretically be added, but I advise against it without a solid use case (sorting only needs __lt__). ---------- components: Library (Lib) messages: 190855 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add MixedTypeKey to reprlib type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 15:59:01 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 09 Jun 2013 13:59:01 +0000 Subject: [issue18038] Unhelpful error message on invalid encoding specification In-Reply-To: <1369262596.73.0.912726466313.issue18038@psf.upfronthosting.co.za> Message-ID: <3bSzbm2LsjzStC@mail.python.org> Roundup Robot added the comment: New changeset 15aa786b723b by Serhiy Storchaka in branch '3.3': Issue #18038: SyntaxError raised during compilation sources with illegal http://hg.python.org/cpython/rev/15aa786b723b New changeset 39e2f0059ee2 by Serhiy Storchaka in branch 'default': Issue #18038: SyntaxError raised during compilation sources with illegal http://hg.python.org/cpython/rev/39e2f0059ee2 New changeset 570b5b4040b1 by Serhiy Storchaka in branch '2.7': Issue #18038: SyntaxError raised during compilation sources with illegal http://hg.python.org/cpython/rev/570b5b4040b1 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 16:13:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 09 Jun 2013 14:13:10 +0000 Subject: [issue15239] Abandoned Tools/unicode/mkstringprep.py In-Reply-To: <1341164174.42.0.994750295138.issue15239@psf.upfronthosting.co.za> Message-ID: <3bSzw56W0Wz7Ljj@mail.python.org> Roundup Robot added the comment: New changeset 8f95d77443da by Serhiy Storchaka in branch '3.3': Issue #15239: Make mkstringprep.py work again on Python 3. http://hg.python.org/cpython/rev/8f95d77443da New changeset 4abe61a412be by Serhiy Storchaka in branch 'default': Issue #15239: Make mkstringprep.py work again on Python 3. http://hg.python.org/cpython/rev/4abe61a412be ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 16:13:49 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 14:13:49 +0000 Subject: [issue18038] Unhelpful error message on invalid encoding specification In-Reply-To: <1369262596.73.0.912726466313.issue18038@psf.upfronthosting.co.za> Message-ID: <1370787229.88.0.0903665089362.issue18038@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 16:21:03 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 14:21:03 +0000 Subject: [issue15239] Abandoned Tools/unicode/mkstringprep.py In-Reply-To: <1341164174.42.0.994750295138.issue15239@psf.upfronthosting.co.za> Message-ID: <1370787663.98.0.825784138975.issue15239@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 17:34:32 2013 From: report at bugs.python.org (Pascal Garcia) Date: Sun, 09 Jun 2013 15:34:32 +0000 Subject: [issue18171] os.path.expanduser does not use the system encoding In-Reply-To: <1370775070.3.0.708484887412.issue18171@psf.upfronthosting.co.za> Message-ID: <1370792072.78.0.334675625213.issue18171@psf.upfronthosting.co.za> Pascal Garcia added the comment: Here are 2 logs one with the default site.py forcing defaultencoding to ascii, and the other to utf8. You can see that the home dir includes accents : P?p? Not an insult to anybody but this stupid computer :) When I force using the locale.getdefaultlocale() as encoding then the function works, but, after having called expanduser, I need to make an explicit decode(locale.getdefaultlocale()), or else the string can not be used to build path to files. ==> with ASCII C:\Users\p?p?>D:\DevelopmentWorkspaces\SCOLASYNC\ScolaSyncNG\scolasync-ng\src\scolasync.py Traceback (most recent call last): File "D:\DevelopmentWorkspaces\SCOLASYNC\ScolaSyncNG\scolasync-ng\src\scolasync.py", line 329, in run() File "D:\DevelopmentWorkspaces\SCOLASYNC\ScolaSyncNG\scolasync-ng\src\scolasync.py", line 206, in run globaldef.initDefs(wd, force) File "D:\DevelopmentWorkspaces\SCOLASYNC\ScolaSyncNG\scolasync-ng\src\globaldef.py", line 80, in initDefs wrkdir= os.path.expanduser(u"~"+os.sep) File "C:\Python27\lib\ntpath.py", line 301, in expanduser return userhome + path[i:] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 10: ordinal not in range(128) WITH UTF8 : C:\Users\p?p?>D:\DevelopmentWorkspaces\SCOLASYNC\ScolaSyncNG\scolasync-ng\src\scolasync.py Traceback (most recent call last): File "D:\DevelopmentWorkspaces\SCOLASYNC\ScolaSyncNG\scolasync-ng\src\scolasync.py", line 329, in run() File "D:\DevelopmentWorkspaces\SCOLASYNC\ScolaSyncNG\scolasync-ng\src\scolasync.py", line 206, in run globaldef.initDefs(wd, force) File "D:\DevelopmentWorkspaces\SCOLASYNC\ScolaSyncNG\scolasync-ng\src\globaldef.py", line 80, in initDefs wrkdir= os.path.expanduser(u"~"+os.sep) File "C:\Python27\lib\ntpath.py", line 301, in expanduser return userhome + path[i:] File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 18:03:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 09 Jun 2013 16:03:10 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <3bT2M12CwdzRg8@mail.python.org> Roundup Robot added the comment: New changeset a4d31e56075d by Christian Heimes in branch 'default': Issue #18143: Implement ssl.get_default_verify_paths() in order to debug http://hg.python.org/cpython/rev/a4d31e56075d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 18:05:28 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sun, 09 Jun 2013 16:05:28 +0000 Subject: [issue14015] surrogateescape largely missing from documentation In-Reply-To: <1329245790.15.0.430373154575.issue14015@psf.upfronthosting.co.za> Message-ID: <1370793928.47.0.485055115179.issue14015@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Here's a proposed patch that touches the Sphinx documentation and a docstring in codecs.py. The text is slightly revised from my current revisions to the Unicode howto. help(open) says "See the documentation for codecs.register for a list of the permitted encoding error strings". This is strictly correct: the Sphinx documentation features this info. But help(codecs.register) doesn't; it's more helpful to look at help(codecs.Codec). So maybe the docstring for open() should say: "See help(codecs.Codec) for a list of the permitted..." instead. ---------- Added file: http://bugs.python.org/file30514/patch14015.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 18:05:47 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 09 Jun 2013 16:05:47 +0000 Subject: [issue18171] os.path.expanduser does not use the system encoding In-Reply-To: <1370775070.3.0.708484887412.issue18171@psf.upfronthosting.co.za> Message-ID: <1370793947.28.0.515208508833.issue18171@psf.upfronthosting.co.za> R. David Murray added the comment: On linux as well this fails: os.path.expanduser(u'~' + os.sep) But this works: os.path.expanduser('~' + os.sep) Counterintuitive, to say the least. The reason is that the value of the HOME environment variable is read as a byte string, but when that byte string value is added to the unicode u'~/', unicode coercion attempts to decode the byte string as an ASCII string, which fails. So, you must manipulate paths as byte strings in python2, decoding them yourself with the appropriate codec if needed. This stuff is handled automatically in Python3, using the default encoding as you suggest (plus the surrogateescape error handler to handle unknown bytes on linux/unix). Fixes for stuff like this is a large part of the purpose of Python3. So, in Python2 this is working as expected. ---------- resolution: -> invalid stage: -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 18:26:50 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 09 Jun 2013 16:26:50 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370795210.23.0.758850835511.issue17947@psf.upfronthosting.co.za> Eli Bendersky added the comment: LGTM. I suggest you wait for a couple of days to see if others have any critical comments and then commit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 18:36:56 2013 From: report at bugs.python.org (Pascal Garcia) Date: Sun, 09 Jun 2013 16:36:56 +0000 Subject: [issue18171] os.path.expanduser does not use the system encoding In-Reply-To: <1370775070.3.0.708484887412.issue18171@psf.upfronthosting.co.za> Message-ID: <1370795816.58.0.339449030608.issue18171@psf.upfronthosting.co.za> Pascal Garcia added the comment: Sorry for this error. Thanks for the solution. Here is the code as I modify it. wrkdir= os.path.expanduser("~"+os.sep) loc = locale.getdefaultlocale() if loc[1]: encoding = loc[1] wrkdir= wrkdir.decode(encoding) I need to explicitally decode the string if I want to use it and have the next sentence working a bit further. os.path.join(wrkdir, u"Tango\\") Encodding is a very good motivation to go to python3, and if i didn't have other constraints it would be done for ages. For this special case I think that function should return strings with the default encoding, and the programmer should not have to know about the underground to make the right decode. But it works, thanks again. Pascal ---------- resolution: invalid -> status: closed -> open type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 18:45:15 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 09 Jun 2013 16:45:15 +0000 Subject: [issue18171] os.path.expanduser does not use the system encoding In-Reply-To: <1370775070.3.0.708484887412.issue18171@psf.upfronthosting.co.za> Message-ID: <1370796315.03.0.384765914524.issue18171@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- resolution: -> invalid status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 19:03:41 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 09 Jun 2013 17:03:41 +0000 Subject: [issue17134] Use Windows' certificate store for CA certs In-Reply-To: <1360078143.8.0.938168290854.issue17134@psf.upfronthosting.co.za> Message-ID: <3bT3hr4HhhzSRJ@mail.python.org> Roundup Robot added the comment: New changeset 10d325f674f5 by Christian Heimes in branch 'default': Issue #17134: Add ssl.enum_cert_store() as interface to Windows' cert store. http://hg.python.org/cpython/rev/10d325f674f5 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 19:14:08 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 09 Jun 2013 17:14:08 +0000 Subject: [issue17134] Use Windows' certificate store for CA certs In-Reply-To: <3bT3hr4HhhzSRJ@mail.python.org> Message-ID: <51B4B7E8.2010904@free.fr> Antoine Pitrou added the comment: > New changeset 10d325f674f5 by Christian Heimes in branch 'default': > Issue #17134: Add ssl.enum_cert_store() as interface to Windows' cert store. > http://hg.python.org/cpython/rev/10d325f674f5 I don't want to sound annoying, but I would have liked to review this before it goes in. Could it wait a few days? (I'm sure it can :-)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 19:23:10 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 17:23:10 +0000 Subject: [issue16741] `int()`, `float()`, etc think python strings are null-terminated In-Reply-To: <1356046641.74.0.314140910069.issue16741@psf.upfronthosting.co.za> Message-ID: <1370798590.83.0.420821880192.issue16741@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Patch updated. It now reuses code for bytes->int in longobject.c and abstract.c, doesn't raise UnicodeDecodeError for non-utf-8 bytes, and always reports an invalid bytes literal as a bytes object. ---------- Added file: http://bugs.python.org/file30515/int_from_str-3.3_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 19:32:06 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 17:32:06 +0000 Subject: [issue18101] Tk.split() doesn't work with nested Unicode strings In-Reply-To: <1369922361.42.0.622055843561.issue18101@psf.upfronthosting.co.za> Message-ID: <1370799126.57.0.216317793043.issue18101@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ezio, have you reviewed the main code? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 19:57:35 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 17:57:35 +0000 Subject: [issue18101] Tk.split() doesn't work with nested Unicode strings In-Reply-To: <1369922361.42.0.622055843561.issue18101@psf.upfronthosting.co.za> Message-ID: <1370800655.94.0.0538991143198.issue18101@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Here are patches with updated tests as Ezio suggested. ---------- Added file: http://bugs.python.org/file30516/tkinter_split_nested_unicode_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 19:58:33 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 17:58:33 +0000 Subject: [issue18101] Tk.split() doesn't work with nested Unicode strings In-Reply-To: <1369922361.42.0.622055843561.issue18101@psf.upfronthosting.co.za> Message-ID: <1370800713.6.0.25081730071.issue18101@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file30517/tkinter_split_nested_unicode-2.7_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 20:10:47 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 09 Jun 2013 18:10:47 +0000 Subject: [issue16102] uuid._netbios_getnode() is outdated In-Reply-To: <1349112809.97.0.499056156586.issue16102@psf.upfronthosting.co.za> Message-ID: <3bT5BG5WJ1zS0f@mail.python.org> Roundup Robot added the comment: New changeset 27f55ff12f41 by Serhiy Storchaka in branch '3.3': Issue #16102: Make uuid._netbios_getnode() work again on Python 3. http://hg.python.org/cpython/rev/27f55ff12f41 New changeset 4a0017722910 by Serhiy Storchaka in branch 'default': Issue #16102: Make uuid._netbios_getnode() work again on Python 3. http://hg.python.org/cpython/rev/4a0017722910 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 20:23:12 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 18:23:12 +0000 Subject: [issue16102] uuid._netbios_getnode() is outdated In-Reply-To: <1349112809.97.0.499056156586.issue16102@psf.upfronthosting.co.za> Message-ID: <1370802192.02.0.263045394751.issue16102@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 21:06:51 2013 From: report at bugs.python.org (Zachary Ware) Date: Sun, 09 Jun 2013 19:06:51 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370804811.44.0.267891613738.issue17947@psf.upfronthosting.co.za> Zachary Ware added the comment: enum.rst will need to be added to a table of contents page somewhere, I would guess possibly Development Tools (Doc/library/development.rst) or maybe Data Types (Doc/library/datatypes.rst). I would trust almost anybody else's opinion over mine on where it should go, though :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 21:19:16 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 19:19:16 +0000 Subject: [issue17944] Refactor test_zipfile In-Reply-To: <1368093470.65.0.477520947191.issue17944@psf.upfronthosting.co.za> Message-ID: <1370805556.69.0.278153614987.issue17944@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 21:47:53 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 09 Jun 2013 19:47:53 +0000 Subject: [issue18174] Make regrtest with --huntrleaks check for fd leaks Message-ID: <1370807273.91.0.83033499223.issue18174@psf.upfronthosting.co.za> New submission from Richard Oudkerk: regrtest already tests for refcount leaks and memory allocation leaks. It can also be made to check for file descriptor leaks (and perhaps also handles on Windows). Running with the attached patch makes it look like test_openpty, test_shutil, test_subprocess, test_uuid all leak fds on Linux, but I have not investigated: $ ./python -m test.regrtest -R 3:3 test_openpty test_shutil test_subprocess test_uuid [1/4] test_openpty 123456 ...... test_openpty leaked [2, 2, 2] fds, sum=6 [2/4/1] test_shutil beginning 6 repetitions 123456 ...... test_shutil leaked [4, 4, 4] fds, sum=12 [3/4/2] test_subprocess beginning 6 repetitions 123456 ...... test_subprocess leaked [5, 5, 5] fds, sum=15 [4/4/3] test_uuid beginning 6 repetitions 123456 ...... test_uuid leaked [1, 1, 1] fds, sum=3 4 tests failed: test_openpty test_shutil test_subprocess test_uuid ---------- files: fdleak.patch keywords: patch messages: 190871 nosy: sbt priority: normal severity: normal status: open title: Make regrtest with --huntrleaks check for fd leaks Added file: http://bugs.python.org/file30518/fdleak.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 22:23:35 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 09 Jun 2013 20:23:35 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() In-Reply-To: <1370397033.84.0.295479011719.issue18138@psf.upfronthosting.co.za> Message-ID: <1370809415.27.0.86116178172.issue18138@psf.upfronthosting.co.za> Christian Heimes added the comment: New patch: * rename function to add_ca_cert() * only accept CA certs, no other certs * raise an error if extra data is found after cert (e.g. two certs). PEM_read_bio_X509() silently ignores extra data * fixes from Ezio's code review * documentation ---------- nosy: +ezio.melotti, pitrou Added file: http://bugs.python.org/file30519/sslctx_add_cert2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 22:34:10 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Jun 2013 20:34:10 +0000 Subject: [issue17394] Add slicing support to collections.deque In-Reply-To: <1362972021.66.0.443403979058.issue17394@psf.upfronthosting.co.za> Message-ID: <1370810050.32.0.795463885348.issue17394@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The slicing support can be implemented using just rotates, appends, and pops. ---------- assignee: rhettinger -> nosy: +serhiy.storchaka priority: low -> normal stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 9 23:28:22 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Jun 2013 21:28:22 +0000 Subject: [issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode() In-Reply-To: <1369059208.07.0.0770184639372.issue18022@psf.upfronthosting.co.za> Message-ID: <1370813302.17.0.150706546125.issue18022@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There are other inconsistencies. email.quoprimime.decode(), binascii.a2b_qp() and pure Python (by default binascii used) quopri.decodestring() returns different results for following data: quoprimime binascii quopri b'=' '' b'' b'=' b'==' '=' b'=' b'==' b'= ' '' b'= ' b'= ' b'= \n' '' b'= \n' b'' b'=\r' '' b'' b'=\r' b'==41' '=A' b'=41' b'=A' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 00:31:46 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 09 Jun 2013 22:31:46 +0000 Subject: [issue18175] os.listdir(fd) leaks fd on error Message-ID: <1370817106.33.0.219931679645.issue18175@psf.upfronthosting.co.za> New submission from Richard Oudkerk: If os.listdir() is used with an fd, but fdopendir() fails (e.g. if the the fd is a normal file) then a duplicated fd is leaked. This explains the leaks in test_shutil mentioned in #18174. ---------- messages: 190875 nosy: sbt priority: normal severity: normal status: open title: os.listdir(fd) leaks fd on error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 00:51:15 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 09 Jun 2013 22:51:15 +0000 Subject: [issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode() In-Reply-To: <1369059208.07.0.0770184639372.issue18022@psf.upfronthosting.co.za> Message-ID: <1370818275.5.0.94082508417.issue18022@psf.upfronthosting.co.za> R. David Murray added the comment: Most of the variations represent different invalid-input recovery choices. I believe binascii's decoding of b'= \n' is incorrect, as is its decoding of b'==41'. quopri's decoding of b'=\r' is arguably incorrect as well, given that python generally supports universal line ends. Otherwise the decodings are all responses to erroneous input for which the behavior is not specified. That said, we ought to pick one error recovery scheme and implement it in all places, and IMO it shouldn't be exactly any of the ones we've got. Or better yet, use one common implementation. Untangling quopri is on my (too large) List of Things To Do :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 00:54:46 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 09 Jun 2013 22:54:46 +0000 Subject: [issue18175] os.listdir(fd) leaks fd on error In-Reply-To: <1370817106.33.0.219931679645.issue18175@psf.upfronthosting.co.za> Message-ID: <1370818486.51.0.163337845925.issue18175@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 01:32:58 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 09 Jun 2013 23:32:58 +0000 Subject: [issue6632] Include more chars in the decimal codec In-Reply-To: <1249317285.35.0.709481915004.issue6632@psf.upfronthosting.co.za> Message-ID: <1370820778.73.0.785664449208.issue6632@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I am changing the title slightly to include '\N{MINUS SIGN}' in the scope of this issues. See [1]: "Unless anyone can point me to a case where \N{MINUS SIGN} should not be treated as a (duh) minus sign, we should go and try to make life easier for our users by adopting at least a few of such characters." (?ukasz Langa) [1] http://mail.python.org/pipermail/python-ideas/2013-June/021243.html ---------- title: Include more fullwidth chars in the decimal codec -> Include more chars in the decimal codec _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 02:15:04 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 00:15:04 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. Message-ID: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: Reference to http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedNumericType.txt in http://docs.python.org/3.4/library/stdtypes.html#numeric-types-int-float-complex should be changed to http://www.unicode.org/Public/6.1.0/ucd/extracted/DerivedNumericType.txt for 3.3 and to http://www.unicode.org/Public/6.2.0/ucd/extracted/DerivedNumericType.txt for 3.4. Note that the change from 6.1 to 6.2 is immaterial because it did not involve the Nd category, but a change from 6.0 to 6.1 introduced several new ranges: +110F0..110F9 ; Decimal # Nd [10] SORA SOMPENG DIGIT ZERO..SORA SOMPENG DIGIT NINE +11136..1113F ; Decimal # Nd [10] CHAKMA DIGIT ZERO..CHAKMA DIGIT NINE +111D0..111D9 ; Decimal # Nd [10] SHARADA DIGIT ZERO..SHARADA DIGIT NINE +116C0..116C9 ; Decimal # Nd [10] TAKRI DIGIT ZERO..TAKRI DIGIT NINE ---------- messages: 190878 nosy: belopolsky priority: normal severity: normal status: open title: Builtins documentation refers to old version of UCD. versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 02:45:28 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 10 Jun 2013 00:45:28 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1370825128.98.0.666544960351.issue18162@psf.upfronthosting.co.za> Brett Cannon added the comment: Yes, I mean weakref. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 02:46:56 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 10 Jun 2013 00:46:56 +0000 Subject: [issue18170] define built-in exceptions in Python code In-Reply-To: <1370735699.37.0.350073873785.issue18170@psf.upfronthosting.co.za> Message-ID: <1370825216.39.0.428669821528.issue18170@psf.upfronthosting.co.za> Brett Cannon added the comment: Yeah, that's the tricky bit. =) That's why I was thinking of starting with the leaf exceptions and then just slowly working down the hierarchy until I hit exceptions that just had to exist in C code (e.g. BaseException, Exception, and maybe SyntaxError). The rest could be made fake with Exception to start and then replace after the module was loaded. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 03:55:58 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 01:55:58 +0000 Subject: [issue6632] Include more chars in the decimal codec In-Reply-To: <1249317285.35.0.709481915004.issue6632@psf.upfronthosting.co.za> Message-ID: <1370829358.56.0.512052871642.issue6632@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: As a design principle, "accept what's unambiguous in any locale" is reasonable, but it is hard to apply consistently. I would agree that the status quo is hard to defend. After a long discussion, it has been accepted that fullwidth digits should be accepted and now float(u'???') is valid, but not float('????'), float('????') or float('???'). The last example is >>> '\N{FULLWIDTH DIGIT ONE}\N{FULLWIDTH DIGIT TWO}\N{DIGIT THREE FULL STOP}' '???' All these variations can be neatly addressed by applying NFKC or NFKD normalization to unicode data before conversion: >>> float(unicodedata.normalize('NFKD', '????')) 123.0 >>> float(unicodedata.normalize('NFKD', '????')) -123.0 >>> float(unicodedata.normalize('NFKC', '???')) 123.0 This would even allow parsing fullwidth hexadecimal numbers: >>> float.fromhex(unicodedata.normalize('NFKC', '??????')) 11.5 >>> int(unicodedata.normalize('NFKC', '??'), 16) 127 but would not help with the MINUS SIGN. Allowing '\N{MINUS SIGN}' is particularly attractive because arguably unicode text should prefer it to ambiguous '\N{HYPHEN-MINUS}', but on the same token fractions.Fraction() should accept '\N{FRACTION SLASH}' in addition to the legacy '\N{SOLIDUS}'. Overall, I think this situation calls for a PEP-size proposal and discussion about handling unicode numerical data throughout stdlib rather that a case by case discussion of the various quirks in the curent version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 04:03:00 2013 From: report at bugs.python.org (icedream91) Date: Mon, 10 Jun 2013 02:03:00 +0000 Subject: [issue18177] Typo in Documents Message-ID: <1370829780.84.0.0627044566719.issue18177@psf.upfronthosting.co.za> New submission from icedream91: In library.pdf file(Release 3.3.2, June 09, 2013), I found a typo in page 149: I think the quotation marks are wrong in "datetime.isoformat(sep=?T?)" sentence, they should both be "'". But it's right in online documents (http://docs.python.org/3/library/datetime.html#datetime.datetime.isoformat). Thanks. ---------- assignee: docs at python components: Documentation messages: 190882 nosy: docs at python, icedream91 priority: normal severity: normal status: open title: Typo in Documents versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 04:04:27 2013 From: report at bugs.python.org (Larry Hastings) Date: Mon, 10 Jun 2013 02:04:27 +0000 Subject: [issue18175] os.listdir(fd) leaks fd on error In-Reply-To: <1370817106.33.0.219931679645.issue18175@psf.upfronthosting.co.za> Message-ID: <1370829867.44.0.487528080361.issue18175@psf.upfronthosting.co.za> Larry Hastings added the comment: Duplicate of #17899. ---------- resolution: -> duplicate stage: -> committed/rejected status: open -> closed type: -> resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 04:04:54 2013 From: report at bugs.python.org (Brian Curtin) Date: Mon, 10 Jun 2013 02:04:54 +0000 Subject: [issue18172] New easter egg: insecure string pickle In-Reply-To: <1370782058.78.0.671693022573.issue18172@psf.upfronthosting.co.za> Message-ID: <1370829894.62.0.421035718733.issue18172@psf.upfronthosting.co.za> Brian Curtin added the comment: Sorry, I don't think this is something we can do. We're not going to put an image link into an exception message or docstring. ---------- nosy: +brian.curtin stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 04:24:33 2013 From: report at bugs.python.org (Larry Hastings) Date: Mon, 10 Jun 2013 02:24:33 +0000 Subject: [issue17899] os.listdir() leaks FDs if invoked on FD pointing to a non-directory In-Reply-To: <1367608586.39.0.0815102318744.issue17899@psf.upfronthosting.co.za> Message-ID: <1370831073.65.0.873163058108.issue17899@psf.upfronthosting.co.za> Larry Hastings added the comment: Second rev incorporating a suggestion from the ever-present Serhiy. Also, for what it's worth, I walked through this with the debugger when using os.listdir(0) and it worked fine. ---------- Added file: http://bugs.python.org/file30520/larry.listdir.fd.leakage.bug.2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 04:31:42 2013 From: report at bugs.python.org (Larry Hastings) Date: Mon, 10 Jun 2013 02:31:42 +0000 Subject: [issue17899] os.listdir() leaks FDs if invoked on FD pointing to a non-directory In-Reply-To: <1367608586.39.0.0815102318744.issue17899@psf.upfronthosting.co.za> Message-ID: <1370831502.67.0.947883961371.issue17899@psf.upfronthosting.co.za> Larry Hastings added the comment: Here's a patch for 3.3. There's been enough churn around listdir in trunk that I was gonna have to write the patches separately anyway. ---------- Added file: http://bugs.python.org/file30521/larry.3.3.listdir.fd.leakage.bug.1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 05:01:26 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 10 Jun 2013 03:01:26 +0000 Subject: [issue18172] New easter egg: insecure string pickle In-Reply-To: <1370782058.78.0.671693022573.issue18172@psf.upfronthosting.co.za> Message-ID: <1370833286.33.0.655787197188.issue18172@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- resolution: -> rejected versions: +Python 3.4 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 07:53:38 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 05:53:38 +0000 Subject: [issue17899] os.listdir() leaks FDs if invoked on FD pointing to a non-directory In-Reply-To: <1367608586.39.0.0815102318744.issue17899@psf.upfronthosting.co.za> Message-ID: <1370843618.78.0.36433607494.issue17899@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: rewinddir() is called only when dirp != NULL && fd > -1. fdopendir() is called when fd != -1. close() is called when dirp == NULL && fd != -1. Therefore rewinddir() and fdopendir() with close() can't be called in the same time. And you can move block if (dirp == NULL) close(fd); up, just after fdopendir(). In all other branches fd == -1 and close() is not called. You will save #ifdef HAVE_FDOPENDIR/#endif and Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS lines. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 08:22:33 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 06:22:33 +0000 Subject: [issue18168] plistlib output self-sorted dictionary In-Reply-To: <1370663536.42.0.663795573436.issue18168@psf.upfronthosting.co.za> Message-ID: <1370845353.78.0.558986423102.issue18168@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I'm reworking the patch in #14455 and one of the things I intend to do is to add a keyword argument that controls whether or not the keys in dictionaries will be sorted by plistlib. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 08:32:58 2013 From: report at bugs.python.org (Stefan Drees) Date: Mon, 10 Jun 2013 06:32:58 +0000 Subject: [issue17941] namedtuple should support fully qualified name for more portable pickling In-Reply-To: <1368071216.78.0.0822877752405.issue17941@psf.upfronthosting.co.za> Message-ID: <1370845978.42.0.923633230863.issue17941@psf.upfronthosting.co.za> Changes by Stefan Drees : ---------- nosy: +dilettant _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 08:35:36 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 06:35:36 +0000 Subject: [issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode() In-Reply-To: <1369059208.07.0.0770184639372.issue18022@psf.upfronthosting.co.za> Message-ID: <1370846136.72.0.665954608103.issue18022@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Perl's MIME::QuotedPrint produces same result as pure Python quopri. konwert qp-8bit produces same result as binascii (except '==41' it decodes as '=A'). RFC 2045 says: """A reasonable approach by a robust implementation might be to include the "=" character and the following character in the decoded data without any transformation and, if possible, indicate to the user that proper decoding was not possible at this point in the data. """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 09:44:56 2013 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 10 Jun 2013 07:44:56 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail In-Reply-To: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> Message-ID: <1370850296.48.0.713649371452.issue18110@psf.upfronthosting.co.za> Mark Dickinson added the comment: While I agree that this isn't an exact duplicate of #3692, the underlying cause is the same, and Python is working as designed and documented in this case. In Python 2, list comprehensions don't have their own scope, so the `x` in your initial example lives at class scope. However, the set comprehension *does* have its own scope. By design, a variable defined at class scope is not visible to inner scopes inside that class. In Python 3, this works because the list comprehension has its own scope. See the documentation here: http://docs.python.org/2/reference/executionmodel.html#naming-and-binding and the `class A` example in particular. Reclosing: there's no way this behaviour going to change in Python 2, and this particular case is no longer an issue in Python 3. ---------- nosy: +mark.dickinson resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 09:46:19 2013 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 10 Jun 2013 07:46:19 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail In-Reply-To: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> Message-ID: <1370850379.18.0.493859278717.issue18110@psf.upfronthosting.co.za> Mark Dickinson added the comment: "won't fix" is probably a better resolution. But in the absence of that apostrophe-rich option, I'll use "wont fix" instead. ---------- resolution: invalid -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 10:11:18 2013 From: report at bugs.python.org (rm) Date: Mon, 10 Jun 2013 08:11:18 +0000 Subject: [issue18178] Redefinition of malloc(3) family of functions at build time Message-ID: <1370851878.25.0.593003779218.issue18178@psf.upfronthosting.co.za> New submission from rm: Hello. Marcel Moolenaar (marcel at FreeBSD.org) pointed this out after committing FreeBSD revision 250991 [1], that makes the malloc(3) family of functions weak symbols. I'm citing him, because (silly me) I don't understand all of this completely: """ After my commit to head that makes the malloc(3) family of functions weak symbols, a bug in what appears to be the Python build was exposed. The net effect of the bug is that _ctypes.so contains (strong) definitions of the malloc(3) family of functions and resulting in unintended symbol resolution. _ctypes.so incorporates the libffi functionality for what I presume is the basis for Python bindings. libffi includes dlmalloc.c, an open source allocator. dlmalloc.c is incuded by closures.c and closures.c defines USE_DL_PREFIX. On top of that closures.c makes all allocator functions static. This, therefore adds a memory allocator to libffi without exposure of standard symbols In short: dlmalloc.c never gets compiler separately or independently for this reason. The python build however compiles dlmalloc.c separately/independently. As such, dlmalloc.c now defines and exports the malloc(3) family of functions and it also get linked into _ctypes.so. Thus when libffi is built as part of the Python build, the set of symbols exported is different from when libffi is compiled as a port. The simplest test case is this (on a -current machines): 1. Build & install lang/python27 (unmodified; if needed) 2. try and build databases/py-sqlite3 The build of databases/py-sqlite3 fails because this: running config *** Signal 11 On amd64 I observed an assertion failure of FreeBSD's malloc, with the same effect. Manually triggering this: fbsdvm% pwd /usr/ports/databases/py-sqlite3/work/Python-2.7.5/Modules fbsdvm% /usr/local/bin/python2.7 setup.py config running config Segmentation fault But if symbols are resolved non-lazily, things change: fbsdvm% setenv LD_BIND_NOW yes fbsdvm% /usr/local/bin/python2.7 setup.py config running config This demonstrates how, after loading _ctypes.so, malloc(3) and friends get resolved differently and thus inconsistently from before. The publicly visible symbols in _ctypes.so, also show the problem: fbsdvm% nm /usr/local/lib/python2.7/lib-dynload/_ctypes.so | grep ' T ' | egrep '(alloc)|(free)' 0000c3f0 T _ctypes_alloc_callback 00005250 T _ctypes_alloc_format_string 00016d10 T calloc 000121e0 T ffi_closure_alloc 00013760 T ffi_closure_free 00016050 T free 000170c0 T independent_calloc 000172d0 T independent_comalloc 000148e0 T malloc 00017460 T malloc_footprint 00017480 T malloc_max_footprint 000175c0 T malloc_stats 00017440 T malloc_trim 000176e0 T malloc_usable_size 000173a0 T pvalloc 00016d90 T realloc 00017310 T valloc There are definitions of malloc(3) and friends that shouldn't be there. """ We have similar reports in our bug-tracker [2] and [3]. And the patch attached fixes this for post-r250991 versions of FreeBSD, and noop for earlier versions. The same patch applied to python2.7, python3.2, python3.3 and patched in FreeBSD ports tree locally. [1] http://svnweb.freebsd.org/changeset/base/250991 [2] http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179102 [3] http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179413 ---------- components: ctypes files: patch-Modules-_ctypes-libffi_fficonfig.py.in messages: 190892 nosy: cvs-src priority: normal severity: normal status: open title: Redefinition of malloc(3) family of functions at build time type: crash versions: Python 2.7 Added file: http://bugs.python.org/file30522/patch-Modules-_ctypes-libffi_fficonfig.py.in _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 10:37:27 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 10 Jun 2013 08:37:27 +0000 Subject: [issue17269] getaddrinfo segfaults on OS X when provided with invalid arguments combinations In-Reply-To: <1361489513.5.0.894275569557.issue17269@psf.upfronthosting.co.za> Message-ID: <3bTSQH0MVkzQct@mail.python.org> Roundup Robot added the comment: New changeset 4d1e4bc6c5b5 by Ronald Oussoren in branch '2.7': Ensure that the fix for #17269 also works on OSX 10.4 http://hg.python.org/cpython/rev/4d1e4bc6c5b5 New changeset ef103e7e7af2 by Ronald Oussoren in branch '3.3': Ensure that the fix for #17269 also works on OSX 10.4 http://hg.python.org/cpython/rev/ef103e7e7af2 New changeset 062f1985a5b7 by Ronald Oussoren in branch 'default': (3.3->default) Ensure that the fix for #17269 also works on OSX 10.4 http://hg.python.org/cpython/rev/062f1985a5b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 10:57:33 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 10 Jun 2013 08:57:33 +0000 Subject: [issue17134] Use Windows' certificate store for CA certs In-Reply-To: <1360078143.8.0.938168290854.issue17134@psf.upfronthosting.co.za> Message-ID: <1370854653.71.0.0950311908673.issue17134@psf.upfronthosting.co.za> Christian Heimes added the comment: Ezio already reviewed my code. But sure I can wait a couple of days. The second part of the patch depends on #18138 anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 11:07:08 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 09:07:08 +0000 Subject: [issue18178] Redefinition of malloc(3) family of functions at build time In-Reply-To: <1370851878.25.0.593003779218.issue18178@psf.upfronthosting.co.za> Message-ID: <1370855228.39.0.81418854252.issue18178@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 11:10:04 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 09:10:04 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1370855404.52.0.411922481634.issue14455@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I've attached issue14455-v2.txt with an updated patch. The patch is still very much a work in progress, I haven't had as much time to work on this as I'd like. This version: * Should apply cleanly to the tip of the default branch * Move around some code. * Doesn't pass unit tests (most likely because I've botched the manual merge). The unittests also don't cover the functionality I've added. * Adds documentation * Adds 'skipkeys' and 'sort_keys' to the write functions (with the same semantics as these keywords have with json.dump) * Adds 'data_as_bytes' to the read functions. Then this option is true binary data is returned as an instance of bytes instead of plistlib.Data The latter is still the default. ---------- Added file: http://bugs.python.org/file30523/issue14455-v2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 11:34:25 2013 From: report at bugs.python.org (Eric Wieser) Date: Mon, 10 Jun 2013 09:34:25 +0000 Subject: [issue18110] Nested set comprehensions in class scope fail In-Reply-To: <1370038928.9.0.337300237862.issue18110@psf.upfronthosting.co.za> Message-ID: <1370856865.66.0.895588222415.issue18110@psf.upfronthosting.co.za> Eric Wieser added the comment: Thanks for the clarification - this behavior now makes perfect sense to me. As expected, swapping the list comprehension for a generator comprehension, or vice versa, prevents the error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 12:13:25 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Mon, 10 Jun 2013 10:13:25 +0000 Subject: [issue18178] Redefinition of malloc(3) family of functions at build time In-Reply-To: <1370851878.25.0.593003779218.issue18178@psf.upfronthosting.co.za> Message-ID: <1370859205.85.0.639598224585.issue18178@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Said simpler: dlmalloc.c code is indeed compiled twice: - once as part of closures.c, which #include "dlmalloc.c"; this is done carefully (with 'static' and 'USE_DL_PREFIX') to not clash with standard malloc functions. - once as a separate target; without USE_DL_PREFIX it will define functions named malloc() and free()... The second one is not necessary, of course. The patch looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 12:24:28 2013 From: report at bugs.python.org (Jonas H.) Date: Mon, 10 Jun 2013 10:24:28 +0000 Subject: [issue18179] SMTP.local_hostname is undocumented Message-ID: <1370859868.96.0.822120662228.issue18179@psf.upfronthosting.co.za> New submission from Jonas H.: The Sphinx docs don't contain any explanation for `local_hostname`. ---------- assignee: docs at python components: Documentation messages: 190898 nosy: docs at python, jonash priority: normal severity: normal status: open title: SMTP.local_hostname is undocumented versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 13:31:22 2013 From: report at bugs.python.org (Berker Peksag) Date: Mon, 10 Jun 2013 11:31:22 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1370863882.37.0.854584626794.issue2771@psf.upfronthosting.co.za> Berker Peksag added the comment: Lib/smtplib.py#l226 Lib/smtplib.py:l226 Lib/smtplib.py#226 Lib/smtplib.py:226 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 13:47:04 2013 From: report at bugs.python.org (Berker Peksag) Date: Mon, 10 Jun 2013 11:47:04 +0000 Subject: [issue18179] SMTP.local_hostname is undocumented In-Reply-To: <1370859868.96.0.822120662228.issue18179@psf.upfronthosting.co.za> Message-ID: <1370864824.72.0.665337356244.issue18179@psf.upfronthosting.co.za> Berker Peksag added the comment: The docstring of the SMTP class says: "If specified, `local_hostname` is used as the FQDN of the local host. By default, the local hostname is found using socket.getfqdn()." See Lib/smtplib.py:226. ---------- nosy: +berker.peksag versions: -Python 2.6, Python 3.1, Python 3.2, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 13:54:25 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 10 Jun 2013 11:54:25 +0000 Subject: [issue18180] Refleak in test_imp on Windows Message-ID: <1370865265.03.0.501914398945.issue18180@psf.upfronthosting.co.za> New submission from Richard Oudkerk: Seems to be in error path of _PyImport_GetDynLoadWindows(). ---------- files: load_dynamic.patch keywords: patch messages: 190901 nosy: sbt priority: normal severity: normal status: open title: Refleak in test_imp on Windows Added file: http://bugs.python.org/file30524/load_dynamic.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 14:06:42 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 12:06:42 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1370866002.77.0.768608378884.issue14455@psf.upfronthosting.co.za> Changes by Ronald Oussoren : Added file: http://bugs.python.org/file30525/issue14455-v3.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 14:13:33 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 12:13:33 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1370866413.91.0.72039291789.issue14455@psf.upfronthosting.co.za> Ronald Oussoren added the comment: v3 is still a work in progress, and still fails some tests * Replaced test data by data generated by a helper script (to make it easier to update) * Use 'subtest' feature of unittest library in 3.4 * Small tweaks to plist library (the dump/load/dumps/loads function at the end probably won't survive) * Updated link to the CFBinaryPlist.c source code (this should be a newer version of the file) * Added option to readPlist to pass in the dictionary type (defaults to plistlib._InternalDict). This is primarily useful for testing and debugging, but also mirrors the 'sortkeys' keyword argument for the writer (when the order can be important for writing the user should have some way to detect the order when reading). The data generated by the binary plist generator does't match the data generated by Cocoa in OSX 10.8 (and generated by the helper script), I haven't fully debugged that problem yet. The generated binary plist and the Cocoa version can both be parsed by plistlib, and result in the same data structure ---------- Added file: http://bugs.python.org/file30526/plistlib_generate_testdata.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 14:23:29 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 12:23:29 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1370867009.98.0.33642297695.issue14455@psf.upfronthosting.co.za> Ronald Oussoren added the comment: See also: #18168: request for the sort_keys option #11101: request for an option to ignore 'None' values when writing #9256: datetime.datetime objects created by plistlib don't include timezone information (and looking at the code I'd say that timezones are ignored when *writing* plist files as well) #10733: Apple's plist can create malformed XML (control characters) than cannot be read by plistlib ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 14:48:54 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Jun 2013 12:48:54 +0000 Subject: [issue18179] SMTP.local_hostname is undocumented In-Reply-To: <1370859868.96.0.822120662228.issue18179@psf.upfronthosting.co.za> Message-ID: <1370868534.85.0.877963086399.issue18179@psf.upfronthosting.co.za> R. David Murray added the comment: SMTP.local_hostname is probably a private attribute of the SMTP class, dating from before we started getting strict about having private attributes start with '_'. However, I see no reason to keep it private; we might as well just document it, since I'm sure people are using it and there is no reason to expect to want to change its behavior. ---------- components: +email nosy: +barry, r.david.murray stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 15:15:53 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 13:15:53 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ Message-ID: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> New submission from Ronald Oussoren: Super() walks the MRO and looks for the looked-up attribute in the __dict__ of types on the MRO. This can cause problems when classes implement __getattribute__: a class on the MRO can implement a method that super() won't find because it isn't in the class __dict__ (yet). I'm running into this with PyObjC: the __dict__ for the Python proxies for Objective-C classes are filled lazily (*) by tp_getattro (__getattribute__ in Python) to speed up the bridge and because ObjC is almost as dynamic as Python and methods might appear during runtime (without there being a hook for detecting such changes). A possible solution to this: * Add a tp_getattro_super (**) slot to PyTypeObject, with the same signature as tp_getattro, but that only looks at this particular class (as opposed to tp_getattro that walks the entire MRO and looks in the object's __dict__) (***) * The tp_gettro of super calls tp_getattro_super of types of along the MRO when that slot is not NULL, and uses the current implementation (look in tp_dict) when the slot is NULL. Would such a change be acceptable? Open issues: * Does the new slot get exposed to Python code (and if so, under which name)? * Should PyObject_GenericGetAttr use the new slot as well? Footnotes: (*) The current release of PyObjC (2.5) eagerly tries to keep the proxy class __dict__ up to date, an upcoming major release will be as lazy as possible to speed up the bridge. The problem can with some effert be triggered with PyObjC 2.5, and triggering it is easy in the upcoming major release (**) Or some better name (***) I'm being very sloppy in my use of terminology here, hopefully my proposal is clear enough anyway. ---------- components: Interpreter Core messages: 190905 nosy: ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: super vs. someclass.__getattribute__ type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 15:59:13 2013 From: report at bugs.python.org (Alexander Tobias Heinrich) Date: Mon, 10 Jun 2013 13:59:13 +0000 Subject: [issue18182] xml.dom.createElement() does not take implicit namespaces into account Message-ID: <1370872753.13.0.359771001968.issue18182@psf.upfronthosting.co.za> New submission from Alexander Tobias Heinrich: First of all, I am not sure, if this is a bug in python itself - it could as well be a bug in the py-dom-xpath module (http://code.google.com/p/py-dom-xpath) or not a bug at all (but I find the latter to be highly unlikely). Consider an XML document such as: If one creates a new Chimp-element using the xml.dom.createElement() function and then appends it to the Compound element, then the xpath module will not find the element unless the whole document is saved and then re-parsed. Creating the element with xml.dom.createElementNS() and thus explicitly specifying its namespace works around the problem. I consider this to be a bug, because in both cases, xml.dom will create the same valid XML, so I believe xpath should produce the same results in both cases, too. My believe, that the bug is in xml.dom is just a feeling and I could be wrong. I imagine, that xml.dom.createElement() forgets about adding the new element to its inherited namespace and adds it to the null namespace instead. In consequence xpath doesn't find the new element. I originally posted a more verbose explanation of this issue to StackOverflow (see http://stackoverflow.com/questions/16980521/python-xpath-find-wont-find-new-elements-if-they-were-added-without-namespac ), because I was unsure about whether this is a bug or not - and if it was, then in which module. Because I did not receive any feedback on that post, I have now decided to file it here as a bug report. I attached a sample script that demonstrates the problem if (xpath dependency is installed). I tested it under Windows with Python 2.7.5 and 2.7.4. ---------- components: XML files: pydomprob.py messages: 190906 nosy: Alexander.Tobias.Heinrich priority: normal severity: normal status: open title: xml.dom.createElement() does not take implicit namespaces into account type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file30527/pydomprob.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 16:20:36 2013 From: report at bugs.python.org (Dave Challis) Date: Mon, 10 Jun 2013 14:20:36 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError Message-ID: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> New submission from Dave Challis: This occurred when attempting to decode invalid UTF-8 bytes using "errors='replace'", then attempting to lowercase the produced unicode string. This was also tested in python 2.7, but it doesn't occur there. Code to reproduce: x = b'\xe2\xb3\x99\xb3\xd1\x9f\xe0vjGd|\x12\xf2\x84\xac\xae&$\xa4\xae+\xa4sbtf$&fG\xfb\xe6?.\xe2sbv\x14\xcb\x89\x98\xda\xd9\x99\xda\xb9d9\x1bY\x99\xb7\xb3\x1b9\xa2y*B\xa3\xba\xefj&g\xe2\x92Et\x85~\xbf\x8a\xe3\x919\x8bvc\xfb#$$.\xber6D&b.#4\xa4.\x13RtI\x10\xed\x9c\xd0\x98\xb8\x18\x91\x99\\\nC\x13\x8dV\xccL\xf4\x89\x9c\x90' x = x.decode('utf-8', errors='replace') x.lower() Output: Traceback (most recent call last): File "", line 1, in SystemError: invalid maximum character passed to PyUnicode_New ---------- components: Unicode messages: 190907 nosy: davechallis, ezio.melotti priority: normal severity: normal status: open title: Calling .lower() on certain unicode string raises SystemError type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 16:26:02 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Mon, 10 Jun 2013 14:26:02 +0000 Subject: [issue18177] Typo in Documents In-Reply-To: <1370829780.84.0.0627044566719.issue18177@psf.upfronthosting.co.za> Message-ID: <1370874362.17.0.368713820114.issue18177@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Confirmed. I think this is a general typographic issue in the PDF documentation. If I cut-and-paste the datetime.isoformat(sep='T') line from the PDF, the single quotes are pasted as U+2019 RIGHT SINGLE QUOTE. Looking at the library.tex file built by "make pdflatex", it contains the ASCII single quotes, so LaTeX is responsible for turning the quotes into smart quotes. I don't know if this is worth fixing and can see arguments both ways. The smart quotes are readable and I doubt a reader will be confused and try to actually type them in their source code. OTOH it's annoying that cut-and-pasting code from the PDFs won't work. ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 16:29:29 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Mon, 10 Jun 2013 14:29:29 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370874569.4.0.529895469312.issue18181@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Do you have an example in pure Python code? ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 16:38:17 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Jun 2013 14:38:17 +0000 Subject: [issue18177] Typo in Documents In-Reply-To: <1370829780.84.0.0627044566719.issue18177@psf.upfronthosting.co.za> Message-ID: <1370875097.58.0.589492361658.issue18177@psf.upfronthosting.co.za> R. David Murray added the comment: I presume that tex doesn't do quote-transformation on code blocks (it is not really smart quotes, since IIRC in tex you actually have to specify ` and ' in the correct places yourself). So perhaps the problem is that the function headers &c aren't being properly marked up as code in the latex output engine of Sphinx? ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 16:39:00 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Jun 2013 14:39:00 +0000 Subject: [issue18177] Incorect quote marks in code section-headers in PDF version of docs In-Reply-To: <1370829780.84.0.0627044566719.issue18177@psf.upfronthosting.co.za> Message-ID: <1370875140.54.0.831781381344.issue18177@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- title: Typo in Documents -> Incorect quote marks in code section-headers in PDF version of docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 16:46:57 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 10 Jun 2013 14:46:57 +0000 Subject: [issue18180] Refleak in test_imp on Windows In-Reply-To: <1370865265.03.0.501914398945.issue18180@psf.upfronthosting.co.za> Message-ID: <3bTccc1JGjzRqd@mail.python.org> Roundup Robot added the comment: New changeset ec854f76d6b9 by Richard Oudkerk in branch '3.3': Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows(). http://hg.python.org/cpython/rev/ec854f76d6b9 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 16:55:13 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 14:55:13 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370876113.9.0.807501929776.issue18183@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: +Interpreter Core nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:08:16 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 15:08:16 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370876896.42.0.155961425001.issue18181@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I didn't, but the attached script should do the trick. The code suffers badly from copy&paste editing, but more or less has the same behavior as PyObjC. It defines a subclass of list (MyList) with an append method, and more importantly also defines 3 "proxy" classes: ProxyObject, ProxyList and ProxyMyList that are proxy types for object, list and MyList. At the end I try to access methods on instances of a proxy objects for MyList, and finally try to access super(MyList, v).append. That only works when "append" is in the __dict__ for ProxyList (for example by uncommenting the 3 lines just above the use of super()). ---------- Added file: http://bugs.python.org/file30528/supers.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:12:16 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 15:12:16 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1370877136.13.0.0919915647892.issue14455@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The test failure I'm getting is caused by a difference in the order in which items are written to the archive. I'm working on a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:23:49 2013 From: report at bugs.python.org (Chris AtLee) Date: Mon, 10 Jun 2013 15:23:49 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1370877829.38.0.794912540474.issue18167@psf.upfronthosting.co.za> Chris AtLee added the comment: To demonstrate how to hit this in a real use case, run the attached script which implements a simple http server that saves POSTed files to a local file "got_data". It returns the sha1sum of the POSTed file as the http response. Then, create a test file consisting of 65,535 null bytes, and submit with curl. -> % dd if=/dev/zero of=data bs=1 count=65535 65535+0 records in 65535+0 records out 65535 bytes (66 kB) copied, 0.0890487 s, 736 kB/s -> % sha1sum data 391edab7225a1de662ebc3a1a670a20d8e6a226b data -> % curl -Fdata=@data http://localhost:8080/ 8dd623ef130a8cd3e97086101a6e1255a91fb916% ---------- Added file: http://bugs.python.org/file30529/test_cgi_server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:33:14 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 10 Jun 2013 15:33:14 +0000 Subject: [issue18174] Make regrtest with --huntrleaks check for fd leaks In-Reply-To: <1370807273.91.0.83033499223.issue18174@psf.upfronthosting.co.za> Message-ID: <3bTdf174dSzPkG@mail.python.org> Roundup Robot added the comment: New changeset a7381fe515e8 by Richard Oudkerk in branch '2.7': Issue #18174: Fix fd leaks in tests. http://hg.python.org/cpython/rev/a7381fe515e8 New changeset 46fe1bb0723c by Richard Oudkerk in branch '3.3': Issue #18174: Fix fd leaks in tests. http://hg.python.org/cpython/rev/46fe1bb0723c ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:49:51 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 15:49:51 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370879391.22.0.180237864126.issue18183@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Minimal example: >>> '\U00010000\U00100000'.lower() Traceback (most recent call last): File "", line 1, in SystemError: invalid maximum character passed to PyUnicode_New ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:50:38 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 15:50:38 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370879438.31.0.581048537702.issue18183@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:51:10 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 10 Jun 2013 15:51:10 +0000 Subject: [issue18180] Refleak in test_imp on Windows In-Reply-To: <1370865265.03.0.501914398945.issue18180@psf.upfronthosting.co.za> Message-ID: <1370879470.41.0.0625862964038.issue18180@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> resource usage versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:53:14 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 15:53:14 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370879594.65.0.295445067437.issue18183@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It happens due to use fast MAX_MAXCHAR() which can produce maxchar out of range (0x10000 | 0x100000 > MAX_UNICODE). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:53:50 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 10 Jun 2013 15:53:50 +0000 Subject: [issue18174] Make regrtest with --huntrleaks check for fd leaks In-Reply-To: <1370807273.91.0.83033499223.issue18174@psf.upfronthosting.co.za> Message-ID: <1370879630.26.0.966914974603.issue18174@psf.upfronthosting.co.za> Richard Oudkerk added the comment: The test_shutil leak is caused by #17899. The others are fixed by a7381fe515e8 and 46fe1bb0723c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 17:57:23 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Mon, 10 Jun 2013 15:57:23 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370879843.3.0.360732826425.issue18183@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: >>> a = chr(0x84b2e)+chr(0x109710) >>> a.lower() SystemError: invalid maximum character passed to PyUnicode_New The MAX_MAXCHAR() macro only works for 'maxchar' values, like 0xff, 0xffff... in do_upper_or_lower() it's used with arbitrary UCS4 values. ---------- nosy: +amaury.forgeotdarc, haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 18:01:03 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Mon, 10 Jun 2013 16:01:03 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370880063.62.0.0392041581279.issue18181@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: issue783528 was a bit similar. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 18:09:22 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 16:09:22 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370880562.25.0.874714832433.issue18181@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Looks like it. That issue was closed without a good reason though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 18:23:23 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 10 Jun 2013 16:23:23 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1370881403.51.0.678365721503.issue14455@psf.upfronthosting.co.za> Ronald Oussoren added the comment: v4 passes the included tests. The testsuite isn't finished yet. ---------- Added file: http://bugs.python.org/file30530/issue14455-v4.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 18:24:12 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 10 Jun 2013 16:24:12 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <3bTfmq410FzRxF@mail.python.org> Roundup Robot added the comment: New changeset 89b106d298a9 by Benjamin Peterson in branch '3.3': remove MAX_MAXCHAR because it's unsafe for computing maximum codepoitn value (see #18183) http://hg.python.org/cpython/rev/89b106d298a9 New changeset 668aba845fb2 by Benjamin Peterson in branch 'default': merge 3.3 (#18183) http://hg.python.org/cpython/rev/668aba845fb2 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 18:26:55 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 10 Jun 2013 16:26:55 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370881615.53.0.384340664156.issue18183@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I simply removed the MAX_MAXCHAR micro-optimization, since it seems fairly unsafe. Interested parties can restore it safely if they wish. ---------- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 18:51:08 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Jun 2013 16:51:08 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370883068.97.0.327952909403.issue18183@psf.upfronthosting.co.za> STINNER Victor added the comment: Oops, my MAX_MAXCHAR macro was too optimized :-) (the result is incorrect) It shows us that the test suite does not have enough test on non-BMP characters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 20:04:31 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 18:04:31 +0000 Subject: [issue18178] Redefinition of malloc(3) family of functions at build time In-Reply-To: <1370851878.25.0.593003779218.issue18178@psf.upfronthosting.co.za> Message-ID: <1370887471.86.0.934445678484.issue18178@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I don't have a system affected by the change, but the explanation and the patch look right to me. FWIW, the patch applies cleanly to 3.4 head and passes 'make test'. ---------- stage: -> commit review versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 20:07:27 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 10 Jun 2013 18:07:27 +0000 Subject: [issue18182] xml.dom.createElement() does not take implicit namespaces into account In-Reply-To: <1370872753.13.0.359771001968.issue18182@psf.upfronthosting.co.za> Message-ID: <1370887647.5.0.0867914979336.issue18182@psf.upfronthosting.co.za> Jeremy Kloth added the comment: This really is not a bug, but more of a (common) misunderstanding of how the mixing of namespace-aware (createElementNS) and namespace-ignorant (createElement) methods work. >From DOM3 Core [http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations]: Elements and attributes created by the DOM Level 1 methods do not have a namespace prefix, namespace URI or local name. DOM4 updates this to say that the namespace URI and prefix are null if not explicitly given at creation. To use your example, adding a Chimp-element to the existing document is really: The fact that serializing and re-parsing it works is really a bug in the serializing code not honoring the null-namespace. So in short, always use create*NS() methods when dealing with namespace-aware XML (like XPath). ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 20:17:23 2013 From: report at bugs.python.org (Berker Peksag) Date: Mon, 10 Jun 2013 18:17:23 +0000 Subject: [issue13248] deprecated in 3.2/3.3, should be removed in 3.4 In-Reply-To: <1319392186.66.0.823106983991.issue13248@psf.upfronthosting.co.za> Message-ID: <1370888243.96.0.752427840637.issue13248@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 20:44:32 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 18:44:32 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. In-Reply-To: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> Message-ID: <1370889872.82.0.859465183947.issue18176@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- hgrepos: +197 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 20:46:33 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 18:46:33 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. In-Reply-To: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> Message-ID: <1370889993.52.0.560347171707.issue18176@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- keywords: +patch Added file: http://bugs.python.org/file30531/686836ad3042.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 20:51:28 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 18:51:28 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. In-Reply-To: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> Message-ID: <1370890288.27.0.240268861865.issue18176@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: This is a trivial change, but I would like someone to review this in case there is a better solution to keep this in sync with unicodedata.unidata_version. ---------- assignee: -> docs at python keywords: +needs review nosy: +docs at python stage: -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 21:53:31 2013 From: report at bugs.python.org (Bohuslav "Slavek" Kabrda) Date: Mon, 10 Jun 2013 19:53:31 +0000 Subject: [issue9263] Try to print repr() when an C-level assert fails (in the garbage collector, beyond?) In-Reply-To: <1279151450.93.0.973335817084.issue9263@psf.upfronthosting.co.za> Message-ID: <1370894011.56.0.19178914823.issue9263@psf.upfronthosting.co.za> Bohuslav "Slavek" Kabrda added the comment: I'm currently patching Python 3.3.2 with this, so I thought it might be nice to attach an up-to-date patch. The only notable difference is that I added self.preclean() at the beginning of test_refcount_errors - without it, running test suite produced a huge number of these lines: Exception AttributeError: "'GCCallbackTests' object has no attribute 'visit'" in > ignored ---------- nosy: +bkabrda Added file: http://bugs.python.org/file30532/00170-gc-assertions.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 22:25:41 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 20:25:41 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370895941.22.0.0655997166856.issue18183@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Here are additional tests for this issue. ---------- keywords: +patch stage: needs patch -> patch review status: closed -> open Added file: http://bugs.python.org/file30533/test_issue18183.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 22:37:57 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 20:37:57 +0000 Subject: [issue10382] Command line error marker misplaced on unicode entry In-Reply-To: <1289417775.52.0.418272995538.issue10382@psf.upfronthosting.co.za> Message-ID: <1370896677.04.0.384769068557.issue10382@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: The latest patch at #2382 is simpler than mine, so I am closing this as duplicate. ---------- resolution: -> duplicate status: open -> closed superseder: -> [Py3k] SyntaxError cursor shifted if multibyte character is in line. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 22:43:15 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Jun 2013 20:43:15 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370896995.93.0.0699484669622.issue18183@psf.upfronthosting.co.za> STINNER Victor added the comment: + '\U00010000\U00100000'.lower() Why not checking the result of these calls? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 22:45:38 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 20:45:38 +0000 Subject: [issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line. In-Reply-To: <1205817752.04.0.892564898323.issue2382@psf.upfronthosting.co.za> Message-ID: <1370897138.31.0.753546880917.issue2382@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: haypo> The purpose of this issue is to handle CJK characters taking 2 haypo> columns instead of 1 in a terminal, or did I misunderstand it? That's the other half of the problem, but the more common issue is misplaced caret when non-ascii characters are present: >>> ?????????? File "", line 1 ?????????? ^ SyntaxError: invalid character in identifier With Serhiy's patch: >>> ?????????? File "", line 1 ?????????? ^ SyntaxError: invalid character in identifier ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 22:54:17 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 10 Jun 2013 20:54:17 +0000 Subject: [issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line. In-Reply-To: <1205817752.04.0.892564898323.issue2382@psf.upfronthosting.co.za> Message-ID: <1370897657.74.0.614441426102.issue2382@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Serhiy's patch is lacking tests, but it passes the test I proposed at #10382 at attaching here. ---------- Added file: http://bugs.python.org/file30534/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 23:00:13 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 21:00:13 +0000 Subject: [issue18184] Add range check for %c in PyUnicode_FromFormat Message-ID: <1370898013.19.0.579439947433.issue18184@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Currently PyUnicode_FromFormat doesn't check an argument for %c and can raise SystemError only due maxchar check in PyUnicode_New. On 2.7 an error doesn't raised, but %c argument can be silently wrapped (on narrow build) or illegal Unicode string can be created (on wide build). The proposed patch adds explicit range check for %c argument. ---------- components: Interpreter Core, Unicode files: format_c.diff keywords: patch messages: 190935 nosy: ezio.melotti, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add range check for %c in PyUnicode_FromFormat type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30535/format_c.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 23:00:38 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 21:00:38 +0000 Subject: [issue18184] Add range check for %c in PyUnicode_FromFormat In-Reply-To: <1370898013.19.0.579439947433.issue18184@psf.upfronthosting.co.za> Message-ID: <1370898038.22.0.917808355408.issue18184@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file30536/format_c-2.7.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 23:03:52 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 21:03:52 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1370898232.4.0.101979435099.issue18183@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The result is trivial. Is not checking the result distract an attention from the main issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 23:08:58 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Jun 2013 21:08:58 +0000 Subject: [issue18184] Add range check for %c in PyUnicode_FromFormat In-Reply-To: <1370898013.19.0.579439947433.issue18184@psf.upfronthosting.co.za> Message-ID: <1370898538.88.0.127021254436.issue18184@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 10 23:22:51 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Jun 2013 21:22:51 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. In-Reply-To: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> Message-ID: <1370899371.56.0.672715398863.issue18176@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: +Documentation, Unicode nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 01:05:54 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Jun 2013 23:05:54 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370905554.45.0.897236243062.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: py_setallocators-filename.patch: Here is a try to define an API providing the filename and line number of the C code. The Py_SetAllocators() API is unchanged: PyAPI_FUNC(int) Py_SetAllocators( char api, void* (*malloc) (size_t size, void *user_data), void* (*realloc) (void *ptr, size_t size, void *user_data), void (*free) (void *ptr, void *user_data), void *user_data ); If Python is compiled with -DPYMEM_TRACE_MALLOC, user_data is not the last parameter passed to Py_SetAllocators() but a pointer to a _PyMem_Trace structure: typedef struct { void *data; /* NULL and -1 when unknown */ const char *filename; int lineno; } _PyMem_Trace; The problem is that the module using Py_SetAllocators() must be compiled differently depending on PYMEM_TRACE_MALLOC. Example from pytracemalloc, modified for this patch: --- _PyMem_Trace *ctrace; trace_api_t *api; void *call_data; void *ptr; #ifdef PYMEM_TRACE_MALLOC ctrace = (_PyMem_Trace *)data; api = (trace_api_t *)ctrace->data; ctrace->data = api->data; call_data = data; #else ctrace = NULL; api = (trace_api_t *)data; call_data = api->data; #endif ptr = api->malloc(size, call_data); ... --- I didn't like the "ctrace->data = api->data;" instruction: pytracemalloc modifies the input _PyMem_Trace structure. pytracemalloc code is a little bit more complex, but "it works". pytracemalloc can reuse the filename and line number of the C module, or of the Python module. It can be configured at runtime. Example of output for the C module: --- 2013-06-11 00:36:30: Top 15 allocations per file and line (compared to 2013-06-11 00:36:25) #1: Objects/dictobject.c:352: size=6 MiB (+4324 KiB), count=9818 (+7773), average=663 B #2: Objects/unicodeobject.c:1085: size=6 MiB (+2987 KiB), count=61788 (+26197), average=111 B #3: Objects/tupleobject.c:104: size=4054 KiB (+2176 KiB), count=44569 (+24316), average=93 B #4: Objects/typeobject.c:770: size=2440 KiB (+1626 KiB), count=13906 (+10360), average=179 B #5: Objects/bytesobject.c:107: size=2395 KiB (+1114 KiB), count=24846 (+11462), average=98 B #6: Objects/funcobject.c:12: size=1709 KiB (+1103 KiB), count=11516 (+7431), average=152 B #7: Objects/codeobject.c:117: size=1760 KiB (+871 KiB), count=11267 (+5578), average=160 B #8: Objects/dictobject.c:399: size=784 KiB (+627 KiB), count=10040 (+8028), average=80 B #9: Objects/listobject.c:159: size=420 KiB (+382 KiB), count=5386 (+4891), average=80 B #10: Objects/frameobject.c:649: size=1705 KiB (+257 KiB), count=3374 (+505), average=517 B #11: ???:?: size=388 KiB (+161 KiB), count=588 (+240), average=676 B #12: Objects/weakrefobject.c:36: size=241 KiB (+138 KiB), count=2579 (+1482), average=96 B #13: Objects/dictobject.c:420: size=135 KiB (+112 KiB), count=2031 (+1736), average=68 B #14: Objects/classobject.c:59: size=109 KiB (+105 KiB), count=1400 (+1345), average=80 B #15: Objects/unicodeobject.c:727: size=188 KiB (+86 KiB), count=1237 (+687), average=156 B 37 more: size=828 KiB (+315 KiB), count=8421 (+5281), average=100 B Total Python memory: size=29 MiB (+16 MiB), count=212766 (+117312), average=145 B Total process memory: size=68 MiB (+22 MiB) (ignore tracemalloc: 0 B) --- I also had to modify the following GC functions to get more accurate information: - _PyObject_GC_Malloc(size) - _PyObject_GC_New(tp) - _PyObject_GC_NewVar(tp, nitems) - PyObject_GC_Del(op) For example, PyTuple_New() calls PyObject_GC_NewVar() to allocate its memory. With my patch, you get "Objects/tupleobject.c:104" instead of a generic "Modules/gcmodule.c:1717". ---------- Added file: http://bugs.python.org/file30537/py_setallocators-filename.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 01:24:31 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 10 Jun 2013 23:24:31 +0000 Subject: [issue18114] Update PyImport_ImportFrozenModuleObject() to set __package__ In-Reply-To: <1370056399.99.0.692031308648.issue18114@psf.upfronthosting.co.za> Message-ID: <1370906671.79.0.329351441785.issue18114@psf.upfronthosting.co.za> Brett Cannon added the comment: Forgot that PyImport_ImportFrozenModule() uses PyImport_ImportFrozenModuleObject() and the former is used to load _frozen_importlib, so can't drop the function. The code could still be updated, though, to set __package__ before the code object is executed. That probably wouldn't be too hard to do by factoring out the code in PyImport_ImportModuleLevelObject which calculates the parent there. ---------- assignee: brett.cannon -> priority: normal -> low title: Update PyImport_ImportFrozenModuleObject() to use importlib -> Update PyImport_ImportFrozenModuleObject() to set __package__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 01:24:46 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 10 Jun 2013 23:24:46 +0000 Subject: [issue18114] Update PyImport_ImportFrozenModuleObject() to set __package__ In-Reply-To: <1370056399.99.0.692031308648.issue18114@psf.upfronthosting.co.za> Message-ID: <1370906686.82.0.597577436209.issue18114@psf.upfronthosting.co.za> Brett Cannon added the comment: Marking as easy for any C coders. ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 03:17:36 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jun 2013 01:17:36 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370913456.76.0.174533236195.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: New version of the patch, py_setallocators-3.patch: - _PyMem_DebugMalloc(), _PyMem_DebugFree() and _PyMem_DebugRealloc() are now setup as hooks to the system allocator and are hook on PyMem API *and* on PyObject API - move "if (size > PY_SSIZE_T_MAX)" check into PyObject_Malloc() and PyObject_Realloc() This patch does not propose a simple API to reuse internal debug hooks when replacing system (PyMem) allocators. ---------- Added file: http://bugs.python.org/file30538/py_setallocators-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 04:06:08 2013 From: report at bugs.python.org (Sye van der Veen) Date: Tue, 11 Jun 2013 02:06:08 +0000 Subject: [issue18185] Error in test_set.TestVariousIteratorArgs.test_inline_methods Message-ID: <1370916368.79.0.653461926178.issue18185@psf.upfronthosting.co.za> New submission from Sye van der Veen: I'm working with Python's test suite and noticed this error: http://hg.python.org/cpython/file/668aba845fb2/Lib/test/test_set.py#l1669 # etc... for g in (G, I, Ig, L, R): expected = meth(data) actual = meth(G(data)) # etc... I believe the assignment to actual should be using a lower-case 'g'. ---------- components: Tests messages: 190941 nosy: syeberman priority: normal severity: normal status: open title: Error in test_set.TestVariousIteratorArgs.test_inline_methods type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 04:41:16 2013 From: report at bugs.python.org (halfjuice) Date: Tue, 11 Jun 2013 02:41:16 +0000 Subject: [issue18168] plistlib output self-sorted dictionary In-Reply-To: <1370663536.42.0.663795573436.issue18168@psf.upfronthosting.co.za> Message-ID: <1370918476.86.0.965349990022.issue18168@psf.upfronthosting.co.za> halfjuice added the comment: Awesome. Thanks Ronald! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 05:30:23 2013 From: report at bugs.python.org (Matthew Bentley) Date: Tue, 11 Jun 2013 03:30:23 +0000 Subject: [issue18048] Merging test_pep263.py and test_coding.py In-Reply-To: <1369387812.98.0.236232283698.issue18048@psf.upfronthosting.co.za> Message-ID: <1370921423.58.0.0244398944133.issue18048@psf.upfronthosting.co.za> Matthew Bentley added the comment: OK, I think I fixed this. I merged the two tests into one, called test_source_encoding.py. It doesn't fail, and I'm not sure what else I need to do. Patch is attached. This is also my first patch, so please tell me if I'm doing anything wrong. ---------- keywords: +patch nosy: +Matthew.Bentley Added file: http://bugs.python.org/file30539/fix_issue_18048.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 05:52:10 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 11 Jun 2013 03:52:10 +0000 Subject: [issue17963] Deprecate the frame hack for implicitly getting module details In-Reply-To: <1368364153.58.0.131087315276.issue17963@psf.upfronthosting.co.za> Message-ID: <1370922730.94.0.989893118119.issue17963@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 06:08:17 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 11 Jun 2013 04:08:17 +0000 Subject: [issue17511] Idle find function closes after each find operation In-Reply-To: <1363902452.43.0.911749750934.issue17511@psf.upfronthosting.co.za> Message-ID: <3bTyPD27CDzPkG@mail.python.org> Roundup Robot added the comment: New changeset 73de0794ae71 by Roger Serwy in branch '2.7': #17511: Keep IDLE find dialog open after clicking "Find Next". http://hg.python.org/cpython/rev/73de0794ae71 New changeset dac11f143581 by Roger Serwy in branch '3.3': #17511: Keep IDLE find dialog open after clicking "Find Next". http://hg.python.org/cpython/rev/dac11f143581 New changeset 67714c4d9725 by Roger Serwy in branch 'default': #17511: merge with 3.3. http://hg.python.org/cpython/rev/67714c4d9725 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 06:11:31 2013 From: report at bugs.python.org (Roger Serwy) Date: Tue, 11 Jun 2013 04:11:31 +0000 Subject: [issue17511] Idle find function closes after each find operation In-Reply-To: <1363902452.43.0.911749750934.issue17511@psf.upfronthosting.co.za> Message-ID: <1370923891.7.0.494576236773.issue17511@psf.upfronthosting.co.za> Roger Serwy added the comment: I'm closing this issue as fixed. Thank you for the patch, Sarah. ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 06:23:04 2013 From: report at bugs.python.org (Berker Peksag) Date: Tue, 11 Jun 2013 04:23:04 +0000 Subject: [issue18185] Error in test_set.TestVariousIteratorArgs.test_inline_methods In-Reply-To: <1370916368.79.0.653461926178.issue18185@psf.upfronthosting.co.za> Message-ID: <1370924584.1.0.233142000674.issue18185@psf.upfronthosting.co.za> Berker Peksag added the comment: Related changeset: http://hg.python.org/cpython/rev/54ff68e973ee#l12.1110 ---------- keywords: +patch nosy: +berker.peksag stage: -> patch review versions: +Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30540/issue18185.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 07:36:27 2013 From: report at bugs.python.org (Chris Rebert) Date: Tue, 11 Jun 2013 05:36:27 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1370928987.85.0.713763211113.issue10581@psf.upfronthosting.co.za> Changes by Chris Rebert : ---------- nosy: +cvrebert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 07:53:37 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 11 Jun 2013 05:53:37 +0000 Subject: [issue16715] Get rid of IOError. Use OSError instead In-Reply-To: <3YW0Xs2j15zRkN@mail.python.org> Message-ID: <1370930017.44.0.560166740599.issue16715@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I would wait and see if it happens gain or on other buildbots. As I am sure you know, intermittent failures, not reproducible on demand, are nasty. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 08:55:17 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 11 Jun 2013 06:55:17 +0000 Subject: [issue6632] Include more chars in the decimal codec In-Reply-To: <1249317285.35.0.709481915004.issue6632@psf.upfronthosting.co.za> Message-ID: <1370933717.84.0.816224812267.issue6632@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: [In the light of the current discussion on python-ideas regarding adding support for the Unicode minus sign] I'm +1 on adding support for the minus code point, since it's the correct correspondent to the plus code point in Unicode. The traditional ASCII "-" is a compromise between a mathematical minus and a hyphen. https://en.wikipedia.org/wiki/Hyphen-minus While we're at it, we should probably also include the FULLWIDTH PLUS SIGN (U+FF0B) and SUPERSCRIPT PLUS SIGN (U+207A) as alternative for the plus sign, and additionally the SUPERSCRIPT MINUS (U+207B) as alternative for the minus sign. http://en.wikipedia.org/wiki/Minus_sign I'm also +1 on adding support for other mathematical symbols used in parsing numbers, but only if their purpose is clearly defined in the Unicode database (i.e. accepting an "e" in some other script for exponential notation should not be allowed). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 09:05:50 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 11 Jun 2013 07:05:50 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1370934350.24.0.934391503338.issue10581@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: I've changed my mind :-) Restricting the decimal encoder to only accept code points from one of the possible decimal digit ranges is a good idea. Let's do that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 10:40:58 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 11 Jun 2013 08:40:58 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1370940058.74.0.601421245448.issue14455@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The fifth version of the patch should be much cleaner. Changes: * Coding style cleanup, the new code uses PEP8 conformant names for methods and variables. * Explicitly make private classes private by prefixing their name with an underscore (including the old XML parser/generator classes) * Remove support in the binary plist code for sets and uuids, neither can be written to plist files by Apple's code. * More tests * There is no support for JSON because JSON is not supported by Apple's propertylist APIs either. The command-line tool plutil does support JSON output, but the C and Objective-C APIs do not. * There is no support for the old OpenStep format. That format is badly documented, has been deprecated for a long time, and writing it is not supported by Apple's plist libraries. The OpenStep format also seems to be much more limited than the two modern ones. Open issues: * The patch contains plistlib.{dump,dumps,load,loads} which mirror the functions with same name from the pickle and json modules. Is is usefull to add those functions to plistlib, and deprecate the older functions? Advantages: + Cleaner API + Provides a clean path to remove plistlib.Data and plistlib._InternalDict (the latter is already deprecated) Disadvantages: - Very (too?) close to needless code churn * Is renaming PlistParser and PlistWriter ok? Both are private and a quick search on google seems to indicate that nobody directory uses these classes. If renaming is ok, should methods/variables be renamed to PEP8 style? * Should a 'default' keyword be added to the serialization functions (simular to the keyword in json.dump) I don't have a usecase for this, the only reason to add is is consistency with the json module * Should a 'skipvalues' keyword be added to the serialization functions (to ignore values that cannot be serialized, see #11101) I'm not convinced that this would be a good idea. * Should a 'check_circular' keyword be added to the serialization functions (again similar to the same keyword for json.dump)? This would avoid relying on the recursion limit to break infinite loops when serializing circular datastructures. Would need to check if binary plist can contain circular data structures when they are written using Apple's libraries. ---------- keywords: +needs review Added file: http://bugs.python.org/file30541/issue14455-v5.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 10:45:49 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Tue, 11 Jun 2013 08:45:49 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1370940349.04.0.518100182958.issue3329@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: I prefer the new version without PYMEM_TRACE_MALLOC :-) Can we rename "API" and "api_id" to something more specific? maybe DOMAIN and domain_id? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 10:55:42 2013 From: report at bugs.python.org (Daniel Farina) Date: Tue, 11 Jun 2013 08:55:42 +0000 Subject: [issue14903] dictobject infinite loop on 2.6.5 on 32-bit x86 In-Reply-To: <1337890784.99.0.00556765207687.issue14903@psf.upfronthosting.co.za> Message-ID: <1370940942.89.0.901076135463.issue14903@psf.upfronthosting.co.za> Daniel Farina added the comment: Hello folks, After long delay, I can confirm this issue reproduces in a similar way inside of init_socket in 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 10:55:57 2013 From: report at bugs.python.org (Daniel Farina) Date: Tue, 11 Jun 2013 08:55:57 +0000 Subject: [issue14903] dictobject infinite loop on 2.6.5 on 32-bit x86 In-Reply-To: <1337890784.99.0.00556765207687.issue14903@psf.upfronthosting.co.za> Message-ID: <1370940957.54.0.229084553611.issue14903@psf.upfronthosting.co.za> Changes by Daniel Farina : ---------- versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 11:01:10 2013 From: report at bugs.python.org (Daniel Farina) Date: Tue, 11 Jun 2013 09:01:10 +0000 Subject: [issue18186] 2.x subprocess contains set notation Message-ID: <1370941270.02.0.283113352418.issue18186@psf.upfronthosting.co.za> New submission from Daniel Farina: I was vendoring subprocess to pick up the change for #16327 when I noticed I could not import it on 2.6. The backwards compatibility claim at the top is 2.2. Included is a tiny patch that uses a semantically equivalent form. ---------- components: Library (Lib) files: old-set-notation-v1.patch keywords: patch messages: 190953 nosy: Daniel.Farina priority: normal severity: normal status: open title: 2.x subprocess contains set notation versions: Python 2.6 Added file: http://bugs.python.org/file30542/old-set-notation-v1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 11:15:13 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 11 Jun 2013 09:15:13 +0000 Subject: [issue14903] dictobject infinite loop on 2.6.5 on 32-bit x86 In-Reply-To: <1337890784.99.0.00556765207687.issue14903@psf.upfronthosting.co.za> Message-ID: <1370942113.14.0.592849514981.issue14903@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +benjamin.peterson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 11:46:41 2013 From: report at bugs.python.org (Armin Rigo) Date: Tue, 11 Jun 2013 09:46:41 +0000 Subject: [issue18033] Example for Profile Module shows incorrect method In-Reply-To: <1369235558.14.0.532987051887.issue18033@psf.upfronthosting.co.za> Message-ID: <1370944001.51.0.311573042144.issue18033@psf.upfronthosting.co.za> Armin Rigo added the comment: A slightly more complete example that I tested: http://stackoverflow.com/a/16077568/1556290 ---------- nosy: +arigo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 11:50:11 2013 From: report at bugs.python.org (Berker Peksag) Date: Tue, 11 Jun 2013 09:50:11 +0000 Subject: [issue18186] 2.x subprocess contains set notation In-Reply-To: <1370941270.02.0.283113352418.issue18186@psf.upfronthosting.co.za> Message-ID: <1370944211.37.0.143270359926.issue18186@psf.upfronthosting.co.za> Berker Peksag added the comment: Python 2.6 only receives security fixes. You can also look at the subprocess32 module: https://pypi.python.org/pypi/subprocess32 ---------- nosy: +berker.peksag resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 11:52:34 2013 From: report at bugs.python.org (Daniel Farina) Date: Tue, 11 Jun 2013 09:52:34 +0000 Subject: [issue18186] 2.x subprocess contains set notation In-Reply-To: <1370941270.02.0.283113352418.issue18186@psf.upfronthosting.co.za> Message-ID: <1370944354.27.0.334974679656.issue18186@psf.upfronthosting.co.za> Daniel Farina added the comment: Then most assuredly the message at the top is out of date. It seems a pity that for this small change that older python versions cannot use the same code verbatim. It reads: # This module should remain compatible with Python 2.2, see PEP 291. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 11:53:14 2013 From: report at bugs.python.org (Daniel Farina) Date: Tue, 11 Jun 2013 09:53:14 +0000 Subject: [issue18186] 2.x subprocess contains set notation In-Reply-To: <1370941270.02.0.283113352418.issue18186@psf.upfronthosting.co.za> Message-ID: <1370944394.09.0.906677716269.issue18186@psf.upfronthosting.co.za> Daniel Farina added the comment: Also, this fix would be for 2.7. My mistake, even though the goal was to import on older Pythons. ---------- status: closed -> open versions: +Python 2.7 -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 12:11:42 2013 From: report at bugs.python.org (Berker Peksag) Date: Tue, 11 Jun 2013 10:11:42 +0000 Subject: [issue18187] Fix broken link in Doc/library/venv.rst Message-ID: <1370945502.31.0.379254379799.issue18187@psf.upfronthosting.co.za> New submission from Berker Peksag: The correct location of the venv module is Lib/venv, not Lib/venv.py. Attaching a simple patch that fixes the location. ---------- assignee: docs at python components: Documentation files: venv-location.diff keywords: patch messages: 190958 nosy: berker.peksag, docs at python priority: normal severity: normal status: open title: Fix broken link in Doc/library/venv.rst versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30543/venv-location.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 12:32:08 2013 From: report at bugs.python.org (Shlomi Fish) Date: Tue, 11 Jun 2013 10:32:08 +0000 Subject: [issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags Message-ID: <1370946728.63.0.485742635949.issue18188@psf.upfronthosting.co.za> New submission from Shlomi Fish: After I build Python-3.3.2 from the .tar.xz using the following script (on Mageia Linux Cauldron x86-64): <<< #!/bin/bash ./configure --prefix="$HOME/apps/python3" --with-threads \ --enable-ipv6 --with-dbmliborder=gdbm \ --with-system-expat \ --with-system-ffi \ --enable-shared \ --with-valgrind shlomif at telaviv1:~/Download/unpack/prog/python/Python-3.3.2$ >>> then I get this test failure in the ?test_no_optimize_flag?: [ QUOTE ] ====================================================================== ERROR: test_no_optimize_flag (distutils.tests.test_bdist_rpm.BuildRpmTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/tests/test_bdist_rpm.py", line 125, in test_no_optimize_flag cmd.run() File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/command/bdist_rpm.py", line 366, in run self.spawn(rpm_cmd) File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/cmd.py", line 366, in spawn spawn(cmd, search_path, dry_run=self.dry_run) File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/spawn.py", line 32, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/home/shlomif/Download/unpack/prog/python/Python-3.3.2/Lib/distutils/spawn.py", line 163, in _spawn_posix % (cmd[0], exit_status)) distutils.errors.DistutilsExecError: command 'rpmbuild' failed with exit status 1 https://bugs.mageia.org/show_bug.cgi?id=9395 [ / QUOTE] More info can be found at http://bugs.python.org/issue18142 . Please look into fixing it. Regards, -- Shlomi Fish ---------- components: Tests messages: 190959 nosy: shlomif priority: normal severity: normal status: open title: ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 13:30:19 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Tue, 11 Jun 2013 11:30:19 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py Message-ID: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> New submission from R. Jayakrishnan: Continuing the IDLE unittest framework initiated in http://bugs.python.org/issue15392. A small unit test for IDLE Delegator.py module. This patch introduces a test module named test_delegator.py inside Lib/idlelib/idle_test, considering the points README file in idle_test. The test method test_setdelegate() simply passes a text widget to Delegator by calling setdelegate(), and test the widget returned by getdelegate() for the same. ---------- components: IDLE files: test_delegator.patch keywords: patch messages: 190960 nosy: JayKrish priority: normal severity: normal status: open title: IDLE Improvements: Unit test for Delegator.py type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30544/test_delegator.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 13:45:06 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Tue, 11 Jun 2013 11:45:06 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1370951106.21.0.92369916718.issue18189@psf.upfronthosting.co.za> Changes by R. Jayakrishnan : ---------- versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 13:46:04 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 11 Jun 2013 11:46:04 +0000 Subject: [issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags In-Reply-To: <1370946728.63.0.485742635949.issue18188@psf.upfronthosting.co.za> Message-ID: <1370951164.28.0.472745091655.issue18188@psf.upfronthosting.co.za> R. David Murray added the comment: This looks related to issue 14443, which was supposed to be fixed in 3.3.0. Can you do some of the same debugging that was done in that issue and see if it reveals any more about the problem? Also, I notice from that issue that Antoine was (is?) running Mageia, so I'm adding him to nosy in case he wants to try to reproduce it. ---------- nosy: +pitrou, r.david.murray type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 13:59:00 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Jun 2013 11:59:00 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1370940349.04.0.518100182958.issue3329@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Amaury Forgeot d'Arc added the comment: > I prefer the new version without PYMEM_TRACE_MALLOC :-) Well, py_setallocators-filename.patch is more a proof-of-concept showing how to use my Py_SetAllocators() API to pass the C trace (filename/line number), than a real proposition. The patch is very intrusive and huge, I also prefer py_setallocators-3.patch :-) > Can we rename "API" and "api_id" to something more specific? maybe DOMAIN and domain_id? Something like: {PY_ALLOC_MEM_DOMAIN, PY_ALLOC_OBJECT_DOMAIN}. or {PYMEM_DOMAIN, PYOBJECT_DOMAIN} ? There are only two values, another option is to duplicate functions: - PyMem_GetAllocators(), PyMem_SetAllocators(), PyMem_Malloc(), .. - PyObject_GetAllocators(), PyObject_SetAllocators(), PyObject_Malloc(), .. I prefer PyMem_SetAllocators() over PYOBJECT_DOMAIN. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 14:47:55 2013 From: report at bugs.python.org (Todd Rovito) Date: Tue, 11 Jun 2013 12:47:55 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1370954875.17.0.350471764493.issue18189@psf.upfronthosting.co.za> Changes by Todd Rovito : ---------- nosy: +Todd.Rovito _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 14:53:08 2013 From: report at bugs.python.org (Todd Rovito) Date: Tue, 11 Jun 2013 12:53:08 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1370955188.74.0.374015601495.issue18189@psf.upfronthosting.co.za> Changes by Todd Rovito : ---------- nosy: +philwebster _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 14:56:13 2013 From: report at bugs.python.org (Todd Rovito) Date: Tue, 11 Jun 2013 12:56:13 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1370955373.45.0.245168083898.issue18189@psf.upfronthosting.co.za> Changes by Todd Rovito : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 15:07:35 2013 From: report at bugs.python.org (Shlomi Fish) Date: Tue, 11 Jun 2013 13:07:35 +0000 Subject: [issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags In-Reply-To: <1370946728.63.0.485742635949.issue18188@psf.upfronthosting.co.za> Message-ID: <1370956055.07.0.930976246482.issue18188@psf.upfronthosting.co.za> Shlomi Fish added the comment: Hi, I don't understand the issue in questioned - it's too wordy and unclear. I don't know how to do the debugging in question - please guide me. I should note that after I do ?unset PYTHONDONTWRITEBYTECODE? then all tests pass except for test_ftp.py, which gives me this. However, I don't see the bdist_rpm anywhere in the output. Was it skipped? If so, how, where and why? [QUOTE] ====================================================================== error: test_ftp (test.test_urllib2net.othernetworktests) ---------------------------------------------------------------------- traceback (most recent call last): file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 2307, in retrfile self.ftp.cwd(file) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/ftplib.py", line 591, in cwd return self.voidcmd(cmd) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/ftplib.py", line 264, in voidcmd return self.voidresp() file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/ftplib.py", line 238, in voidresp resp = self.getresp() file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/ftplib.py", line 233, in getresp raise error_perm(resp) ftplib.error_perm: 550 failed to change directory. during handling of the above exception, another exception occurred: traceback (most recent call last): file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/test/test_urllib2net.py", line 112, in test_ftp self._test_urls(urls, self._extra_handlers()) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/test/test_urllib2net.py", line 218, in _test_urls f = urlopen(url, req, timeout) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/test/test_urllib2net.py", line 33, in wrapped return _retry_thrice(func, exc, *args, **kwargs) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/test/test_urllib2net.py", line 23, in _retry_thrice return func(*args, **kwargs) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 469, in open response = self._open(req, data) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 487, in _open '_open', req) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 447, in _call_chain result = func(*args) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 1464, in ftp_open fp, retrlen = fw.retrfile(file, type) file "/home/shlomif/download/unpack/prog/python/python-3.3.2/lib/urllib/request.py", line 2309, in retrfile raise urlerror('ftp error: %d' % reason) from reason typeerror: %d format: a number is required, not error_perm ---------------------------------------------------------------------- ran 15 tests in 14.820s [/QUOTE] Also see: https://bugs.mageia.org/show_bug.cgi?id=9395 Regards, -- Shlomi Fish ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 15:27:41 2013 From: report at bugs.python.org (Pierrick Koch) Date: Tue, 11 Jun 2013 13:27:41 +0000 Subject: [issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe In-Reply-To: <1367934356.3.0.498041746077.issue17925@psf.upfronthosting.co.za> Message-ID: <1370957261.73.0.469809586575.issue17925@psf.upfronthosting.co.za> Pierrick Koch added the comment: sorry for the delay, here is the updated patch, shall I add a new class in Lib/test/test_asynchat.py ? ---------- Added file: http://bugs.python.org/file30545/cpython.asyncore.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 16:30:59 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 11 Jun 2013 14:30:59 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370961059.96.0.264348531685.issue18181@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I've attached a first very rough patch to demonstrate what I was rambling about. With this patch and a patched version of PyObjC I can use the builtin super class with the proxy classes for Objective-C classes. Open issues: * Does this need a pep? * The name of the new slot sucks, need to find a better one * Should it be possible to define the slot in Python code? Probably, the 'super.py' file is a crude hack but I can imagine more realistic scenarios where implementing the slot in Python would be useful. * There are no tests, and no documentation updates ---------- keywords: +patch Added file: http://bugs.python.org/file30546/issue-18181-poc.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 16:40:35 2013 From: report at bugs.python.org (Harry Bock) Date: Tue, 11 Jun 2013 14:40:35 +0000 Subject: [issue18190] RuntimeError raised with re.search + re.DOTALL on empty string Message-ID: <1370961635.12.0.751109303707.issue18190@psf.upfronthosting.co.za> New submission from Harry Bock: In Python 2.7.5, running re.search on regular expressions beginning with '.+' will raise RuntimeError if: * the string being matched is empty * the flags include re.DOTALL/re.S >>> re.search(".+a", "", flags=re.S) File "C:\Python27\lib\site-packages\IPython\core\interactiveshell.py", line 2731, in run_code exec code_obj in self.user_global_ns, self.user_ns File "", line 1, in myre.search("") RuntimeError: internal error in regular expression engine This does not occur if the input string is not empty, or if re.match is used instead of re.search, or if the re.S flag is omitted. The bug does not occur on previous versions of Python 2.x, including 2.7.4. ---------- components: Regular Expressions messages: 190966 nosy: ezio.melotti, hbock, mrabarnett priority: normal severity: normal status: open title: RuntimeError raised with re.search + re.DOTALL on empty string type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 16:40:58 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 11 Jun 2013 14:40:58 +0000 Subject: [issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags In-Reply-To: <1370946728.63.0.485742635949.issue18188@psf.upfronthosting.co.za> Message-ID: <1370961658.49.0.630035637586.issue18188@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I don't really use Mageia anymore, that said: > I should note that after I do ?unset PYTHONDONTWRITEBYTECODE? [snip] Yep, this is a long-lasting Mageia issue. See: https://qa.mandriva.com/show_bug.cgi?id=50484 https://bugs.mageia.org/show_bug.cgi?id=3348 You could try arguing with the maintainer (Michael Scherer) but he seems both stubborn and slightly clueless about anything Python-related, unfortunately. > all tests pass except for test_ftp.py, which gives me this You are not the only one getting the test_ftp failure. I guess Giampaolo didn't fix it well enough. > However, I don't see the bdist_rpm anywhere in the output Individual test cases are only listed on failure, or when verbose mode is specified. So, if it doesn't appear in the output, it passed. ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 16:44:39 2013 From: report at bugs.python.org (Julien Danjou) Date: Tue, 11 Jun 2013 14:44:39 +0000 Subject: [issue18191] urllib2/urllib.parse.splitport does not handle IPv6 correctly Message-ID: <1370961879.5.0.532150427937.issue18191@psf.upfronthosting.co.za> New submission from Julien Danjou: >>> import urllib.parse >>> urllib.parse.splitport("::1") (':', '1') This is obviously invalid. ---------- components: Library (Lib) messages: 190968 nosy: jd priority: normal severity: normal status: open title: urllib2/urllib.parse.splitport does not handle IPv6 correctly versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 17:00:30 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 11 Jun 2013 15:00:30 +0000 Subject: [issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags In-Reply-To: <1370946728.63.0.485742635949.issue18188@psf.upfronthosting.co.za> Message-ID: <1370962830.46.0.891420124885.issue18188@psf.upfronthosting.co.za> R. David Murray added the comment: Benjamin fixed the ftp error message, one commit after the 3.3.2 tag. Not sure if that is enough to make the test pass, though. So, it sounds like 18142 should be closed as "works for me"? That is, the remaining test failures are do to the poor system configuration in Mageia? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 17:29:27 2013 From: report at bugs.python.org (Shlomi Fish) Date: Tue, 11 Jun 2013 15:29:27 +0000 Subject: [issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags In-Reply-To: <1370946728.63.0.485742635949.issue18188@psf.upfronthosting.co.za> Message-ID: <1370964567.83.0.108854504708.issue18188@psf.upfronthosting.co.za> Shlomi Fish added the comment: I see regarding test_ftp.py and the verbosity of the tests and the absence of bdist_rpm in the output - however, shouldn't the test suite handle the presence of the PYTHONDONTWRITEBYTECODE=1 flag better? (E.g: refuse to run the tests to begin with (with an error), or not run the failing tests, or unset the flag before running the test suite, or whatever?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 17:45:37 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 11 Jun 2013 15:45:37 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370965537.24.0.685786093591.issue18181@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Second version of the poc adds a way to implement the hook in Python code, and supers_updated.py uses that hook. Still no tests, no documentation and with awfull naming :-) ---------- Added file: http://bugs.python.org/file30547/supers_updated.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 17:46:30 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 11 Jun 2013 15:46:30 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370965590.0.0.589218959066.issue18181@psf.upfronthosting.co.za> Ronald Oussoren added the comment: . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 18:01:58 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 11 Jun 2013 16:01:58 +0000 Subject: [issue17269] getaddrinfo segfaults on OS X when provided with invalid arguments combinations In-Reply-To: <1361489513.5.0.894275569557.issue17269@psf.upfronthosting.co.za> Message-ID: <1370966518.52.0.0651211265864.issue17269@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The buildbot seems to be happy right now (at least as far as getaddrinfo is concerned). ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 18:16:27 2013 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 11 Jun 2013 16:16:27 +0000 Subject: [issue18190] RuntimeError raised with re.search + re.DOTALL on empty string In-Reply-To: <1370961635.12.0.751109303707.issue18190@psf.upfronthosting.co.za> Message-ID: <1370967387.03.0.900557954972.issue18190@psf.upfronthosting.co.za> Matthew Barnett added the comment: Also in Python 3.3.2, but not Python 3.2. I haven't tested Python 3.3.1 or Python 3.3.0. ---------- versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 18:37:12 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 11 Jun 2013 16:37:12 +0000 Subject: [issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags In-Reply-To: <1370946728.63.0.485742635949.issue18188@psf.upfronthosting.co.za> Message-ID: <1370968632.82.0.73490995471.issue18188@psf.upfronthosting.co.za> R. David Murray added the comment: Given that we introduced the flag to support read-only file systems, I think one can argue that the test suite should support running on one. However, the right thing to do would be to set up a buildbot where that was true so that it doesn't get re-broken in the future. That might be a tad tricky to set up, I'm not sure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 19:16:39 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Tue, 11 Jun 2013 17:16:39 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370970999.25.0.158348101799.issue18181@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Is it possible to avoid a new slot? for example, super() could walk the tp_base-> chain and call tp_getattro each time the value changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 19:17:55 2013 From: report at bugs.python.org (Christian Tismer) Date: Tue, 11 Jun 2013 17:17:55 +0000 Subject: [issue17941] namedtuple should support fully qualified name for more portable pickling In-Reply-To: <1368071216.78.0.0822877752405.issue17941@psf.upfronthosting.co.za> Message-ID: <1370971075.26.0.552798476487.issue17941@psf.upfronthosting.co.za> Christian Tismer added the comment: I would like to make an additional suggestion. (and I implemented this yesterday): Native namedtuple (not a derived class) can be made much simpler to handle when no module and class machinery is involved at all. The way I implemented it has no need for sys._getframes, and it does not store a reference to the class at all. The advantage of doing so is that this maximizes the compatibility with ordinary tuples. Ordinary tuples have no pickling issue at all, and this way the named tuple should behave as well. My implementation re-creates the namedtuple classes on the fly by a function in __reduce_ex__. There is no speed penalty for this because of caching the classes by their unique name and set of field names. This is IMHO the way things should work: A namedtuple replaces a builtin type, so it has the same pickling behavior: nothing needed. Rationale: tuples are used everywhere and dynamically. namedtuple should be as compatible to that as possible. By having to specify a module etc., this dynamic is partially lost. Limitation: When a class is derived from namedtuple, pickling support is no longer automated. This is compatible with ordinary tuples as well. Cheers - Chris ---------- hgrepos: +198 nosy: +Christian.Tismer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 19:49:53 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 11 Jun 2013 17:49:53 +0000 Subject: [issue18190] RuntimeError raised with re.search + re.DOTALL on empty string In-Reply-To: <1370961635.12.0.751109303707.issue18190@psf.upfronthosting.co.za> Message-ID: <1370972993.96.0.593363998027.issue18190@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your report. This is a duplicate of issue17998. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> internal error in regular expression engine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 20:01:52 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 11 Jun 2013 18:01:52 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1370973712.89.0.78719015162.issue18181@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I don't think it is possible to avoid adding a new slot. The default implementation of tp_getattro (PyObject_GenericGetAttr) looks in the instance dict, while super does not (because it wants a less specific implementation). PyObject_GenericGetAttr will also walk the entire MRO, while super.__getattribute__ does not start search at the first entry in the MRO. Although I'd love to be proven wrong ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 20:40:20 2013 From: report at bugs.python.org (Ethan Furman) Date: Tue, 11 Jun 2013 18:40:20 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1370976020.25.0.616772240821.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: Final (hopefully! ;) patch. I stuck the toc reference in datatypes. If no more edits are necessary I'll commit on Friday (three days from now). ---------- Added file: http://bugs.python.org/file30548/pep-0435.12.stoneleaf.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:24:54 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:24:54 +0000 Subject: [issue17907] Deprecate imp.new_module() in favour of types.ModuleType In-Reply-To: <1367691908.58.0.339991159831.issue17907@psf.upfronthosting.co.za> Message-ID: <1370982294.64.0.682232211311.issue17907@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:44:04 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:44:04 +0000 Subject: [issue18192] Move imp.get_magic() to importlib Message-ID: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> New submission from Brett Cannon: As part of deprecating imp, need to move imp.get_magic() to importlib where it now belongs. Will be exposed as an attribute instead of a function, though. ---------- components: Library (Lib) messages: 190981 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Move imp.get_magic() to importlib versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:44:21 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:44:21 +0000 Subject: [issue17177] Document/deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1370983461.5.0.525523546391.issue17177@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- dependencies: +Move imp.get_magic() to importlib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:45:11 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:45:11 +0000 Subject: [issue18193] Move imp.reload() to importlib Message-ID: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> New submission from Brett Cannon: For convenience it should live directly off of importlib and not importlib.util. ---------- components: Library (Lib) messages: 190982 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Move imp.reload() to importlib versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:45:25 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:45:25 +0000 Subject: [issue17177] Document/deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1370983525.13.0.061226928407.issue17177@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- dependencies: +Move imp.reload() to importlib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:47:03 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:47:03 +0000 Subject: [issue18194] Move imp.source_from_cache/cache_from_source to importlib Message-ID: <1370983623.04.0.860337452651.issue18194@psf.upfronthosting.co.za> New submission from Brett Cannon: To facilitate deprecating imp, need to move imp.source_from_cache() and cache_from_source() to importlib.util or as static methods on importlib.machinery.SourceLoader. ---------- components: Library (Lib) messages: 190983 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Move imp.source_from_cache/cache_from_source to importlib versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:47:48 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:47:48 +0000 Subject: [issue17177] Document/deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1370983668.67.0.584107185318.issue17177@psf.upfronthosting.co.za> Brett Cannon added the comment: There should now be issues for each of the required relocations to make imp redundant. ---------- dependencies: +Move imp.source_from_cache/cache_from_source to importlib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:48:09 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:48:09 +0000 Subject: [issue17907] Deprecate imp.new_module() in favour of types.ModuleType In-Reply-To: <1367691908.58.0.339991159831.issue17907@psf.upfronthosting.co.za> Message-ID: <1370983689.73.0.35211832533.issue17907@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: brett.cannon -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 22:52:45 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 20:52:45 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1370983965.1.0.0636899793514.issue18192@psf.upfronthosting.co.za> Brett Cannon added the comment: This could be an attribute on importlib.machinery.SourceLoader instead of an attribute in importlib.util. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:06:40 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 11 Jun 2013 21:06:40 +0000 Subject: [issue18194] Move imp.source_from_cache/cache_from_source to importlib In-Reply-To: <1370983623.04.0.860337452651.issue18194@psf.upfronthosting.co.za> Message-ID: <20130611170637.68f75f5f@anarchist> Barry A. Warsaw added the comment: On Jun 11, 2013, at 08:47 PM, Brett Cannon wrote: >To facilitate deprecating imp, need to move imp.source_from_cache() and >cache_from_source() to importlib.util or as static methods on >importlib.machinery.SourceLoader. +1 for importlib.util. They should be publicly - and easily - available. -Barry ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:07:31 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 11 Jun 2013 21:07:31 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <20130611170728.1ddc7943@anarchist> Barry A. Warsaw added the comment: On Jun 11, 2013, at 08:44 PM, Brett Cannon wrote: >As part of deprecating imp, need to move imp.get_magic() to importlib where >it now belongs. Will be exposed as an attribute instead of a function, >though. so, importlib.magic ? ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:08:05 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 11 Jun 2013 21:08:05 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1370984885.77.0.25049522376.issue18192@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I'd like to see it be more easily accessible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:09:52 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 11 Jun 2013 21:09:52 +0000 Subject: [issue18157] remove usage of imp.load_module() from pydoc In-Reply-To: <1370626914.2.0.873203030907.issue18157@psf.upfronthosting.co.za> Message-ID: <3bVP401B52zP4B@mail.python.org> Roundup Robot added the comment: New changeset 2c747be20d05 by Brett Cannon in branch 'default': Issue #18157: stop using imp.load_module() in imp. http://hg.python.org/cpython/rev/2c747be20d05 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:11:16 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 21:11:16 +0000 Subject: [issue18157] remove usage of imp.load_module() from pydoc In-Reply-To: <1370626914.2.0.873203030907.issue18157@psf.upfronthosting.co.za> Message-ID: <1370985076.09.0.681966779941.issue18157@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:12:38 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 11 Jun 2013 21:12:38 +0000 Subject: [issue18158] Delete test_importhooks In-Reply-To: <1370626990.67.0.389270737108.issue18158@psf.upfronthosting.co.za> Message-ID: <3bVP7B2NZ9z7LjR@mail.python.org> Roundup Robot added the comment: New changeset 176fe1f8496f by Brett Cannon in branch 'default': Issue #18158: delete test_importhooks. Redundant in the face of http://hg.python.org/cpython/rev/176fe1f8496f ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:13:03 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 21:13:03 +0000 Subject: [issue18158] Delete test_importhooks In-Reply-To: <1370626990.67.0.389270737108.issue18158@psf.upfronthosting.co.za> Message-ID: <1370985183.24.0.613306157962.issue18158@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:13:25 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 11 Jun 2013 21:13:25 +0000 Subject: [issue14797] Deprecate imp.find_module()/load_module() In-Reply-To: <1336926729.01.0.715234386918.issue14797@psf.upfronthosting.co.za> Message-ID: <1370985205.88.0.662342946746.issue14797@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:26:05 2013 From: report at bugs.python.org (Ned Deily) Date: Tue, 11 Jun 2013 21:26:05 +0000 Subject: [issue18186] 2.x subprocess contains set notation In-Reply-To: <1370941270.02.0.283113352418.issue18186@psf.upfronthosting.co.za> Message-ID: <1370985965.36.0.164760110369.issue18186@psf.upfronthosting.co.za> Ned Deily added the comment: Your proposed change would still not make the source compatible with Python 2.2 (released over a decade ago) as set() was introduced in 2.4. When the subprocess module was introduced back then, it made sense to maintain compatibility with then-recent releases but it no longer makes sense when Python 2.7 is reaching the end of its life and all previous versions of Python 2 are retired or no longer receive bug fixes. In Python 3, a number of these compatibility claims have been removed from the source, including the one in subprocess. We could do a comment cleanup in the Python 2 source, as well, but at this point it hardly seems worth it. And since we do no testing against previously retired releases, making this code change is no guarantee that the module would really work in any previous version of Python 2.x. That's for you to decide if you are backporting to these unsupported versions. ---------- nosy: +ned.deily resolution: invalid -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:36:45 2013 From: report at bugs.python.org (Daniel Farina) Date: Tue, 11 Jun 2013 21:36:45 +0000 Subject: [issue18186] 2.x subprocess contains set notation In-Reply-To: <1370941270.02.0.283113352418.issue18186@psf.upfronthosting.co.za> Message-ID: <1370986605.57.0.00999560486404.issue18186@psf.upfronthosting.co.za> Daniel Farina added the comment: Okay, fair enough, in that case, here's a patch to fix the documentation as to not make incorrect statements. ---------- status: closed -> open Added file: http://bugs.python.org/file30549/fix-subprocess-compat-documentation-v1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:40:53 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 11 Jun 2013 21:40:53 +0000 Subject: [issue18187] Fix broken link in Doc/library/venv.rst In-Reply-To: <1370945502.31.0.379254379799.issue18187@psf.upfronthosting.co.za> Message-ID: <3bVPlm3xzWz7Ljy@mail.python.org> Roundup Robot added the comment: New changeset b1eeda9db91d by Ned Deily in branch '3.3': Issue #18187: Fix broken link in venv documentation. Patch by Berker Peksag. http://hg.python.org/cpython/rev/b1eeda9db91d New changeset e6fc120012e5 by Ned Deily in branch 'default': Issue #18187: merge from 3.3 http://hg.python.org/cpython/rev/e6fc120012e5 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 11 23:41:37 2013 From: report at bugs.python.org (Ned Deily) Date: Tue, 11 Jun 2013 21:41:37 +0000 Subject: [issue18187] Fix broken link in Doc/library/venv.rst In-Reply-To: <1370945502.31.0.379254379799.issue18187@psf.upfronthosting.co.za> Message-ID: <1370986897.04.0.586035246162.issue18187@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the patch! ---------- nosy: +ned.deily resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 00:01:18 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 11 Jun 2013 22:01:18 +0000 Subject: [issue18186] 2.x subprocess contains set notation In-Reply-To: <1370941270.02.0.283113352418.issue18186@psf.upfronthosting.co.za> Message-ID: <3bVQCL0yc3z7LjR@mail.python.org> Roundup Robot added the comment: New changeset 4b2fdd4dd700 by Ned Deily in branch '2.7': Issue #18186: remove obsolete 2.2 compatibility comment. http://hg.python.org/cpython/rev/4b2fdd4dd700 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 00:02:43 2013 From: report at bugs.python.org (Ned Deily) Date: Tue, 11 Jun 2013 22:02:43 +0000 Subject: [issue18186] 2.x subprocess contains set notation In-Reply-To: <1370941270.02.0.283113352418.issue18186@psf.upfronthosting.co.za> Message-ID: <1370988163.85.0.283330338352.issue18186@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 00:05:51 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Tue, 11 Jun 2013 22:05:51 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1370988351.13.0.716966062638.issue18192@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 00:06:24 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Tue, 11 Jun 2013 22:06:24 +0000 Subject: [issue18193] Move imp.reload() to importlib In-Reply-To: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> Message-ID: <1370988384.99.0.202051479768.issue18193@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 00:07:05 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Tue, 11 Jun 2013 22:07:05 +0000 Subject: [issue18194] Move imp.source_from_cache/cache_from_source to importlib In-Reply-To: <1370983623.04.0.860337452651.issue18194@psf.upfronthosting.co.za> Message-ID: <1370988425.31.0.542868751895.issue18194@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 00:45:32 2013 From: report at bugs.python.org (mrjbq7) Date: Tue, 11 Jun 2013 22:45:32 +0000 Subject: [issue18195] error when deep copying module is confusing Message-ID: <1370990732.59.0.654966118724.issue18195@psf.upfronthosting.co.za> New submission from mrjbq7: If you have a simple module (say "foo.py"): $ cat foo.py bar = 1 You get weird errors when trying to deep copy them (which I did by accident, not intentionally trying to deep copy modules): Python 2.7.2: >>> import foo >>> import copy >>> copy.deepcopy(foo) Traceback (most recent call last): File "", line 1, in File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 190, in deepcopy y = _reconstruct(x, rv, 1, memo) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 334, in _reconstruct state = deepcopy(state, memo) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy y = copier(x, memo) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy y = copier(x, memo) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 190, in deepcopy y = _reconstruct(x, rv, 1, memo) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 329, in _reconstruct y = callable(*args) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.py", line 93, in __newobj__ return cls.__new__(cls, *args) TypeError: object.__new__(NotImplementedType) is not safe, use NotImplementedType.__new__() Python 3.3.2: >>> import foo >>> import copy >>> copy.deepcopy(foo) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.3/copy.py", line 174, in deepcopy y = _reconstruct(x, rv, 1, memo) File "/usr/lib/python3.3/copy.py", line 301, in _reconstruct y.__dict__.update(state) AttributeError: 'NoneType' object has no attribute 'update' I'm not expecting to be able to deep copy a module, but it would be really great if it is not possible for the error message to say something like "deepcopy doesn't work for modules" rather than two different funky tracebacks that don't really explain the problem... Thanks, ---------- messages: 190996 nosy: mrjbq7 priority: normal severity: normal status: open title: error when deep copying module is confusing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 01:22:14 2013 From: report at bugs.python.org (Brandon Craig Rhodes) Date: Tue, 11 Jun 2013 23:22:14 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1370992934.65.0.777899181668.issue16487@psf.upfronthosting.co.za> Brandon Craig Rhodes added the comment: Kristj?n, your patch is a wonderful idea?I am about to commit production code that will have to create tens of thousands of temporary files during operation, one file each time SSL is started up on a socket, which could be avoided if something like this patch were applied. I had always assumed that it was simply a limitation of the underlying SSL library! An interface that takes a filename like this, instead of a live file-like object, seems so un-Pythonic that I assumed the only reason for it was a limitation in OpenSSL. Thank you very much for looking under the covers and discovering that this was not the case! I do, though, feel a slight twinge when we add Even More Parameters to a Standard Library routine but in such a way that it cannot be used with an existing parameter ? as here in your patch, where we gain a parameter like `certdata` that cannot be (should not be?) used at the same time as `certfile`. It seems redundant to have two names for the same parameter to the underlying library, and makes it look like the routine needs more information than it really does. Since my own instinct was to think, ten minutes ago, "Maybe I can pass a StringIO, since it says it wants a fine!", I am very much in support of the idea of keeping only the existing parameters, but making them accept both strings (which, for compatibility, would continue to be interpreted as filenames) and file-like objects as arguments. I think this would have a great deal of symmetry with how other parts of the Standard Library work, while keeping this patch's central value of making it possible for those of us with cert-heavy code to avoid the creation of thousands of files a minute. Again, thank you VERY much for discovering that OpenSSL can do this, and I will try to provide whatever encouragement I can as you try to shepherd this past the other committers. ---------- nosy: +brandon-rhodes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 01:25:33 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Jun 2013 23:25:33 +0000 Subject: [issue18147] SSL: diagnostic functions to list loaded CA certs In-Reply-To: <1370513969.26.0.776855011912.issue18147@psf.upfronthosting.co.za> Message-ID: <1370993133.82.0.579878046279.issue18147@psf.upfronthosting.co.za> Christian Heimes added the comment: New patch * method has been renamed to get_ca_list() and returns only CA certs * get_ca_list(binary_form=True) returns CA certs in DER format * cert_store_stats() returns three elements: X.509 CA cert count, X.509 non-CA count and CRL count ---------- Added file: http://bugs.python.org/file30550/ssl_ca_stats2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 02:46:23 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 Jun 2013 00:46:23 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1370997983.94.0.995901825388.issue18163@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Since the key is already accessible via the "args" attribute, what is the point of a new attribute? >>> d = {} >>> try: d['roger'] except KeyError as e: print(e.args) ('roger',) ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 02:55:23 2013 From: report at bugs.python.org (tahnoon pasha) Date: Wed, 12 Jun 2013 00:55:23 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1370998523.2.0.121470347152.issue18153@psf.upfronthosting.co.za> tahnoon pasha added the comment: I'll log this at the davmail forums too and report back if I get a response there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 03:39:51 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 12 Jun 2013 01:39:51 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1371001191.57.0.942586453018.issue18163@psf.upfronthosting.co.za> R. David Murray added the comment: Making it unambiguous what piece of data is being retrieved, and allowing new code to have a more complex message than just 'Keyerror: xxxx' and still be able to get at only the missing key. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 03:45:57 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 12 Jun 2013 01:45:57 +0000 Subject: [issue18195] error when deep copying module is confusing In-Reply-To: <1370990732.59.0.654966118724.issue18195@psf.upfronthosting.co.za> Message-ID: <1371001557.17.0.0145404416581.issue18195@psf.upfronthosting.co.za> R. David Murray added the comment: Well, we don't generally complicate the code to handle edge cases. That said, it might not be too complicated to add copy protocol methods to the module object which just raise a more useful error. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 04:48:28 2013 From: report at bugs.python.org (Roger Serwy) Date: Wed, 12 Jun 2013 02:48:28 +0000 Subject: [issue17838] Can't assign a different value for sys.stdin in IDLE In-Reply-To: <1366872984.94.0.234893757031.issue17838@psf.upfronthosting.co.za> Message-ID: <1371005308.23.0.246563862365.issue17838@psf.upfronthosting.co.za> Roger Serwy added the comment: I'm closing this issue as the original problem reported has been resolved. ---------- stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 05:06:41 2013 From: report at bugs.python.org (Roger Serwy) Date: Wed, 12 Jun 2013 03:06:41 +0000 Subject: [issue5492] Error on leaving IDLE with quit() or exit() under Linux In-Reply-To: <1237121077.76.0.63532373748.issue5492@psf.upfronthosting.co.za> Message-ID: <1371006401.74.0.477102747124.issue5492@psf.upfronthosting.co.za> Roger Serwy added the comment: I noticed that the tracebacks didn't occur in 2.7 due to 872a3aca2120, but that patch was not grafted onto the 3.x branches. I'll take care of that. With #13495 fixed, the two errors mentioned in msg187323 do not occur with the _rev1 patch applied. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 05:13:36 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 12 Jun 2013 03:13:36 +0000 Subject: [issue5492] Error on leaving IDLE with quit() or exit() under Linux In-Reply-To: <1237121077.76.0.63532373748.issue5492@psf.upfronthosting.co.za> Message-ID: <3bVY7g1M1JzQJ4@mail.python.org> Roundup Robot added the comment: New changeset ca8e86711403 by Roger Serwy in branch '2.7': #5492: Avoid traceback when exiting IDLE caused by a race condition. http://hg.python.org/cpython/rev/ca8e86711403 New changeset da852f5250af by Roger Serwy in branch '3.3': #5492: Avoid traceback when exiting IDLE caused by a race condition. http://hg.python.org/cpython/rev/da852f5250af New changeset 187da33826eb by Roger Serwy in branch 'default': #5492: merge with 3.3 http://hg.python.org/cpython/rev/187da33826eb ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 05:14:44 2013 From: report at bugs.python.org (Roger Serwy) Date: Wed, 12 Jun 2013 03:14:44 +0000 Subject: [issue5492] Error on leaving IDLE with quit() or exit() under Linux In-Reply-To: <1237121077.76.0.63532373748.issue5492@psf.upfronthosting.co.za> Message-ID: <1371006884.92.0.651715010197.issue5492@psf.upfronthosting.co.za> Roger Serwy added the comment: This issue is now fixed. Thank you everyone for helping! ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 05:20:33 2013 From: report at bugs.python.org (Roger Serwy) Date: Wed, 12 Jun 2013 03:20:33 +0000 Subject: [issue18196] IDLE: forward apply patch for handling SystemExit Message-ID: <1371007233.82.0.0390159251256.issue18196@psf.upfronthosting.co.za> New submission from Roger Serwy: As a formality, I opened this issue to apply 872a3aca2120 to the 3.x branch. This addresses a concern brought up by Terry in msg187323 from issue5492. Here's the relevant part of the message: """ Without or with patch, quit() or exit brings up TK box (?) The program is still running! Do you want to kill it? [OK] [Cancel] Did this always happen? [Cancel] causes traceback (not good, regression?) Traceback (most recent call last): File "", line 1, in quit() File "D:\Python\dev\cpython\lib\site.py", line 356, in __call__ raise SystemExit(code) SystemExit: None """ ---------- assignee: roger.serwy components: IDLE files: catch_exit.patch keywords: patch messages: 191007 nosy: rhettinger, roger.serwy, terry.reedy priority: low severity: normal stage: patch review status: open title: IDLE: forward apply patch for handling SystemExit type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30551/catch_exit.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 05:24:48 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 12 Jun 2013 03:24:48 +0000 Subject: [issue18196] IDLE: forward apply patch for handling SystemExit In-Reply-To: <1371007233.82.0.0390159251256.issue18196@psf.upfronthosting.co.za> Message-ID: <3bVYNb5lqZzQJ4@mail.python.org> Roundup Robot added the comment: New changeset 0e56d4e37777 by Roger Serwy in branch '3.3': #18196: Avoid displaying spurious SystemExit tracebacks. http://hg.python.org/cpython/rev/0e56d4e37777 New changeset 479aad3bb122 by Roger Serwy in branch 'default': #18196: merge with 3.3 http://hg.python.org/cpython/rev/479aad3bb122 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 05:25:38 2013 From: report at bugs.python.org (Ben Hearsum) Date: Wed, 12 Jun 2013 03:25:38 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1371007538.0.0.758385586562.issue18167@psf.upfronthosting.co.za> Changes by Ben Hearsum : ---------- nosy: +Ben.Hearsum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 05:25:54 2013 From: report at bugs.python.org (Roger Serwy) Date: Wed, 12 Jun 2013 03:25:54 +0000 Subject: [issue18196] IDLE: forward apply patch for handling SystemExit In-Reply-To: <1371007233.82.0.0390159251256.issue18196@psf.upfronthosting.co.za> Message-ID: <1371007554.99.0.427446377574.issue18196@psf.upfronthosting.co.za> Roger Serwy added the comment: And it's applied. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 07:01:34 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 12 Jun 2013 05:01:34 +0000 Subject: [issue6632] Include more chars in the decimal codec In-Reply-To: <1249317285.35.0.709481915004.issue6632@psf.upfronthosting.co.za> Message-ID: <1371013294.01.0.267441687569.issue6632@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: This is essentially a duplicate of #10581, so I am closing this and will summarize the situation there. ---------- resolution: -> duplicate status: open -> closed superseder: -> Review and document string format accepted in numeric data type constructors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 07:32:17 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 12 Jun 2013 05:32:17 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1371015137.36.0.535918556898.issue10581@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: It looks like we a approaching consensus on some points: 1. Mixed script numerals should be disallowed. 2. '\N{MINUS SIGN}' should be accepted as an alternative to '\N{HYPHEN-MINUS}' Open question: should we accept fullwidth + and -, sub/superscript variants etc.? I believe rather than debating variant codepoints one by one, we should consider applying NFKC (compatibility) normalization to unicode strings to be interpreted as numbers. This would allow parsing strings like this: >>> float(normalize('NFKC', '\N{FULLWIDTH HYPHEN-MINUS}\N{DIGIT ONE FULL STOP}\N{FULLWIDTH DIGIT TWO}')) -1.2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 08:25:59 2013 From: report at bugs.python.org (Max DeLiso) Date: Wed, 12 Jun 2013 06:25:59 +0000 Subject: [issue18197] insufficient error checking causes crash on windows Message-ID: <1371018359.58.0.123065301657.issue18197@psf.upfronthosting.co.za> New submission from Max DeLiso: hi. if you cross compile the mercurial native extensions against python 2.7.5 (x64) on 64 bit windows 7 and then try to clone something, it will crash. I believe the reason for this is that the c runtime functions in the microsoft crt will throw a win32 exception if they are given invalid parameters, and since the return value of fileno() is not checked in Objects/fileobject.c, if a file handle is passed to fileno and the result is not a valid file descriptor, that invalid decriptor will get passed to _fstat64i32, an invalid parameter exception will be raised, and the program will crash. here's the function with the alleged bug: static PyFileObject* dircheck(PyFileObject* f) { #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR) struct stat buf; if (f->f_fp == NULL) return f; if (fstat(fileno(f->f_fp), &buf) == 0 && // this line is the problem, fileno's return value never gets checked S_ISDIR(buf.st_mode)) { char *msg = strerror(EISDIR); PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(isO)", EISDIR, msg, f->f_name); PyErr_SetObject(PyExc_IOError, exc); Py_XDECREF(exc); return NULL; } #endif return f; } here's the stack trace: > msvcr90.dll!_invalid_parameter () Unknown msvcr90.dll!_fstat64i32 () Unknown python27.dll!dircheck(PyFileObject * f) Line 127 C python27.dll!fill_file_fields(PyFileObject * f, _iobuf * fp, _object * name, char * mode, int (_iobuf *) * close) Line 183 C python27.dll!PyFile_FromFile(_iobuf * fp, char * name, char * mode, int (_iobuf *) * close) Line 484 C here's a dump summary: Dump Summary ------------ Process Name: python.exe : c:\Python27\python.exe Process Architecture: x64 Exception Code: 0xC0000417 Exception Information: Heap Information: Present about the patch: the attached patch fixes that behavior and doesn't break any test cases on windows or linux. it applies against the current trunk of cpython. the return value of fileno should get checked for correctness anyways, even on *nix. the extra overhead is tiny, (one comparison and a conditional jump and a few extra bytes of stack space), but you do catch some weird edge cases. here are the steps to reproduce: download the python 2.7.5 installer for windows download the mercurial 2.6.2 source release build the native extensions with 64 bit microsoft compilers try to hg clone any remote repo (it should crash) here are some version strings: Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win32 Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60315.1 for x64 mercurial 2.6.2 here are some links: in particular, read the bits about the invalid parameter exception: _fsta64i32: http://msdn.microsoft.com/en-US/library/221w8e43%28v=vs.80%29.aspx _fileno: http://msdn.microsoft.com/en-US/library/zs6wbdhx%28v=vs.80%29.aspx Please let me know if my patch needs work or if I missed something. Thanks! ---------- components: IO files: fileobject_fix.patch hgrepos: 199 keywords: patch messages: 191012 nosy: maxdeliso priority: normal severity: normal status: open title: insufficient error checking causes crash on windows type: crash versions: Python 2.7 Added file: http://bugs.python.org/file30552/fileobject_fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 08:26:24 2013 From: report at bugs.python.org (Max DeLiso) Date: Wed, 12 Jun 2013 06:26:24 +0000 Subject: [issue18197] insufficient error checking causes crash on windows In-Reply-To: <1371018359.58.0.123065301657.issue18197@psf.upfronthosting.co.za> Message-ID: <1371018384.54.0.704313370404.issue18197@psf.upfronthosting.co.za> Changes by Max DeLiso : ---------- hgrepos: -199 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 08:29:05 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 12 Jun 2013 06:29:05 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <3bVdTD1f4dzMvq@mail.python.org> Roundup Robot added the comment: New changeset b11507395ce4 by Serhiy Storchaka in branch '3.3': Add tests for issue #18183. http://hg.python.org/cpython/rev/b11507395ce4 New changeset 17c9f1627baf by Serhiy Storchaka in branch 'default': Add tests for issue #18183. http://hg.python.org/cpython/rev/17c9f1627baf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 08:30:40 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Jun 2013 06:30:40 +0000 Subject: [issue18183] Calling .lower() on certain unicode string raises SystemError In-Reply-To: <1370874036.73.0.39673641693.issue18183@psf.upfronthosting.co.za> Message-ID: <1371018640.91.0.53372225382.issue18183@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 08:33:58 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Jun 2013 06:33:58 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1371018838.16.0.160416374338.issue18167@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 09:05:08 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 12 Jun 2013 07:05:08 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1371015137.36.0.535918556898.issue10581@psf.upfronthosting.co.za> Message-ID: <51B81D9D.1040005@egenix.com> Marc-Andre Lemburg added the comment: On 12.06.2013 07:32, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > It looks like we a approaching consensus on some points: > > 1. Mixed script numerals should be disallowed. > 2. '\N{MINUS SIGN}' should be accepted as an alternative to '\N{HYPHEN-MINUS}' > > Open question: should we accept fullwidth + and -, sub/superscript variants etc.? I believe rather than debating variant codepoints one by one, we should consider applying NFKC (compatibility) normalization to unicode strings to be interpreted as numbers. This would allow parsing strings like this: > >>>> float(normalize('NFKC', '\N{FULLWIDTH HYPHEN-MINUS}\N{DIGIT ONE FULL STOP}\N{FULLWIDTH DIGIT TWO}')) > -1.2 While it would solve these cases, I think that would cause a significant performance hit. Perhaps we could do this in two phases: 1. detect whether the string uses non-ASCII digits and symbols 2. if it does, apply normalization and then use the decimal codec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 10:01:19 2013 From: report at bugs.python.org (vila) Date: Wed, 12 Jun 2013 08:01:19 +0000 Subject: [issue18198] unittest discover should provide a way to define discovery at package level Message-ID: <1371024079.21.0.947683959467.issue18198@psf.upfronthosting.co.za> New submission from vila: While most test suites are a tree with test_*.py files, there are cases where being able to define the discovery for a subtree in the package __init__.py file comes handy. A poc implementation is available at http://bazaar.launchpad.net/~canonical-isd-qa/selenium-simple-test/trunk/view/head:/src/sst/tests/test_loader.py http://bazaar.launchpad.net/~canonical-isd-qa/selenium-simple-test/trunk/view/head:/src/sst/loader.py It allows test writers to define their own discovery when needed (including a specific edge case for the project mentioned above: test scripts that should not be imported at load time). It also addresses http://bugs.python.org/issue16662 ---------- messages: 191015 nosy: vila priority: normal severity: normal status: open title: unittest discover should provide a way to define discovery at package level _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 10:04:07 2013 From: report at bugs.python.org (Robert Collins) Date: Wed, 12 Jun 2013 08:04:07 +0000 Subject: [issue18198] unittest discover should provide a way to define discovery at package level In-Reply-To: <1371024079.21.0.947683959467.issue18198@psf.upfronthosting.co.za> Message-ID: <1371024247.39.0.308633390039.issue18198@psf.upfronthosting.co.za> Robert Collins added the comment: This is a duplicate of 16662 ---------- nosy: +rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 10:07:05 2013 From: report at bugs.python.org (Robert Collins) Date: Wed, 12 Jun 2013 08:07:05 +0000 Subject: [issue18198] unittest discover should provide a way to define discovery at package level In-Reply-To: <1371024079.21.0.947683959467.issue18198@psf.upfronthosting.co.za> Message-ID: <1371024425.18.0.117393647514.issue18198@psf.upfronthosting.co.za> Robert Collins added the comment: Well, spoke with vila on IRC. I content it's a duplicate because if load_tests in __init__ kicks in and supercedes discovery, I believe this bug would not be needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 11:25:11 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 12 Jun 2013 09:25:11 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1371029111.25.0.963039397212.issue16487@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Hi there. Thanks for your comments. This is the kind of discussion I was hoping to have about my draft patch. I too have reservations about adding arguments. In the version of this that we have in house, we actually don't use a "certdata" argument, but rather this: - 'certfile' can be either a filename or a string containing the data. The start of the string is examined to determine if is the latter The reason I didn't do it this way in the patch is because: a) it could be confusing and possibly un-pythonic to have that level of polymorphism employed b) There are possible edge cases. What if you had a filename that started with the magic tokens (unlikely but technically possible). I also would prefer passing in the certificates as raw bytes data, rather than file-like objects. there is no reason for them to be files, this is not data that is read on demand. libssl reads the entire contents of these files in one gulp, so there is no efficiency to be gained through any sort of pipelining by providing a file-like-object.. Adding the plumbing inside the library to do python "read()" calls is completely unnecessary when the caller can simply do that. The only possible reason would be to resolve the above ambiguity, i.e. to allow the api to try to invoke a "read()" function on the 'file' to determine if it is a file-like object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 12:10:25 2013 From: report at bugs.python.org (vila) Date: Wed, 12 Jun 2013 10:10:25 +0000 Subject: [issue18054] Add more exception related assertions to unittest In-Reply-To: <1369464959.25.0.285327189549.issue18054@psf.upfronthosting.co.za> Message-ID: <1371031825.1.0.5064279723.issue18054@psf.upfronthosting.co.za> Changes by vila : ---------- nosy: +vila _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 12:35:18 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Jun 2013 10:35:18 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1371033318.77.0.790506986405.issue18167@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your report, but your patch looks overcomplicated, it fails on 'x'*65535+'\r'+'y'*65535 and hangs on 'x'*65535+'\r'. Here is a simpler patch with tests. ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka Added file: http://bugs.python.org/file30553/issue18167-2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 12:36:23 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Jun 2013 10:36:23 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1371033383.31.0.79955020016.issue18167@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- versions: +Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30554/issue18167-3.3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 13:01:15 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 12 Jun 2013 11:01:15 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1371034875.41.0.912100809158.issue18181@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Slightly updated patch (different names, added some documentation) ---------- Added file: http://bugs.python.org/file30555/issue-18181-poc-v3.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 13:01:51 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 12 Jun 2013 11:01:51 +0000 Subject: [issue18181] super vs. someclass.__getattribute__ In-Reply-To: <1370870153.93.0.646087371852.issue18181@psf.upfronthosting.co.za> Message-ID: <1371034911.5.0.899096204738.issue18181@psf.upfronthosting.co.za> Ronald Oussoren added the comment: added draft of a pep-style proposal ---------- Added file: http://bugs.python.org/file30556/super-hook-proposal.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 14:28:22 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Wed, 12 Jun 2013 12:28:22 +0000 Subject: [issue515074] Extended storage in new-style classes Message-ID: <1371040102.34.0.339002292708.issue515074@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Most concrete variable-sized types don't use tp_basicsize to know where the data lives. For example, PyBytesObject has a "char ob_sval[1];" member, and PyBytes_AsString() looks at this fixed offset. For this reason, additional data cannot be stored before the variable-length section, only after. It is possible to store data after the variable section, and CPython does it already for the __dict__ slot of user-defined classes:: >>> bytes.__basicsize__ 33 >>> class B(bytes): pass ... >>> B.__basicsize__ 41 >>> B.__dictoffset__ -8 Note that tp_basicsize was increased by the size of the additional data (here a PyObject*). To access your data, the logic is something like:: tp->tp_basicsize + (obj->ob_size * tp->tp_itemsize) - sizeof(MyData) The function _PyObject_GetDictPtr() has similar code, and already aligns to the pointer size. Of course, at the end of one object you cannot have *both* a __dict__ slot and custom data. The custom type needs to either disallow subclassing, or provide a (negative) tp_dictoffset. Also, some care may be required if the base class uses a custom allocator. Overall, I think it's a bit involved, but doable. I close the issue as "works for me", someone can reopen if there is something wrong in the base types. ---------- nosy: +amaury.forgeotdarc resolution: -> works for me status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 14:30:14 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 12 Jun 2013 12:30:14 +0000 Subject: [issue18198] unittest discover should provide a way to define discovery at package level In-Reply-To: <1371024079.21.0.947683959467.issue18198@psf.upfronthosting.co.za> Message-ID: <1371040214.8.0.169791634096.issue18198@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 14:53:38 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 12 Jun 2013 12:53:38 +0000 Subject: [issue18198] unittest discover should provide a way to define discovery at package level In-Reply-To: <1371024079.21.0.947683959467.issue18198@psf.upfronthosting.co.za> Message-ID: <1371041618.25.0.786918813528.issue18198@psf.upfronthosting.co.za> R. David Murray added the comment: The linked code does something different. I believe the title of this issue is incorrect for the implicitly suggested enhancement. I also suspect the suggested enhancement (to the extent that I understand it) is not ripe for stdlib inclusion, but I'll leave that up to Michael. ---------- nosy: +michael.foord, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 14:54:56 2013 From: report at bugs.python.org (Michael Foord) Date: Wed, 12 Jun 2013 12:54:56 +0000 Subject: [issue16662] load_tests not invoked in package/__init__.py In-Reply-To: <1355217291.85.0.41912767842.issue16662@psf.upfronthosting.co.za> Message-ID: <1371041696.59.0.852532987109.issue16662@psf.upfronthosting.co.za> Changes by Michael Foord : ---------- assignee: -> michael.foord nosy: +michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 14:55:30 2013 From: report at bugs.python.org (Michael Foord) Date: Wed, 12 Jun 2013 12:55:30 +0000 Subject: [issue16662] load_tests not invoked in package/__init__.py In-Reply-To: <1355217291.85.0.41912767842.issue16662@psf.upfronthosting.co.za> Message-ID: <1371041730.19.0.860424616171.issue16662@psf.upfronthosting.co.za> Michael Foord added the comment: I agree that load_tests *should* be used in packages and that not doing this from the start was a mistake. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 14:58:23 2013 From: report at bugs.python.org (Michael Foord) Date: Wed, 12 Jun 2013 12:58:23 +0000 Subject: [issue18198] unittest discover should provide a way to define discovery at package level In-Reply-To: <1371024079.21.0.947683959467.issue18198@psf.upfronthosting.co.za> Message-ID: <1371041903.16.0.207021012933.issue18198@psf.upfronthosting.co.za> Michael Foord added the comment: The load_tests protocol is already the intended way for test writers to customize discovery. The problem, as issue 16662 states, is that load_tests is not invoked for packages by default. Fixing that is the right fix. I'm rejecting this issue in favour of 16662. ---------- assignee: -> michael.foord resolution: -> rejected stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 15:06:56 2013 From: report at bugs.python.org (Mark Levitt) Date: Wed, 12 Jun 2013 13:06:56 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <1371042416.21.0.932379547896.issue18149@psf.upfronthosting.co.za> Mark Levitt added the comment: I've added a "clear_cache()" method to filecmp.py. Patch attached. I had thought about implementing an optional parameter to only invalidate the cache of a specific file object, but figured I'd keep it simple for now. First time submitting a patch, so apologies if I've done something the wrong way. ---------- keywords: +patch nosy: +melevittfl Added file: http://bugs.python.org/file30557/18149.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 15:34:02 2013 From: report at bugs.python.org (Julien Danjou) Date: Wed, 12 Jun 2013 13:34:02 +0000 Subject: [issue18191] urllib2/urllib.parse.splitport does not handle IPv6 correctly In-Reply-To: <1370961879.5.0.532150427937.issue18191@psf.upfronthosting.co.za> Message-ID: <1371044042.06.0.16329692267.issue18191@psf.upfronthosting.co.za> Julien Danjou added the comment: Attached is a patch inspired by a function written for OpenStack Oslo library. ---------- keywords: +patch Added file: http://bugs.python.org/file30558/0001-Make-urllib.parse.splitport-handle-IPv6-correctly.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 15:53:24 2013 From: report at bugs.python.org (vila) Date: Wed, 12 Jun 2013 13:53:24 +0000 Subject: [issue7559] TestLoader.loadTestsFromName swallows import errors In-Reply-To: <1261429637.28.0.131724711132.issue7559@psf.upfronthosting.co.za> Message-ID: <1371045204.97.0.278299318862.issue7559@psf.upfronthosting.co.za> Changes by vila : ---------- nosy: +vila _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 15:59:17 2013 From: report at bugs.python.org (vila) Date: Wed, 12 Jun 2013 13:59:17 +0000 Subject: [issue18198] unittest discover should provide a way to define discovery at package level In-Reply-To: <1371024079.21.0.947683959467.issue18198@psf.upfronthosting.co.za> Message-ID: <1371045557.56.0.136035192232.issue18198@psf.upfronthosting.co.za> vila added the comment: > The linked code does something different. Right, it addressed other issues encountered in that project: 1 - the need for different paterns for files and directories (http://bugs.python.org/issue16662), 2 - handling import errors at load time (http://bugs.python.org/issue7559 as Robert told me), 3 - changing discovery policy at package level 4 - not importing test files (project specific) The most blocking issue in that project was that there was no way to address (3). If that's fixed (and (1) as well) with http://bugs.python.org/issue16662, I'm fine with that, I'll be able to build the specifics for that project on top of it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 16:48:18 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 14:48:18 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371048498.67.0.625451613952.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: Benchmark of py_setallocators-3.patch: - benchmarks suite (-b 2n3): some tests are 1.04x faster, some tests are 1.04 slower, significant is between 115 and -191. I don't understand these output, but I guess that the overhead cannot be seen with such test. - pybench: "+0.1%" (diff between -4.9% and +5.6%) If I understood correctly, the overhead is really really low (near zero). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 16:48:27 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 14:48:27 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371048507.69.0.512995545623.issue3329@psf.upfronthosting.co.za> Changes by STINNER Victor : Added file: http://bugs.python.org/file30559/pybench.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 16:48:34 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 14:48:34 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371048514.48.0.0465057962863.issue3329@psf.upfronthosting.co.za> Changes by STINNER Victor : Added file: http://bugs.python.org/file30560/benchmarks.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 16:49:05 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 14:49:05 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371048545.35.0.225247628448.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: > If I understood correctly, the overhead is really really low (near zero). See attached output pybench.txt and benchmarks.txt. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 16:57:07 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Wed, 12 Jun 2013 14:57:07 +0000 Subject: [issue18174] Make regrtest with --huntrleaks check for fd leaks In-Reply-To: <1370807273.91.0.83033499223.issue18174@psf.upfronthosting.co.za> Message-ID: <1371049027.19.0.513598355653.issue18174@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Updated version which adds checks for handle leaks on Windows. ---------- Added file: http://bugs.python.org/file30561/fdleak.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 16:57:31 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 12 Jun 2013 14:57:31 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: <1367159799.26.0.456231833917.issue17860@psf.upfronthosting.co.za> Message-ID: <1371049051.09.0.960610724802.issue17860@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The attached patch explicitly mentions that stdin/stdout/stderr are opened as binary streams when universal_newlines is False. I'm not convinced that adding this text will solve the confusion, subprocess has fairly complex documentation due to the rich API and it is easy to mis information when you don't read carefully. That said, the documentation for check_output (which is likely the most common way to run a command and fetch its output) is already clear about the types of the returned data, both in prose and example code. ---------- nosy: +ronaldoussoren Added file: http://bugs.python.org/file30562/issue17860.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 17:24:41 2013 From: report at bugs.python.org (Daniel Sturm) Date: Wed, 12 Jun 2013 15:24:41 +0000 Subject: [issue18199] No long filename support for Windows Message-ID: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> New submission from Daniel Sturm: Python at the moment does not handle paths with more than MAX_PATH characters well under Windows. With Windows 7 x64, Python 3.3 32bit, the attached file fails with: Traceback (most recent call last): File ".\filename_bug.py", line 4, in os.makedirs(dir) File "C:\Python33\lib\os.py", line 269, in makedirs mkdir(name, mode) FileNotFoundError: [WinError 3] The system cannot find the path specified: './aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' Same things apply to os.rmdir and probably other functions. The problem is that in posixmodule.c:path_converter (which is used to get the wchar_t* pathname that is expected by the Win32 API) we do have the following check: length = PyUnicode_GET_SIZE(unicode); if (length > 32767) { FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows"); Py_DECREF(unicode); return 0; } wide = PyUnicode_AsUnicode(unicode); but the documentation states: "The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path"." Source: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx The problem is that we never prepend "\\?\" to the pathname hence getting the old MAX_PATH limit. To fix this the easiest solution would be to change the unicode code path of the function to always return an absolute path (relative paths are always limited by MAX_PATH) with \\?\. For optimization we could only do this if the path is longer than 248 (CreateDir has another interesting exception there..) resp. MAX_CHAR characters. ---------- components: Unicode, Windows files: filename_bug.py messages: 191033 nosy: Voo, ezio.melotti priority: normal severity: normal status: open title: No long filename support for Windows Added file: http://bugs.python.org/file30563/filename_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 17:26:22 2013 From: report at bugs.python.org (Daniel Sturm) Date: Wed, 12 Jun 2013 15:26:22 +0000 Subject: [issue18199] No long filename support for Windows In-Reply-To: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> Message-ID: <1371050782.39.0.65691465394.issue18199@psf.upfronthosting.co.za> Changes by Daniel Sturm : ---------- components: +IO type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 17:44:14 2013 From: report at bugs.python.org (egallager) Date: Wed, 12 Jun 2013 15:44:14 +0000 Subject: [issue18164] Embedding Python doc incorrectly refers to LINKFORSHARED In-Reply-To: <1370638344.32.0.268021495329.issue18164@psf.upfronthosting.co.za> Message-ID: <1371051854.32.0.311794005603.issue18164@psf.upfronthosting.co.za> egallager added the comment: For reference, this originally came from the following MacPorts ticket: https://trac.macports.org/ticket/39223#comment:14 ---------- nosy: +E.Money _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 18:30:09 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 16:30:09 +0000 Subject: [issue18199] No long filename support for Windows In-Reply-To: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> Message-ID: <1371054609.31.0.557760569048.issue18199@psf.upfronthosting.co.za> STINNER Victor added the comment: Using extended path ("\\?\" prefix) causes new issues. * #13234: issue in os.listdir() * #13772: issue with os.symlink() * #9949: issue in os.path.realpath() ---------- nosy: +brian.curtin, haypo, loewis, pitrou, serhiy.storchaka, tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 18:33:18 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 16:33:18 +0000 Subject: [issue18199] No long filename support for Windows In-Reply-To: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> Message-ID: <1371054798.29.0.678851445042.issue18199@psf.upfronthosting.co.za> STINNER Victor added the comment: > The problem is that we never prepend "\\?\" to the pathname hence getting the old MAX_PATH limit. I would not call this a "problem". In my opinion, it is a bug in Windows: I don't understand why we should preprend something to support longer path. I'm not sure that low-level APIs (functions of the os module) should workaround this Windows limitation. An higher level API like pathlib may prepend "\\?\" prefix to support longer path. pathlib: PEP 428 and https://pypi.python.org/pypi/pathlib/ ---------- type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 18:33:43 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 16:33:43 +0000 Subject: [issue18199] No long filename support for Windows In-Reply-To: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> Message-ID: <1371054823.34.0.937427075805.issue18199@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 18:36:46 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 16:36:46 +0000 Subject: [issue18174] Make regrtest with --huntrleaks check for fd leaks In-Reply-To: <1370807273.91.0.83033499223.issue18174@psf.upfronthosting.co.za> Message-ID: <1371055006.03.0.11810282102.issue18174@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 18:55:12 2013 From: report at bugs.python.org (Daniel Sturm) Date: Wed, 12 Jun 2013 16:55:12 +0000 Subject: [issue18199] No long filename support for Windows In-Reply-To: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> Message-ID: <1371056112.62.0.0335824090274.issue18199@psf.upfronthosting.co.za> Daniel Sturm added the comment: > In my opinion, it is a bug in Windows I don't think calling every complicated API a "bug" is useful. Is the Win32 API exceedingly annoying? I think everybody agrees on that, but imo it's better to fix this once in python itself and don't force all developers to think about those details. Fixing this in pathlib is better than not doing anything, although with the large amounts of code out there that use os, it'd be nice if we could fix it at the source (also since I assume pathlib internally is going to call the os module, it's still the same amount of work). If I provide unit tests for all the involved file system functions and fix the issues (more work than expected looking at the linked issues, but doesn't seem too hard), would such a patch have chances to be included? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 19:23:33 2013 From: report at bugs.python.org (Doug Hellmann) Date: Wed, 12 Jun 2013 17:23:33 +0000 Subject: [issue18191] urllib2/urllib.parse.splitport does not handle IPv6 correctly In-Reply-To: <1370961879.5.0.532150427937.issue18191@psf.upfronthosting.co.za> Message-ID: <1371057813.3.0.664637902885.issue18191@psf.upfronthosting.co.za> Changes by Doug Hellmann : ---------- nosy: +doughellmann _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 19:36:23 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 12 Jun 2013 17:36:23 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1371058583.62.0.772052224753.issue18163@psf.upfronthosting.co.za> Brett Cannon added the comment: What David said. =) The fact that the key is the first value from args is almost happenstance as the exception message is customized in __str__() and not in what is passed to the exception. But what if I had defined __getattr__ or __getattribute__ and had some prefix requirement? It would be more helpful to say ``KeyError("{!r} does not start with py_".format(key))`` which breaks your args[0] usage but is a much more descriptive message and has no defined way to provide the key as an attribute. It's basically "explicit is better than implicit" since there is no API guarantee that the first thing in 'args' for KeyError will in actuality be the key. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 19:41:00 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 12 Jun 2013 17:41:00 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1371058860.74.0.992914746543.issue18192@psf.upfronthosting.co.za> Brett Cannon added the comment: So what are your arguments to making it more accessible? The typical user won't need to use it so I don't know if it really requires being off of importlib directly like find_loader, import_module, or (eventually) reload (which for convenience-sake while at the interpreter should be there). While I'm happy to entertain the argument that it should be importlib.machinery.MAGIC (like the file suffixes for the various file types) instead of importlib.abc.SourceLoader.magic, I don't want to make it importlib.magic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 19:43:51 2013 From: report at bugs.python.org (Doug Hellmann) Date: Wed, 12 Jun 2013 17:43:51 +0000 Subject: [issue18191] urllib2/urllib.parse.splitport does not handle IPv6 correctly In-Reply-To: <1370961879.5.0.532150427937.issue18191@psf.upfronthosting.co.za> Message-ID: <1371059031.12.0.426672669971.issue18191@psf.upfronthosting.co.za> Doug Hellmann added the comment: LGTM ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 20:40:12 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Jun 2013 18:40:12 +0000 Subject: [issue18191] urllib2/urllib.parse.splitport does not handle IPv6 correctly In-Reply-To: <1370961879.5.0.532150427937.issue18191@psf.upfronthosting.co.za> Message-ID: <1371062412.27.0.765735687036.issue18191@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I see only tests. It is more common to use arguments for assertEqual() in the reverse order, first actual value, and than expected value. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 21:09:24 2013 From: report at bugs.python.org (Berker Peksag) Date: Wed, 12 Jun 2013 19:09:24 +0000 Subject: [issue18191] urllib2/urllib.parse.splitport does not handle IPv6 correctly In-Reply-To: <1370961879.5.0.532150427937.issue18191@psf.upfronthosting.co.za> Message-ID: <1371064164.12.0.748377091864.issue18191@psf.upfronthosting.co.za> Berker Peksag added the comment: FTR, urllib.parse.splitport is undocumented and it is only used by urllib.request in the stdlib. ---------- nosy: +berker.peksag versions: -Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 21:22:45 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 19:22:45 +0000 Subject: [issue18199] No long filename support for Windows In-Reply-To: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> Message-ID: <1371064965.41.0.9734829467.issue18199@psf.upfronthosting.co.za> STINNER Victor added the comment: > it'd be nice if we could fix it at the source Yes, it is what we are trying to do. But it's not so simple. That's why the issue is splitted into more specific issues. > If I provide unit tests for all the involved file system > functions and fix the issues (more work than expected looking > at the linked issues, but doesn't seem too hard), > would such a patch have chances to be included? Sure! If adding \\?\ prefix causes new issue, you have to fix these issues first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 21:38:11 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 12 Jun 2013 19:38:11 +0000 Subject: [issue18164] Embedding Python doc incorrectly refers to LINKFORSHARED In-Reply-To: <1370638344.32.0.268021495329.issue18164@psf.upfronthosting.co.za> Message-ID: <1371065891.27.0.404995260434.issue18164@psf.upfronthosting.co.za> ?ric Araujo added the comment: I think it was Antoine who committed the patch originally. ---------- nosy: +eric.araujo, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 21:48:48 2013 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 12 Jun 2013 19:48:48 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: <1367159799.26.0.456231833917.issue17860@psf.upfronthosting.co.za> Message-ID: <1371066528.34.0.588995395805.issue17860@psf.upfronthosting.co.za> anatoly techtonik added the comment: The only thing that can save the docs is pictures. Or tables. +---------+---------------------------+ | | universal_newlines = True | +------+---------+---------------------------+ |Py.2 | str | str | +------+ | | |Py.3 | bytes | str | +------+---------+---------------------------+ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 22:08:46 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 12 Jun 2013 20:08:46 +0000 Subject: [issue15767] add ModuleNotFoundError In-Reply-To: <1345664718.23.0.712313947558.issue15767@psf.upfronthosting.co.za> Message-ID: <1371067726.69.0.375749869428.issue15767@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- title: add ImportNotFoundError -> add ModuleNotFoundError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 22:59:54 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 12 Jun 2013 20:59:54 +0000 Subject: [issue15767] add ModuleNotFoundError In-Reply-To: <1345664718.23.0.712313947558.issue15767@psf.upfronthosting.co.za> Message-ID: <3bW0p22Q3zzP0d@mail.python.org> Roundup Robot added the comment: New changeset 8a0ed9f63c6e by Brett Cannon in branch 'default': Issue #15767: Introduce ModuleNotFoundError, a subclass of http://hg.python.org/cpython/rev/8a0ed9f63c6e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 23:00:34 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 12 Jun 2013 21:00:34 +0000 Subject: [issue15767] add ModuleNotFoundError In-Reply-To: <1345664718.23.0.712313947558.issue15767@psf.upfronthosting.co.za> Message-ID: <1371070834.16.0.944754622201.issue15767@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 23:01:48 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 12 Jun 2013 21:01:48 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError Message-ID: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> New submission from Brett Cannon: The common idiom:: try: import something except ImportError: pass should be updated to use ModuleNotFoundError instead to not accidentally swallow ImportError exceptions which signal actual errors. ---------- components: Library (Lib) keywords: easy messages: 191047 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Update stdlib to use ModuleNotFoundError versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 23:01:54 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 12 Jun 2013 21:01:54 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError In-Reply-To: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> Message-ID: <1371070914.48.0.121441683903.issue18200@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- dependencies: +add ModuleNotFoundError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 23:03:40 2013 From: report at bugs.python.org (Ned Deily) Date: Wed, 12 Jun 2013 21:03:40 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <1371071020.83.0.844165414948.issue18149@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the patch, Mark. I've left some review comments via Rietveld (the review link next to the patch). Also, if you haven't already, please fill out the contributor form as described in the Developer's Guide (http://docs.python.org/devguide/patch.html#licensing). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 23:51:09 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 21:51:09 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371073869.6.0.0575976127124.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: New version (4) of the patch: - move the opaque pointer (now called "void *ctx", "context") as the first parameter instead of the last parameter, as done in zlib, lzma and Oracle's OCI APIs; ctx is also the first parameter of Py*_GetFunctions() and Py*_SetFunctions() instead of the last - rename public functions: * Py_GetAllocators() -> PyMem_GetAllocators(), PyObject_GetAllocators() * Py_SetAllocators() -> PyMem_SetAllocators(), PyObject_SetAllocators() * Py_GetBlockAllocators() -> PyObject_GetArenaAllocators() * Py_SetBlockAllocators() -> PyObject_SetArenaAllocators() - move declaration of PyObject_*() functions from pymem.h to objimpl.h - split _PyMem big structure into smaller structures: _PyMem, _PyObject, _PyObject_Arena - move "if (size == 0) size = 1;" from PyMem_Malloc() to _PyMem_Malloc(), so the custom allocator can decide how to implement PyMem_Malloc(0) (maybe something more efficient) Does the new API look better? py_setallocators-4.patch is ready for a final review. If nobody complains, I'm going to commit it. ---------- Added file: http://bugs.python.org/file30564/py_setallocators-4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 12 23:53:52 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Jun 2013 21:53:52 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371074032.74.0.25292277455.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: py_setallocators-4.patch: - Oh, I forgot another change: Py*_Get/SetAllocators() cannot fail anymore (because of an unknown API identifier), so the return type is now void I just saw that I forgot ".. versionadded:: 3.4" in the doc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 01:40:21 2013 From: report at bugs.python.org (Mark Levitt) Date: Wed, 12 Jun 2013 23:40:21 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <1371080421.88.0.708544094543.issue18149@psf.upfronthosting.co.za> Mark Levitt added the comment: Ned, Thanks for taking the time to review. I've updated the docs, added a unit test, signed the contributor form, and made the changes/corrections from your review. Updated patch attached. ---------- Added file: http://bugs.python.org/file30565/18149-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 02:16:40 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 00:16:40 +0000 Subject: [issue11957] re.sub confusion between count and flags args In-Reply-To: <1304101630.86.0.175815070517.issue11957@psf.upfronthosting.co.za> Message-ID: <1371082600.38.0.875488037231.issue11957@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- components: -Unicode _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 02:37:20 2013 From: report at bugs.python.org (Ned Deily) Date: Thu, 13 Jun 2013 00:37:20 +0000 Subject: [issue18164] Embedding Python doc incorrectly refers to LINKFORSHARED In-Reply-To: <1370638344.32.0.268021495329.issue18164@psf.upfronthosting.co.za> Message-ID: <1371083840.65.0.664041913246.issue18164@psf.upfronthosting.co.za> Ned Deily added the comment: On further review, I think the 3.x documentation is pretty good as is. I propose one change to it: getting another config var to help emphasize "the configuration values that you will want to combine together". The proposed 2.7 patch backports the whole 3.x section including that change. ---------- keywords: +patch stage: needs patch -> commit review Added file: http://bugs.python.org/file30566/issue18164_3x.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 02:37:32 2013 From: report at bugs.python.org (Ned Deily) Date: Thu, 13 Jun 2013 00:37:32 +0000 Subject: [issue18164] Embedding Python doc incorrectly refers to LINKFORSHARED In-Reply-To: <1370638344.32.0.268021495329.issue18164@psf.upfronthosting.co.za> Message-ID: <1371083852.53.0.315754997733.issue18164@psf.upfronthosting.co.za> Changes by Ned Deily : Added file: http://bugs.python.org/file30567/issue18164-27.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 02:46:19 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Thu, 13 Jun 2013 00:46:19 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError In-Reply-To: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> Message-ID: <1371084379.99.0.967702482926.issue18200@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 03:30:19 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 13 Jun 2013 01:30:19 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError In-Reply-To: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> Message-ID: <1371087019.71.0.634763680236.issue18200@psf.upfronthosting.co.za> Brett Cannon added the comment: Changeset 84105:281857369a78 and 84106:c4d7228421df have some updates to use ModuleNotFoundError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 05:29:28 2013 From: report at bugs.python.org (Roundup Robot) Date: Thu, 13 Jun 2013 03:29:28 +0000 Subject: [issue15767] add ModuleNotFoundError In-Reply-To: <1345664718.23.0.712313947558.issue15767@psf.upfronthosting.co.za> Message-ID: <3bW9RW4DN2zS4T@mail.python.org> Roundup Robot added the comment: New changeset 3a50025f1900 by Brett Cannon in branch 'default': Issue #15767: Touch up ModuleNotFoundError usage by import. http://hg.python.org/cpython/rev/3a50025f1900 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 05:38:57 2013 From: report at bugs.python.org (Roundup Robot) Date: Thu, 13 Jun 2013 03:38:57 +0000 Subject: [issue15767] add ModuleNotFoundError In-Reply-To: <1345664718.23.0.712313947558.issue15767@psf.upfronthosting.co.za> Message-ID: <3bW9fT0JbyzS0f@mail.python.org> Roundup Robot added the comment: New changeset c6c0faaf65d7 by Brett Cannon in branch 'default': Issue #15767: Add an explicit test for raising ModuleNotFoundError http://hg.python.org/cpython/rev/c6c0faaf65d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 05:40:47 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 13 Jun 2013 03:40:47 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError In-Reply-To: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> Message-ID: <1371094847.33.0.681595857764.issue18200@psf.upfronthosting.co.za> Brett Cannon added the comment: Here is a patch that uses ModuleNotFoundError in the stdlib sans test modules. ---------- keywords: +patch Added file: http://bugs.python.org/file30568/use_ModuleNotFoundError.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 05:40:57 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 13 Jun 2013 03:40:57 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError In-Reply-To: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> Message-ID: <1371094857.13.0.123875670933.issue18200@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 07:18:55 2013 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Thu, 13 Jun 2013 05:18:55 +0000 Subject: [issue18201] distutils write into symlinks instead of replacing them Message-ID: <1371100735.33.0.721782392161.issue18201@psf.upfronthosting.co.za> New submission from Micha? G?rny: We're doing heavy wrapping of Python scripts on Gentoo in order to efficiently support having multiple versions of Python installed. For that reason, every Python script installed using the package manager is renamed, and a symlink to a common wrapper binary is installed in its place. For example, setuptools install looks like: /usr/bin/easy_install -> python-exec /usr/bin/easy_install-python2.7 /usr/bin/easy_install-python3.2 Using the wrappers like this allow us to actively support user preference of Python version and map it to supported ones. Symlinking a common binary makes this more maintainable since there's just one place where wrapper needs to be updated. However, it seems that setup.py is failing hard in replacing symlinks. Whenever user upgrades any installed package, either externally or due to some tool like easy_install or pip, the relevant setup.py writes into /usr/bin/easy_install rather than properly replacing it with a new file. The effect, as you may imagine, is the wrapper being replaced with a random Python script and system-wide breakage. The proper thing to do would be to write into temporary file in the destination directory, then use os.rename() to atomically replace the destination with the temporary file. Since distutils is no longer maintained, I would be equally happy with simply os.remove() before writing the scripts. The problem may affect distutils2 as well. ---------- assignee: eric.araujo components: Distutils messages: 191057 nosy: eric.araujo, mgorny, tarek priority: normal severity: normal status: open title: distutils write into symlinks instead of replacing them versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 07:19:06 2013 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Thu, 13 Jun 2013 05:19:06 +0000 Subject: [issue18201] distutils write into symlinks instead of replacing them In-Reply-To: <1371100735.33.0.721782392161.issue18201@psf.upfronthosting.co.za> Message-ID: <1371100746.51.0.502789269107.issue18201@psf.upfronthosting.co.za> Changes by Micha? G?rny : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 08:02:19 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 13 Jun 2013 06:02:19 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: <1367159799.26.0.456231833917.issue17860@psf.upfronthosting.co.za> Message-ID: <1371103339.82.0.177834978723.issue17860@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I don't agree that adding a table/picture is the only thing that can be done, or even that it is a good idea. IMHO the subprocess documentation is clear enough about the distinction between bytes and string, especially in the section about convenience functions that is right at the top of the page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 08:20:37 2013 From: report at bugs.python.org (Ezio Melotti) Date: Thu, 13 Jun 2013 06:20:37 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: <1367159799.26.0.456231833917.issue17860@psf.upfronthosting.co.za> Message-ID: <1371104437.18.0.433695740446.issue17860@psf.upfronthosting.co.za> Ezio Melotti added the comment: Also in the Python 3 docs we don't compare the current behavior with Python 2. Ronald patch LGTM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 08:29:12 2013 From: report at bugs.python.org (Ned Deily) Date: Thu, 13 Jun 2013 06:29:12 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <1371104952.56.0.274675730472.issue18149@psf.upfronthosting.co.za> Ned Deily added the comment: Looks good to me, other than that the doc change should include a version added directive (which can be added by the committer): .. function:: clear_cache() + .. versionadded:: 3.4 + Clear the filecmp cache. This may be useful if a file is compared so quickly ---------- stage: needs patch -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 08:32:14 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Jun 2013 06:32:14 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: <1367159799.26.0.456231833917.issue17860@psf.upfronthosting.co.za> Message-ID: <1371105134.54.0.725746379358.issue17860@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 08:41:26 2013 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 13 Jun 2013 06:41:26 +0000 Subject: [issue17010] Windows launcher ignores active virtual environment In-Reply-To: <1358812657.25.0.839528896034.issue17010@psf.upfronthosting.co.za> Message-ID: <1371105686.09.0.0928769620782.issue17010@psf.upfronthosting.co.za> Vinay Sajip added the comment: Recent changes to the launcher mean that for a shebang line of "#!/usr/bin/env python", the path is searched for a Python executable. This will include the Python executable in an activated venv, so I am closing this issue. The change is already available for testing in the standalone launcher at https://bitbucket.org/pypa/pylauncher/downloads/ and should be incorporated into the launcher released with Python 3.4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 08:41:39 2013 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 13 Jun 2013 06:41:39 +0000 Subject: [issue17010] Windows launcher ignores active virtual environment In-Reply-To: <1358812657.25.0.839528896034.issue17010@psf.upfronthosting.co.za> Message-ID: <1371105699.22.0.240882282212.issue17010@psf.upfronthosting.co.za> Changes by Vinay Sajip : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 09:12:55 2013 From: report at bugs.python.org (Roundup Robot) Date: Thu, 13 Jun 2013 07:12:55 +0000 Subject: [issue18048] Merging test_pep263.py and test_coding.py In-Reply-To: <1369387812.98.0.236232283698.issue18048@psf.upfronthosting.co.za> Message-ID: <3bWGPK6hGtzQWx@mail.python.org> Roundup Robot added the comment: New changeset 00a199c265c3 by Serhiy Storchaka in branch 'default': Issue #18048: Rename test_pep263.py to test_source_encoding.py. http://hg.python.org/cpython/rev/00a199c265c3 New changeset 3b906421245d by Serhiy Storchaka in branch 'default': Issue #18048: Rename test_coding.py to test_source_encoding.py. http://hg.python.org/cpython/rev/3b906421245d New changeset 464e8fd7300d by Serhiy Storchaka in branch 'default': Issue #18048: Merge test_pep263.py and test_coding.py into test_source_encoding.py. http://hg.python.org/cpython/rev/464e8fd7300d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 09:16:02 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Jun 2013 07:16:02 +0000 Subject: [issue18048] Merging test_pep263.py and test_coding.py In-Reply-To: <1369387812.98.0.236232283698.issue18048@psf.upfronthosting.co.za> Message-ID: <1371107762.02.0.543709061374.issue18048@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Merging itself is trivial. The trick is how preserve the history of both files. Unfortunately this can't be represented in one mercurial patch. Three commits needed for this. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 09:54:01 2013 From: report at bugs.python.org (Piotr Dobrogost) Date: Thu, 13 Jun 2013 07:54:01 +0000 Subject: [issue17010] Windows launcher ignores active virtual environment In-Reply-To: <1358812657.25.0.839528896034.issue17010@psf.upfronthosting.co.za> Message-ID: <1371110041.42.0.786516594532.issue17010@psf.upfronthosting.co.za> Piotr Dobrogost added the comment: @Vinay Is there any discussion which lead to this change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 10:03:07 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Jun 2013 08:03:07 +0000 Subject: [issue18202] Minor fixes for test_coding Message-ID: <1371110587.57.0.733906103611.issue18202@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Here is a patch which contains followed changes: * Use bytes in test_exec_valid_coding(). Encoding instruction is ignored in strings. * Use non-ascii data in test_exec_valid_coding() to check that encoding is working. * Use explicit file encoding in test_file_parse(). * Use with statement for file in test_file_parse(). * Modify sys.path after opening file in test_file_parse() and restore before other cleanups. * Cleanup '.pyo' file in test_file_parse(). Test can ran in optimized mode. * Add msg parameter for better failure reporting in test_error_from_string(). * Use unittest.main(). ---------- components: Tests files: test_coding.patch keywords: patch messages: 191066 nosy: lemburg, loewis, nnorwitz, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Minor fixes for test_coding type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30569/test_coding.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 10:03:49 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Jun 2013 08:03:49 +0000 Subject: [issue18202] Minor fixes for test_coding In-Reply-To: <1371110587.57.0.733906103611.issue18202@psf.upfronthosting.co.za> Message-ID: <1371110629.64.0.26562808552.issue18202@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file30569/test_coding.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 10:04:44 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Jun 2013 08:04:44 +0000 Subject: [issue18202] Minor fixes for test_coding In-Reply-To: <1371110587.57.0.733906103611.issue18202@psf.upfronthosting.co.za> Message-ID: <1371110684.44.0.916842765453.issue18202@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file30570/test_coding.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 10:32:28 2013 From: report at bugs.python.org (Mark Levitt) Date: Thu, 13 Jun 2013 08:32:28 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <1371112348.67.0.128692008374.issue18149@psf.upfronthosting.co.za> Mark Levitt added the comment: Cool. I've gone ahead and generated a new patch with the version added directive included. ---------- Added file: http://bugs.python.org/file30571/18149-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 10:32:39 2013 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 13 Jun 2013 08:32:39 +0000 Subject: [issue17010] Windows launcher ignores active virtual environment In-Reply-To: <1358812657.25.0.839528896034.issue17010@psf.upfronthosting.co.za> Message-ID: <1371112359.43.0.68001500949.issue17010@psf.upfronthosting.co.za> Vinay Sajip added the comment: > Is there any discussion which lead to this change? http://mail.python.org/pipermail/python-dev/2013-May/125939.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 10:34:40 2013 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Jun 2013 08:34:40 +0000 Subject: [issue18179] SMTP.local_hostname is undocumented In-Reply-To: <1370859868.96.0.822120662228.issue18179@psf.upfronthosting.co.za> Message-ID: <1371112480.17.0.836609618697.issue18179@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file30572/issue18179.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 10:50:55 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 13 Jun 2013 08:50:55 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: <1367159799.26.0.456231833917.issue17860@psf.upfronthosting.co.za> Message-ID: <1371113455.6.0.581503527088.issue17860@psf.upfronthosting.co.za> Changes by Ronald Oussoren : ---------- assignee: docs at python -> ronaldoussoren stage: needs patch -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 10:58:38 2013 From: report at bugs.python.org (Paul Moore) Date: Thu, 13 Jun 2013 08:58:38 +0000 Subject: [issue13238] Add shell command helpers to subprocess module In-Reply-To: <1319176813.33.0.203455355645.issue13238@psf.upfronthosting.co.za> Message-ID: <1371113918.75.0.837938878963.issue13238@psf.upfronthosting.co.za> Paul Moore added the comment: There's also https://pypi.python.org/pypi/sarge One other thing I *often* want to do when scripting commands is to capture output, but provide some form of "progress" reporting (something like a dot per line of output, usually). That's annoyingly verbose with subprocess. ---------- nosy: +pmoore _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 11:38:35 2013 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Jun 2013 09:38:35 +0000 Subject: [issue18193] Move imp.reload() to importlib In-Reply-To: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> Message-ID: <1371116315.2.0.475835355205.issue18193@psf.upfronthosting.co.za> Berker Peksag added the comment: Here's a patch. Changes: - Used types.ModuleType instead of type(sys) - Updated imp and importlib docs - Moved test_imp.ReloadTests to test_importlib.test_api.ReloadTests ---------- keywords: +patch nosy: +berker.peksag stage: test needed -> patch review Added file: http://bugs.python.org/file30573/issue18193.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 12:31:51 2013 From: report at bugs.python.org (Martin Panter) Date: Thu, 13 Jun 2013 10:31:51 +0000 Subject: [issue8402] Add a function to escape metacharacters in glob/fnmatch In-Reply-To: <1271292687.68.0.249436327738.issue8402@psf.upfronthosting.co.za> Message-ID: <1371119511.98.0.32875388738.issue8402@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 12:39:37 2013 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 13 Jun 2013 10:39:37 +0000 Subject: [issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe In-Reply-To: <1367934356.3.0.498041746077.issue17925@psf.upfronthosting.co.za> Message-ID: <1371119977.52.0.416536457021.issue17925@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Attached are two test cases for this patch. test_simple_producer still fails with the new patch because it should be: self.producer_fifo.extendleft([first, data]) instead of: self.producer_fifo.appendleft([data, first]) The order of the items in the list is reversed, as documented in deque.extendleft. So the attachment also includes the corrected patch with this single change. I still think that if num_sent == 0, then 'first' should be put back in the queue. This means that initiate_send should not attempt anymore to send an empty string, which is confusing anyway, and therefore at the beginning of initiate_send, when 'if not first', then we should return in all cases and not only when 'first' is None. ---------- Added file: http://bugs.python.org/file30574/cpython.asyncore_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 12:40:42 2013 From: report at bugs.python.org (anatoly techtonik) Date: Thu, 13 Jun 2013 10:40:42 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: <1371104437.18.0.433695740446.issue17860@psf.upfronthosting.co.za> Message-ID: anatoly techtonik added the comment: On Thu, Jun 13, 2013 at 9:20 AM, Ezio Melotti wrote: > > Also in the Python 3 docs we don't compare the current behavior with > Python 2. > That's most unfortunate. Major PITA comes from attempts to port existing code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 12:41:38 2013 From: report at bugs.python.org (anatoly techtonik) Date: Thu, 13 Jun 2013 10:41:38 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: Message-ID: anatoly techtonik added the comment: _failed_ attempts to port existing code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 12:44:33 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 10:44:33 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371120273.93.0.138744572072.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: > This patch does not propose a simple API to reuse internal > debug hooks when replacing system (PyMem) allocators. Ok, this is now fixed with new patch (version 5). Nick does not want a new environment variable, so I added instead a new function PyMem_SetupDebugHooks() which reinstalls hooks to detect bugs if allocator functions were replaced with PyMem_SetAllocators() or PyObject_SetAllocators(). The function does nothing is Python is not compiled in debug more or if hooks are already installed (so the function can be called twice). I also added unit tests for PyMem_SetAllocators() and PyObject_SetAllocators()! And I added "versionadded:: 3.4" to the C API documentation. ---------- Added file: http://bugs.python.org/file30575/py_setallocators-5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 12:45:21 2013 From: report at bugs.python.org (Andrew Stormont) Date: Thu, 13 Jun 2013 10:45:21 +0000 Subject: [issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe In-Reply-To: <1367934356.3.0.498041746077.issue17925@psf.upfronthosting.co.za> Message-ID: <1371120321.22.0.0774664506474.issue17925@psf.upfronthosting.co.za> Andrew Stormont added the comment: I think you mean: self.producer_fifo.extendleft([data, first]) Instead of: self.producer_fifo.extendleft([first, data]) No? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 12:52:39 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 10:52:39 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() Message-ID: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> New submission from STINNER Victor: The issue #3329 proposes an API to replace memory allocator functions. But Python calls directly malloc(), realloc() and free() in some functions, so custom allocators would not be used there. Examples of functions calling malloc/realloc/free directly: _PySequence_BytesToCharpArray(), block_new() (of pyarena.c), find_key() (of thread.c), PyInterpreterState_New(), win32_wchdir(), posix_getcwd(), Py_Main(), etc. We have to be careful with the GIL: PyMem_*() functions can only be called when holding the GIL. ---------- messages: 191076 nosy: amaury.forgeotdarc, haypo, kristjan.jonsson, ncoghlan priority: normal severity: normal status: open title: Replace calls to malloc() with PyMem_Malloc() type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 12:54:44 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 10:54:44 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371120884.28.0.325311613347.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: > To be exhaustive, another patch should be developed to replace > all calls for malloc/realloc/free by > PyMem_Malloc/PyMem_Realloc/PyMem_Free. I created issue #18203 for this point. > PyObject_Malloc() is still using mmap() or malloc() internally > for example. Arena allocator can be replaced or hooked with PyObject_SetArenaAllocators() of my lastest patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 13:14:12 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Jun 2013 11:14:12 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371122052.98.0.140615389805.issue18203@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Be aware about external code which allocate memory itself (i.e. expat). ---------- nosy: +serhiy.storchaka stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 13:16:33 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Thu, 13 Jun 2013 11:16:33 +0000 Subject: [issue17860] subprocess docs lack info how to use output result In-Reply-To: <1367159799.26.0.456231833917.issue17860@psf.upfronthosting.co.za> Message-ID: <1371122193.1.0.706055107024.issue17860@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Surely there are already good places to help with 2->3 transition? The Library Reference is not such a place. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 13:32:02 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 11:32:02 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371123122.32.0.83474557806.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: > Be aware about external code which allocate memory itself (i.e. expat). Well, I know that it will hard to cover 100% of the stdlib. I just want to replace the most obvious calls. Some libraries can be configured to use a custom memory allocators: - zlib: zalloc and zfree, http://www.zlib.net/manual.html#Usage - bz2 - lzma: LzmaEnc_Create parameter - OpenSSL: CRYPTO_set_mem_functions - etc. We should probably uses these functions to reuse Python allocators (PyMem_Malloc()), or maybe only if PyMem_SetAllocators() has been called? (if Python does not use system allocators, aka malloc) See also #18178 for libffi, it may be related. The _decimal module configures libmpdec to use PyMem_Malloc: #define _Py_DEC_MINALLOC 4 mpd_mallocfunc = PyMem_Malloc; mpd_reallocfunc = PyMem_Realloc; mpd_callocfunc = mpd_callocfunc_em; mpd_free = PyMem_Free; mpd_setminalloc(_Py_DEC_MINALLOC); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 14:06:58 2013 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 13 Jun 2013 12:06:58 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1371125218.18.0.0572478723595.issue10581@psf.upfronthosting.co.za> Nick Coghlan added the comment: I think PEP 393 gives us a quick way to fast parsing: if the max char is < 128, just roll straight into normal processing, otherwise do the normalisation and "all decimal digits are from the same script" steps. There are almost certainly better ways to do the script translation, but the example below tries to just do the "convert to ASCII" step to avoid duplicating the +/- and decimal point processing logic: if max_char(arg) >= 128: arg = toNFKC(arg) originals = set() converted = [] for c in arg: try: d = str(unicodedata.decimal(c)) except ValueError: d = c else: originals.add(c) converted.append(d) if (max(originals) - min(originals)) >= 10: raise ValueError("%s mixes digits from multiple scripts" % arg) arg = "".join(converted) result = parse_ascii_number(arg) P.S. I don't think the base argument is especially applicable ('0x' is rejected because 'x' is not a base 10 digit and we allow a base of '0' to request "use int literal base markers"). ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 14:15:18 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jun 2013 12:15:18 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371125718.17.0.452649853096.issue18203@psf.upfronthosting.co.za> Christian Heimes added the comment: expat has a XML_Memory_Handling_Suite. You just have to replace XML_ParserCreate() and XML_ParserCreateNS with XML_ParserCreate_MM(). ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 17:47:53 2013 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 13 Jun 2013 15:47:53 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1371138473.77.0.567799776638.issue18163@psf.upfronthosting.co.za> Mark Dickinson added the comment: +1. I recently chastised a colleague for doing "raise KeyError(long_message)" instead of "raise KeyError(missing_item)". When I went to the standard library to support my POV, I found (to my chagrin) a big mix of the two styles. >>> from collections import ChainMap >>> d = ChainMap({}, {}) >>> try: ... d.pop('not there') ... except KeyError as e: ... key, = e.args ... >>> key "Key not found in the first mapping: 'not there'" ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 18:25:53 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 13 Jun 2013 16:25:53 +0000 Subject: [issue18201] distutils write into symlinks instead of replacing them In-Reply-To: <1371100735.33.0.721782392161.issue18201@psf.upfronthosting.co.za> Message-ID: <1371140753.76.0.879333217611.issue18201@psf.upfronthosting.co.za> ?ric Araujo added the comment: There are a handful of issues related to symlinks handling in distutils. From the discussion on #15205 , the state of things is that basically distutils has no defined behaviour with respect to symlinks, and it?s not clear to me what the desired behaviour would be. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 18:46:02 2013 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Thu, 13 Jun 2013 16:46:02 +0000 Subject: [issue18201] distutils write into symlinks instead of replacing them In-Reply-To: <1371100735.33.0.721782392161.issue18201@psf.upfronthosting.co.za> Message-ID: <1371141962.45.0.327466036789.issue18201@psf.upfronthosting.co.za> Micha? G?rny added the comment: Well, I don't see much relevance between the two bugs, to be honest :). I think this bug is more of a symptom of a deeper issue with the way distutils is installing files. But the issue is causing repeating issues for our users, and I don't really know what is the best way of at least helping our users avoid them. If there were an agreement that this specific behavior of distutils is unintended, we can prepare a patch. I don't really want to diverge from the 'upstream' behavior in Gentoo just to fix our issue, and I don't really see another good way of fixing it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 19:27:30 2013 From: report at bugs.python.org (Georg Brandl) Date: Thu, 13 Jun 2013 17:27:30 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371144450.95.0.437245067379.issue18203@psf.upfronthosting.co.za> Georg Brandl added the comment: > We have to be careful with the GIL: PyMem_*() functions can only be > called when holding the GIL. > Some libraries can be configured to use a custom memory allocators: > [...] > We should probably uses these functions to reuse Python allocators > (PyMem_Malloc()) I think there's a potential problem here :) ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 21:20:43 2013 From: report at bugs.python.org (raylu) Date: Thu, 13 Jun 2013 19:20:43 +0000 Subject: [issue14044] IncompleteRead error with urllib2 or urllib.request -- fine with urllib, wget, or curl In-Reply-To: <1329500177.48.0.42118882394.issue14044@psf.upfronthosting.co.za> Message-ID: <1371151243.78.0.432126960033.issue14044@psf.upfronthosting.co.za> raylu added the comment: The URL works for me. While wget does download it successfully, I get the following output: $ wget http://info.kingcounty.gov/health/ehs/foodsafety/inspections/XmlRest.aspx\?Zip_Code\=98199 --2013-06-13 12:15:21-- http://info.kingcounty.gov/health/ehs/foodsafety/inspections/XmlRest.aspx?Zip_Code=98199 Resolving info.kingcounty.gov (info.kingcounty.gov)... 146.129.240.75 Connecting to info.kingcounty.gov (info.kingcounty.gov)|146.129.240.75|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/xml] Saving to: ?XmlRest.aspx?Zip_Code=98199? [ <=> ] 515,315 448KB/s in 1.1s 2013-06-13 12:15:23 (448 KB/s) - Read error at byte 515315 (Success).Retrying. --2013-06-13 12:15:24-- (try: 2) http://info.kingcounty.gov/health/ehs/foodsafety/inspections/XmlRest.aspx?Zip_Code=98199 Connecting to info.kingcounty.gov (info.kingcounty.gov)|146.129.240.75|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/xml] Saving to: ?XmlRest.aspx?Zip_Code=98199? [ <=> ] 0 --.-K/s in 0s Cannot write to ?XmlRest.aspx?Zip_Code=98199? (Success). Similarly, curl gives $ curl http://info.kingcounty.gov/health/ehs/foodsafety/inspections/XmlRest.aspx\?Zip_Code\=98199 > /dev/null % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 503k 0 503k 0 0 222k 0 --:--:-- 0:00:02 --:--:-- 229k curl: (18) transfer closed with outstanding read data remaining $ wget --version GNU Wget 1.14 built on linux-gnu. $ curl --version curl 7.30.0 (x86_64-pc-linux-gnu) libcurl/7.30.0 OpenSSL/1.0.1e zlib/1.2.8 libidn/1.25 libssh2/1.4.2 librtmp/2.3 ---------- nosy: +raylu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 21:41:38 2013 From: report at bugs.python.org (Matt Perry) Date: Thu, 13 Jun 2013 19:41:38 +0000 Subject: [issue18204] distutils error showing upload error message Message-ID: <1371152498.03.0.330361928353.issue18204@psf.upfronthosting.co.za> New submission from Matt Perry: Distutils attempts "r.read()" instead of "request.read()" when showing an upload error message. ---------- assignee: eric.araujo components: Distutils files: disutils_error_message.diff keywords: patch messages: 191088 nosy: eric.araujo, tarek, unshift priority: normal severity: normal status: open title: distutils error showing upload error message versions: Python 2.7 Added file: http://bugs.python.org/file30576/disutils_error_message.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 23:02:17 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 21:02:17 +0000 Subject: [issue18205] PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold Message-ID: <1371157337.46.0.836983135269.issue18205@psf.upfronthosting.co.za> New submission from STINNER Victor: The callback PyOS_ReadlineFunctionPointer (used to read a line from the standard input) must return a buffer allocated by PyMem_Malloc(), but PyOS_Readline() releases the GIL before calling PyOS_ReadlineFunctionPointer. Simplified extract of PyOS_Readline(): Py_BEGIN_ALLOW_THREADS if (!isatty (fileno (sys_stdin)) || !isatty (fileno (sys_stdout))) rv = PyOS_StdioReadline (sys_stdin, sys_stdout, prompt); else rv = (*PyOS_ReadlineFunctionPointer)(sys_stdin, sys_stdout, prompt); Py_END_ALLOW_THREADS tok_nextc() calls PyOS_Readline() and calls PyMem_FREE() to release its result. PyOS_ReadlineFunctionPointer should allocate memory using malloc(), not using PyMem_Malloc(). But PyOS_Readline() should copy the line into a buffer allocated by PyMem_Malloc() to keep backward compatibility. See also issue #18203 and #3329. ---------- components: Interpreter Core, Library (Lib) messages: 191089 nosy: haypo priority: normal severity: normal status: open title: PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 23:13:55 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 21:13:55 +0000 Subject: [issue18205] PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold In-Reply-To: <1371157337.46.0.836983135269.issue18205@psf.upfronthosting.co.za> Message-ID: <1371158035.62.0.806176455813.issue18205@psf.upfronthosting.co.za> STINNER Victor added the comment: Here is a patch for Python 3.4. ---------- keywords: +patch Added file: http://bugs.python.org/file30577/readline_gil.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 23:20:09 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 21:20:09 +0000 Subject: [issue18205] PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold In-Reply-To: <1371157337.46.0.836983135269.issue18205@psf.upfronthosting.co.za> Message-ID: <1371158409.24.0.547469868474.issue18205@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, this is a duplicate of #16742, read also the thread on python-dev: http://mail.python.org/pipermail/python-dev/2012-December/123225.html ---------- resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 13 23:22:30 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 21:22:30 +0000 Subject: [issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe In-Reply-To: <1356086390.48.0.327620937355.issue16742@psf.upfronthosting.co.za> Message-ID: <1371158550.71.0.843018865072.issue16742@psf.upfronthosting.co.za> STINNER Victor added the comment: I just found the readline/GIL issue while working on #18203. I created #18205 but then I found this issue. I just closed #18205 as a duplicate. Here is a patch for Python 3.4. -- Copy of the initial message (msg191089): The callback PyOS_ReadlineFunctionPointer (used to read a line from the standard input) must return a buffer allocated by PyMem_Malloc(), but PyOS_Readline() releases the GIL before calling PyOS_ReadlineFunctionPointer. Simplified extract of PyOS_Readline(): Py_BEGIN_ALLOW_THREADS if (!isatty (fileno (sys_stdin)) || !isatty (fileno (sys_stdout))) rv = PyOS_StdioReadline (sys_stdin, sys_stdout, prompt); else rv = (*PyOS_ReadlineFunctionPointer)(sys_stdin, sys_stdout, prompt); Py_END_ALLOW_THREADS tok_nextc() calls PyOS_Readline() and calls PyMem_FREE() to release its result. PyOS_ReadlineFunctionPointer should allocate memory using malloc(), not using PyMem_Malloc(). But PyOS_Readline() should copy the line into a buffer allocated by PyMem_Malloc() to keep backward compatibility. See also issue #18203 and #3329. ---------- keywords: +patch nosy: +haypo versions: -Python 3.2 Added file: http://bugs.python.org/file30578/readline_gil.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 00:07:03 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 22:07:03 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371161223.07.0.0226419694161.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: >> We have to be careful with the GIL: PyMem_*() functions can only be >> called when holding the GIL. > (...) > I think there's a potential problem here :) I didn't understand the motivation to require the GIL held for PyMem_Malloc(). I searched in the source code history and on the Internet (archives of python-dev). In my opinion, the restiction is motivated by a bug: PyMem_Malloc() calls (indirectly) PyObject_Malloc() in debug mode, and PyObject_Malloc() is not thread-safe. I opened a thread on python-dev to discuss this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 00:07:58 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 22:07:58 +0000 Subject: [issue18205] PyOS_ReadlineFunctionPointer violates PyMem_Malloc() API: the GIL is not hold In-Reply-To: <1371157337.46.0.836983135269.issue18205@psf.upfronthosting.co.za> Message-ID: <1371161278.89.0.176209855809.issue18205@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- superseder: -> PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 00:10:25 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 22:10:25 +0000 Subject: [issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe In-Reply-To: <1356086390.48.0.327620937355.issue16742@psf.upfronthosting.co.za> Message-ID: <1371161425.14.0.68918993301.issue16742@psf.upfronthosting.co.za> STINNER Victor added the comment: See the following thread on python-dev, the root problem is that PyMem_Malloc() cannot be called with the GIL held. This is a bug in my opinion, and it should be fixed. http://mail.python.org/pipermail/python-dev/2013-June/126822.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 00:29:20 2013 From: report at bugs.python.org (py.user) Date: Thu, 13 Jun 2013 22:29:20 +0000 Subject: [issue18206] There is no license.html on www.python.org Message-ID: <1371162560.09.0.685782864566.issue18206@psf.upfronthosting.co.za> New submission from py.user: [guest at localhost ~]$ python3 Python 3.3.0 (default, Sep 29 2012, 22:07:38) [GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> license() See http://www.python.org/3.3/license.html >>> 404 answer from webmaster at python.org: Hello, When I use the version of Python distributed by python.org and type "license()" I get the full license text and not the url. It seems like this might be a change made by Red Hat? Either way, the proper place to discuss issues like this is on the Python bug tracker: http://bugs.python.org/ Feel free to report an issue there and the developers can look at it. This email address is actually for reporting problems with the Python.org website! All the best, Michael Foord in Lib/site.py: [guest at localhost cpython]$ sed -n '453,456p' Lib/site.py builtins.license = _Printer( "license", "See http://www.python.org/%.3s/license.html" % sys.version, ["LICENSE.txt", "LICENSE"], [os.path.join(here, os.pardir), here, os.curdir]) [guest at localhost cpython]$ ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 191095 nosy: docs at python, py.user priority: normal severity: normal status: open title: There is no license.html on www.python.org type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 00:30:25 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 22:30:25 +0000 Subject: [issue18206] There is no license.html on www.python.org In-Reply-To: <1371162560.09.0.685782864566.issue18206@psf.upfronthosting.co.za> Message-ID: <1371162625.44.0.637070141363.issue18206@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 00:52:34 2013 From: report at bugs.python.org (Georg Brandl) Date: Thu, 13 Jun 2013 22:52:34 +0000 Subject: [issue18206] There is no license.html on www.python.org In-Reply-To: <1371162560.09.0.685782864566.issue18206@psf.upfronthosting.co.za> Message-ID: <1371163954.66.0.67667616531.issue18206@psf.upfronthosting.co.za> Georg Brandl added the comment: This broke because we now have release 3.3.0 instead of 3.3. But it's easy to add a redirect, which I've done now. In the future, site.py should be fixed to say 3.3.0 or 3.3.X depending on the current bugfix version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 00:57:25 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Thu, 13 Jun 2013 22:57:25 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371164245.24.0.735293244103.issue3329@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 00:58:26 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 22:58:26 +0000 Subject: [issue18202] Minor fixes for test_coding In-Reply-To: <1371110587.57.0.733906103611.issue18202@psf.upfronthosting.co.za> Message-ID: <1371164306.21.0.0299673668366.issue18202@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 01:26:02 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 13 Jun 2013 23:26:02 +0000 Subject: [issue18206] license url in site.py should always use X.Y.Z form of version number In-Reply-To: <1371162560.09.0.685782864566.issue18206@psf.upfronthosting.co.za> Message-ID: <1371165962.91.0.496619617311.issue18206@psf.upfronthosting.co.za> R. David Murray added the comment: For anyone who wants to work on this: the license URL is printed if only if the license file can't be found. ---------- keywords: +easy nosy: +r.david.murray stage: -> needs patch title: There is no license.html on www.python.org -> license url in site.py should always use X.Y.Z form of version number versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 01:42:58 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 23:42:58 +0000 Subject: [issue18199] Windows: support path longer than 260 bytes using "\\?\" prefix In-Reply-To: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> Message-ID: <1371166978.15.0.429174700645.issue18199@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: No long filename support for Windows -> Windows: support path longer than 260 bytes using "\\?\" prefix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 01:47:50 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Jun 2013 23:47:50 +0000 Subject: [issue18197] insufficient error checking causes crash on windows In-Reply-To: <1371018359.58.0.123065301657.issue18197@psf.upfronthosting.co.za> Message-ID: <1371167270.5.0.462851111897.issue18197@psf.upfronthosting.co.za> STINNER Victor added the comment: Can you explain why fileno() does fail? Do you have an idea of how many open file descriptor do you have? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 01:51:12 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jun 2013 23:51:12 +0000 Subject: [issue8106] SSL session management In-Reply-To: <1268184052.67.0.269640299758.issue8106@psf.upfronthosting.co.za> Message-ID: <1371167472.36.0.770619742101.issue8106@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 01:58:14 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 13 Jun 2013 23:58:14 +0000 Subject: [issue18207] OpenSSL may ignore seconds in notAfter Message-ID: <1371167894.29.0.607710152237.issue18207@psf.upfronthosting.co.za> New submission from Christian Heimes: I'm doing some testing with old versions of OpenSSL. Some versions like 0.9.8i from 15 Sep 2008 ignore seconds in notAfter field: ./python -m test test_ssl test_hashlib [1/2] test_ssl test test_ssl failed -- Traceback (most recent call last): File "/home/heimes/dev/python/cpython/Lib/test/test_ssl.py", line 145, in test_parse_cert self.assertEqual(p['notAfter'], 'Oct 5 23:01:56 2020 GMT') AssertionError: 'Oct 5 23:01:00 2020 GMT' != 'Oct 5 23:01:56 2020 GMT' - Oct 5 23:01:00 2020 GMT ? ^^ + Oct 5 23:01:56 2020 GMT It's actually an issue in OpenSSL. I'm getting the same result with the openssl binary: $ ../openssl/0.9.8i/bin/openssl x509 -text -in Lib/test/https_svn_python_org_root.pem | grep GMT Not Before: Mar 30 12:29:00 2003 GMT Not After : Mar 29 12:29:00 2033 GMT $ ../openssl/0.9.8y/bin/openssl x509 -text -in Lib/test/https_svn_python_org_root.pem | grep GMT Not Before: Mar 30 12:29:49 2003 GMT Not After : Mar 29 12:29:49 2033 GMT I'd like to modify the test for a well-defined set of errnous OpenSSL versions. ---------- components: Extension Modules messages: 191099 nosy: christian.heimes, pitrou priority: normal severity: normal status: open title: OpenSSL may ignore seconds in notAfter versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 02:57:39 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 00:57:39 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError In-Reply-To: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> Message-ID: <3bWk1t4CmFzRc1@mail.python.org> Roundup Robot added the comment: New changeset 8d28d44f3a9a by Brett Cannon in branch 'default': Issue #18200: Update the stdlib (except tests) to use http://hg.python.org/cpython/rev/8d28d44f3a9a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 02:57:51 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 00:57:51 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError In-Reply-To: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> Message-ID: <1371171471.86.0.142232619737.issue18200@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 02:58:49 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 00:58:49 +0000 Subject: [issue18200] Update stdlib to use ModuleNotFoundError In-Reply-To: <1371070908.67.0.272178306242.issue18200@psf.upfronthosting.co.za> Message-ID: <1371171529.16.0.71372203118.issue18200@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 03:43:38 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 14 Jun 2013 01:43:38 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1371174218.35.0.775547858789.issue10581@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: PEP 393 implementation has already added the fast path to decimal encoding: http://hg.python.org/cpython/diff/8beaa9a37387/Objects/unicodeobject.c#l1.3735 What we can do, however, is improve performance of converting non-ascii numerals by looking up only the first digit's value and converting the rest using simple: value = code - (first_code - first_value) if not 0 <= value < 10: raise or fall back to UCD lookup ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 03:56:17 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 14 Jun 2013 01:56:17 +0000 Subject: [issue1611154] os.path.exists("file/") failure on Solaris 9 Message-ID: <1371174977.1.0.224165757796.issue1611154@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Here's an updated version of the patch. It at least compiles and runs on MacOS, but I don't have a Solaris installation to check whether it still fixes the problem on Solaris 9. Note that, according to http://en.wikipedia.org/wiki/Solaris_(operating_system)#Version_history, Solaris 9 will only be supported until October 2014. ---------- keywords: +patch Added file: http://bugs.python.org/file30579/python-stat-patch-3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 09:31:13 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 07:31:13 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <3bWtm1093QzRhj@mail.python.org> Roundup Robot added the comment: New changeset fae92309c3be by Ethan Furman in branch 'default': Closes issue 17947. Adds PEP-0435 (Enum, IntEnum) to the stdlib. http://hg.python.org/cpython/rev/fae92309c3be ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 09:44:40 2013 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 14 Jun 2013 07:44:40 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1371195880.73.0.241305977392.issue17947@psf.upfronthosting.co.za> Nick Coghlan added the comment: That commit looks just a touch incomplete... ---------- resolution: fixed -> stage: committed/rejected -> commit review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 09:53:40 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 14 Jun 2013 07:53:40 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1371174218.35.0.775547858789.issue10581@psf.upfronthosting.co.za> Message-ID: <51BACBF9.7050300@egenix.com> Marc-Andre Lemburg added the comment: On 14.06.2013 03:43, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > PEP 393 implementation has already added the fast path to decimal encoding: > > http://hg.python.org/cpython/diff/8beaa9a37387/Objects/unicodeobject.c#l1.3735 > > What we can do, however, is improve performance of converting non-ascii numerals by looking up only the first digit's value and converting the rest using simple: > > value = code - (first_code - first_value) > if not 0 <= value < 10: > raise or fall back to UCD lookup I'm not sure whether just relying on PEP 393 is good enough. Of course, you can special case the conversion based on the kind, but that's only one form of optimization. Slicing operations don't recheck the max code point used in the substring. As a result, a slice may very well be of the UCS2 kind, even though the text itself is ASCII. Apart from the fast-path based on the string kind, I think the decimal encoder would also have to scan the string for non-ASCII code points. If it finds non-ASCII code points, it would have to call the normalizer and restart the scan based on the normalized string. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jun 14 2013) >>> Python Projects, Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2013-07-01: EuroPython 2013, Florence, Italy ... 17 days to go 2013-07-16: Python Meeting Duesseldorf ... 32 days to go ::::: Try our 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/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 10:38:20 2013 From: report at bugs.python.org (Aditya Atluri) Date: Fri, 14 Jun 2013 08:38:20 +0000 Subject: [issue15315] Can't build Python extension with mingw32 on Windows In-Reply-To: <1341895923.16.0.599445307566.issue15315@psf.upfronthosting.co.za> Message-ID: <1371199100.2.0.356712513651.issue15315@psf.upfronthosting.co.za> Aditya Atluri added the comment: I have found a hack for the issue. First, install Microsoft Visual C++ 2010 Redistributable Package. Second, copy the msvcr100.dll to C:\Python33\libs. Reason: During compilation, the directory for linking is C:\Python44\libs. Both -lpython and -lmsvcr100 are pointed to the same location. So, they have to be in the same directory. I have another problem here. The log is attached. Is there a change in functions and objects in building extensions in C from 2.7 and 3.3? ---------- nosy: +adityaatluri Added file: http://bugs.python.org/file30580/log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 10:40:42 2013 From: report at bugs.python.org (Berker Peksag) Date: Fri, 14 Jun 2013 08:40:42 +0000 Subject: [issue17354] TypeError when running setup.py upload --show-response In-Reply-To: <1362477390.5.0.0948217479976.issue17354@psf.upfronthosting.co.za> Message-ID: <1371199242.95.0.862284939943.issue17354@psf.upfronthosting.co.za> Berker Peksag added the comment: Duplicate of issue 12853. ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> global name 'r' is not defined in upload.py type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 10:42:34 2013 From: report at bugs.python.org (Phil Connell) Date: Fri, 14 Jun 2013 08:42:34 +0000 Subject: [issue18208] Wrong bytecode generated for 'in' operation Message-ID: <1371199354.64.0.33010347301.issue18208@psf.upfronthosting.co.za> New submission from Phil Connell: The following two expressions should have the same value: Python 3.4.0a0 (default:fae92309c3be, Jun 14 2013, 09:29:54) [GCC 4.8.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1 in [2] == False False >>> (1 in [2]) == False True It looks like this is a compiler issue - there shouldn't be a jump if the 'in' expression is false: >>> dis.dis("1 in [2] == False") 1 0 LOAD_CONST 0 (1) 3 LOAD_CONST 1 (2) 6 BUILD_LIST 1 9 DUP_TOP 10 ROT_THREE 11 COMPARE_OP 6 (in) 14 JUMP_IF_FALSE_OR_POP 24 17 LOAD_CONST 2 (False) 20 COMPARE_OP 2 (==) 23 RETURN_VALUE >> 24 ROT_TWO 25 POP_TOP 26 RETURN_VALUE >>> ---------- components: Interpreter Core messages: 191108 nosy: benjamin.peterson, brett.cannon, georg.brandl, isoschiz, ncoghlan, pconnell priority: normal severity: normal status: open title: Wrong bytecode generated for 'in' operation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 10:43:37 2013 From: report at bugs.python.org (Berker Peksag) Date: Fri, 14 Jun 2013 08:43:37 +0000 Subject: [issue18204] distutils error showing upload error message In-Reply-To: <1371152498.03.0.330361928353.issue18204@psf.upfronthosting.co.za> Message-ID: <1371199417.3.0.815549416836.issue18204@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the report and patch. This is duplicate of issue 12853. ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> global name 'r' is not defined in upload.py type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 10:58:44 2013 From: report at bugs.python.org (Vincent Michel) Date: Fri, 14 Jun 2013 08:58:44 +0000 Subject: [issue18209] Bytearray type not supported as a mutable object in the fcntl.ioctl function Message-ID: <1371200324.57.0.0793560197908.issue18209@psf.upfronthosting.co.za> New submission from Vincent Michel: The Bytearray type is a mutable object that support the read-write buffer interface. The fcntl.ioctl() function is supposed to handle mutable object (such as array.array) for the system calls in order to pass object that are more than 1024 bytes long. The problem is that in Python 2.7, Bytearray type is not supported as a mutable object in the fcntl.ioctl function. In Python 3.2, it works perfectly. In the specific case where a large C structure is needed (more than 1024 bytes), the Bytearray type is extremely useful compare to the array.array type that is adapted for C arrays. Example : >>> file_handle = open('/dev/my_device') >>> arg = bytearray() >>> arg += pack('IL',1,2) >>> command = 0 >>> ioctl(file_handle,command,arg) Traceback (most recent call last): File "", line 1, in ioctl(file_handle,command,arg) TypeError: an integer is required ---------- components: IO messages: 191110 nosy: vxgmichel priority: normal severity: normal status: open title: Bytearray type not supported as a mutable object in the fcntl.ioctl function type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 11:12:30 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Fri, 14 Jun 2013 09:12:30 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371201150.88.0.894777642892.issue18203@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Keeping the GIL requirement is _very_ useful for PyMem_MALLOC et al. It allows applications to hook in their own monitoring code, accessible from python itself, without having to worry about conflicts with python. even if it were not for the GIL itself, PyMem_Malloc() may have all sorts of side effects. Because of this, and to allow ourselves the flexibility to do all sorts of things inside PyMem_Malloc(), at CCP we added a parallel api, PyMem_MALLOC_RAW() etc. This api is guaranteed to delegate directly to the external allocator (malloc by default, or an embedding application's supplied allocastor) We have patched pythoncore in 2.7 in all places there were using malloc directly using the file attached to the defect. Notice how it can patch "malloc" in two different ways, using either regular malloc (in non-sensitive areas) and using the raw malloc (in sensitive areas.) e.g. thread.c contains the following lines in our branch: #include "Python.h" /* patch malloc/free with threadsafe python versions */ #define CCPMEM_PATCH_RAW #include "ccpmem_patch.h" ---------- Added file: http://bugs.python.org/file30581/ccpmem_patch.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 11:31:13 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 14 Jun 2013 09:31:13 +0000 Subject: [issue18208] Wrong bytecode generated for 'in' operation In-Reply-To: <1371199354.64.0.33010347301.issue18208@psf.upfronthosting.co.za> Message-ID: <1371202273.19.0.00769654421367.issue18208@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: This is one case of chained comparisons: http://docs.python.org/3/reference/expressions.html#not-in "x <= y <= z" is equivalent to "(x <= y) and (y <= z)" "x in y == z" is equivalent to "(x in y) and (y == z)" There is a jump if the 'in' expression is false, because 'and' should short-circuit the second comparison. ---------- nosy: +amaury.forgeotdarc resolution: -> invalid status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 11:43:21 2013 From: report at bugs.python.org (Aditya Atluri) Date: Fri, 14 Jun 2013 09:43:21 +0000 Subject: [issue18210] Problem creating extension in python3.3 with mingw32 Message-ID: <1371203001.41.0.920026348206.issue18210@psf.upfronthosting.co.za> New submission from Aditya Atluri: I am trying to build c extensions in windows using mingw32. The file hello.c works fine with 2.7 but, errors are poping up in 3.3. Attachments: [1] log.txt : The errors [2] hello.c : The C file [3] setup.py: The setup file The command I used in cmd is, "python setup.py build -c mingw32" ---------- assignee: eric.araujo components: Distutils, Extension Modules files: Build-Bug.zip messages: 191113 nosy: adityaatluri, eric.araujo, tarek priority: normal severity: normal status: open title: Problem creating extension in python3.3 with mingw32 versions: Python 3.3 Added file: http://bugs.python.org/file30582/Build-Bug.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 11:56:00 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 14 Jun 2013 09:56:00 +0000 Subject: [issue18210] Problem creating extension in python3.3 with mingw32 In-Reply-To: <1371203001.41.0.920026348206.issue18210@psf.upfronthosting.co.za> Message-ID: <1371203760.68.0.486288065897.issue18210@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Python3 has a new API to create modules: PyModule_Create() and PyModuleDef. See also: http://docs.python.org/3/howto/cporting.html?highlight=pymodule_create#module-initialization-and-state ---------- nosy: +amaury.forgeotdarc resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 12:19:08 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 14 Jun 2013 10:19:08 +0000 Subject: [issue15315] Can't build Python extension with mingw32 on Windows In-Reply-To: <1341895923.16.0.599445307566.issue15315@psf.upfronthosting.co.za> Message-ID: <1371205148.12.0.640267128885.issue15315@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Aditya, python3 changed the API to create modules. See issue18210. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 13:08:34 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 14 Jun 2013 11:08:34 +0000 Subject: [issue12743] C API marshalling doc contains XXX In-Reply-To: <1313160183.82.0.137409262179.issue12743@psf.upfronthosting.co.za> Message-ID: <1371208114.59.0.477225283094.issue12743@psf.upfronthosting.co.za> Ronald Oussoren added the comment: >From reading the source of Python/marshal.c it seems that the read function's raise an exception on I/O errors, but don't return a specific value (that is, sentence starting with "It appears that" is wrong). PyMarshal_ReadLongFromFile calls r_long, this calls r_string without checking for errors and calculates the return value from the buffer passed to r_string. On I/O errors the buffer may not have been filled at all and contains random data (whatever happened to be on the stack). Likewise for PyMarhal_ReadShortFromFile (through r_short instead of r_long). r_string does raise an exception on I/O errors or short reads, but reading from FILE* and Python objects. The most straightforward documentation update would be: * Remove the entire XXX paragraph * Add text to the documentation for PyMarshal_ReadLongFromFile and PyMarshal_ReadShortFromFile: On error sets the appopriate exception (:exc:`EOFError`), but does not return a specific value. Use :func:`PyErr_Occurred` to check for errors. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 13:32:06 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 14 Jun 2013 11:32:06 +0000 Subject: [issue15883] Add Py_errno to work around multiple CRT issue In-Reply-To: <1347111302.92.0.306708953598.issue15883@psf.upfronthosting.co.za> Message-ID: <1371209526.12.0.398432232245.issue15883@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I'd prefer to have new variants of the PyErr_SetFromErrno* functions where the errno value is explicitly passed in instead of adding a side-channel for passing in the value. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 13:36:31 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 14 Jun 2013 11:36:31 +0000 Subject: [issue15883] Add Py_errno to work around multiple CRT issue In-Reply-To: <1347111302.92.0.306708953598.issue15883@psf.upfronthosting.co.za> Message-ID: <1371209791.3.0.485278787306.issue15883@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Agreed with Ronald. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 13:50:35 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 14 Jun 2013 11:50:35 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem Message-ID: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> New submission from Ronald Oussoren: Changeset a3559c8c614b added -Werror=statement-after-declaration to the CFLAGS for compiler that support it. This new flags is fine for CPython itself (which is explicitly writting in C89 style to support older compilers and Microsoft Visual Studio), but the new flags also gets used when building 3th-party extensions using distutils and might cause problems there when that code uses C99. I don't have a good solution for this yet, the flag is useful to have when building CPython to avoid regressions in C89 support but shouldn't be used when building 3th-party extensions. ---------- assignee: eric.araujo components: Build, Distutils messages: 191119 nosy: benjamin.peterson, eric.araujo, ronaldoussoren, tarek priority: normal severity: normal stage: needs patch status: open title: -Werror=statement-after-declaration problem type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 14:20:09 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 14 Jun 2013 12:20:09 +0000 Subject: [issue1611154] os.path.exists("file/") failure on Solaris 9 Message-ID: <1371212409.34.0.254720019967.issue1611154@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: I don't like the idea of adding such a kludge to workaround an OS bug - especially since Solaris 9 won't be supported for too long. ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 14:30:23 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jun 2013 12:30:23 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem In-Reply-To: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> Message-ID: <1371213023.11.0.117331219993.issue18211@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 14:35:31 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 14 Jun 2013 12:35:31 +0000 Subject: [issue18199] Windows: support path longer than 260 bytes using "\\?\" prefix In-Reply-To: <1371050681.12.0.381093438517.issue18199@psf.upfronthosting.co.za> Message-ID: <1371213331.47.0.838500547411.issue18199@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Well, the problem, as you point out, is that "\\?\" only works with absolute paths, but the stdlib currently works with both absolute and relative paths. The only reasonable solution right now is to prepend the "\\?\" prefix yourself (after having resolved the path to absolute). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 14:38:47 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jun 2013 12:38:47 +0000 Subject: [issue14813] Can't build under VS2008 anymore In-Reply-To: <1337077263.22.0.0914534373529.issue14813@psf.upfronthosting.co.za> Message-ID: <1371213527.8.0.302811863871.issue14813@psf.upfronthosting.co.za> Christian Heimes added the comment: Is there anything left to do or can I close this bug? ---------- nosy: +christian.heimes stage: -> committed/rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 14:39:42 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 14 Jun 2013 12:39:42 +0000 Subject: [issue14813] Can't build under VS2008 anymore In-Reply-To: <1337077263.22.0.0914534373529.issue14813@psf.upfronthosting.co.za> Message-ID: <1371213582.8.0.61434988018.issue14813@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I don't have my Windows VM anymore, so unfortunately I won't be able to tell you whether there is still a build problem :) ---------- status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 14:45:22 2013 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 14 Jun 2013 12:45:22 +0000 Subject: [issue18000] _md5 should be built if _ssl cannot be built In-Reply-To: <1368818592.85.0.0295311805267.issue18000@psf.upfronthosting.co.za> Message-ID: <1371213922.43.0.66567039795.issue18000@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: The problem on the machine that I mentioned was a regression from 2.7.4 to 2.7.5, probably due to #17086. Whether you consider a patch a "bugfix" or "new feature" is quite subjective, right? If #17086 is a bugfix, then this can also be a bugfix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 14:47:21 2013 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 14 Jun 2013 12:47:21 +0000 Subject: [issue17086] backport cross-build patches to the 2.7 branch In-Reply-To: <1359587420.86.0.11365762234.issue17086@psf.upfronthosting.co.za> Message-ID: <1371214041.07.0.422240777175.issue17086@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: This is causing breakage, see #17990 and #18000. ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 15:17:56 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jun 2013 13:17:56 +0000 Subject: [issue15464] ssl: add set_msg_callback function In-Reply-To: <1343352856.85.0.212414509347.issue15464@psf.upfronthosting.co.za> Message-ID: <1371215876.64.0.427160559374.issue15464@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 15:25:45 2013 From: report at bugs.python.org (Ram Rachum) Date: Fri, 14 Jun 2013 13:25:45 +0000 Subject: [issue18212] No way to check whether Future is finished? Message-ID: <1371216345.77.0.119966223843.issue18212@psf.upfronthosting.co.za> New submission from Ram Rachum: I have a `Future` and I want to check whether it's in finished state. It seems like I don't have a method to do that, right? (I could emulate the existing methods for checking Future state, but that would mean fiddling with private variables.) Why not just expose the Future state in a property that automatically acquires `self._condition`? (Instead of a horde of methods.) ---------- components: Library (Lib) messages: 191126 nosy: cool-RR priority: normal severity: normal status: open title: No way to check whether Future is finished? type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 15:35:54 2013 From: report at bugs.python.org (Stefan Krah) Date: Fri, 14 Jun 2013 13:35:54 +0000 Subject: [issue14813] Can't build under VS2008 anymore In-Reply-To: <1371213527.8.0.302811863871.issue14813@psf.upfronthosting.co.za> Message-ID: <20130614133554.GA14266@sleipnir.bytereef.org> Stefan Krah added the comment: Building the external packages isn't fixed yet, but I don't know if it's worth the trouble. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 15:48:33 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 13:48:33 +0000 Subject: [issue15172] Document nasm-2.10.01 as required version for openssl In-Reply-To: <1340569947.64.0.165180800824.issue15172@psf.upfronthosting.co.za> Message-ID: <3bX37N2BWtz7Ljr@mail.python.org> Roundup Robot added the comment: New changeset ee3952965934 by Christian Heimes in branch '3.3': Issue #15172: Document NASM 2.10+ as requirement for building OpenSSL 1.0.1 on Windows http://hg.python.org/cpython/rev/ee3952965934 New changeset 1b2cbdc9c1d4 by Christian Heimes in branch 'default': Issue #15172: Document NASM 2.10+ as requirement for building OpenSSL 1.0.1 on Windows http://hg.python.org/cpython/rev/1b2cbdc9c1d4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 15:50:11 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jun 2013 13:50:11 +0000 Subject: [issue15172] Document nasm-2.10.01 as required version for openssl In-Reply-To: <1340569947.64.0.165180800824.issue15172@psf.upfronthosting.co.za> Message-ID: <1371217811.61.0.4284569107.issue15172@psf.upfronthosting.co.za> Christian Heimes added the comment: I got bitten by the bug, too. NASM 2.10 or newer as requirement is now documented in PCbuild/readme.txt. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:06:16 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Fri, 14 Jun 2013 14:06:16 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem In-Reply-To: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> Message-ID: <1371218776.14.0.694634204758.issue18211@psf.upfronthosting.co.za> Changes by Jeremy Kloth : ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:07:08 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jun 2013 14:07:08 +0000 Subject: [issue9216] FIPS support for hashlib In-Reply-To: <1278721335.16.0.522410247151.issue9216@psf.upfronthosting.co.za> Message-ID: <1371218828.08.0.0775360654071.issue9216@psf.upfronthosting.co.za> Christian Heimes added the comment: It's out of scope for 3.3 but I'd love to see the feature in 3.4. ---------- versions: -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:07:25 2013 From: report at bugs.python.org (Phil Muldoon) Date: Fri, 14 Jun 2013 14:07:25 +0000 Subject: [issue18213] py-bt errors on backtrace Message-ID: <1371218845.8.0.761231443863.issue18213@psf.upfronthosting.co.za> New submission from Phil Muldoon: (gdb) py-bt #2 Frame 0xef8180, for file , line 1, in () Python Exception (2, 'No such file or directory', ''): Error occurred in Python command: (2, 'No such file or directory', '') This is the actual raw frame data: #0 frapy_pc (self=, args=0x0) at ../../gdb/gdb/python/py-frame.c:223 #1 0x0000003edf4dcfd6 in call_function (oparg=, pp_stack=0x7fffffffd378) at /usr/src/debug/Python-2.7.3/Python/ceval.c:4082 #2 PyEval_EvalFrameEx (f=f at entry=Frame 0xef8180, for file , line 1, in (), throwflag=throwflag at entry=0) at /usr/src/debug/Python-2.7.3/Python/ceval.c:2740 #3 0x0000003edf4ddcbf in PyEval_EvalCodeEx ( During symbol reading, Multiple children of DIE 0x3904c refer to DIE 0x38d87 as their abstract origin. co=co at entry=0x7ffff1adb8b0, globals=globals at entry= {'g': , '__builtins__': , 'GdbRemoveReadlineFinder': , '__package__': None, 'sys': , 'gdb': , '__name__': '__main__', '__doc__': None}, locals=locals at entry= {'g': , '__builtins__': , 'GdbRemoveReadlineFinder': , '__package__': None, 'sys': , 'gdb': , '__name__': '__main__', '__doc__': None}, args=args at entry=0x0, argcount=argcount at entry=0, kws=kws at entry=0x0, kwcount=kwcount at entry=0, defs=defs at entry=0x0, defcount=defcount at entry=0, closure=closure at entry=0x0) at /usr/src/debug/Python-2.7.3/Python/ceval.c:3330 ---------- components: Demos and Tools messages: 191131 nosy: dmalcolm, pmuldoon priority: normal severity: normal status: open title: py-bt errors on backtrace type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:08:58 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jun 2013 14:08:58 +0000 Subject: [issue11943] Add TLS-SRP (RFC 5054) support to ssl, _ssl, http, and urllib In-Reply-To: <1303943331.28.0.343800117154.issue11943@psf.upfronthosting.co.za> Message-ID: <1371218938.22.0.0078699676558.issue11943@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:11:37 2013 From: report at bugs.python.org (Tom Tromey) Date: Fri, 14 Jun 2013 14:11:37 +0000 Subject: [issue18213] py-bt errors on backtrace In-Reply-To: <1371218845.8.0.761231443863.issue18213@psf.upfronthosting.co.za> Message-ID: <1371219097.28.0.689766946939.issue18213@psf.upfronthosting.co.za> Changes by Tom Tromey : ---------- nosy: +tromey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:19:40 2013 From: report at bugs.python.org (Delhallt) Date: Fri, 14 Jun 2013 14:19:40 +0000 Subject: [issue11192] test_socket error on AIX In-Reply-To: <1297436751.32.0.492226695457.issue11192@psf.upfronthosting.co.za> Message-ID: <1371219580.37.0.890179621067.issue11192@psf.upfronthosting.co.za> Delhallt added the comment: not a python problem, see closed aix issue http://www-01.ibm.com/support/docview.wss?uid=isg1IZ57712 ---------- nosy: +delhallt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:26:27 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Fri, 14 Jun 2013 14:26:27 +0000 Subject: [issue9122] Problems with multiprocessing, Python embedding and Windows In-Reply-To: <1277847282.9.0.57284514454.issue9122@psf.upfronthosting.co.za> Message-ID: <1371219987.8.0.489804158476.issue9122@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:29:19 2013 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 14 Jun 2013 14:29:19 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1371195880.73.0.241305977392.issue17947@psf.upfronthosting.co.za> Message-ID: Eli Bendersky added the comment: Ethan, did you forget to "hg add" ? On Fri, Jun 14, 2013 at 12:44 AM, Nick Coghlan wrote: > > Nick Coghlan added the comment: > > That commit looks just a touch incomplete... > > ---------- > resolution: fixed -> > stage: committed/rejected -> commit review > status: closed -> open > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:59:31 2013 From: report at bugs.python.org (Phil Connell) Date: Fri, 14 Jun 2013 14:59:31 +0000 Subject: [issue18208] Wrong bytecode generated for 'in' operation In-Reply-To: <1371199354.64.0.33010347301.issue18208@psf.upfronthosting.co.za> Message-ID: <1371221971.5.0.316679653244.issue18208@psf.upfronthosting.co.za> Phil Connell added the comment: Thanks Amaury. That's quite surprising, but I wouldn't advocate changing such long standing behaviour. I'm closing the issue. ---------- status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 16:59:39 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Fri, 14 Jun 2013 14:59:39 +0000 Subject: [issue18214] Stop purging modules which are garbage collected before shutdown Message-ID: <1371221979.53.0.00385452158182.issue18214@psf.upfronthosting.co.za> New submission from Richard Oudkerk: Currently when a module is garbage collected its dict is purged by replacing all values except __builtins__ by None. This helps clear things at shutdown. But this can cause problems if it occurs *before* shutdown: if we use a function defined in a module which has been garbage collected, then that function must not depend on any globals, because they will have been purged. Usually this problem only occurs with programs which manipulate sys.modules. For example when setuptools and nose run tests they like to reset sys.modules each time. See for example http://bugs.python.org/issue15881 See also http://bugs.python.org/issue16718 The trivial patch attached prevents the purging behaviour for modules gc'ed before shutdown begins. Usually garbage collection will end up clearing the module's dict anyway. I checked the count of refs and blocks reported on exit when running a trivial program and a full regrtest (which will cause quite a bit of sys.modules manipulation). The difference caused by the patch is minimal. Without patch: do nothing: [20234 refs, 6582 blocks] full regrtest: [92713 refs, 32597 blocks] With patch: do nothing: [20234 refs, 6582 blocks] full regrtest: [92821 refs, 32649 blocks] ---------- files: prevent-purge-before-shutdown.patch keywords: patch messages: 191135 nosy: sbt priority: normal severity: normal status: open title: Stop purging modules which are garbage collected before shutdown versions: Python 3.4 Added file: http://bugs.python.org/file30583/prevent-purge-before-shutdown.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 17:06:51 2013 From: report at bugs.python.org (Dave Malcolm) Date: Fri, 14 Jun 2013 15:06:51 +0000 Subject: [issue18213] py-bt errors on backtrace with PyRun_SimpleString and friends In-Reply-To: <1371218845.8.0.761231443863.issue18213@psf.upfronthosting.co.za> Message-ID: <1371222411.96.0.122694696425.issue18213@psf.upfronthosting.co.za> Dave Malcolm added the comment: pmuldoon: did you truncate the output of bt? (or did the superior gdb you're using do this behind the scenes? I know you hack on gdb itself, and this looks a superior gdb debugging an inferior gdb). The reason for this error: Python Exception (2, 'No such file or directory', ''): is that py-bt is attempting to print the line of source code that the frame is at, but the source was provided as a string, not a file, presumably due to a call to PyRun_SimpleString et al. Python sets the filename of such code to be the dummy name "", and py-bt attempts to use that as a real filename and open it, failing (unless you happen to have a file named "" in which case it tries to list it). ---------- assignee: -> dmalcolm title: py-bt errors on backtrace -> py-bt errors on backtrace with PyRun_SimpleString and friends _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 17:56:15 2013 From: report at bugs.python.org (Ethan Furman) Date: Fri, 14 Jun 2013 15:56:15 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1371225375.42.0.887293388546.issue17947@psf.upfronthosting.co.za> Ethan Furman added the comment: Well, that made me laugh first thing in the morning! I had nuked and redone my clone, and yeah, forgot to re-add the files. :/ Trying again... Commit message was okay? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 17:58:48 2013 From: report at bugs.python.org (Phil Muldoon) Date: Fri, 14 Jun 2013 15:58:48 +0000 Subject: [issue18213] py-bt errors on backtrace with PyRun_SimpleString and friends In-Reply-To: <1371218845.8.0.761231443863.issue18213@psf.upfronthosting.co.za> Message-ID: <1371225528.72.0.966094346525.issue18213@psf.upfronthosting.co.za> Phil Muldoon added the comment: Yes I did truncate the output, the backtrace was very long. This is my scenario: gdb --args ./gdb When the superior gdb loads, I did: (top-gdb) b frapy_pc (top-gdb) run In the inferior gdb, I did: (gdb) start (gdb) py g = gdb.selected_frame() (gdb) py print g.pc() This will hit the breakpoint in the inferior gdb and you will be returned to the superior gdb. I then did: (top-gdb) py-bt ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 18:00:42 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 14 Jun 2013 16:00:42 +0000 Subject: [issue18215] Script to test multiple versions of OpenSSL Message-ID: <1371225642.81.0.592691190065.issue18215@psf.upfronthosting.co.za> New submission from Christian Heimes: I have created a little script that automates downloading, compiling and testing multiple versions of OpenSSL. It's a bit of a hack but it suits its purpose. Maybe somebody likes to take it from here and turn it into a proper tool for Python's Tools/ directory. >From the doc string of the script: The script (1) downloads OpenSSL tar bundle (2) extracts it to ../openssl/src/openssl-VERSION/ (3) compiles OpenSSL (4) installs OpenSSL into ../openssl/VERSION/ (5) forces a recompilation of Python modules using the header and library files from ../openssl/VERSION/ (6) runs Python's test suite The script must be run with Python's build directory as current working directory. The script uses LD_RUN_PATH, LD_LIBRARY_PATH, CPPFLAGS and LDFLAGS to bend search paths for header files and shared libraries. It's known to work on Linux with GCC 4.x. Tested with OpenSSL 0.9.7m, 0.9.8y, 1.0.0k and 1.0.1e. ---------- components: Demos and Tools files: multissl.py messages: 191139 nosy: christian.heimes, gregory.p.smith, pitrou priority: low severity: normal status: open title: Script to test multiple versions of OpenSSL type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30584/multissl.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 18:20:42 2013 From: report at bugs.python.org (Chris Rebert) Date: Fri, 14 Jun 2013 16:20:42 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1371226842.31.0.489927824778.issue18163@psf.upfronthosting.co.za> Changes by Chris Rebert : ---------- nosy: +cvrebert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 18:25:40 2013 From: report at bugs.python.org (Chris Rebert) Date: Fri, 14 Jun 2013 16:25:40 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1371227140.28.0.662456331079.issue18162@psf.upfronthosting.co.za> Changes by Chris Rebert : ---------- nosy: +cvrebert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 18:26:05 2013 From: report at bugs.python.org (Chris Rebert) Date: Fri, 14 Jun 2013 16:26:05 +0000 Subject: [issue18166] 'value' attribute for ValueError In-Reply-To: <1370638616.72.0.719325929736.issue18166@psf.upfronthosting.co.za> Message-ID: <1371227165.68.0.293430198077.issue18166@psf.upfronthosting.co.za> Changes by Chris Rebert : ---------- nosy: +cvrebert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 18:30:25 2013 From: report at bugs.python.org (Chris Rebert) Date: Fri, 14 Jun 2013 16:30:25 +0000 Subject: [issue18170] define built-in exceptions in Python code In-Reply-To: <1370735699.37.0.350073873785.issue18170@psf.upfronthosting.co.za> Message-ID: <1371227425.81.0.33799719924.issue18170@psf.upfronthosting.co.za> Changes by Chris Rebert : ---------- nosy: +cvrebert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 18:30:27 2013 From: report at bugs.python.org (Berker Peksag) Date: Fri, 14 Jun 2013 16:30:27 +0000 Subject: [issue18193] Move imp.reload() to importlib In-Reply-To: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> Message-ID: <1371227427.03.0.761727068117.issue18193@psf.upfronthosting.co.za> Berker Peksag added the comment: Updated patch adressing Brett's comments. ---------- Added file: http://bugs.python.org/file30585/issue18193_v2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 18:55:07 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 16:55:07 +0000 Subject: [issue18193] Move imp.reload() to importlib In-Reply-To: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> Message-ID: <1371228907.0.0.567316274892.issue18193@psf.upfronthosting.co.za> Brett Cannon added the comment: Answered Berker's questions from the review. At this point Berker just needs to tweak one line in the test and it should then be good to go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 19:36:09 2013 From: report at bugs.python.org (Berker Peksag) Date: Fri, 14 Jun 2013 17:36:09 +0000 Subject: [issue18193] Move imp.reload() to importlib In-Reply-To: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> Message-ID: <1371231369.47.0.275867146743.issue18193@psf.upfronthosting.co.za> Changes by Berker Peksag : Added file: http://bugs.python.org/file30586/issue18193_v3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 19:41:55 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 17:41:55 +0000 Subject: [issue18193] Move imp.reload() to importlib In-Reply-To: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> Message-ID: <1371231715.14.0.487246673198.issue18193@psf.upfronthosting.co.za> Brett Cannon added the comment: With Berker's nice use of TestCase.subTest() I think the patch is good to go! I should hopefully get this checked in today or tomorrow. ---------- resolution: -> fixed stage: patch review -> commit review status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 20:44:18 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Fri, 14 Jun 2013 18:44:18 +0000 Subject: [issue18212] No way to check whether Future is finished? In-Reply-To: <1371216345.77.0.119966223843.issue18212@psf.upfronthosting.co.za> Message-ID: <1371235458.38.0.633675862529.issue18212@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Do you want something like f.done() and not f.cancelled() and f.exception() is None ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:04:36 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 19:04:36 +0000 Subject: [issue18193] Move imp.reload() to importlib In-Reply-To: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> Message-ID: <3bXB832sFrz7LkB@mail.python.org> Roundup Robot added the comment: New changeset 01da7bf11ca1 by Brett Cannon in branch 'default': Issue #18193: Add importlib.reload(), documenting (but not http://hg.python.org/cpython/rev/01da7bf11ca1 ---------- nosy: +python-dev status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:06:02 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 19:06:02 +0000 Subject: [issue18193] Move imp.reload() to importlib In-Reply-To: <1370983511.06.0.645112750282.issue18193@psf.upfronthosting.co.za> Message-ID: <1371236762.24.0.126397292461.issue18193@psf.upfronthosting.co.za> Brett Cannon added the comment: Thanks for the patch, Berker! ---------- assignee: -> brett.cannon stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:06:17 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 19:06:17 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371236777.14.0.217319774907.issue17177@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- title: Document/deprecate imp -> Deprecate imp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:08:47 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 19:08:47 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1371236927.4.0.679360887125.issue18192@psf.upfronthosting.co.za> Brett Cannon added the comment: Any chance I could get a response to my questions, Barry, soon? I think I can finish the rest of the issues related to deprecating imp this weekend if we can settle this quickly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:08:56 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 19:08:56 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1371236936.2.0.311801330911.issue18192@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:10:55 2013 From: report at bugs.python.org (Ram Rachum) Date: Fri, 14 Jun 2013 19:10:55 +0000 Subject: [issue18212] No way to check whether Future is finished? In-Reply-To: <1371216345.77.0.119966223843.issue18212@psf.upfronthosting.co.za> Message-ID: <1371237055.04.0.895166916255.issue18212@psf.upfronthosting.co.za> Ram Rachum added the comment: I guess that'd be equivalent, yes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:35:25 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 14 Jun 2013 19:35:25 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1371238525.09.0.340720776249.issue18192@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: The only argument I have about it is that if someone *does* want to use, it should be fairly easily discoverable. Also, since it's a concrete value, it seems a little weird that it's stashed in an abc. I suppose importlib.machinery.MAGIC is better than importlib.abc.SourceLoader.magic ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:49:49 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Fri, 14 Jun 2013 19:49:49 +0000 Subject: [issue18000] _md5 should be built if _ssl cannot be built In-Reply-To: <1368818592.85.0.0295311805267.issue18000@psf.upfronthosting.co.za> Message-ID: <1371239389.58.0.426483098625.issue18000@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 21:53:38 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 19:53:38 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1371239618.14.0.532698337605.issue18192@psf.upfronthosting.co.za> Brett Cannon added the comment: I'll put it into importlib.util.MAGIC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 22:05:12 2013 From: report at bugs.python.org (Zachary Ware) Date: Fri, 14 Jun 2013 20:05:12 +0000 Subject: [issue15968] Incorporate Tcl/Tk/Tix into the Windows build process In-Reply-To: <1347996983.92.0.069726969781.issue15968@psf.upfronthosting.co.za> Message-ID: <1371240312.75.0.00931908722419.issue15968@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 22:24:06 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 14 Jun 2013 20:24:06 +0000 Subject: [issue18179] SMTP.local_hostname is undocumented In-Reply-To: <1370859868.96.0.822120662228.issue18179@psf.upfronthosting.co.za> Message-ID: <1371241446.42.0.544265522877.issue18179@psf.upfronthosting.co.za> Changes by A.M. Kuchling : ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 22:14:18 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 14 Jun 2013 20:14:18 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1371239618.14.0.532698337605.issue18192@psf.upfronthosting.co.za> Message-ID: <20130614161415.2283b49d@anarchist> Barry A. Warsaw added the comment: On Jun 14, 2013, at 07:53 PM, Brett Cannon wrote: >I'll put it into importlib.util.MAGIC. +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 22:24:43 2013 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 14 Jun 2013 20:24:43 +0000 Subject: [issue1475523] gettext breaks on plural-forms header Message-ID: <1371241483.19.0.646703681555.issue1475523@psf.upfronthosting.co.za> Changes by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 22:25:42 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 14 Jun 2013 20:25:42 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <1371241542.57.0.362446687779.issue18155@psf.upfronthosting.co.za> Changes by A.M. Kuchling : ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 22:34:41 2013 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 14 Jun 2013 20:34:41 +0000 Subject: [issue18216] gettext doesn't check MO versions Message-ID: <1371242081.43.0.507366610452.issue18216@psf.upfronthosting.co.za> New submission from Jakub Wilk: The MO file format specification[0] reads: "A program seeing an unexpected major revision number should stop reading the MO file entirely" But Python doesn't pay attention to versions at all. As a test-case I attached a MO file with a bogus major revision number. msgunfmt correcly rejects such a file: $ msgunfmt messages.mo msgunfmt: file "messages.mo" is not in GNU .mo format Yet Python opens it happily: >>> import gettext >>> t = gettext.GNUTranslations(open("messages.mo", "rb")) >>> t.gettext("foo") 'bar' [0] http://www.gnu.org/software/gettext/manual/html_node/MO-Files.html ---------- components: Library (Lib) files: messages.mo messages: 191151 nosy: jwilk priority: normal severity: normal status: open title: gettext doesn't check MO versions Added file: http://bugs.python.org/file30587/messages.mo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 22:36:49 2013 From: report at bugs.python.org (Alex Gaynor) Date: Fri, 14 Jun 2013 20:36:49 +0000 Subject: [issue18217] Deprecate and remove gettext.install Message-ID: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> New submission from Alex Gaynor: There's a myriad of reasons it's a bad idea: * Makes code harder to read * Doesn't play nicely with multiple projects using gettext * Defeats any attempt at static analysis * etc... ---------- messages: 191152 nosy: alex priority: normal severity: normal status: open title: Deprecate and remove gettext.install _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 22:42:45 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 14 Jun 2013 20:42:45 +0000 Subject: [issue11352] Update cgi module doc In-Reply-To: <1298895261.86.0.965235067518.issue11352@psf.upfronthosting.co.za> Message-ID: <1371242565.18.0.965742143922.issue11352@psf.upfronthosting.co.za> Changes by A.M. Kuchling : ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:06:57 2013 From: report at bugs.python.org (Zachary Ware) Date: Fri, 14 Jun 2013 21:06:57 +0000 Subject: [issue15968] Incorporate Tcl/Tk/Tix into the Windows build process In-Reply-To: <1347996983.92.0.069726969781.issue15968@psf.upfronthosting.co.za> Message-ID: <1371244017.45.0.323638742557.issue15968@psf.upfronthosting.co.za> Zachary Ware added the comment: The current patch doesn't apply cleanly anymore and contained an accidental reversion of a commit, so I took the liberty of creating an updated version. I'll also be leaving comments on Rietveld. ---------- Added file: http://bugs.python.org/file30588/issue15968_update.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:08:00 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 14 Jun 2013 21:08:00 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1371244080.0.0.978842399999.issue18217@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:24:17 2013 From: report at bugs.python.org (Steve Ward) Date: Fri, 14 Jun 2013 21:24:17 +0000 Subject: [issue12932] filecmp.dircmp does not allow non-shallow comparisons In-Reply-To: <1315411296.33.0.213336425163.issue12932@psf.upfronthosting.co.za> Message-ID: <1371245057.31.0.149797146824.issue12932@psf.upfronthosting.co.za> Steve Ward added the comment: Add input parameter 'shallow' to dircmp. Use it in phase3 and phase4. Document it in filecmp.rst. Did not modify test_filecmp.py. ---------- keywords: +patch Added file: http://bugs.python.org/file30589/issue12932.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:27:00 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Jun 2013 21:27:00 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1371245220.95.0.613249731575.issue18217@psf.upfronthosting.co.za> R. David Murray added the comment: How would you do dynamic switching of translation locale at runtime, then? ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:34:32 2013 From: report at bugs.python.org (Alex Gaynor) Date: Fri, 14 Jun 2013 21:34:32 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1371245672.75.0.913893337832.issue18217@psf.upfronthosting.co.za> Alex Gaynor added the comment: I'm not sure I understand the question. What `install()` does is set `__builtins__._` to be gettext. I think people should import the gettext function they need. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:37:47 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 14 Jun 2013 21:37:47 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371245220.95.0.613249731575.issue18217@psf.upfronthosting.co.za> Message-ID: <20130614173744.52d79cfe@anarchist> Barry A. Warsaw added the comment: On Jun 14, 2013, at 09:27 PM, R. David Murray wrote: >How would you do dynamic switching of translation locale at runtime, then? flufl.i18n :) http://pythonhosted.org/flufl.i18n/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:43:59 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Jun 2013 21:43:59 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1371246239.68.0.182748235839.issue18217@psf.upfronthosting.co.za> R. David Murray added the comment: install says this: This installs the function _() in Python?s builtins namespace, based on domain, localedir, and codeset which are passed to the function translation() Unless I'm misunderstanding something, this means that the actual value of _ is different depending on which domain, localedir, and codeset are in use. So if my application allows the user to *change languages* at runtime, I need to *change* what is bound to _. If my program has assigned a value to _, when another part of the application changes the language, what is bound to _ in other modules is not going to change. This is my understanding of why _ is put in the global namespace. Of course, I've only used gettext in one application (that did dynamic language switching), so I could just have been doing it wrong...and I suppose there is no reason (and some sense) why _ could not be a function that indirects to the current language. Or is that the way it works now and I am just misunderstanding the documentation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:46:35 2013 From: report at bugs.python.org (Alex Gaynor) Date: Fri, 14 Jun 2013 21:46:35 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1371246395.88.0.716354133389.issue18217@psf.upfronthosting.co.za> Alex Gaynor added the comment: I think the code makes what this does much clearer: http://hg.python.org/cpython/file/01da7bf11ca1/Lib/gettext.py#l209 There's no reason you can't make your own translation object, and expose it's gettext method as as your API, and then you can update the underlying translation object to check locales. This is approximately exactly how Django works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 14 23:55:54 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Jun 2013 21:55:54 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1371246954.23.0.986450995548.issue18217@psf.upfronthosting.co.za> R. David Murray added the comment: Which is what Barry's library does. But rather than just deprecating install, I think we should fix the module so that it supports this directly. That could be as simple as adding a dynamic translations class. What does library code that wants to provide internationalization do, though? Right now they could just use _, and tell library users they need to call gettext.install in their application. Is there some other technique that is currently used? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:06:47 2013 From: report at bugs.python.org (tahnoon pasha) Date: Fri, 14 Jun 2013 22:06:47 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1371247607.21.0.535136148343.issue18153@psf.upfronthosting.co.za> tahnoon pasha added the comment: http://sourceforge.net/p/davmail/bugs/532/ The response back from the davmail software maintainer is that this is a non RFC mechanism with a purpose (used as a keep alive on a very slow responding server - SELECT can be very slow when getting mail this way.) I guess it's a request back to imaplib maintainers to see how this might be fixed in imaplib. I'm very new to python and not a programmer by trade but if its a straightforward fix I'd be happy to have a go if someone can point me in the right direction. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:20:23 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 22:20:23 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <3bXGTy4rrVzQr3@mail.python.org> Roundup Robot added the comment: New changeset bfd53dcb02ff by Ned Deily in branch 'default': Issue #18149: Add filecmp.clear_cache() to manually clear the filecmp cache. http://hg.python.org/cpython/rev/bfd53dcb02ff ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:22:19 2013 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Jun 2013 22:22:19 +0000 Subject: [issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution In-Reply-To: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za> Message-ID: <1371248539.47.0.238260368526.issue18149@psf.upfronthosting.co.za> Ned Deily added the comment: Committed for release in 3.4.0. Thanks, Mark. ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:33:29 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 22:33:29 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <3bXGn44bV9z7LkN@mail.python.org> Roundup Robot added the comment: New changeset 46ef1d2af352 by Brett Cannon in branch 'default': Issue #17222: Raise FileExistsError when py_compile.compile would http://hg.python.org/cpython/rev/46ef1d2af352 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:33:56 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 22:33:56 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1371249236.62.0.350062870323.issue17222@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:36:32 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 22:36:32 +0000 Subject: [issue17907] Deprecate imp.new_module() in favour of types.ModuleType In-Reply-To: <1367691908.58.0.339991159831.issue17907@psf.upfronthosting.co.za> Message-ID: <1371249392.07.0.601532408845.issue17907@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:36:40 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 22:36:40 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1371249400.44.0.324844517963.issue18192@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: barry -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:36:49 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 22:36:49 +0000 Subject: [issue18194] Move imp.source_from_cache/cache_from_source to importlib In-Reply-To: <1370983623.04.0.860337452651.issue18194@psf.upfronthosting.co.za> Message-ID: <1371249409.58.0.931871379914.issue18194@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 00:44:09 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 22:44:09 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <3bXH1P1LTJz7LkR@mail.python.org> Roundup Robot added the comment: New changeset 6661a8154eb3 by Victor Stinner in branch 'default': Issue #3329: Add new APIs to customize memory allocators http://hg.python.org/cpython/rev/6661a8154eb3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:01:10 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Jun 2013 23:01:10 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1371250870.2.0.885052456782.issue18153@psf.upfronthosting.co.za> R. David Murray added the comment: Well, the first thing to do would be to write a test that reproduces the problem. There is test infrastructure in Lib/test/test_imaplib.py, but I will admit that writing the server side of imaplib tests is not a walk in the park. You are welcome to take a look. If you can figure it out, you'll be on your way to being a non-newbie Python programmer :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:02:42 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 23:02:42 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <3bXHQn74m5z7Lk1@mail.python.org> Roundup Robot added the comment: New changeset 5619bc2d8207 by Brett Cannon in branch 'default': Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document the http://hg.python.org/cpython/rev/5619bc2d8207 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:03:03 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Jun 2013 23:03:03 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1371250982.99.0.324016530534.issue18153@psf.upfronthosting.co.za> R. David Murray added the comment: Oh, by the way there's a bit more of the test infrastructure in python3 compared to python2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:03:12 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 23:03:12 +0000 Subject: [issue18192] Move imp.get_magic() to importlib In-Reply-To: <1370983444.92.0.65091801701.issue18192@psf.upfronthosting.co.za> Message-ID: <1371250992.47.0.554970262296.issue18192@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:05:45 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Jun 2013 23:05:45 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371251145.24.0.615385065539.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: I commited my new API to customize memory allocators: New changeset 6661a8154eb3 by Victor Stinner in branch 'default': Issue #3329: Add new APIs to customize memory allocators http://hg.python.org/cpython/rev/6661a8154eb3 I added PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() in the same commit. These functions are wrappers to malloc/realloc/free which can be called without the GIL held. Using these new functions instead of malloc/realloc/free is interesting because the internal functions can be replaced with PyMem_SetRawAllocators() and many checks are added in debug mode (ex: check for buffer under- and overflow). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:16:45 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Jun 2013 23:16:45 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1371251805.59.0.446539235215.issue18153@psf.upfronthosting.co.za> R. David Murray added the comment: I'll also note that if you start from the traceback and look at the code involved in the exception (keeping in mind that since the exception is caught, in python2 you lose the original cause, which is therefore in the function called in the try block), there is actually a comment in the code that is directly on point to this issue. If we can get a reproducible test case the fix will probably be simple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:20:05 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 23:20:05 +0000 Subject: [issue17907] Deprecate imp.new_module() in favour of types.ModuleType In-Reply-To: <1367691908.58.0.339991159831.issue17907@psf.upfronthosting.co.za> Message-ID: <3bXHps0D5szT0n@mail.python.org> Roundup Robot added the comment: New changeset be50f1403f4d by Brett Cannon in branch 'default': Issue #17907: Document types.ModuleType's constructor and attributes, http://hg.python.org/cpython/rev/be50f1403f4d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:20:25 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 14 Jun 2013 23:20:25 +0000 Subject: [issue17907] Deprecate imp.new_module() in favour of types.ModuleType In-Reply-To: <1367691908.58.0.339991159831.issue17907@psf.upfronthosting.co.za> Message-ID: <1371252025.47.0.0464001600391.issue17907@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:56:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Jun 2013 23:56:10 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <3bXJcV0KVMz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset e7a01c7f69fe by Ethan Furman in branch 'default': Closes issue 17947. Adds PEP-0435 (Adding an Enum type to the Python standard library). http://hg.python.org/cpython/rev/e7a01c7f69fe ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 01:57:42 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Jun 2013 23:57:42 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1371254262.81.0.793037115769.issue17947@psf.upfronthosting.co.za> STINNER Victor added the comment: > New changeset e7a01c7f69fe by Ethan Furman in branch 'default': > Closes issue 17947. Adds PEP-0435 (Adding an Enum type to the Python standard library). > http://hg.python.org/cpython/rev/e7a01c7f69fe Great job :-) ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 02:07:37 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 00:07:37 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371254857.49.0.344324978489.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: pymem_debugcheckgil.patch: Patch adding check in debug mode to ensure that PyMem_Malloc() and PyObject_Malloc() are called with the GIL held. ---------- keywords: +patch Added file: http://bugs.python.org/file30590/pymem_debugcheckgil.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 02:10:11 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 00:10:11 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371255011.55.0.974808126815.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: py_finalize.patch: modify Py_Finalize() to destroy the GIL after the last call to PyMem_Malloc() or PyObject_Malloc(). For example, PyCFunction_Fini() calls PyObject_GC_Del() which calls PyObject_FREE(). ---------- Added file: http://bugs.python.org/file30591/py_finalize.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 02:13:03 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 00:13:03 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371255183.22.0.567496712286.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: pymem_debugcheckgil.patch: oops, a forgot a change in pgenmain.c. New fixed patch attached. ---------- Added file: http://bugs.python.org/file30592/pymem_debugcheckgil-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 02:21:21 2013 From: report at bugs.python.org (Tom Prince) Date: Sat, 15 Jun 2013 00:21:21 +0000 Subject: [issue17121] SSH upload for distutils In-Reply-To: <1359972222.78.0.301395503133.issue17121@psf.upfronthosting.co.za> Message-ID: <1371255681.52.0.218032459829.issue17121@psf.upfronthosting.co.za> Tom Prince added the comment: > "this package performs heavy monkey-patching of distutils to make it use the system's ssh command." > I don't think this bodes well for immediate inclusion, especially in a bugfix release. It only needs monkey-patching to convince distutils to connect over ssh. This is suggesting it handle it natively. (clearly) ---------- nosy: +Tom.Prince versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 02:35:50 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 00:35:50 +0000 Subject: [issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe In-Reply-To: <1356086390.48.0.327620937355.issue16742@psf.upfronthosting.co.za> Message-ID: <1371256550.04.0.261318322348.issue16742@psf.upfronthosting.co.za> STINNER Victor added the comment: Updated patch for the final API of #3329. Update also the documentation. PyOS_ReadlineFunctionPointer must now use PyMem_RawMalloc() or PyMem_RawRealloc(), instead of PyMem_Malloc() or PyMem_Realloc(). ---------- Added file: http://bugs.python.org/file30593/readline_gil-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 02:36:28 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 00:36:28 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371256588.11.0.218699632779.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: See also issue #16742: "PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 02:44:07 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 00:44:07 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371257047.45.0.676211934604.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: malloc_init.patch: Patch for functions called at Python initialization. This patch is not complete: to parse "-X" option (PySys_AddXOption) and "-W" (PySys_AddWarnOption), PyMem_Malloc() and PyObject_Malloc() are still called indirectly. Fixing this issue may need to reorganize completly how Python is initialized, because we need to have basic Python types (ex: Unicode) to be ready to be able to parse the command line. But we cannot initialize too much because the Python initialization also depends on options from the command line... ---------- Added file: http://bugs.python.org/file30594/malloc_init.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 02:57:57 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 15 Jun 2013 00:57:57 +0000 Subject: [issue17947] Code, test, and doc review for PEP-0435 Enum In-Reply-To: <1368168600.94.0.409104207023.issue17947@psf.upfronthosting.co.za> Message-ID: <1371257877.1.0.312878137366.issue17947@psf.upfronthosting.co.za> Nick Coghlan added the comment: Nicely done - you can also mark the PEP as Final now :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 03:19:49 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 01:19:49 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371259189.21.0.719269581435.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: malloc_modules.patch: Patch for different Python modules. ---------- Added file: http://bugs.python.org/file30595/malloc_modules.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 03:35:21 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 01:35:21 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371260121.31.0.0137280201618.issue18203@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, initial patches are attached. Let describe them a little bit. - pymem_debugcheckgil-2.patch: I don't think that this patch can be commited before the "bootstrap" issue is solved (Python doesn't start in debug mode with this patch when -W or -X command line option is used). I wrote it to check that other patches are correct (check if the GIL is held when PyMem_Malloc is called). - py_finalize.patch: should be safe - malloc_init.patch: change _Py_char2wchar() API, the result must now be freed by PyMem_RawFree() instead of PyMem_Free(). the change does not hurt in release mode (both functions are just wrapper to free()), but may break in debug mode (because python checks that PyMem_RawFree() is called on a buffer allocated by PyMem_RawMalloc()) in extension modules using _Py_char2wchar(). I would like to _Py_char2wchar() API (not to solve this issue, just because it is very useful for applications embedding Python), so changing its name would avoid a crash (applications would get a compilation or link error instead). Other change of the patch: replace free() and PyMem_Free() with PyMem_RawFree(), should be safe. - malloc_modules.patch: I replaced many malloc() with PyMem_Malloc(), which is not safe. All these patches must be reviewed carefully to check if the GIL is held or not, and tested with pymem_debugcheckgil-2.patch (on Windows too! some patched functions os posixmodule.c are only compiled on Windows). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 03:38:02 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 01:38:02 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <3bXLt14Yzcz7Ljk@mail.python.org> Roundup Robot added the comment: New changeset b1455dd08000 by Victor Stinner in branch 'default': Revert changeset 6661a8154eb3: Issue #3329: Add new APIs to customize memory allocators http://hg.python.org/cpython/rev/b1455dd08000 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:26:38 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 02:26:38 +0000 Subject: [issue17907] Deprecate imp.new_module() in favour of types.ModuleType In-Reply-To: <1367691908.58.0.339991159831.issue17907@psf.upfronthosting.co.za> Message-ID: <3bXMy624S7z7LkG@mail.python.org> Roundup Robot added the comment: New changeset 9cacdb9d0c59 by Brett Cannon in branch 'default': Issue #17907: touch up the code for imp.new_module(). http://hg.python.org/cpython/rev/9cacdb9d0c59 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:35:48 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 02:35:48 +0000 Subject: [issue18194] Move imp.source_from_cache/cache_from_source to importlib In-Reply-To: <1370983623.04.0.860337452651.issue18194@psf.upfronthosting.co.za> Message-ID: <3bXN8g56ZfzQ1v@mail.python.org> Roundup Robot added the comment: New changeset 32067804942e by Brett Cannon in branch 'default': Issue #18194: Introduce importlib.util.cache_from_source() and http://hg.python.org/cpython/rev/32067804942e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:36:00 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 15 Jun 2013 02:36:00 +0000 Subject: [issue18194] Move imp.source_from_cache/cache_from_source to importlib In-Reply-To: <1370983623.04.0.860337452651.issue18194@psf.upfronthosting.co.za> Message-ID: <1371263759.99.0.500228848664.issue18194@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:42:24 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 15 Jun 2013 02:42:24 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371264144.86.0.94187108132.issue17177@psf.upfronthosting.co.za> Brett Cannon added the comment: Everything that is going to be kept around has been moved. That just leaves: 1. Removing all uses of imp from the stdlib 2. Document as deprecated the last few things in imp which are simply being removed (including adding a note in the docstrings) 3. Remove all function/class-level deprecation warnings and add a module-level pending deprecation one 4. Run the test suite with -W always to make sure I didn't miss anything ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:44:23 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 15 Jun 2013 02:44:23 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371264263.61.0.331249677134.issue17177@psf.upfronthosting.co.za> Brett Cannon added the comment: And in case anyone is interested, it could be as many as 98 files to go through. =) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:47:07 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 15 Jun 2013 02:47:07 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371264427.6.0.450182220379.issue17177@psf.upfronthosting.co.za> Brett Cannon added the comment: Sorry, bad regex: it's more like 60 files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:49:09 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 02:49:09 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXNS45432zQ1v@mail.python.org> Roundup Robot added the comment: New changeset 3d3b9d456eb8 by Brett Cannon in branch 'default': Issue #17177: Update the programming FAQ to use importlib http://hg.python.org/cpython/rev/3d3b9d456eb8 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:52:07 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 15 Jun 2013 02:52:07 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371264727.48.0.777803854079.issue17177@psf.upfronthosting.co.za> Brett Cannon added the comment: To have it on record, the command I am using to find uses of imp is:: ack "import imp(,|\n)|from imp import" -l ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 04:53:42 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 15 Jun 2013 02:53:42 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371264822.29.0.836184162188.issue17177@psf.upfronthosting.co.za> Brett Cannon added the comment: ack "import (\w+, *)*imp(,|\n)|from imp import" -l ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 05:04:11 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 03:04:11 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXNnR0Dq8zQHY@mail.python.org> Roundup Robot added the comment: New changeset cc27d50bd91a by Brett Cannon in branch 'default': Issue #17177: stop using imp for compileall. http://hg.python.org/cpython/rev/cc27d50bd91a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 05:05:17 2013 From: report at bugs.python.org (tahnoon pasha) Date: Sat, 15 Jun 2013 03:05:17 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1371265517.49.0.912976217592.issue18153@psf.upfronthosting.co.za> tahnoon pasha added the comment: Okay David. Thanks for the pointer. With great trepidation Ill hit google and try and figure out how to create a test case for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 06:06:47 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 15 Jun 2013 04:06:47 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371269207.46.0.562234950336.issue18203@psf.upfronthosting.co.za> Nick Coghlan added the comment: Note that CPython's main function accesses the C API before calling Py_Initialize(). This is insane, but fixing it is hard (and one of the main goals of PEP 432). I suggest using Py_IsInitialized() to exclude those from your debug checks for now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 06:29:37 2013 From: report at bugs.python.org (py.user) Date: Sat, 15 Jun 2013 04:29:37 +0000 Subject: [issue18218] In itertools.count() clarify the starting point Message-ID: <1371270577.83.0.291953378937.issue18218@psf.upfronthosting.co.za> New submission from py.user: http://docs.python.org/3/library/itertools.html#itertools.count "itertools.count(start=0, step=1) Make an iterator that returns evenly spaced values starting with n." starting with start ---------- assignee: docs at python components: Documentation files: issue.patch keywords: patch messages: 191196 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools.count() clarify the starting point type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30596/issue.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 07:08:20 2013 From: report at bugs.python.org (py.user) Date: Sat, 15 Jun 2013 05:08:20 +0000 Subject: [issue18218] In itertools.count() clarify the starting point In-Reply-To: <1371270577.83.0.291953378937.issue18218@psf.upfronthosting.co.za> Message-ID: <1371272900.44.0.496631870872.issue18218@psf.upfronthosting.co.za> Changes by py.user : Added file: http://bugs.python.org/file30597/issue18218.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 07:10:51 2013 From: report at bugs.python.org (py.user) Date: Sat, 15 Jun 2013 05:10:51 +0000 Subject: [issue18218] In itertools.count() clarify the starting point In-Reply-To: <1371270577.83.0.291953378937.issue18218@psf.upfronthosting.co.za> Message-ID: <1371273051.32.0.823995426861.issue18218@psf.upfronthosting.co.za> Changes by py.user : Removed file: http://bugs.python.org/file30596/issue18218.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 07:12:39 2013 From: report at bugs.python.org (Mikhail Traskin) Date: Sat, 15 Jun 2013 05:12:39 +0000 Subject: [issue18219] csv.DictWriter is slow when writing files with large number of columns Message-ID: <1371273159.09.0.766674685212.issue18219@psf.upfronthosting.co.za> New submission from Mikhail Traskin: _dict_to_list method of the csv.DictWriter objects created with extrasaction="raise" uses look-up in the list of field names to check if current row has any unknown fields. This results in O(n^2) execution time and is very slow if there are a lot of columns in a CSV file (in hundreds or thousands). Replacing look-up in a list with a look-up in a set solves the issue (see the attached patch). ---------- components: Library (Lib) files: csvdictwriter.patch keywords: patch messages: 191197 nosy: mtraskin priority: normal severity: normal status: open title: csv.DictWriter is slow when writing files with large number of columns type: performance Added file: http://bugs.python.org/file30598/csvdictwriter.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 07:29:55 2013 From: report at bugs.python.org (Eric Snow) Date: Sat, 15 Jun 2013 05:29:55 +0000 Subject: [issue14303] Incorrect documentation for socket.py on linux In-Reply-To: <1331744298.15.0.025379356395.issue14303@psf.upfronthosting.co.za> Message-ID: <1371274195.27.0.317311351597.issue14303@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 07:52:23 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Jun 2013 05:52:23 +0000 Subject: [issue18219] csv.DictWriter is slow when writing files with large number of columns In-Reply-To: <1371273159.09.0.766674685212.issue18219@psf.upfronthosting.co.za> Message-ID: <1371275543.21.0.434771518321.issue18219@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think there is no need in public fieldset property. Just use private self._fieldset field in private _dict_to_list() method. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 08:29:33 2013 From: report at bugs.python.org (py.user) Date: Sat, 15 Jun 2013 06:29:33 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() Message-ID: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> New submission from py.user: http://docs.python.org/3/library/itertools.html#itertools.islice " itertools.islice(iterable, stop) itertools.islice(iterable, start, stop[, step])" >>> print(itertools.islice.__doc__) islice(iterable, [start,] stop [, step]) --> islice object ... ---------- assignee: docs at python components: Documentation files: issue.patch keywords: patch messages: 191199 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools.islice() make prototype like in help() type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30599/issue.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 08:42:36 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Jun 2013 06:42:36 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371278556.3.0.7494984003.issue18220@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 09:29:56 2013 From: report at bugs.python.org (py.user) Date: Sat, 15 Jun 2013 07:29:56 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371281396.19.0.787483916751.issue18220@psf.upfronthosting.co.za> py.user added the comment: same thing with range(): http://docs.python.org/3/library/stdtypes.html?highlight=range#range http://docs.python.org/3//library/functions.html#func-range and with slice(): http://docs.python.org/3/library/functions.html?highlight=slice#slice http://docs.python.org/3//library/functions.html#slice can't patch them, because comma doesn't get into brackets "class range([start], stop[, step])" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 09:50:34 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 15 Jun 2013 07:50:34 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371282634.46.0.909134309107.issue18220@psf.upfronthosting.co.za> R. David Murray added the comment: The documentation is correct, it is the docstrings that need to be changed. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 14:38:02 2013 From: report at bugs.python.org (Jeremy Gray) Date: Sat, 15 Jun 2013 12:38:02 +0000 Subject: [issue18221] abspath strips trailing spaces on win32 Message-ID: <1371299882.82.0.523042534705.issue18221@psf.upfronthosting.co.za> New submission from Jeremy Gray: The behavior of os.path.abspath differs between Mac OS X and Windows. It seems like a bug that, on Windows, abspath strips trailing whitespace: Windows: >>> from os.path import abspath >>> abspath('start ') + 'END' 'c:\Users\jgray\code\startEND' ^ Mac: >>> from os.path import abspath >>> abspath('start ') + 'END' '/Users/jgray/code/start END' ^^ I have only tested with python 2.7.3 (Enthought distribution), 32-bit, and only Mac 10.8.2 and Windows 7. ---------- components: Windows messages: 191202 nosy: Jeremy.Gray priority: normal severity: normal status: open title: abspath strips trailing spaces on win32 type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 14:40:14 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Balcerzak?=) Date: Sat, 15 Jun 2013 12:40:14 +0000 Subject: [issue18222] os.path.abspath should accept multiple path parts and join them Message-ID: <1371300014.52.0.302689191901.issue18222@psf.upfronthosting.co.za> New submission from ?ukasz Balcerzak: In projects I work on I constantly end up creating something like: abspath = lambda *p: os.path.abspath(os.path.join(*p)) This could be easily avoided by allowing abspath to accept multiple arguments. This would be: 1. Backward compatibile (calls with single argument would remain the same) 2. Very simple to fix (just join given path parts before doing anything else) I can document this, do most of the coding and test on Mac and linux, however would not be able to test on other platforms. Let me know if this is acceptable. Attaching a diff with posixpath update. ---------- components: Library (Lib) files: abspath-with-joins.diff keywords: patch messages: 191203 nosy: ?ukasz.Balcerzak priority: normal severity: normal status: open title: os.path.abspath should accept multiple path parts and join them type: enhancement versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file30600/abspath-with-joins.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 15:19:41 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Jun 2013 13:19:41 +0000 Subject: [issue17944] Refactor test_zipfile In-Reply-To: <1368093470.65.0.477520947191.issue17944@psf.upfronthosting.co.za> Message-ID: <1371302381.0.0.761740374579.issue17944@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If there are no objection I'm going to commit this patch soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 15:47:28 2013 From: report at bugs.python.org (Rene Hahne) Date: Sat, 15 Jun 2013 13:47:28 +0000 Subject: [issue15869] IDLE: Include .desktop file and icon In-Reply-To: <1346929874.07.0.220677915984.issue15869@psf.upfronthosting.co.za> Message-ID: <1371304048.0.0.0454688399832.issue15869@psf.upfronthosting.co.za> Rene Hahne added the comment: I have the same issue with arch linux and gnome 3.8. Solution was adding "Type=Application" to idle.desktop file ---------- nosy: +Rene.Hahne _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 15:49:24 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 15 Jun 2013 13:49:24 +0000 Subject: [issue18222] os.path.abspath should accept multiple path parts and join them In-Reply-To: <1371300014.52.0.302689191901.issue18222@psf.upfronthosting.co.za> Message-ID: <1371304164.19.0.509335544292.issue18222@psf.upfronthosting.co.za> R. David Murray added the comment: I'm -1 on this. It doesn't make sense to me to conflate two functions like that. If you need that functionality often in your application, just write a small helper function. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 16:00:28 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 15 Jun 2013 14:00:28 +0000 Subject: [issue18222] os.path.abspath should accept multiple path parts and join them In-Reply-To: <1371300014.52.0.302689191901.issue18222@psf.upfronthosting.co.za> Message-ID: <1371304828.12.0.418211462315.issue18222@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Would you expect to make the following also accept a sequence of path elements? - normpath, realpath, relpath - dirname - exists, lexists - expanduser, expandvars - isdir, isfile, islink - getsize, etc. I agree with R. David's sentiment. Moreover, relpath takes an optional second argument which would make this change backward incompatible. ---------- nosy: +lukasz.langa versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 16:09:26 2013 From: report at bugs.python.org (Chris AtLee) Date: Sat, 15 Jun 2013 14:09:26 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1371305366.5.0.505646111508.issue18167@psf.upfronthosting.co.za> Chris AtLee added the comment: Thanks, your patch is definitely much simpler! I was worried about the case where you have interrupted \r\n that appears in the middle of the content. But that case is handled by the next readline(), which returns a single \n. One question about the tests you've attached - would it be better to be explicit about the line endings in check()? Do triple quoted strings in python always use \n for EOL regardless of the source code EOL format? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 16:18:35 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Jun 2013 14:18:35 +0000 Subject: [issue18223] Refactor test_tarfile Message-ID: <1371305914.88.0.406502768054.issue18223@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: test_tarfile already use parametric classes approach for constructing different tests. The proposed patch extends this approach to generating tests for different compression types. In additional this patch: * Makes test_tarfile discoverable. * Uses more special tests (i.e. assertEqual, assertIs) instead of assertTrue. * Adds explicit test skips instead of reporting skipped tests as passed. * Wraps long lines. ---------- components: Tests files: test_tarfile.patch keywords: patch messages: 191209 nosy: ezio.melotti, lars.gustaebel, michael.foord, pitrou, serhiy.storchaka, zach.ware priority: normal severity: normal stage: patch review status: open title: Refactor test_tarfile type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30601/test_tarfile.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 16:27:14 2013 From: report at bugs.python.org (Peter Santoro) Date: Sat, 15 Jun 2013 14:27:14 +0000 Subject: [issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows Message-ID: <1371306434.01.0.246562250059.issue18224@psf.upfronthosting.co.za> New submission from Peter Santoro: I've recently hit an issue with pyvenv in Python 3.3.2 that is causing AttributeErrors in other packages on Windows (see https://groups.google.com/forum/?fromgroups#!topic/pylons-discuss/FpOSMDpdvy4). Here's what I believe is going on: On Windows, the pyvenv pydoc script has a .py extension - so import finds it instead of the system's pydoc module. On Linux, the pyvenv pydoc script doesn't have an extension - so import finds the system's pydoc module. I believe the Windows pyvenv pydoc.py script should be renamed to something like pydocs.py to prevent AttributeErrors. ---------- components: Windows messages: 191210 nosy: peter at psantoro.net priority: normal severity: normal status: open title: pyvenv pydoc.py script causing AttributeErrors on Windows type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 16:42:07 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 15 Jun 2013 14:42:07 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1371307327.36.0.836636045669.issue18113@psf.upfronthosting.co.za> Changes by A.M. Kuchling : ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 16:49:10 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Sat, 15 Jun 2013 14:49:10 +0000 Subject: [issue16136] Removal of VMS support In-Reply-To: <1349389263.57.0.925729224322.issue16136@psf.upfronthosting.co.za> Message-ID: <1371307750.88.0.300314327748.issue16136@psf.upfronthosting.co.za> Jes?s Cea Avi?n added the comment: Possibly relevant: http://www.theregister.co.uk/2013/06/10/openvms_death_notice/ http://www.openvms.org/stories.php?story=13/06/06/2422149 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 16:56:21 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Jun 2013 14:56:21 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1371308181.2.0.238918430305.issue18167@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > Do triple quoted strings in python always use \n for EOL regardless of the source code EOL format? Python parser always interprets EOL as \n in string literals. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 16:58:43 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Jun 2013 14:58:43 +0000 Subject: [issue18221] abspath strips trailing spaces on win32 In-Reply-To: <1371299882.82.0.523042534705.issue18221@psf.upfronthosting.co.za> Message-ID: <1371308323.95.0.872786265738.issue18221@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +brian.curtin, pitrou, tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 18:42:24 2013 From: report at bugs.python.org (Tomer Levi) Date: Sat, 15 Jun 2013 16:42:24 +0000 Subject: [issue18225] ctypes Structure data size is incorrect Message-ID: <1371314544.05.0.0841863678451.issue18225@psf.upfronthosting.co.za> New submission from Tomer Levi: Whenever you create a ctypes.Structure with mixed ctypes, the size of all components is calculated by the size of largest one. This is especially irritating when trying to use Structure on bytearray. The problem repeated for me in Python2.6 and 2.7 (both 32bit and 64bit versions) [My computer is 64bit] Example: #Creating a Structure that should take up 5 bytes class Test(ctypes.Structure): _fields_ = [("test", ctypes.c_byte), ("test2", ctypes.c_uint32),] #Initiating the Structure Test.from_buffer(bytearray(5)) --- OUTPUT ---- Traceback (most recent call last): File "", line 1, in Test.from_buffer(bytearray(5)) ValueError: Buffer size too small (5 instead of at least 8 bytes) ---------- components: ctypes messages: 191213 nosy: Tomer.Levi priority: normal severity: normal status: open title: ctypes Structure data size is incorrect type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 18:45:39 2013 From: report at bugs.python.org (Alex Gaynor) Date: Sat, 15 Jun 2013 16:45:39 +0000 Subject: [issue18225] ctypes Structure data size is incorrect In-Reply-To: <1371314544.05.0.0841863678451.issue18225@psf.upfronthosting.co.za> Message-ID: <1371314739.42.0.260533534205.issue18225@psf.upfronthosting.co.za> Alex Gaynor added the comment: This is how padding works in the C ABI, not a bug. ---------- nosy: +alex resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 19:00:01 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 17:00:01 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXlKs1hJgzPTs@mail.python.org> Roundup Robot added the comment: New changeset 30aa032c4bd0 by Brett Cannon in branch 'default': Issue #17177: Stop using imp in distutils http://hg.python.org/cpython/rev/30aa032c4bd0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 19:08:30 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sat, 15 Jun 2013 17:08:30 +0000 Subject: [issue18214] Stop purging modules which are garbage collected before shutdown In-Reply-To: <1371221979.53.0.00385452158182.issue18214@psf.upfronthosting.co.za> Message-ID: <1371316110.08.0.315288656498.issue18214@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 19:23:08 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 17:23:08 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXlrX2YRgzQ3P@mail.python.org> Roundup Robot added the comment: New changeset 0b96a16656b7 by Brett Cannon in branch 'default': Issue #17177: Stop using imp in multiprocessing http://hg.python.org/cpython/rev/0b96a16656b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:11:39 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jun 2013 18:11:39 +0000 Subject: [issue18214] Stop purging modules which are garbage collected before shutdown In-Reply-To: <1371221979.53.0.00385452158182.issue18214@psf.upfronthosting.co.za> Message-ID: <1371319899.13.0.747350154244.issue18214@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Usually garbage collection will end up clearing the module's dict anyway. This is not true, since global objects might have a __del__ and then hold the whole module dict alive through a reference cycle. Happily though, PEP 442 is going to make that concern obsolete. As for the interpreter shutdown itself, I have a pending patch (post-PEP 442) to get rid of the globals cleanup as well. It may be better to merge the two approaches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:12:46 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jun 2013 18:12:46 +0000 Subject: [issue18112] PEP 442 implementation Message-ID: <1371319966.78.0.275191221121.issue18112@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- keywords: +patch Added file: http://bugs.python.org/file30602/19fd6ab59bbb.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:20:46 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jun 2013 18:20:46 +0000 Subject: [issue18112] PEP 442 implementation Message-ID: <1371320446.43.0.701996950262.issue18112@psf.upfronthosting.co.za> Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file30602/19fd6ab59bbb.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:21:10 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jun 2013 18:21:10 +0000 Subject: [issue18112] PEP 442 implementation Message-ID: <1371320470.1.0.29875326718.issue18112@psf.upfronthosting.co.za> Changes by Antoine Pitrou : Added file: http://bugs.python.org/file30604/1d47c88412ac.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:25:12 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 18:25:12 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXnD76SNbz7Ljr@mail.python.org> Roundup Robot added the comment: New changeset 91467f342977 by Brett Cannon in branch 'default': Issue #17177: Stop using imp with py_compile http://hg.python.org/cpython/rev/91467f342977 New changeset 81cf3d6e6756 by Brett Cannon in branch 'default': Issue #17177: Stop using imp in pydoc http://hg.python.org/cpython/rev/81cf3d6e6756 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:26:04 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jun 2013 18:26:04 +0000 Subject: [issue18112] PEP 442 implementation Message-ID: <1371320764.63.0.0772595125462.issue18112@psf.upfronthosting.co.za> New submission from Antoine Pitrou: Here is the patch implementing PEP 442. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:27:29 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 18:27:29 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXnGm5TSyz7Ljp@mail.python.org> Roundup Robot added the comment: New changeset 8fff5554125d by Brett Cannon in branch 'default': Issue #17177: switch from imp.new_module to types.ModuleType for runpy http://hg.python.org/cpython/rev/8fff5554125d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:29:57 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:29:57 +0000 Subject: [issue1253] IDLE - Percolator overhaul In-Reply-To: <1191982624.13.0.198270020748.issue1253@psf.upfronthosting.co.za> Message-ID: <1371320997.82.0.20951123576.issue1253@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- assignee: kbk -> versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:32:27 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 18:32:27 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXnNM4Wl4zQCV@mail.python.org> Roundup Robot added the comment: New changeset 1e141c2cc0d7 by Brett Cannon in branch 'default': Issue #17177: Stop using imp in sysconfig http://hg.python.org/cpython/rev/1e141c2cc0d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:34:36 2013 From: report at bugs.python.org (Ned Deily) Date: Sat, 15 Jun 2013 18:34:36 +0000 Subject: [issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows In-Reply-To: <1371306434.01.0.246562250059.issue18224@psf.upfronthosting.co.za> Message-ID: <1371321276.8.0.997450079933.issue18224@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:41:33 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:41:33 +0000 Subject: [issue12690] Tix bug 2643483 In-Reply-To: <1312425211.65.0.926094356075.issue12690@psf.upfronthosting.co.za> Message-ID: <1371321693.14.0.176952933628.issue12690@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I do not think there is any pydev interest in separately patching tix, any more than we patch tk itself. ---------- resolution: rejected -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:43:08 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:43:08 +0000 Subject: [issue13179] IDLE uses common tkinter variables across all editor windows In-Reply-To: <1318607548.28.0.391563618977.issue13179@psf.upfronthosting.co.za> Message-ID: <1371321788.07.0.590618203674.issue13179@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:43:52 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:43:52 +0000 Subject: [issue13319] IDLE: Menu accelerator conflict between Format and Options In-Reply-To: <1320195837.58.0.031082649983.issue13319@psf.upfronthosting.co.za> Message-ID: <1371321832.17.0.869378756881.issue13319@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:44:32 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:44:32 +0000 Subject: [issue13504] Meta-issue for "Invent with Python" IDLE feedback In-Reply-To: <1322613083.36.0.200533745275.issue13504@psf.upfronthosting.co.za> Message-ID: <1371321872.76.0.341891318614.issue13504@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:45:07 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:45:07 +0000 Subject: [issue13519] Tkinter rowconfigure and columnconfigure functions crash if minsize, pad, or weight is not None In-Reply-To: <1322817071.4.0.270134570046.issue13519@psf.upfronthosting.co.za> Message-ID: <1371321907.35.0.0277683710148.issue13519@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:45:31 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:45:31 +0000 Subject: [issue13582] IDLE and pythonw.exe stderr problem In-Reply-To: <1323632290.53.0.810720020667.issue13582@psf.upfronthosting.co.za> Message-ID: <1371321931.56.0.909605445311.issue13582@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:45:54 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:45:54 +0000 Subject: [issue13586] IDLE: Replace selected not working/consistent with find In-Reply-To: <1323668532.6.0.615781606265.issue13586@psf.upfronthosting.co.za> Message-ID: <1371321954.45.0.197794393211.issue13586@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.3, Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:48:15 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 18:48:15 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <3bXnkl1BBXzQ1v@mail.python.org> Roundup Robot added the comment: New changeset aff0bdab358e by Andrew Kuchling in branch '2.7': #18113: Objects associated to a curses.panel object with set_userptr() were leaked. http://hg.python.org/cpython/rev/aff0bdab358e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:49:00 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:49:00 +0000 Subject: [issue13630] IDLE: Find(ed) text is not highlighted while dialog box is open In-Reply-To: <1324260829.97.0.644849663035.issue13630@psf.upfronthosting.co.za> Message-ID: <1371322140.85.0.443570323302.issue13630@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.3, Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:50:00 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:50:00 +0000 Subject: [issue13659] Add a help() viewer for IDLE's Shell. In-Reply-To: <1324707815.11.0.534121320744.issue13659@psf.upfronthosting.co.za> Message-ID: <1371322200.61.0.18830701293.issue13659@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:50:45 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:50:45 +0000 Subject: [issue13802] IDLE Prefernces/Fonts: use multiple alphabets in examples In-Reply-To: <1326756140.29.0.0714084996967.issue13802@psf.upfronthosting.co.za> Message-ID: <1371322245.08.0.807378082157.issue13802@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:51:49 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:51:49 +0000 Subject: [issue14105] Breakpoints in debug lost if line is inserted; IDLE In-Reply-To: <1330047327.02.0.291761854329.issue14105@psf.upfronthosting.co.za> Message-ID: <1371322309.41.0.614936461786.issue14105@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:53:18 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:53:18 +0000 Subject: [issue14111] IDLE Debugger should handle interrupts In-Reply-To: <1330112839.68.0.0096879566667.issue14111@psf.upfronthosting.co.za> Message-ID: <1371322398.15.0.811974850943.issue14111@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:55:25 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:55:25 +0000 Subject: [issue14440] Close background process if IDLE closes abnormally. In-Reply-To: <1333027712.59.0.103811521392.issue14440@psf.upfronthosting.co.za> Message-ID: <1371322525.39.0.650424573583.issue14440@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 20:57:15 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 18:57:15 +0000 Subject: [issue14576] IDLE: resolving home directory for configuration uses HOMEDRIVE, HOMEPATH, and USERPROFILE inconsistently on Windows. In-Reply-To: <1334400065.92.0.605072928338.issue14576@psf.upfronthosting.co.za> Message-ID: <1371322635.52.0.741772265423.issue14576@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 2.7, Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:01:02 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:01:02 +0000 Subject: [issue14944] Setup & Usage documentation for pydoc, idle & 2to3 In-Reply-To: <1338256058.02.0.10025521772.issue14944@psf.upfronthosting.co.za> Message-ID: <1371322862.75.0.199289484291.issue14944@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:02:34 2013 From: report at bugs.python.org (=?utf-8?q?C=C3=A9dric_Krier?=) Date: Sat, 15 Jun 2013 19:02:34 +0000 Subject: [issue9625] argparse: Problem with defaults for variable nargs when using choices In-Reply-To: <1282036744.37.0.964764969496.issue9625@psf.upfronthosting.co.za> Message-ID: <1371322954.86.0.302260167487.issue9625@psf.upfronthosting.co.za> C?dric Krier added the comment: ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:03:06 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:03:06 +0000 Subject: [issue1524639] Fix Tkinter Tcl-commands memory-leaks Message-ID: <1371322986.19.0.106903049442.issue1524639@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:03:31 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 19:03:31 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <3bXp4M0TcRz7Ljt@mail.python.org> Roundup Robot added the comment: New changeset 3d75bd69e5a9 by Andrew Kuchling in branch '3.3': #18113: Objects associated to a curses.panel object with set_userptr() were leaked. http://hg.python.org/cpython/rev/3d75bd69e5a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:03:50 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:03:50 +0000 Subject: [issue15308] IDLE - add an "Interrupt Execution" to shell menu In-Reply-To: <1341865491.11.0.0892141451607.issue15308@psf.upfronthosting.co.za> Message-ID: <1371323030.31.0.971193583694.issue15308@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:05:08 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:05:08 +0000 Subject: [issue15313] IDLE - remove all bare excepts In-Reply-To: <1341887371.61.0.0302814737095.issue15313@psf.upfronthosting.co.za> Message-ID: <1371323108.04.0.396061442612.issue15313@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:05:38 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:05:38 +0000 Subject: [issue15335] IDLE - debugger steps through run.py internals In-Reply-To: <1342111374.05.0.899363686539.issue15335@psf.upfronthosting.co.za> Message-ID: <1371323138.68.0.502656332037.issue15335@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:06:19 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:06:19 +0000 Subject: [issue15363] Idle/tkinter ~x.py 'save as' fails. closes idle In-Reply-To: <1342394243.7.0.336788716257.issue15363@psf.upfronthosting.co.za> Message-ID: <1371323179.91.0.550594963832.issue15363@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:06:59 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:06:59 +0000 Subject: [issue15457] consistent treatment of generator terminology In-Reply-To: <1343302676.51.0.168761959505.issue15457@psf.upfronthosting.co.za> Message-ID: <1371323219.63.0.30675185785.issue15457@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:08:00 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:08:00 +0000 Subject: [issue15786] IDLE code completion window does not scroll/select with mouse In-Reply-To: <1346027701.33.0.908436854594.issue15786@psf.upfronthosting.co.za> Message-ID: <1371323280.55.0.920166483245.issue15786@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:10:12 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:10:12 +0000 Subject: [issue16547] IDLE raises an exception in tkinter after fresh file's text has been rendered In-Reply-To: <1353785000.68.0.88975991365.issue16547@psf.upfronthosting.co.za> Message-ID: <1371323412.41.0.103094526464.issue16547@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:11:52 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:11:52 +0000 Subject: [issue16655] IDLE list.append calltips test failures In-Reply-To: <1355106680.63.0.980843765647.issue16655@psf.upfronthosting.co.za> Message-ID: <1371323512.63.0.311057732119.issue16655@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.3, Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:12:42 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:12:42 +0000 Subject: [issue16893] Create IDLE help.txt from Doc/library/idle.rst In-Reply-To: <1357663512.19.0.739336896498.issue16893@psf.upfronthosting.co.za> Message-ID: <1371323562.56.0.297817712703.issue16893@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- assignee: docs at python -> versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:14:58 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:14:58 +0000 Subject: [issue17224] can not open idle in python 2.7.3 In-Reply-To: <1361176830.93.0.935966223453.issue17224@psf.upfronthosting.co.za> Message-ID: <1371323698.89.0.220466658315.issue17224@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This is probably a duplicate of other issues. But please try with the newest 2.7.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:22:40 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 19:22:40 +0000 Subject: [issue17238] IDLE: Enhance import statement completion In-Reply-To: <1361287971.25.0.643782901011.issue17238@psf.upfronthosting.co.za> Message-ID: <1371324160.95.0.142919058133.issue17238@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Making a list of all possible modules is harder than a list of attributes. With relative imports, I am not sure its even possible to sensible make a list of every entry that would work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:34:31 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 15 Jun 2013 19:34:31 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1371324871.61.0.99679169397.issue18113@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Thanks for the bug report! I've committed a fix to the 2.7 and 3.3 branches that retrieves the existing userptr and Py_DECREFs it if it's not null. This seems to fix the leak. ---------- assignee: -> akuchling resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:34:43 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 15 Jun 2013 19:34:43 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1371324883.91.0.240919825664.issue18113@psf.upfronthosting.co.za> Changes by A.M. Kuchling : ---------- stage: needs patch -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:43:07 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sat, 15 Jun 2013 19:43:07 +0000 Subject: [issue18214] Stop purging modules which are garbage collected before shutdown In-Reply-To: <1371319899.13.0.747350154244.issue18214@psf.upfronthosting.co.za> Message-ID: <51BCC3C6.9070108@gmail.com> Richard Oudkerk added the comment: On 15/06/2013 7:11pm, Antoine Pitrou wrote: >> Usually garbage collection will end up clearing the module's dict anyway. > > This is not true, since global objects might have a __del__ and then hold > the whole module dict alive through a reference cycle. Happily though, > PEP 442 is going to make that concern obsolete. I did say "usually". > As for the interpreter shutdown itself, I have a pending patch (post-PEP 442) > to get rid of the globals cleanup as well. It may be better to merge the two approaches. So you would just depend on garbage collection? Do you know how many refs/blocks are left at exit if one just uses garbage collection (assuming PEP 442 is in effect)? I suppose adding GC support to those modules which currently lack it would help a lot. BTW, I had a more complicated patch which keeps track of module dicts using weakrefs and purges any which were left after garbage collection has had a chance to free stuff. But most module dicts ended up being purged anyway, so it did not seem worth the hassle when a two-line patch mostly fixes the immediate problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:44:33 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 15 Jun 2013 19:44:33 +0000 Subject: [issue18214] Stop purging modules which are garbage collected before shutdown In-Reply-To: <51BCC3C6.9070108@gmail.com> Message-ID: <1371325465.2585.4.camel@fsol> Antoine Pitrou added the comment: > > As for the interpreter shutdown itself, I have a pending patch (post-PEP 442) > > to get rid of the globals cleanup as well. It may be better to merge the two approaches. > > So you would just depend on garbage collection? No, I also clean up those modules that are left alive after a garbage collection pass. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:47:15 2013 From: report at bugs.python.org (Zachary Ware) Date: Sat, 15 Jun 2013 19:47:15 +0000 Subject: [issue18223] Refactor test_tarfile In-Reply-To: <1371305914.88.0.406502768054.issue18223@psf.upfronthosting.co.za> Message-ID: <1371325635.76.0.764028501523.issue18223@psf.upfronthosting.co.za> Zachary Ware added the comment: Looks like a winner, barring a few nits picked on Rietveld. This issue supersedes issue17689, would anyone mind marking that for me? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:47:34 2013 From: report at bugs.python.org (Zachary Ware) Date: Sat, 15 Jun 2013 19:47:34 +0000 Subject: [issue17689] Fix test discovery for test_tarfile.py In-Reply-To: <1365619249.38.0.463638779993.issue17689@psf.upfronthosting.co.za> Message-ID: <1371325654.62.0.301475795841.issue17689@psf.upfronthosting.co.za> Zachary Ware added the comment: Superseded by issue18223. ---------- resolution: -> duplicate status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 21:51:21 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 19:51:21 +0000 Subject: [issue17689] Fix test discovery for test_tarfile.py In-Reply-To: <1365619249.38.0.463638779993.issue17689@psf.upfronthosting.co.za> Message-ID: <1371325881.32.0.570384667281.issue17689@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- stage: -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:00:39 2013 From: report at bugs.python.org (Jeremy Gray) Date: Sat, 15 Jun 2013 21:00:39 +0000 Subject: [issue18221] abspath strips trailing spaces on win32 In-Reply-To: <1371299882.82.0.523042534705.issue18221@psf.upfronthosting.co.za> Message-ID: <1371330039.96.0.0975919359902.issue18221@psf.upfronthosting.co.za> Jeremy Gray added the comment: Maybe this a documentation / run-time warning issue, rather than bug. Trailing spaces in filenames are illegal in Win32; nonetheless they can occur, because there are instructions on how to remove such files: http://support.microsoft.com/kb/320081. So os.path.abspath() not only returns the absolute path of a (hypothetical) file, it is also ensuring that the file name is legal within the operating system. It does so silently. (I say hypothetical because there's no requirement that the file actually exists.) This behavior from python was surprising since "explicit is better than implicit": I was not getting just an absolute path, but a changed filename (causing a file-not-found error later in my code), with no warning from python at any point that the filename was illegal and so was being "cleaned up" for me, behind the scenes. Maybe this is the Windows-like way to do things (longtime mac / linux here). Playing around a little, I see "open('file ', 'wb')" also silently changes the filename. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:05:39 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 21:05:39 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1371330339.52.0.576452713577.issue18162@psf.upfronthosting.co.za> Ezio Melotti added the comment: Is there a meta-issue for these changes? I remember a similar discussion a couple of years ago, but I don't remember if it was on python-dev/ideas or on the bug tracker. I agree that exceptions could be improved, but I would like to get the big picture of the changes you are planning to do instead of many individual issues. A simple PEP might also be good, depending on how far you want to go :) ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:05:57 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 21:05:57 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1371330357.05.0.522386914443.issue18163@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:06:07 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 21:06:07 +0000 Subject: [issue18165] Add 'unexpected_type' to TypeError In-Reply-To: <1370638526.17.0.473449662068.issue18165@psf.upfronthosting.co.za> Message-ID: <1371330367.27.0.254399502168.issue18165@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:06:15 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 21:06:15 +0000 Subject: [issue18166] 'value' attribute for ValueError In-Reply-To: <1370638616.72.0.719325929736.issue18166@psf.upfronthosting.co.za> Message-ID: <1371330375.95.0.879026702156.issue18166@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:07:23 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 21:07:23 +0000 Subject: [issue18170] define built-in exceptions in Python code In-Reply-To: <1370735699.37.0.350073873785.issue18170@psf.upfronthosting.co.za> Message-ID: <1371330443.49.0.415900158643.issue18170@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:11:34 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 21:11:34 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXrw53RfVzQsm@mail.python.org> Roundup Robot added the comment: New changeset bc18b5d4920e by Brett Cannon in branch 'default': Issue #17177: Stop using imp in a bunch of tests http://hg.python.org/cpython/rev/bc18b5d4920e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:14:07 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 21:14:07 +0000 Subject: [issue18174] Make regrtest with --huntrleaks check for fd leaks In-Reply-To: <1370807273.91.0.83033499223.issue18174@psf.upfronthosting.co.za> Message-ID: <1371330847.22.0.222692729441.issue18174@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:19:38 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 21:19:38 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. In-Reply-To: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> Message-ID: <1371331178.61.0.625105865644.issue18176@psf.upfronthosting.co.za> Ezio Melotti added the comment: If all the versions are up to date it shouldn't be difficult to grep for '6.2.0' at the next update, and I would expect people to do it when it happens. Maybe adding a comment where unidata_version is defined as a remainder to update the rest will suffice. That said there might be some rst trick to define constants and use them around but I don't know it off the top of my head and if there is, I'm not sure it can be used in links. ---------- nosy: +eric.araujo, georg.brandl type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:21:25 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 15 Jun 2013 21:21:25 +0000 Subject: [issue18177] Incorect quote marks in code section-headers in PDF version of docs In-Reply-To: <1370829780.84.0.0627044566719.issue18177@psf.upfronthosting.co.za> Message-ID: <1371331285.48.0.567161862045.issue18177@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti type: -> enhancement versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:33:37 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 21:33:37 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXsPX4Nvtz7Ljq@mail.python.org> Roundup Robot added the comment: New changeset f96eb1dc335f by Brett Cannon in branch 'default': Issue #17177: Stop using imp in zipfile http://hg.python.org/cpython/rev/f96eb1dc335f New changeset b2b2bdc4cf6f by Brett Cannon in branch 'default': Issue # 17177: Stop using imp in turtledemo http://hg.python.org/cpython/rev/b2b2bdc4cf6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:53:07 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 21:53:07 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXsr31N7Sz7Lkf@mail.python.org> Roundup Robot added the comment: New changeset 4a1161eaed99 by Brett Cannon in branch 'default': Issue # 17177: Stop using imp in setup.py http://hg.python.org/cpython/rev/4a1161eaed99 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 15 23:55:32 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 15 Jun 2013 21:55:32 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1371333332.09.0.500157263853.issue18111@psf.upfronthosting.co.za> R. David Murray added the comment: I find it interesting that I just came across a case where I want this functionality, involving a generator derived from a possibly-empty sql table. I'm using Stefan's functional expression for now :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 00:10:25 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 22:10:25 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXtD067dxzSpD@mail.python.org> Roundup Robot added the comment: New changeset ca3bdac1f88a by Brett Cannon in branch 'default': Issue #17177: update checkpyc to stop using imp http://hg.python.org/cpython/rev/ca3bdac1f88a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 00:27:01 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 22:27:01 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1371335221.09.0.98990117089.issue18189@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The format looks good. The content looks skimpy. I am not familiar with Delegator and have not yet looked to see what more is needed. But this is enough to test working with a gui test. This *is* a gui test. See msg190576. So it must be protected by requiring the gui resource. I am still investigating this subject, but I believe the following should work for the momemnt. from test.resource import requires ... class ... @classmethod def setUpClass(cls): requires('gui') In a console, "python -m test test_idle" should report that test_delegator.Test_delegator was skipped, follows by other stuff. Please make the change, run from the console, and copy the result here. Add '-ugui' *before* 'test_idle' and Test_delegator should run. As written, the empty root window is left to be closed by hand. The teardown method should have self.root.destroy(). That will destroy the children also, so I believe that is all that is needed. ---------- nosy: +kbk, roger.serwy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 00:33:57 2013 From: report at bugs.python.org (Todd Rovito) Date: Sat, 15 Jun 2013 22:33:57 +0000 Subject: [issue18226] IDLE Unit test for FormatParagrah.py Message-ID: <1371335636.99.0.534048602964.issue18226@psf.upfronthosting.co.za> New submission from Todd Rovito: Continuing the IDLE unittest framework initiated in http://bugs.python.org/issue15392. A small unit test for IDLE FormatParagraph.py. This patch introduces a test module named test_format_paragraph.py inside Lib/idlelib/idle_test, considering the guidance in README file from idle_test. I should have a patch uploaded by Monday 6/17/2013 night. ---------- messages: 191242 nosy: Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Unit test for FormatParagrah.py type: enhancement versions: Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 00:34:22 2013 From: report at bugs.python.org (Todd Rovito) Date: Sat, 15 Jun 2013 22:34:22 +0000 Subject: [issue18226] IDLE Unit test for FormatParagrah.py In-Reply-To: <1371335636.99.0.534048602964.issue18226@psf.upfronthosting.co.za> Message-ID: <1371335662.2.0.447745362368.issue18226@psf.upfronthosting.co.za> Changes by Todd Rovito : ---------- nosy: +JayKrish _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 00:39:29 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 15 Jun 2013 22:39:29 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bXtsY131KzSjN@mail.python.org> Roundup Robot added the comment: New changeset 5e8b377942f7 by Brett Cannon in branch 'default': Issue #17177: stop using imp in test_importlib http://hg.python.org/cpython/rev/5e8b377942f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 00:49:23 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Jun 2013 22:49:23 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371336563.83.0.593233311189.issue18103@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The basic question for this issue is whether to segregate gui tests in a separate directory (idle_test_gui?) and run them with a separate test_idle_gui.py? or to sprinkle gui test cases throughout the test suite, perhaps one to each test_idle/text_xxx.py file? For development, I am pretty sure I would prefer the latter. I have started test_grep for the 3 methods that can be gui free, but if (when) I do a gui-requiring test of the dialog itself, I would prefer to have it follow in the same file. However, my impression is that each requires('gui') call will result in a skip message on the test output. (Correct?) So my question is: will non-idle developers tolerate over 50 skip warnings from Idle tests? or is there a way to suppress multiple warnings and consolidate them into just one if there is at least one? ---------- nosy: +ncoghlan, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 00:55:03 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 15 Jun 2013 22:55:03 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1371336903.12.0.185912067003.issue18162@psf.upfronthosting.co.za> Brett Cannon added the comment: Nope, no meta-issue. I literally just realized one evening that the handful of exceptions that I filed bugs for could use an attribute for why the exception was raised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 00:59:35 2013 From: report at bugs.python.org (Ned Deily) Date: Sat, 15 Jun 2013 22:59:35 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371337175.24.0.666305451004.issue18103@psf.upfronthosting.co.za> Ned Deily added the comment: Individual test cases are only seen if you run regrtest (-m test) in verbose mode (-v). There are many test cases that are akipped in the standard library, depending on platform and -u options, and you normally don't see them (without -v). So mixing gui-dependent test cases in with others shouldn't be a problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 01:13:59 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 15 Jun 2013 23:13:59 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371338039.54.0.874123516236.issue17177@psf.upfronthosting.co.za> Brett Cannon added the comment: At this point I have updated all the code that does not directly exposes imp somehow or in Tools. At this point the only thing I need to decide is whether I want to continue to expose the lock stuff from imp or leave it private. After that the pending deprecation is ready to go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 01:27:49 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 23:27:49 +0000 Subject: [issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL Message-ID: <1371338869.58.0.00725626403199.issue18227@psf.upfronthosting.co.za> New submission from STINNER Victor: With the PEP 445 and the issue #3329, Python will get an API to setup custom memory allocators. To be able to configure how memory is handled in external libraries, some libraries allow to setup a custom allocator too. New functions PyMem_RawMalloc(), PyMem_GetRawAllocators() PyMem_SetRawAllocators() can be used for that. The safest option is to only reuse custom allocators if a library allows to setup them for a specfic function call or a specific object, and not replace the memory allocators globally. For example, the lzma library allows to set memory allocators only for one compressor object: LzmaEnc_Create(&SzAllocForLzma); We might change the global allocators of a library if Python is not embedded, but Python *is* the application (the standard "python" program). I don't know yet if it is safe to reuse custom memory allocators. Windows has for example a special behaviour: each DLL (dynamic library) has its own heap, memory allocator in a DLL cannot be released from another DLL. Would this issue introduce such bug? ---------- components: Interpreter Core messages: 191248 nosy: christian.heimes, haypo priority: normal severity: normal status: open title: Use Python memory allocators in external libraries like zlib or OpenSSL versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 01:28:04 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 23:28:04 +0000 Subject: [issue18203] Replace calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371338884.42.0.829794762448.issue18203@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Replace calls to malloc() with PyMem_Malloc() -> Replace calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 01:28:31 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 23:28:31 +0000 Subject: [issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL In-Reply-To: <1371338869.58.0.00725626403199.issue18227@psf.upfronthosting.co.za> Message-ID: <1371338911.9.0.0998032759571.issue18227@psf.upfronthosting.co.za> STINNER Victor added the comment: See also the issue #18203: "Replace calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc()". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 01:28:38 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 23:28:38 +0000 Subject: [issue18203] Replace direct calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371338918.04.0.637349561892.issue18203@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Replace calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc() -> Replace direct calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 01:43:35 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 15 Jun 2013 23:43:35 +0000 Subject: [issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL In-Reply-To: <1371338869.58.0.00725626403199.issue18227@psf.upfronthosting.co.za> Message-ID: <1371339815.66.0.665477559235.issue18227@psf.upfronthosting.co.za> STINNER Victor added the comment: Uncomplete(?) list of external libraries used by Python: - libffi (_ctypes): has its own memory allocator (dlmalloc), is it used? see also issue #18178 - libmpdec (_decimal): already configured to reuse the PyMem_Malloc() family (see Modules/_decimal/_decimal.c: "Init libpdec") - _sqlite (sqlite3: see http://www.sqlite.org/malloc.html - expat (expact): ? - zlib (zlib): http://www.zlib.net/manual.html#Usage - OpenSSL (_ssl, hashlib): CRYPTO_set_mem_functions, http://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=crypto/mem.c;h=f7984fa958eb1edd6c61f6667f3f2b29753be662;hb=HEAD#l124 - Tcl/Tk (_tkinter): http://tmml.sourceforge.net/doc/tcl/Alloc.html - bz2: http://www.bzip.org/1.0.5/bzip2-manual-1.0.5.html - libncurses (curses): ? - dbm libraries: ndbm, gdbm, db, ... (dbm): ? - lzma: http://www.asawicki.info/news_1368_lzma_sdk_-_how_to_use.html - Windows API (_winapi, nt): ? - readline (readline): ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 02:09:20 2013 From: report at bugs.python.org (Jacob Holm) Date: Sun, 16 Jun 2013 00:09:20 +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: <1371341360.2.0.931671062379.issue13797@psf.upfronthosting.co.za> Changes by Jacob Holm : ---------- nosy: +Jacob.Holm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 02:38:05 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Sun, 16 Jun 2013 00:38:05 +0000 Subject: [issue17547] "checking whether gcc supports ParseTuple __format__... " erroneously returns yes with gcc 4.8 In-Reply-To: <1364240036.0.0.495843553762.issue17547@psf.upfronthosting.co.za> Message-ID: <1371343085.97.0.892972202747.issue17547@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 02:54:55 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Sun, 16 Jun 2013 00:54:55 +0000 Subject: [issue17547] "checking whether gcc supports ParseTuple __format__... " erroneously returns yes with gcc 4.8 In-Reply-To: <1364240036.0.0.495843553762.issue17547@psf.upfronthosting.co.za> Message-ID: <1371344095.39.0.147437551957.issue17547@psf.upfronthosting.co.za> Jes?s Cea Avi?n added the comment: This is affecting 3.2.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 04:05:20 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 16 Jun 2013 02:05:20 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1371348320.28.0.086292167973.issue13483@psf.upfronthosting.co.za> STINNER Victor added the comment: Martin von Loewis: "If we take the route proposed by this patch, I recommend also dropping all other CRT malloc() calls in Python, and make allocations from the process heap instead (that's a separate issue, though)." => see issue #18203 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 04:11:36 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 16 Jun 2013 02:11:36 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1371348696.4.0.700246066598.issue13483@psf.upfronthosting.co.za> STINNER Victor added the comment: haypo> I tested VirtualAlloc/VirtualFree versus malloc/free haypo> on Windows 7 SP1 64-bit. On my small test, ... I realized that I was no precise: I tried attached va.diff patch. I didn't try to replace completly malloc(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 04:39:19 2013 From: report at bugs.python.org (Daniel Farina) Date: Sun, 16 Jun 2013 02:39:19 +0000 Subject: [issue14903] dictobject infinite loop In-Reply-To: <1337890784.99.0.00556765207687.issue14903@psf.upfronthosting.co.za> Message-ID: <1371350359.09.0.814369780343.issue14903@psf.upfronthosting.co.za> Daniel Farina added the comment: In addition to being re-verified on 2.7, this occurred on a 64 bit system, so I've changed the title accordingly. ---------- title: dictobject infinite loop on 2.6.5 on 32-bit x86 -> dictobject infinite loop _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 04:44:18 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jun 2013 02:44:18 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371350658.15.0.364017562484.issue18103@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thanks. That still leaves the problem of getting all tests to run during development when running them with unittest. Calling requires('gui') passes when (_is_gui_available() and (caller is __main__ or 'gui' in use_resources)). Use_resources is normally set by regrtest. As far as I saw, most other support functions work fine with unittest and are not dependent on regrtest. The doc for unittest.main say that the argv argument can be a list of options passed to the program. Which program? Can that be used to set a resource? I plan to try from test import support; support.use_resources = ['gui'] in the 'if __name__ ...' sections of xyz.py and test_idle.py, but that will not work from the command line ('python -m unittest whatever'). An alternative is to have requires() check whether the test is running under regrtest (which supposedly changes support.verbose from 1 (which it starts as) to 0) and passing, at least for 'gui', if not. (Is there any other way for a test to detect the test runner?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 05:01:29 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Jun 2013 03:01:29 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1371351689.43.0.44981369997.issue18162@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I would also like to see a PEP or good python-dev discussion before embarking on all these API expansions. There should be an evaluation of whether any existing code would benefit from it, whether the current "args" attribute is sufficient, whether the code bloat is worth it, etc. Also, I'm unclear on whether you expect users to have to provide the index value in their own code (i.e. is "raise IndexError" to still be permitted or will all pure python code be required to use "raise IndexError(i)" and change existing code if they already use "raise IndexError("Out of range")). If you don't change requirements for pure python code, then how can be even rely on the new attribute being there (i.e. is "except IndexError as e: print(e.index)" guaranteed to work?). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 06:03:15 2013 From: report at bugs.python.org (David Edelsohn) Date: Sun, 16 Jun 2013 04:03:15 +0000 Subject: [issue18228] AIX locale parsing failure Message-ID: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> New submission from David Edelsohn: All tests are failing for 3.x on AIX due to an error parsing the locale. This is not failing on 3.3 branch. File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/regrtest.py", line 1292, in runtest_inner with saved_test_environment(test, verbose, quiet) as environment: File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/regrtest.py", line 1256, in __enter__ in self.resource_info()) File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/regrtest.py", line 1255, in self.saved_values = dict((name, get()) for name, get, restore File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/regrtest.py", line 1239, in get_locale pairings.append((lc, locale.getlocale(lc))) File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/locale.py", line 524, in getlocale return _parse_localename(localename) File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/locale.py", line 433, in _parse_localename raise ValueError('unknown locale: %s' % localename) ValueError: unknown locale: C en_US C C C C ---------- components: Library (Lib) messages: 191257 nosy: David.Edelsohn priority: normal severity: normal status: open title: AIX locale parsing failure type: behavior versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 06:29:05 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 04:29:05 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1371356945.97.0.955468989022.issue18162@psf.upfronthosting.co.za> Brett Cannon added the comment: Obviously it can't be required that the index be provided as that would break way too much code. There are already exceptions in the stdlib that have optional attributes you can choose to (not) set. As for relying upon it, it would be just like any other object that gets a new attribute: either you rely on it because you know the code you are using always provides it (e.g. using core/stdlib code directly) or you use some way to deal with cases where it was not set (EAFP or LBYL). Subclassing IndexError to provide a inheritance guarantee that an attribute exists seems like overkill (e.g. IndexError2 so you can do ``except IndexError2 as exc:``). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 06:53:36 2013 From: report at bugs.python.org (Ned Deily) Date: Sun, 16 Jun 2013 04:53:36 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371358416.01.0.822791221376.issue18103@psf.upfronthosting.co.za> Ned Deily added the comment: Why not just run the tests under regrtest like all other standard library tests? From the build directory, you could use something like (Windows may be a bit different): ./python.exe -m test -h # to get regrtest options help ./python.exe -m test -ugui -v test_idle # to run just the idle tests with verbose on For 2.7, you'll need to use '-m test.regrtest'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 07:06:35 2013 From: report at bugs.python.org (Ramchandra Apte) Date: Sun, 16 Jun 2013 05:06:35 +0000 Subject: [issue17238] IDLE: Enhance import statement completion In-Reply-To: <1371324160.95.0.142919058133.issue17238@psf.upfronthosting.co.za> Message-ID: Ramchandra Apte added the comment: I have a patch ready; have to make it ready (PEP8-compliance etc.) and then I can send it. On 16 June 2013 00:52, Terry J. Reedy wrote: > > Terry J. Reedy added the comment: > > Making a list of all possible modules is harder than a list of attributes. > With relative imports, I am not sure its even possible to sensible make a > list of every entry that would work. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 07:20:56 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 16 Jun 2013 05:20:56 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371360056.69.0.799390089465.issue18103@psf.upfronthosting.co.za> Nick Coghlan added the comment: Indeed, I think the most sensible course here is to require the use of regrtest to run the GUI tests. Our other resource-dependent tests all fall into that category already. If the stdlib unittest provided a resource system, we'd rewrite the regrtest resource system to be based on that instead, but that's not currently the case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 07:25:58 2013 From: report at bugs.python.org (Max DeLiso) Date: Sun, 16 Jun 2013 05:25:58 +0000 Subject: [issue18197] insufficient error checking causes crash on windows In-Reply-To: <1371018359.58.0.123065301657.issue18197@psf.upfronthosting.co.za> Message-ID: <1371360358.04.0.850804601232.issue18197@psf.upfronthosting.co.za> Max DeLiso added the comment: ok I checked in to this more deeply and I was wrong about a few things. first, my patch is worthless - there are several more instances where the retval of fileno is passed directly to fstat and that is totally valid (provided the file* points to a valid file). looking deeper in the call stack, this call stack is originating from a PyCFunction_Call from mercurial's native extension, osutil. # Call Site 00 MSVCR90!fstat64i32+0xe8 01 python27!dircheck+0x29 02 python27!fill_file_fields+0x18e 03 python27!PyFile_FromFile+0x89 04 osutil+0x176f 05 python27!PyCFunction_Call+0x76 Here's the code in osutil.c (which is part of mercurial) (osutil.c:554) #ifndef IS_PY3K fp = _fdopen(fd, fpmode); if (fp == NULL) { _close(fd); PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); goto bail; } file_obj = PyFile_FromFile(fp, name, mode, fclose); //this is the call that is the parent if (file_obj == NULL) { fclose(fp); goto bail; } PyFile_SetBufSize(file_obj, bufsize); #else fileno() is actually 'succeeding' and returning a value of 3. fstat is then throwing the invalid parameter exception, presumably because 3 is not a valid file descriptor. the way fileno() is implemented in M$CRT is really simple: it just copies a value at a fixed offset from the pointer passed to it without checking to see if the FILE* is valid. this is why in the docs for _fileno they say "The result is undefined if stream does not specify an open file." anyways, I don't think this is a bug in python, but rather in the mercurial extension. it's a little tricky to debug on windows because the osutil module gets delay-loaded. I'm taking another pass at it now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 08:19:13 2013 From: report at bugs.python.org (Mikhail Traskin) Date: Sun, 16 Jun 2013 06:19:13 +0000 Subject: [issue18219] csv.DictWriter is slow when writing files with large number of columns In-Reply-To: <1371273159.09.0.766674685212.issue18219@psf.upfronthosting.co.za> Message-ID: <1371363553.14.0.267658203907.issue18219@psf.upfronthosting.co.za> Mikhail Traskin added the comment: Any way is fine with me. If you prefer to avoid having public filedset property, please use the attached patch. ---------- Added file: http://bugs.python.org/file30605/csvdictwriter.v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 09:29:52 2013 From: report at bugs.python.org (Aaron Iles) Date: Sun, 16 Jun 2013 07:29:52 +0000 Subject: [issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL In-Reply-To: <1371338869.58.0.00725626403199.issue18227@psf.upfronthosting.co.za> Message-ID: <1371367792.39.0.33535188234.issue18227@psf.upfronthosting.co.za> Changes by Aaron Iles : ---------- nosy: +aliles _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 09:32:26 2013 From: report at bugs.python.org (Aaron Iles) Date: Sun, 16 Jun 2013 07:32:26 +0000 Subject: [issue18203] Replace direct calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371367946.21.0.142969492993.issue18203@psf.upfronthosting.co.za> Changes by Aaron Iles : ---------- nosy: +aliles _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 11:59:21 2013 From: report at bugs.python.org (Jordan Szubert) Date: Sun, 16 Jun 2013 09:59:21 +0000 Subject: [issue18229] attribute headers of http.server.BaseHTTPRequestHandler sometimes does not exists Message-ID: <1371376761.5.0.41138715811.issue18229@psf.upfronthosting.co.za> New submission from Jordan Szubert: it seems that problem is someone connecting to port 8080 with non-http client, could not find warning in documentation ---fragment of `less access.log`------------ 81.172.30.254 - - [16/Jun/2013 11:36:58] "^SBitTorrent protocol^@^@^@^@^@^X^@^Ej 81.172.30.254 - - [16/Jun/2013 11:38:11] "^N^@f????Q;?xb^C^H?A7 81.172.30.254 - - [16/Jun/2013 11:39:22] "^SBitTorrent protocol^@^@^@^@^@^X^@^Ej 81.172.30.254 - - [16/Jun/2013 11:40:35] "??0?zzr^D2]WQ Exception happened during processing of request from ('81.172.30.254', 63650) Traceback (most recent call last): File "c:\Python33\lib\socketserver.py", line 306, in _handle_request_noblock self.process_request(request, client_address) File "c:\Python33\lib\socketserver.py", line 332, in process_request self.finish_request(request, client_address) File "c:\Python33\lib\socketserver.py", line 345, in finish_request self.RequestHandlerClass(request, client_address, self) File "c:\Python33\lib\socketserver.py", line 666, in __init__ self.handle() File "c:\Python33\lib\http\server.py", line 400, in handle self.handle_one_request() File "c:\Python33\lib\http\server.py", line 380, in handle_one_request if not self.parse_request(): File "c:\Python33\lib\http\server.py", line 283, in parse_request self.send_error(400, "Bad request version (%r)" % version) File "c:\Python33\lib\http\server.py", line 428, in send_error self.send_response(code, message) File "c:\Python33\lib\http\server.py", line 443, in send_response self.log_request(code) File "c:\Users\joru\Dropbox\programowanie\demoniszcze\server\_lowerHTTP.py", line 30, in log_request xff=req.headers.get('X-Forwarded-For') AttributeError: '_HNDL_3' object has no attribute 'headers' # _HNLD_3 derives from http.server.BaseHTTPRequestHandler ---------- assignee: docs at python components: Documentation messages: 191264 nosy: docs at python, joru priority: normal severity: normal status: open title: attribute headers of http.server.BaseHTTPRequestHandler sometimes does not exists type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 14:02:39 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 16 Jun 2013 12:02:39 +0000 Subject: [issue18197] insufficient error checking causes crash on windows In-Reply-To: <1371018359.58.0.123065301657.issue18197@psf.upfronthosting.co.za> Message-ID: <1371384159.31.0.641643427414.issue18197@psf.upfronthosting.co.za> Nick Coghlan added the comment: Closing this on the assumption the bug is in the extension. Feel free to reopen if further investigation shows a problem in the interpreter core. ---------- nosy: +ncoghlan resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 15:48:49 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 13:48:49 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371390529.09.0.153784124357.issue18081@psf.upfronthosting.co.za> Brett Cannon added the comment: Seems to be fairly consistent on Windows but more random on Linux. I have also triggered it on my OS X machine randomly. Can't tell if it's a timing issue or some other test doing something bad. I'm worried solving it is going to require taking one of the failing instance's list of tests and then slowly pruning it down to find the trigger (if it's not a timing thing). ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 16:31:03 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 14:31:03 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371393063.6.0.0282494349471.issue18081@psf.upfronthosting.co.za> Brett Cannon added the comment: Found the test cases to cause this:: ./python.exe -m test test_idle test_logging Adding Roger and Terry to see if they happen to remember any of the IDLE tests using logging or warnings in a way that could cause this. P.S.: I thought we had a script somewhere which helped do a binary search for what tests cause a failure but I can't find it. Am I imagining things? ---------- nosy: +kbk, roger.serwy, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 17:05:25 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Jun 2013 15:05:25 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1371395125.86.0.696168281572.issue18113@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is a problem with this patch. Py_XDECREF can execute arbitrary Python code and this code can call set_panel_userptr. Here is a reproducer (it causes segfault). ---------- resolution: fixed -> stage: committed/rejected -> commit review status: closed -> open Added file: http://bugs.python.org/file30606/userptr-segfault.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 17:07:25 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Jun 2013 15:07:25 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1371395245.89.0.539610753145.issue18113@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: And here is a patch which fixes a segfault. But I can't write a test for it. ---------- keywords: +patch Added file: http://bugs.python.org/file30607/userptr_segfault.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 17:17:40 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 15:17:40 +0000 Subject: [issue18230] test_builtin fails/hangs when run after test_getopt Message-ID: <1371395860.64.0.905722760068.issue18230@psf.upfronthosting.co.za> New submission from Brett Cannon: If you run test_builtin after test_getopt it will hang. If you run test_getopt test_socket test_builtin it will fail in all tty-related tests for input(). Not sure if this is related to issue #17734 or #13886. ---------- components: Library (Lib) messages: 191270 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: test_builtin fails/hangs when run after test_getopt type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 17:18:12 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 15:18:12 +0000 Subject: [issue17734] Failure when running test_builtin after test_genexps In-Reply-To: <1366029613.93.0.971367432491.issue17734@psf.upfronthosting.co.za> Message-ID: <1371395892.53.0.0928112294717.issue17734@psf.upfronthosting.co.za> Brett Cannon added the comment: Issue #18230 is another test_builtin failure related to tty tests. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 17:18:16 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 15:18:16 +0000 Subject: [issue13886] readline-related test_builtin failure In-Reply-To: <1327659819.71.0.475160045664.issue13886@psf.upfronthosting.co.za> Message-ID: <1371395896.32.0.572810827383.issue13886@psf.upfronthosting.co.za> Brett Cannon added the comment: Issue #18230 is another test_builtin failure related to tty tests. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 17:39:54 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 16 Jun 2013 15:39:54 +0000 Subject: [issue17734] Failure when running test_builtin after test_genexps In-Reply-To: <1366029613.93.0.971367432491.issue17734@psf.upfronthosting.co.za> Message-ID: <1371397194.72.0.446747007604.issue17734@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 17:40:10 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 16 Jun 2013 15:40:10 +0000 Subject: [issue18230] test_builtin fails/hangs when run after test_getopt In-Reply-To: <1371395860.64.0.905722760068.issue18230@psf.upfronthosting.co.za> Message-ID: <1371397210.84.0.523974454018.issue18230@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 19:00:53 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 16 Jun 2013 17:00:53 +0000 Subject: [issue14015] surrogateescape largely missing from documentation In-Reply-To: <1329245790.15.0.430373154575.issue14015@psf.upfronthosting.co.za> Message-ID: <3bYMJN5DV4z7Ljb@mail.python.org> Roundup Robot added the comment: New changeset 55f611f55952 by Andrew Kuchling in branch '3.3': Describe 'surrogateescape' in the documentation. http://hg.python.org/cpython/rev/55f611f55952 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 19:14:14 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 16 Jun 2013 17:14:14 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bYMbn6YfMz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset 1b8f08c4efd5 by Brett Cannon in branch 'default': Issue #17177: The imp module is pending deprecation. http://hg.python.org/cpython/rev/1b8f08c4efd5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 19:16:28 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 17:16:28 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371402988.85.0.0245577111461.issue17177@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 19:31:50 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 16 Jun 2013 17:31:50 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. In-Reply-To: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> Message-ID: <1371403910.35.0.890149036826.issue18176@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file30608/bd092995907c.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 19:38:42 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 16 Jun 2013 17:38:42 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. In-Reply-To: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> Message-ID: <1371404322.72.0.560114246685.issue18176@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Here is what grep revealed: $ find Doc -name \*.rst | xargs grep -n '6\.2\.0' Doc/library/stdtypes.rst:357: See http://www.unicode.org/Public/6.2.0/ucd/extracted/DerivedNumericType.txt Doc/library/unicodedata.rst:18:this database is compiled from the `UCD version 6.2.0 Doc/library/unicodedata.rst:19:`_. Doc/library/unicodedata.rst:169:.. [#] http://www.unicode.org/Public/6.2.0/ucd/NameAliases.txt Doc/library/unicodedata.rst:171:.. [#] http://www.unicode.org/Public/6.2.0/ucd/NamedSequences.txt I added a note next to UNIDATA_VERSION = "6.2.0" in makeunicodedata.py script. The makeunicodedata.py would be a place to put code that would update the docs automatically, but with only two affected files I don't think this is worth the effort. Chances are at least unicodedata.rst will benefit from a manual review to reflect any substantive changes in the UCD. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 20:01:08 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Jun 2013 18:01:08 +0000 Subject: [issue18223] Refactor test_tarfile In-Reply-To: <1371305914.88.0.406502768054.issue18223@psf.upfronthosting.co.za> Message-ID: <1371405668.74.0.315659858762.issue18223@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Oh, sorry, I missed issue17689. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 20:06:19 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jun 2013 18:06:19 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371405979.69.0.411164073539.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: test_idle, which runs the tests in idlelib/idle_test, currently comprises 9 test methods and perhaps 100 lines that do not, as far as I know, use warnings or logging. However, perhaps this has an effect: F:\Python\dev\cpython\PCbuild>python_d -m test test_idle [1/1] test_idle Warning -- os.environ was modified by test_idle Warning -- locale was modified by test_idle 1 test altered the execution environment: test_idle Of course, the idle test code itself does no such modification. So I have no idea what the warning is about or how to stop it. F:\Python\dev\cpython\PCbuild>python_d -m test.test_idle which runs under unittest, does not produce the warning. The other test files that use tcl/tk/tkinter, test_tcl, test_tk, test_ttk_guionly, and test_ttk_textonly, produce the os.environ warning but not the locale warning. I duplicated the failure with the command you gave. Substituting _tcl or _tk for _idle removes the error. So perhaps the locale alteration, however it happens, is the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 20:10:53 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 16 Jun 2013 18:10:53 +0000 Subject: [issue18231] What's new in Python should explain what's new in UCD Message-ID: <1371406253.35.0.589040711268.issue18231@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: At the minimum, we should refer to unicode.org: http://www.unicode.org/versions/Unicode6.1.0/#Database_Changes (for Python 3.3), http://www.unicode.org/versions/Unicode6.2.0/#Database_Changes (for Python 3.4). We may also want to highlight changes that directly affect python programs. For example addition of new characters accepted as decimal digits in UCD 6.1.0. ---------- assignee: docs at python messages: 191278 nosy: belopolsky, docs at python priority: normal severity: normal status: open title: What's new in Python should explain what's new in UCD versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 20:20:11 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 16 Jun 2013 18:20:11 +0000 Subject: [issue18231] What's new in Python should explain what's new in UCD In-Reply-To: <1371406253.35.0.589040711268.issue18231@psf.upfronthosting.co.za> Message-ID: <1371406811.15.0.32272701492.issue18231@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- components: +Documentation keywords: +easy nosy: +ezio.melotti stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 20:28:29 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 16 Jun 2013 18:28:29 +0000 Subject: [issue18231] What's new in Python should explain what's new in UCD In-Reply-To: <1371406253.35.0.589040711268.issue18231@psf.upfronthosting.co.za> Message-ID: <1371407309.53.0.132661040119.issue18231@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Here is another change that I think deserves an explicit mention in "What's New": Python 3.3.2 >>> exec('a\u17B4 = 5') >>> eval('a\u17B4') 5 Python 3.2.5 >>> exec('a\u17B4 = 5') Traceback (most recent call last): File "", line 1, in File "", line 1 a? = 5 ^ SyntaxError: invalid character in identifier ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 20:57:06 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 16 Jun 2013 18:57:06 +0000 Subject: [issue18058] Define is_package for NamespaceLoader In-Reply-To: <1369496923.18.0.904476367209.issue18058@psf.upfronthosting.co.za> Message-ID: <3bYPtT5zMzz7Ljb@mail.python.org> Roundup Robot added the comment: New changeset ebec625b13f9 by Brett Cannon in branch 'default': Issues #18058, 18057: Make importlib._bootstrap.NamespaceLoader http://hg.python.org/cpython/rev/ebec625b13f9 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 20:57:45 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 18:57:45 +0000 Subject: [issue18057] Register NamespaceLoader with importlib.abc.Loader In-Reply-To: <1369496810.62.0.455394595935.issue18057@psf.upfronthosting.co.za> Message-ID: <1371409065.49.0.738176290067.issue18057@psf.upfronthosting.co.za> Brett Cannon added the comment: Fixed in http://hg.python.org/cpython/rev/ebec625b13f9 ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 20:57:57 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 18:57:57 +0000 Subject: [issue18058] Define is_package for NamespaceLoader In-Reply-To: <1369496923.18.0.904476367209.issue18058@psf.upfronthosting.co.za> Message-ID: <1371409077.48.0.844597953052.issue18058@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 21:32:39 2013 From: report at bugs.python.org (Robert Collins) Date: Sun, 16 Jun 2013 19:32:39 +0000 Subject: [issue18232] running a suite with no tests is not an error Message-ID: <1371411159.89.0.919313216558.issue18232@psf.upfronthosting.co.za> New submission from Robert Collins: In bug https://bugs.launchpad.net/subunit/+bug/586176 I recorded a user request - that if no tests are found, tools consuming subunit streams should be able to consider that an error. There is an analogous situation though, which is that if discover returns without error, running the resulting suite is worthless, as it has no tests. This is a bit of a sliding slope - what if discover finds one test when there should be 1000's ? Anyhow, filing this because there's been a few times when things have gone completely wrong that it would have helped CI systems detect that. (For instance, the tests package missing entirely, but tests were being scanned in the whole source tree, so no discover level error occurred). I'm thinking I'll add a '--min-tests=X' parameter to unittest.main, with the semantic that if there are less than X tests executed, the test run will be considered a failure, and folk can set this to 1 for the special case, or any arbitrary figure that they want for larger suites. ---------- messages: 191282 nosy: michael.foord, rbcollins priority: normal severity: normal status: open title: running a suite with no tests is not an error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 21:36:11 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 19:36:11 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371411371.89.0.806933516537.issue18081@psf.upfronthosting.co.za> Brett Cannon added the comment: I actually don't get the warnings when I run test_idle under regrtest. But what I did was followed a hunch and added a check for warnings.showwarning() and sure enough, it's been left modified by IDLE: PyShell replaces the function as a side-effect of import. Not sure how you want to fix it. Using warnings.catch_warnings() during import would solve it, but I don't know if that's how you want to go in case that showwarnings replacement is needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 21:38:51 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jun 2013 19:38:51 +0000 Subject: [issue17405] Add _Py_memset_s() to securely clear memory In-Reply-To: <1363107252.29.0.782882608.issue17405@psf.upfronthosting.co.za> Message-ID: <1371411531.7.0.311192733157.issue17405@psf.upfronthosting.co.za> Christian Heimes added the comment: I finally figured out why _Py_memset_s() wasn't available inside extension modules. The linker removes object files from the main binary unless one or more symbols from an object files are referenced somewhere. Objects/object.c has a workaround for PyCapsule_Type: /* Hack to force loading of pycapsule.o */ PyTypeObject *_PyCapsule_hack = &PyCapsule_Type; I have updated my patch. ---------- Added file: http://bugs.python.org/file30609/pymemsets.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 22:05:54 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jun 2013 20:05:54 +0000 Subject: [issue18147] SSL: diagnostic functions to list loaded CA certs In-Reply-To: <1370513969.26.0.776855011912.issue18147@psf.upfronthosting.co.za> Message-ID: <1371413154.69.0.421573674091.issue18147@psf.upfronthosting.co.za> Christian Heimes added the comment: Updated patch with Antoine's review: * method is now called get_ca_certs() * cert_store_stats() returns total amount of X.509 as 'x509' key and X.509 certs with CA purpose in 'x509_ca'. * documentation ---------- Added file: http://bugs.python.org/file30610/ssl_ca_stats3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 22:08:48 2013 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 16 Jun 2013 20:08:48 +0000 Subject: [issue18232] running a suite with no tests is not an error In-Reply-To: <1371411159.89.0.919313216558.issue18232@psf.upfronthosting.co.za> Message-ID: <1371413328.57.0.967809967825.issue18232@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- components: +Tests nosy: +ezio.melotti type: -> enhancement versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 22:13:04 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jun 2013 20:13:04 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371413584.17.0.184816287499.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I discovered the same thing a different way. Grepping Lib/*.py for 'Warning (from warnings module)' hits F:\Python\dev\cpython\Lib\idlelib\PyShell.py: 67: F:\Python\dev\cpython\Lib\idlelib\run.py: 34: Both monkey-patch warnings, when imported, to show warnings 'the Idle way' ;-). I am not sure which test file indirectly imports PyShell, but one must. Idle was written to be run from the command line. It was not written to be imported but not run, as in a test environment, or to be run as part of another script. Roger, can the monkey patching be put in a function that is only called when Idle runs? Perhaps in PyShell.main and run.main? There is no need to reformat warning sent to the console (if there is one) during import, before Idle starts. Can the monkey-patching be undone when Python exits (in case it is being run from within a script)? In the meanwhile, I will try using support.import_fresh_module('warnings') in test_logging, or better, saving and restoring warnings in test_idle. [Although the alteration warnings are red-herrings for this issue, I am sure silencing them, including in tkinter tests, would be a good idea.] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 22:39:55 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 16 Jun 2013 20:39:55 +0000 Subject: [issue18233] SSLSocket.getpeercertchain() Message-ID: <1371415195.44.0.636993698614.issue18233@psf.upfronthosting.co.za> New submission from Christian Heimes: The patch implements a method getpeercertchain() on a SSLSocket. It returns the peer's certificate chain from the leaf cert to the root cert if available. It wraps SSL_get_peer_cert_chain(). SSL_get_peer_cert_chain() doesn't have to pull any additional data from the peer. The information is already exchanged for cert validation. ---------- files: ssl_peerchertchain.patch keywords: patch messages: 191287 nosy: christian.heimes priority: normal severity: normal stage: patch review status: open title: SSLSocket.getpeercertchain() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30611/ssl_peerchertchain.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 22:54:44 2013 From: report at bugs.python.org (Pierrick Koch) Date: Sun, 16 Jun 2013 20:54:44 +0000 Subject: [issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe In-Reply-To: <1367934356.3.0.498041746077.issue17925@psf.upfronthosting.co.za> Message-ID: <1371416084.3.0.152987364907.issue17925@psf.upfronthosting.co.za> Pierrick Koch added the comment: last patch, replaced: self.producer_fifo.appendleft([data, first]) by: self.producer_fifo.extendleft([data, first]) ---------- Added file: http://bugs.python.org/file30612/cpython.asyncore_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 23:05:36 2013 From: report at bugs.python.org (Zachary Ware) Date: Sun, 16 Jun 2013 21:05:36 +0000 Subject: [issue18223] Refactor test_tarfile In-Reply-To: <1371405668.74.0.315659858762.issue18223@psf.upfronthosting.co.za> Message-ID: <67e35e43-32a4-4e1d-ac5f-eb7d9be7b353@email.android.com> Zachary Ware added the comment: >Serhiy Storchaka added the comment: > >Oh, sorry, I missed issue17689. That's alright, this is a legitimately different issue that just happens to encompass the purpose of the other. As long as your patch hits all the points mine meant to, I'm not bothered :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 23:23:15 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 16 Jun 2013 21:23:15 +0000 Subject: [issue18115] Use importlib.util.module_to_load in all loaders in importlib In-Reply-To: <1370056534.07.0.17129637302.issue18115@psf.upfronthosting.co.za> Message-ID: <3bYT771NLjz7Ljn@mail.python.org> Roundup Robot added the comment: New changeset 205aa49e5cd5 by Brett Cannon in branch 'default': Issue #18115: Abstract out managing the cleanup of modules to use in http://hg.python.org/cpython/rev/205aa49e5cd5 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 23:23:27 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 21:23:27 +0000 Subject: [issue18115] Use importlib.util.module_to_load in all loaders in importlib In-Reply-To: <1370056534.07.0.17129637302.issue18115@psf.upfronthosting.co.za> Message-ID: <1371417807.95.0.184229038682.issue18115@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 23:32:01 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 16 Jun 2013 21:32:01 +0000 Subject: [issue18228] AIX locale parsing failure In-Reply-To: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> Message-ID: <1371418321.48.0.347255962629.issue18228@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +haypo, lemburg, trent _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 23:34:25 2013 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 16 Jun 2013 21:34:25 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371418465.23.0.530404962144.issue18081@psf.upfronthosting.co.za> Vinay Sajip added the comment: > In the meanwhile, I will try using support.import_fresh_module('warnings') in test_logging, or better, saving and restoring warnings in test_idle. I agree the second option (changing test_idle) is better. The failing logging test is checking to ensure that the original warnings implementation is used when an explicit file is passed to warnings.showwarning, but it assumes that original implementation is the one in warnings when comparing the output from that (supposed) original implementation. +1 to restoring the environment and locale in test_idle, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 23:35:40 2013 From: report at bugs.python.org (Michael Foord) Date: Sun, 16 Jun 2013 21:35:40 +0000 Subject: [issue18223] Refactor test_tarfile In-Reply-To: <1371305914.88.0.406502768054.issue18223@psf.upfronthosting.co.za> Message-ID: <1371418540.28.0.44972974451.issue18223@psf.upfronthosting.co.za> Changes by Michael Foord : ---------- nosy: -michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 16 23:42:00 2013 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 16 Jun 2013 21:42:00 +0000 Subject: [issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows In-Reply-To: <1371306434.01.0.246562250059.issue18224@psf.upfronthosting.co.za> Message-ID: <1371418920.43.0.511108582719.issue18224@psf.upfronthosting.co.za> Vinay Sajip added the comment: The pyvenv pydoc script should be in the venv's Scripts folder, which is not (normally) on sys.path - the venv's Lib\site-packages is. Can you provide a small script which demonstrates the problem while confirming that the venv's Scripts folder has not been added to sys.path? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 00:37:34 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jun 2013 22:37:34 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371422254.98.0.0761387531539.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Vinay, please comment on this: on my Win7-64 system, as least, test_logging seems broken without running test_idle first. F:\Python\dev\cpython\PCbuild>python_d -m test test_logging [1/1] test_logging dummy.py:42: UserWarning: Explicit Warning -- warnings.filters was modified by test_logging test test_logging failed -- Traceback (most recent call last): File "F:\Python\dev\cpython\lib\test\test_logging.py", line 1779, in test_warnings_no_handlers self.assertEqual(len(logger.handlers), 1) AssertionError: 0 != 1 Relevant code: with warnings.catch_warnings(): logging.captureWarnings(True) self.addCleanup(logging.captureWarnings, False) # confirm our assumption: no loggers are set logger = logging.getLogger("py.warnings") self.assertEqual(logger.handlers, []) warnings.showwarning("Explicit", UserWarning, "dummy.py", 42) self.assertEqual(len(logger.handlers), 1) self.assertIsInstance(logger.handlers[0], logging.NullHandler) Since the above lines have not been touched in 2 years, and presumably worked before, perhaps something changed in warnings.catchwarnings or logging.capturewarnings so that NullHandler is no longer added. With import_fresh_module added to the test.support import (line 69) and warnings imported with "warnings = import_fresh_module('warnings')"; cpython\PCbuild>python_d -m test test_logging produces the same error as above, so it works to eliminate the effect of Idle running first, and could be used as a temporary fix. Side note: on Win7, should I see this? test_basic (test.test_logging.NTEventLogHandlerTest) ... skipped 'win32evtlog/win32evtlogutil required for this test.' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 00:38:01 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 16 Jun 2013 22:38:01 +0000 Subject: [issue18076] Implement importlib.util.decode_source_bytes() In-Reply-To: <1369704249.95.0.785002868519.issue18076@psf.upfronthosting.co.za> Message-ID: <3bYVnN6JwQz7Ljk@mail.python.org> Roundup Robot added the comment: New changeset bdd60bedf933 by Brett Cannon in branch 'default': Issue #18076: Introduce imoportlib.util.decode_source(). http://hg.python.org/cpython/rev/bdd60bedf933 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 00:38:29 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 22:38:29 +0000 Subject: [issue18076] Implement importlib.util.decode_source_bytes() In-Reply-To: <1369704249.95.0.785002868519.issue18076@psf.upfronthosting.co.za> Message-ID: <1371422309.63.0.595251302475.issue18076@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 01:04:01 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 16 Jun 2013 23:04:01 +0000 Subject: [issue18176] Builtins documentation refers to old version of UCD. In-Reply-To: <1370823303.7.0.563688972804.issue18176@psf.upfronthosting.co.za> Message-ID: <1371423841.0.0.644454682573.issue18176@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I have found another place where explicit UCD version is used in the docs: Doc/reference/lexical_analysis.rst:729:.. [#] http://www.unicode.org/Public/6.1.0/ucd/NameAliases.txt I am not sure how this case should be handled. The language reference was deliberately written so that it avoids mentioning specific version of Unicode. For example, PropList.txt in the "Identifiers and keywords" section is linked to the location of the latest published PropList.txt: . This means that as of today, all versions of documentation (3.0 through 3.4) refere to Unicode 6.2.0 version of this file. This may be misleading for the users of the older python versions. In the same section, there is a reference top a "non-normative HTML file listing all valid identifier characters for Unicode 4.1." I would suggest that instead of linking to an external resource we generate a similar table (possibly in ReST format) in makeunicodedata.py and include it with documentation. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 01:09:04 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 16 Jun 2013 23:09:04 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371424144.25.0.359316306414.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I reverted the change to test_logging, reran, and it runs fine, at least twice. Before the revert, I checked that the only two changes were the intentional ones. I tried adding idle_test/test_zdummy.py with a tearDownModule that deletes sys.modules['warnings']. This 'works' in that the original failure passes, as with the change to test_logging, and 'dummy.py:42: UserWarning: Explicit' is printed. But with test_logging unchanged from when it ran and passed, I see the same 0 != 1 error as in the last message plus Traceback (most recent call last): File "F:\Python\dev\cpython\lib\test\test_logging.py", line 1757, in test_warnings self.assertGreater(s.find("UserWarning: I'm warning you...\n"), 0) AssertionError: -1 not greater than 0 ---------- keywords: +patch Added file: http://bugs.python.org/file30613/zdummy.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 01:14:16 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sun, 16 Jun 2013 23:14:16 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1371424456.81.0.466637236791.issue18113@psf.upfronthosting.co.za> A.M. Kuchling added the comment: serhiy.storchaka: good point! I wonder if, for strict correctness, we should only incref obj (the new object) if set_panel_userptr() returns OK and not an error code. I've attached a new version of the patch that does this check, and also adds a test. (OTOH, looking at the ncurses 5.9 source code, set_panel_userptr() only returns an error if the panel object is NULL, which should never happen because Python reports an error if the panel creation fails. So maybe the rc == ERR check is pointless.) ---------- Added file: http://bugs.python.org/file30614/userptr_segfault_revised.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 01:19:30 2013 From: report at bugs.python.org (Brett Cannon) Date: Sun, 16 Jun 2013 23:19:30 +0000 Subject: [issue18076] Implement importlib.util.decode_source() In-Reply-To: <1369704249.95.0.785002868519.issue18076@psf.upfronthosting.co.za> Message-ID: <1371424770.61.0.705499087246.issue18076@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- title: Implement importlib.util.decode_source_bytes() -> Implement importlib.util.decode_source() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 01:42:46 2013 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 16 Jun 2013 23:42:46 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371426166.52.0.392893939766.issue18081@psf.upfronthosting.co.za> Vinay Sajip added the comment: I would change the reverted test_logging to add "print(logging._warnings_showwarning)" before the failing assertions. If this is bound to the original warnings.showwarning implementation, all should be well. If it points to e.g. idle_showwarning, you would expect to get a failure, as idle_showwarning formats warning messages differently from what warnings.showwarning is originally bound to. I think the right fix is to take the approach that logging does: have PyShell.py grow a captureWarnings(bool) function which either captures the old values before setting idle_showwarning/idle_formatwarning or restores them, according to the Boolean passed in. The PyShell.captureWarnings(True) could be called from PyShell module-level code if a side-effect free import is unavoidable, but test_idle could call PyShell.captureWarnings(False) to put things back as they were. I would have thought you could avoid side-effects by having the PyShell.captureWarnings(True) called from somewhere in the code path followed from "if __name__ == '__main__'", or from test_idle code. Re. Your side note - IIRC that skip of the NTEventLogHandler is expected, unless you install some win32 components which aren't shipped with stock Python (Mark Hammond's pywin32 project, available on SourceForge). They are shipped with other Python distributions, e.g. ActivePython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 02:14:18 2013 From: report at bugs.python.org (David Edelsohn) Date: Mon, 17 Jun 2013 00:14:18 +0000 Subject: [issue18228] AIX locale parsing failure In-Reply-To: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> Message-ID: <1371428058.77.0.804412946112.issue18228@psf.upfronthosting.co.za> David Edelsohn added the comment: The problem is Lib/test/regrtest.py. _lc = [getattr(locale, lc) for lc in dir(locale) if lc.startswith('LC_')] The list of locales that start with 'LC_' includes LC_ALL. On AIX, at least, setlocal("LC_ALL",NULL) returns a string with the locales for each locale category. Lib/locale.py for getlocale() specifically says: "category may be one of the LC_* value except LC_ALL." The following patch fixes the AIX testing problem. diff -r bdd60bedf933 Lib/test/regrtest.py --- a/Lib/test/regrtest.py Sun Jun 16 18:37:53 2013 -0400 +++ b/Lib/test/regrtest.py Sun Jun 16 22:05:52 2013 -0700 @@ -1231,7 +1231,7 @@ elif os.path.isdir(support.TESTFN): shutil.rmtree(support.TESTFN) - _lc = [getattr(locale, lc) for lc in dir(locale) if lc.startswith('LC_')] + _lc = [getattr(locale, lc) for lc in dir(locale) if lc.startswith('LC_') and lc != 'LC_ALL'] def get_locale(self): pairings = [] for lc in self._lc: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 02:24:18 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 17 Jun 2013 00:24:18 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases Message-ID: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: Python is aware of unicode codepoint aliases, but unicodedata does not provide a way to find aliases of a given codepoint: >>> ucd.lookup('ESCAPE') == '\N{ESCAPE}' True >>> ucd.lookup('RS') == '\N{RS}' True but >>> ucd.name('\N{ESCAPE}') Traceback (most recent call last): File "", line 1, in ValueError: no such name >>> ucd.name('\N{RS}') Traceback (most recent call last): File "", line 1, in ValueError: no such name ---------- messages: 191300 nosy: belopolsky priority: normal severity: normal status: open title: Unicodedata module should provide access to codepoint aliases type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 02:33:22 2013 From: report at bugs.python.org (David Edelsohn) Date: Mon, 17 Jun 2013 00:33:22 +0000 Subject: [issue18235] _sysconfigdata.py wrong on AIX installations Message-ID: <1371429201.94.0.372851990361.issue18235@psf.upfronthosting.co.za> New submission from David Edelsohn: _sysconfigdata.py includes information about how to build extension modules. On AIX this requires a wrapper script to build shared libraries. The file includes definitions like: 'BLDSHARED': './Modules/ld_so_aix gcc -pthread -bI:./Modules/python.exp', 'LDSHARED': './Modules/ld_so_aix gcc -pthread -bI:./Modules/python.exp', 'LINKCC': './Modules/makexp_aix Modules/python.exp . libpython3.4dm.a; gcc ' '-pthread', 'MAKESETUP': './Modules/makesetup', which is correct in the build directory, but is not correct for the install directory. The paths do not correspond to the installed location of ld_so_aix and makexp_aix in lib/pythonX.Y/config . ---------- components: Extension Modules messages: 191301 nosy: David.Edelsohn priority: normal severity: normal status: open title: _sysconfigdata.py wrong on AIX installations type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 02:56:47 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 17 Jun 2013 00:56:47 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1371430607.66.0.0911786333223.issue10581@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I took another look at the library reference and it looks like when it comes to non-ascii digits support, the reference contradicts itself. On one hand, """ int(x, base=10) If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in radix base. Optionally, the literal can be preceded by + or - (with no space in between) and surrounded by whitespace. """ .. suggests that only "an integer literal" will be accepted by int(), but on the other hand, a note in the "Numeric Types" section says: "The numeric literals accepted include the digits 0 to 9 or any Unicode equivalent (code points with the Nd property)." It also appears that "surrounded by whitespace" part is not entirely correct: >>> '\N{RS}'.isspace() True >>> int('123\N{RS}') Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '123\x1e' This is probably a bug in the current implementation and I will open a separate issue for that. ---------- versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 03:06:30 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 17 Jun 2013 01:06:30 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators Message-ID: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: ASCII information separators, hex codes 1C through 1F are classified as space: >>> all(c.isspace() for c in '\N{FS}\N{GS}\N{RS}\N{US}') True but int()/float() do not accept strings with leading or trailing separators: >>> int('123\N{RS}') Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '123\x1e' This is probably because corresponding bytes values are not classified as whitespace: >>> any(c.encode().isspace() for c in '\N{FS}\N{GS}\N{RS}\N{US}') False ---------- messages: 191303 nosy: belopolsky priority: normal severity: normal status: open title: int() and float() do not accept strings with trailing separators type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 03:07:29 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 17 Jun 2013 01:07:29 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1371431249.92.0.847371582697.issue10581@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: i opened issue18236 to address the issue of surrounding whitespace. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 03:34:47 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jun 2013 01:34:47 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371432887.85.0.0288645600345.issue18081@psf.upfronthosting.co.za> R. David Murray added the comment: As a side note, the various warnings about the execution environment being modified do not appear when tests are run under unittest because those warnings are generated by regrtest itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 03:34:57 2013 From: report at bugs.python.org (Jeff Tratner) Date: Mon, 17 Jun 2013 01:34:57 +0000 Subject: [issue18237] unittest.assertRaisesRegex(p) example is wrong in docs Message-ID: <1371432897.82.0.367432880569.issue18237@psf.upfronthosting.co.za> New submission from Jeff Tratner: One of the examples for assertRaisesRegex(p) is wrong by one character. Current is: self.assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ$', int, 'XYZ') The $ at the end is wrong because the actual error message is "ValueError: invalid literal for int() with base 10: 'XYZ'" (with a ``'`` at the end). Two options for fixing. Option 1 - remove $ self.assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ', int, 'XYZ') Option 2 - add ' self.assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ\'$', int, 'XYZ') Same example is shown for assertRaisesRegex, so applies to both. And for completeness...here's something you can run to see the error [couldn't figure out how to attach two files]: import unittest class MyTest(unittest.TestCase): def test_example(self): # this fails self.assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ$', int, 'XYZ') def test_option1(self): self.assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ', int, 'XYZ') def test_option2(self): self.assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ\'$', int, 'XYZ') unittest.main() ---------- assignee: docs at python components: Documentation files: unittest.patch keywords: patch messages: 191306 nosy: docs at python, jtratner priority: normal severity: normal status: open title: unittest.assertRaisesRegex(p) example is wrong in docs versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file30615/unittest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 03:54:02 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jun 2013 01:54:02 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371434042.64.0.605939078937.issue18103@psf.upfronthosting.co.za> R. David Murray added the comment: support.requires is smart. If the caller's module is __main__, it treats the resources as set. So you don't have to do anything special in your __main__ to make the tests runnable directly. The tests are also run if unittest is called. I don't know why that is, but I tested it on test_urllibnet, which is protected by the 'net' resource, and the tests ran. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 04:02:49 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jun 2013 02:02:49 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371434569.4.0.453379957566.issue18103@psf.upfronthosting.co.za> R. David Murray added the comment: Oh, actually I do know why that is. It is because requires is called from test_main in test_urllibnet, which unittest bypasses. So if you are calling it in particular tests, then I presume that will be an issue for the unittest case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 04:05:53 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jun 2013 02:05:53 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371434753.43.0.186802153215.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The only locale setting is IOBinding.py: 21 # Try setting the locale, so that we can find out what encoding to use locale.setlocale(locale.LC_CTYPE, "") This section, up to line 65, might be wrapped either by a function or if statement. There are only 2 os.environ accesses and no settings in Idle. This alteration might be inherited from tkinter. File tkinter/_fix.py sets TCL/TK/TIX_LIBRARY if they are not already. This seem innocuous as far as other tests go. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 04:12:37 2013 From: report at bugs.python.org (David Edelsohn) Date: Mon, 17 Jun 2013 02:12:37 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX Message-ID: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> New submission from David Edelsohn: test_signal.py wait_helper hangs on AIX. Please skip the test on AIX for now to allow all other tests to run to completion. diff -r bdd60bedf933 Lib/test/test_signal.py --- a/Lib/test/test_signal.py Sun Jun 16 18:37:53 2013 -0400 +++ b/Lib/test/test_signal.py Mon Jun 17 00:10:01 2013 -0700 @@ -593,6 +593,7 @@ """ assert_python_ok('-c', code) + @unittest.skipIf(sys.platform == "aix7", "Test hangs on AIX") @unittest.skipUnless(hasattr(signal, 'pthread_sigmask'), 'need signal.pthread_sigmask()') def wait_helper(self, blocked, test): ---------- components: Tests messages: 191310 nosy: David.Edelsohn priority: normal severity: normal status: open title: test_signal.py wait_helper hangs on AIX type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 04:47:23 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 17 Jun 2013 02:47:23 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem In-Reply-To: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> Message-ID: <1371437243.9.0.218747706778.issue18211@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Yes, we definitely need some way for CPython compiler flags to not infect everything built with distutils. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 04:52:03 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Mon, 17 Jun 2013 02:52:03 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem In-Reply-To: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> Message-ID: <1371437523.12.0.271465510528.issue18211@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 05:20:49 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jun 2013 03:20:49 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371439249.41.0.951532228666.issue18103@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I should have explicitly said 'all test methods in one test file'. I included ' caller is __main__' in the requires 'pass' condition. My first question was only about, for instance, running test_grep from the 'if __name__ ...' part of GrepDialog, For that, I verified as part of #18081 that setting support.use_resources is possible. My second question was about running all tests in one test_idle file from the command line. If not possible, so be it. I just need to document the limitation. Since multiple skips are acceptable, the 'framework' patch for this issue will just be a change to README explaining the use of the gui resource and when it is needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 06:26:21 2013 From: report at bugs.python.org (Rail Aliiev) Date: Mon, 17 Jun 2013 04:26:21 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1371443181.54.0.722985733543.issue18167@psf.upfronthosting.co.za> Changes by Rail Aliiev : ---------- nosy: +rail _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 06:39:52 2013 From: report at bugs.python.org (Trent Nelson) Date: Mon, 17 Jun 2013 04:39:52 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371443992.13.0.403943471623.issue3329@psf.upfronthosting.co.za> Changes by Trent Nelson : ---------- nosy: +trent _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 06:40:03 2013 From: report at bugs.python.org (Trent Nelson) Date: Mon, 17 Jun 2013 04:40:03 +0000 Subject: [issue18203] Replace direct calls to malloc() with PyMem_Malloc() or PyMem_RawMalloc() In-Reply-To: <1371120759.62.0.420345272246.issue18203@psf.upfronthosting.co.za> Message-ID: <1371444003.42.0.0881330282347.issue18203@psf.upfronthosting.co.za> Changes by Trent Nelson : ---------- nosy: +trent _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 06:46:29 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Mon, 17 Jun 2013 04:46:29 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1371444389.18.0.427145410102.issue17222@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: Exception messages are wrong. They contain name of source file instead of target file. ---------- resolution: fixed -> stage: committed/rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 06:46:59 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 17 Jun 2013 04:46:59 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1371444419.38.0.357444662918.issue10581@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I have started a rough prototype for what I plan to eventually reimplement in C and propose as a patch here. https://bitbucket.org/alexander_belopolsky/misc/src/c175171cc76e/utoi.py?at=master Comments welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 07:42:25 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 17 Jun 2013 05:42:25 +0000 Subject: [issue18231] What's new in Python should explain what's new in UCD In-Reply-To: <1371406253.35.0.589040711268.issue18231@psf.upfronthosting.co.za> Message-ID: <1371447745.42.0.269740397119.issue18231@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Are you sure that the permission to use "KHMER VOWEL INHERENT AQ" in an identifier is worth mentioning? Very few of the Python developers speak Khmer in the first place, let alone have the desire to use it in a Python identifier. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 08:27:57 2013 From: report at bugs.python.org (Martin Panter) Date: Mon, 17 Jun 2013 06:27:57 +0000 Subject: [issue15955] gzip, bz2, lzma: add option to limit output size In-Reply-To: <1347884562.79.0.801674791772.issue15955@psf.upfronthosting.co.za> Message-ID: <1371450477.25.0.771027481176.issue15955@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 08:34:45 2013 From: report at bugs.python.org (Martin Panter) Date: Mon, 17 Jun 2013 06:34:45 +0000 Subject: [issue16043] xmlrpc: gzip_decode has unlimited read() In-Reply-To: <1348570326.9.0.587983624118.issue16043@psf.upfronthosting.co.za> Message-ID: <1371450885.72.0.379434857034.issue16043@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 08:52:51 2013 From: report at bugs.python.org (py.user) Date: Mon, 17 Jun 2013 06:52:51 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371451971.87.0.804693948289.issue18220@psf.upfronthosting.co.za> Changes by py.user : Removed file: http://bugs.python.org/file30599/issue18220.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 08:53:08 2013 From: report at bugs.python.org (py.user) Date: Mon, 17 Jun 2013 06:53:08 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371451988.08.0.302815505402.issue18220@psf.upfronthosting.co.za> Changes by py.user : Added file: http://bugs.python.org/file30616/issue18220.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 08:54:56 2013 From: report at bugs.python.org (py.user) Date: Mon, 17 Jun 2013 06:54:56 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371452096.0.0.821426307646.issue18220@psf.upfronthosting.co.za> py.user added the comment: range and slice are normal in python3.4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 08:56:43 2013 From: report at bugs.python.org (Martin Panter) Date: Mon, 17 Jun 2013 06:56:43 +0000 Subject: [issue17005] Add a topological sort algorithm In-Reply-To: <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za> Message-ID: <1371452203.91.0.609455508094.issue17005@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 09:04:25 2013 From: report at bugs.python.org (py.user) Date: Mon, 17 Jun 2013 07:04:25 +0000 Subject: [issue18239] In itertools docstring update arguments in count() example Message-ID: <1371452665.1.0.633243797151.issue18239@psf.upfronthosting.co.za> New submission from py.user: >>> print(itertools.__doc__) Functional tools for creating and using iterators. Infinite iterators: count([n]) --> n, n+1, n+2, ... ... ---------- assignee: docs at python components: Documentation, Library (Lib) files: issue.patch keywords: patch messages: 191317 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools docstring update arguments in count() example type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30617/issue.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 09:10:38 2013 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 17 Jun 2013 07:10:38 +0000 Subject: [issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe In-Reply-To: <1367934356.3.0.498041746077.issue17925@psf.upfronthosting.co.za> Message-ID: <1371453038.38.0.63757607784.issue17925@psf.upfronthosting.co.za> Xavier de Gaye added the comment: > I think you mean: > > self.producer_fifo.extendleft([data, first]) > > Instead of: > > self.producer_fifo.extendleft([first, data]) > > No? No, I do mean: self.producer_fifo.extendleft([first, data]) See the documentation. Also: >>> from collections import deque >>> a = deque([0, 1, 2, 3]) >>> a.extendleft([11, 22]) >>> a deque([22, 11, 0, 1, 2, 3]) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 09:14:39 2013 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 17 Jun 2013 07:14:39 +0000 Subject: [issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe In-Reply-To: <1367934356.3.0.498041746077.issue17925@psf.upfronthosting.co.za> Message-ID: <1371453279.22.0.0350361865007.issue17925@psf.upfronthosting.co.za> Xavier de Gaye added the comment: After applying the last patch cpython.asyncore_3.patch (while cpython.asyncore_2.patch does not fail): ====================================================================== FAIL: test_simple_producer (test.test_asynchat.TestAsynchat) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_asynchat.py", line 198, in test_simple_producer self.fail("join() timed out") AssertionError: join() timed out ====================================================================== FAIL: test_simple_producer (test.test_asynchat.TestAsynchat_WithPoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_asynchat.py", line 198, in test_simple_producer self.fail("join() timed out") AssertionError: join() timed out ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 11:08:10 2013 From: report at bugs.python.org (Berker Peksag) Date: Mon, 17 Jun 2013 09:08:10 +0000 Subject: [issue18237] unittest.assertRaisesRegex(p) example is wrong in docs In-Reply-To: <1371432897.82.0.367432880569.issue18237@psf.upfronthosting.co.za> Message-ID: <1371460090.05.0.850189454675.issue18237@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- versions: -Python 3.1, Python 3.2, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 11:34:16 2013 From: report at bugs.python.org (tahnoon pasha) Date: Mon, 17 Jun 2013 09:34:16 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1371461656.34.0.478016323324.issue18153@psf.upfronthosting.co.za> tahnoon pasha added the comment: Hi David Adding the following post and response from the davmail author/ maintainers site. He seems to have fixed it in davmail and suggests the following fix in imaplib.py if there is a desire to amend it to allow stray spaces Le 15/06/2013 08:19, tahnoon a ?crit : Hi Mickael. I've continued to post on https://bugs.python.org and the imaplib maintainer has agreed to look at fixing this on imaplib if I can provide the appropriate unit test to replicate the problem. I'm not really a programmer so any pointers you can give me on how to set up a server simulation that approximates davmail or if you have one already set up as part of your development that would help solve this at the client end. Thanks Well, it's not easy to reproduce without a backend Exchange server. Basically it should accept multiple spaces after star in untagged response. untested fix of imaplib.py: replace Untagged_response = re.compile(r'* (?P[A-Z-]+)( (?P.))?') with Untagged_response = re.compile(r'*[ ]+(?P[A-Z-]+)( (?P.))?') Note that I disabled this non standard behavior in latest DavMail release, you can enable it in DavMail settings (KeepAlive). Not sure if that closes this issue or if you still think a test case is needed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 12:04:32 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 10:04:32 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <1371463472.06.0.617755037261.issue18238@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 12:38:28 2013 From: report at bugs.python.org (=?utf-8?q?Jonas_Borgstr=C3=B6m?=) Date: Mon, 17 Jun 2013 10:38:28 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" Message-ID: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> New submission from Jonas Borgstr?m: Problem: In hmac.py there's a type check that verifies that the msg parameter is of type bytes(). if not isinstance(msg, bytes): raise TypeError("expected bytes, but got %r" % type(msg).__name__) That is incorrect. The hmac module should also work with other data types as long as they are supported by the underlying hashlib module, for example bytearray() and memoryview(). Suggestion: Remove that type check. hashlib will make sure str() and other invalid data types raises a TypeError. ---------- components: Library (Lib) messages: 191321 nosy: jborg priority: normal severity: normal status: open title: hmac unnecessarily restricts input to "bytes" type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 13:48:56 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 11:48:56 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1371469736.94.0.594165029416.issue18240@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +christian.heimes, gregory.p.smith stage: -> needs patch type: behavior -> enhancement versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 13:49:47 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 11:49:47 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1371469787.36.0.04960865739.issue18234@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +benjamin.peterson, ezio.melotti, lemburg, loewis, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 13:55:30 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 11:55:30 +0000 Subject: [issue18233] SSLSocket.getpeercertchain() In-Reply-To: <1371415195.44.0.636993698614.issue18233@psf.upfronthosting.co.za> Message-ID: <1371470130.07.0.671187394684.issue18233@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- dependencies: +SSL: diagnostic functions to list loaded CA certs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 13:56:37 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 11:56:37 +0000 Subject: [issue18207] OpenSSL may ignore seconds in notAfter In-Reply-To: <1371167894.29.0.607710152237.issue18207@psf.upfronthosting.co.za> Message-ID: <1371470197.0.0.185925968005.issue18207@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'm not sure we should care much about this, but feel free to improve the tests of course :-) ---------- components: +Tests -Extension Modules priority: normal -> low type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 13:57:19 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 11:57:19 +0000 Subject: [issue17944] Refactor test_zipfile In-Reply-To: <1368093470.65.0.477520947191.issue17944@psf.upfronthosting.co.za> Message-ID: <1371470239.47.0.590456739861.issue17944@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Terry for review. Here is updated patch addressed Terry's comments. Now random datas for tests generated once per class (generating them once per module will be more cumbersome and will save less time). Arguments for zipfile.open() now generated from a special generator. This simplifies the code and makes possible to determine with what argument test is failed. I don't think subtest() is appropriate here (in any case it is 3.4 only). ---------- Added file: http://bugs.python.org/file30618/test_zipfile_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 13:58:30 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jun 2013 11:58:30 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1371470310.6.0.00946562252893.issue18240@psf.upfronthosting.co.za> Christian Heimes added the comment: Good idea! We can also lift the restriction for ``key`` a bit. It can also take a bytearray as argument. bytearray has translate() and supports bytes + bytearay. ---------- assignee: -> christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 14:15:43 2013 From: report at bugs.python.org (Jakub Wilk) Date: Mon, 17 Jun 2013 12:15:43 +0000 Subject: [issue14653] Improve mktime_tz to use calendar.timegm instead of time.mktime In-Reply-To: <1335213212.56.0.724242644314.issue14653@psf.upfronthosting.co.za> Message-ID: <1371471343.93.0.0262089432096.issue14653@psf.upfronthosting.co.za> Jakub Wilk added the comment: The documentations says "Minor deficiency: mktime_tz() interprets the first 8 elements of tuple as a local time and then compensates for the timezone difference. This may yield a slight error around changes in daylight savings time, though not worth worrying about for common use." Now that this bug has been fixed, this no longer true. Please update the documentation. :) ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 14:15:45 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 12:15:45 +0000 Subject: [issue17944] Refactor test_zipfile In-Reply-To: <1368093470.65.0.477520947191.issue17944@psf.upfronthosting.co.za> Message-ID: <1371471345.38.0.526489273145.issue17944@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: When applying first Terry's suggestion I found a bug. self.list_gen was a generator and when self.list_gen used second time it was exhausted. As result, some tests were skipped and a bug with concatenating bytes and '\n' was not exposed. This bug should be fixed in 2.7 if it exists. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 14:52:32 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jun 2013 12:52:32 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <1371473552.96.0.868583881104.issue18238@psf.upfronthosting.co.za> STINNER Victor added the comment: > test_signal.py wait_helper hangs on AIX. Why does the test hang? I prefer to only skip a test if I understood the issue (when it is not fixable in Python, like a bug in the kernel). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:01:51 2013 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 17 Jun 2013 13:01:51 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371474111.88.0.673502701594.issue18081@psf.upfronthosting.co.za> Vinay Sajip added the comment: With the attached patch, python -m test_idle test_logging passes (though test_idle still alters locale and environment). Running python -m idelib.idle, and using IDLE itself for inspection, the warnings.formatwarning is set to the implementation in idlelib.run. Perhaps the PyShell changes aren't needed, but I think it may avoid similar issues in the future to leave them in. ---------- Added file: http://bugs.python.org/file30619/changes.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:11:38 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Jun 2013 13:11:38 +0000 Subject: [issue18223] Refactor test_tarfile In-Reply-To: <1371305914.88.0.406502768054.issue18223@psf.upfronthosting.co.za> Message-ID: <3bYt9P3L99zSDW@mail.python.org> Roundup Robot added the comment: New changeset 4b2188b13dd2 by Serhiy Storchaka in branch '3.3': Issue #18223: Refactor test_tarfile. http://hg.python.org/cpython/rev/4b2188b13dd2 New changeset 5c0816e64aac by Serhiy Storchaka in branch 'default': Issue #18223: Refactor test_tarfile. http://hg.python.org/cpython/rev/5c0816e64aac ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:13:01 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 13:13:01 +0000 Subject: [issue18223] Refactor test_tarfile In-Reply-To: <1371305914.88.0.406502768054.issue18223@psf.upfronthosting.co.za> Message-ID: <1371474781.84.0.101198246734.issue18223@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Ezio and Zachary for review. I have included Zachary's patch for issue17689. In addition catching the FileNotFoundError exception used now in test_non_existent_targz_file instead of IOError/OSError + checking errno. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:14:45 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 13:14:45 +0000 Subject: [issue18223] Refactor test_tarfile In-Reply-To: <1371305914.88.0.406502768054.issue18223@psf.upfronthosting.co.za> Message-ID: <1371474885.85.0.898601135327.issue18223@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:33:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Jun 2013 13:33:10 +0000 Subject: [issue18207] OpenSSL may ignore seconds in notAfter In-Reply-To: <1371167894.29.0.607710152237.issue18207@psf.upfronthosting.co.za> Message-ID: <3bYtfF5xb0zRF7@mail.python.org> Roundup Robot added the comment: New changeset c484ca129288 by Christian Heimes in branch 'default': Issue #18207: Fix test_ssl for some versions of OpenSSL that ignore seconds http://hg.python.org/cpython/rev/c484ca129288 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:34:45 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jun 2013 13:34:45 +0000 Subject: [issue18207] OpenSSL may ignore seconds in notAfter In-Reply-To: <1371167894.29.0.607710152237.issue18207@psf.upfronthosting.co.za> Message-ID: <1371476085.05.0.72423876851.issue18207@psf.upfronthosting.co.za> Christian Heimes added the comment: Additional versions of OpenSSL may be affected by the issue. We can add these versions whenever we run into the issue again. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:38:26 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Jun 2013 13:38:26 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <3bYtmK4hKzzRF7@mail.python.org> Roundup Robot added the comment: New changeset 63058453a4cc by Serhiy Storchaka in branch '2.7': Issue #18167: cgi.FieldStorage no more fails to handle multipart/form-data http://hg.python.org/cpython/rev/63058453a4cc New changeset a48f65bac986 by Serhiy Storchaka in branch '3.3': Issue #18167: cgi.FieldStorage no more fails to handle multipart/form-data http://hg.python.org/cpython/rev/a48f65bac986 New changeset 17ec73a3a854 by Serhiy Storchaka in branch 'default': Issue #18167: cgi.FieldStorage no more fails to handle multipart/form-data http://hg.python.org/cpython/rev/17ec73a3a854 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:39:17 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 13:39:17 +0000 Subject: [issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines In-Reply-To: <1370652419.33.0.211091292635.issue18167@psf.upfronthosting.co.za> Message-ID: <1371476357.7.0.467071992216.issue18167@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:45:20 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Jun 2013 13:45:20 +0000 Subject: [issue18147] SSL: diagnostic functions to list loaded CA certs In-Reply-To: <1370513969.26.0.776855011912.issue18147@psf.upfronthosting.co.za> Message-ID: <3bYtwH72QczRFT@mail.python.org> Roundup Robot added the comment: New changeset 38e759e4c9e6 by Christian Heimes in branch 'default': Issue #18147: Add diagnostic functions to ssl.SSLContext(). http://hg.python.org/cpython/rev/38e759e4c9e6 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:45:51 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jun 2013 13:45:51 +0000 Subject: [issue18147] SSL: diagnostic functions to list loaded CA certs In-Reply-To: <1370513969.26.0.776855011912.issue18147@psf.upfronthosting.co.za> Message-ID: <1371476751.34.0.498801306538.issue18147@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 15:58:43 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jun 2013 13:58:43 +0000 Subject: [issue18147] SSL: diagnostic functions to list loaded CA certs In-Reply-To: <1370513969.26.0.776855011912.issue18147@psf.upfronthosting.co.za> Message-ID: <1371477523.98.0.385652648556.issue18147@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:06:28 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 14:06:28 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1371477988.0.0.0181779517201.issue18113@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > I've attached a new version of the patch that does this check, and also adds a test. You are right. Your patch LGTM. > (OTOH, looking at the ncurses 5.9 source code, set_panel_userptr() only returns an error if the panel object is NULL, which should never happen because Python reports an error if the panel creation fails. So maybe the rc == ERR check is pointless.) Future versions or alternative implementations can returns an error in other circumstances. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:07:01 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jun 2013 14:07:01 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1371478021.27.0.920076132914.issue18153@psf.upfronthosting.co.za> R. David Murray added the comment: I don't understand why his keepalive requires the extra spaces...and I'm not 100% sure that accepting them will fix the problem, though in theory it should. I still lean toward making the spaces fix in imaplib, based on the postel principle. I'd prefer to have a unit test, but if you or I or someone else doesn't get around to writing one before the next time we start working on releases, I'll probably commit the (pretty much obviously correct) patch without a test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:09:15 2013 From: report at bugs.python.org (David Edelsohn) Date: Mon, 17 Jun 2013 14:09:15 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <1371478155.64.0.818963882907.issue18238@psf.upfronthosting.co.za> David Edelsohn added the comment: I understand that this is a work-around and the intention is to investigate each error in the testsuite on AIX. But currently this bug eventually leads to a timeout in the testsuite and half of the tests are not run. I am trying to get the AIX buildbot running completely and greatly would appreciate your accommodation with this work-around during that process to make it easier for CPython developers to make another sweep through the testsuite failures to start addressing them. This is not proposed as "skip the test and ignore it". This is proposed as an interim solution to make progress on the buildbot for AIX. Again, I would greatly appreciate your patience and accommodation in this request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:09:17 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jun 2013 14:09:17 +0000 Subject: [issue14653] Improve mktime_tz to use calendar.timegm instead of time.mktime In-Reply-To: <1335213212.56.0.724242644314.issue14653@psf.upfronthosting.co.za> Message-ID: <1371478157.8.0.902702888928.issue14653@psf.upfronthosting.co.za> R. David Murray added the comment: Since this issue has been closed, it would be great if you'd open a new issue just for the doc change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:10:42 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jun 2013 14:10:42 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371478242.86.0.978882060017.issue18081@psf.upfronthosting.co.za> R. David Murray added the comment: Note that it is a known issue that tk (not python's bindings, tk itself) alters the locale. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:30:39 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Mon, 17 Jun 2013 14:30:39 +0000 Subject: [issue18225] ctypes Structure data size is incorrect In-Reply-To: <1371314544.05.0.0841863678451.issue18225@psf.upfronthosting.co.za> Message-ID: <1371479439.64.0.991644714201.issue18225@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: You can also use "_pack_ = 1" to override the default alignment rules: http://docs.python.org/3/library/ctypes.html#ctypes.Structure._pack_ ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:44:02 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 14:44:02 +0000 Subject: [issue18241] Add unique option to heapq functions Message-ID: <1371480242.24.0.0078060677529.issue18241@psf.upfronthosting.co.za> New submission from Antoine Pitrou: In one application, I would like to use a heap as an allocation pool. I also want to check that a given value isn't released twice, therefore that the heap contains unique values. My use case would be solved nicely if heappush() took an optional "unique=False" parameter. Note that I haven't checked if doing so is possible while maintaining the O(log n) complexity :-) ---------- messages: 191341 nosy: pitrou, rhettinger priority: low severity: normal status: open title: Add unique option to heapq functions type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:56:20 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 17 Jun 2013 14:56:20 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371480980.89.0.103721137875.issue18081@psf.upfronthosting.co.za> Brett Cannon added the comment: Another odd thing about this failure is that http://hg.python.org/cpython/rev/59a11c81dd3c should have fixed it as it should be setting warnings.showwarning() back to it's original value before the test began executing. So I checked PyShell again and found out it's being very naughty. If you look at http://hg.python.org/cpython/file/ec4b0145f7e5/Lib/idlelib/PyShell.py#l76 you will find that it is replacing warnings.formatwarning, and that's a big no-no. While warnings.showwarning is designed to be replaced as a hooking point (http://docs.python.org/3/library/warnings.html#warnings.showwarning), formatwarning is not and is meant to be the default function showwarning calls to produce the string that is to be used in the warning (http://docs.python.org/3/library/warnings.html#warnings.formatwarning). My hunch (which I currently can't verify since I'm at work) is that if you stop replacing warnings.formatwarning and instead just have IDLE's showwarning version call its formatting function directly then this failure will go away. The warning about test_idle mucking with warnings.showwarning will still be there until a way to optionally set showwarning is developed, but at least the buildbots should go back to green. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:57:08 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 17 Jun 2013 14:57:08 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371481028.91.0.926858197664.issue18081@psf.upfronthosting.co.za> Brett Cannon added the comment: And Lib/idlelib/run.py also does the substitution. I'll file a separate bug for all of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:59:20 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 17 Jun 2013 14:59:20 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning Message-ID: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> New submission from Brett Cannon: Both idlelib.run and idlelib.PyShell replace warning.formatwarning which is a no-no. Only warning.showwarning is design to be replaced in any way. The proper solution is to replace warnings.showwarning with code that calls whatever formatting function you provide. ---------- components: IDLE messages: 191344 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: IDLE should not be replacing warnings.formatwarning type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 16:59:33 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 17 Jun 2013 14:59:33 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1371481173.59.0.261646563743.issue18081@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- dependencies: +IDLE should not be replacing warnings.formatwarning _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 17:13:19 2013 From: report at bugs.python.org (Peter Santoro) Date: Mon, 17 Jun 2013 15:13:19 +0000 Subject: [issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows In-Reply-To: <1371306434.01.0.246562250059.issue18224@psf.upfronthosting.co.za> Message-ID: <1371481999.82.0.120096272726.issue18224@psf.upfronthosting.co.za> Peter Santoro added the comment: As requested, I've attached a small test script called shadow.py. Steps to reproduce: 1) pyvenv.py bugtest 2) copy the attached shadow.py script to bugtest and bugtest\scripts 3) cd bugtest 4) run shadow.py (first entry in sys.path is refers to bugtest directory per Python docs; finds the systems's pydoc module) 5) run bugtest\shadow.py (first entry in sys.path refers to bugtest\scripts directory per Python docs; finds the bugtest\scripts pydoc module instead of the system's pydoc module) According to the Python documentation (http://docs.python.org/3/library/sys.html#sys.path): "As initialized upon program startup, the first item of this list, path[0], is the directory containing the script that was used to invoke the Python interpreter. If the script directory is not available (e.g. if the interpreter is invoked interactively or if the script is read from standard input), path[0] is the empty string, which directs Python to search modules in the current directory first. Notice that the script directory is inserted before the entries inserted as a result of PYTHONPATH." Maybe I'm missing something here, but isn't this problem caused by the fact that Python initializes sys.path[0] to contain the directory of the executing script and that having pydoc.py in that same directory (i.e. the venv's scripts directory) shadows the system's pydoc.py module? On Linux, I didn't have this problem, because the pydoc script doesn't have the .py extension. However, if you rename the pydoc script on Linux to pydoc.py, the same problem occurs. I don't think a pydoc.py (or any other .py file which shadows a system module) can exist in the venv scripts (or bin) directory without shadowing/breaking the system provided module. Maybe a pydoc.exe or pydoc.bat file is needed on Windows? Another option would be to rename the pydoc.py file to something like pydocs.py, but that would be incompatible with other platforms and the existing documentation. ---------- Added file: http://bugs.python.org/file30620/shadow.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 17:24:02 2013 From: report at bugs.python.org (Jakub Wilk) Date: Mon, 17 Jun 2013 15:24:02 +0000 Subject: [issue18243] mktime_tz documentation out-of-date Message-ID: <1371482642.16.0.49381484414.issue18243@psf.upfronthosting.co.za> New submission from Jakub Wilk: email.utils.mktime_tz documentations says: "Minor deficiency: mktime_tz() interprets the first 8 elements of tuple as a local time and then compensates for the timezone difference. This may yield a slight error around changes in daylight savings time, though not worth worrying about for common use." But now that issue #14653 is fixed, this is no longer true. ---------- assignee: docs at python components: Documentation messages: 191346 nosy: docs at python, jwilk priority: normal severity: normal status: open title: mktime_tz documentation out-of-date _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 17:24:38 2013 From: report at bugs.python.org (Jakub Wilk) Date: Mon, 17 Jun 2013 15:24:38 +0000 Subject: [issue14653] Improve mktime_tz to use calendar.timegm instead of time.mktime In-Reply-To: <1335213212.56.0.724242644314.issue14653@psf.upfronthosting.co.za> Message-ID: <1371482678.0.0.356710836577.issue14653@psf.upfronthosting.co.za> Jakub Wilk added the comment: Fair enough, filed as issue #18243. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 17:31:21 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jun 2013 15:31:21 +0000 Subject: [issue18243] mktime_tz documentation out-of-date In-Reply-To: <1371482642.16.0.49381484414.issue18243@psf.upfronthosting.co.za> Message-ID: <1371483081.12.0.582379701427.issue18243@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- components: +email nosy: +barry, r.david.murray versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 18:03:34 2013 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 17 Jun 2013 16:03:34 +0000 Subject: [issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows In-Reply-To: <1371306434.01.0.246562250059.issue18224@psf.upfronthosting.co.za> Message-ID: <1371485014.07.0.806996579055.issue18224@psf.upfronthosting.co.za> Vinay Sajip added the comment: > the fact that Python initializes sys.path[0] to contain the directory of the executing script Of course, silly me. Sorry. I would prefer to remove the pydoc script altogether. The other alternative would be to rename it to pydoc-script.py and have a pydoc.exe adjacent to it (this is how scripts installed with setuptools or distlib work). However, the simple launcher which would be pydoc.exe is not currently part of Python. I think the best thing would be for me to post on python-dev to see what views people there have about these alternatives. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 18:30:00 2013 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 17 Jun 2013 16:30:00 +0000 Subject: [issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows In-Reply-To: <1371306434.01.0.246562250059.issue18224@psf.upfronthosting.co.za> Message-ID: <1371486600.67.0.325255676338.issue18224@psf.upfronthosting.co.za> Vinay Sajip added the comment: Rethinking, renaming seems more reasonable. I've posted about it to python-dev: http://mail.python.org/pipermail/python-dev/2013-June/126904.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 18:59:24 2013 From: report at bugs.python.org (Berker Peksag) Date: Mon, 17 Jun 2013 16:59:24 +0000 Subject: [issue18206] license url in site.py should always use X.Y.Z form of version number In-Reply-To: <1371162560.09.0.685782864566.issue18206@psf.upfronthosting.co.za> Message-ID: <1371488364.03.0.568441027405.issue18206@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- keywords: +patch nosy: +berker.peksag stage: needs patch -> patch review Added file: http://bugs.python.org/file30621/issue18206.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 19:34:28 2013 From: report at bugs.python.org (Edward Catmur) Date: Mon, 17 Jun 2013 17:34:28 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering Message-ID: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> New submission from Edward Catmur: Suppose we have a class C with MRO (C, B, A, object). C virtual-inherits an ABC V, while B virtual-inherits an unrelated ABC W: object / | \ A W | | .` / B` V | .` C` Recalling that per PEP 443 singledispatch prefers concrete bases to virtual bases, we would expect the following composed MRO: C, B, V, A, W, object However what actually happens is the composed MRO depends on the order of the haystack; if W is processed first the result is correct, but if V is processed first then (because V does not subclass W) W is inserted in the MRO *before* V: C, B, A, object C, B, V, A, object C, B, W, V, A, object This results in ambiguity between V and W. Suggested fix is a slight change to the MRO composition algorithm, considering whether the items already placed in the MRO are concrete base classes. ---------- components: Extension Modules hgrepos: 200 messages: 191350 nosy: ecatmur priority: normal severity: normal status: open title: singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 19:37:34 2013 From: report at bugs.python.org (Edward Catmur) Date: Mon, 17 Jun 2013 17:37:34 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371490654.77.0.195360921642.issue18244@psf.upfronthosting.co.za> Edward Catmur added the comment: Apologies, the linked repository is for the 2.x backport of singledispatch. I'll replace it with a proper Python repo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 19:57:26 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Mon, 17 Jun 2013 17:57:26 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371491846.62.0.611519217168.issue18103@psf.upfronthosting.co.za> Changes by R. Jayakrishnan : ---------- nosy: +JayKrish _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 19:58:15 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Mon, 17 Jun 2013 17:58:15 +0000 Subject: [issue18104] Idle: make human-mediated GUI tests usable In-Reply-To: <1369961521.26.0.131640091288.issue18104@psf.upfronthosting.co.za> Message-ID: <1371491895.55.0.720285843336.issue18104@psf.upfronthosting.co.za> Changes by R. Jayakrishnan : ---------- nosy: +JayKrish _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:07:25 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jun 2013 18:07:25 +0000 Subject: [issue18233] SSLSocket.getpeercertchain() In-Reply-To: <1371415195.44.0.636993698614.issue18233@psf.upfronthosting.co.za> Message-ID: <1371492445.72.0.758102030613.issue18233@psf.upfronthosting.co.za> Christian Heimes added the comment: As expected it is much harder to get the full certification chain from OpenSSL than I initially expected. SSL_get_peer_cert_chain() doesn't return the root CA's certificate. The new patch introduces a validation mode and uses X509_verify_cert(*X509_STORE_CTX) + X509_STORE_CTX_get1_chain() to build a full chain. ---------- Added file: http://bugs.python.org/file30622/ssl_peerchertchain2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:21:39 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 17 Jun 2013 18:21:39 +0000 Subject: [issue18231] What's new in Python should explain what's new in UCD In-Reply-To: <1371406253.35.0.589040711268.issue18231@psf.upfronthosting.co.za> Message-ID: <1371493299.48.0.0254090066392.issue18231@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: MvL> Are you sure that the permission to use "KHMER VOWEL INHERENT AQ" MvL> in an identifier is worth mentioning? No, but it is worth mentioning that there are no more substantial changes. I don't think the change from 6.1.0 to 6.2.0 has any effect on python programs that don't explicitly use unicodedata module. ("Version 6.2 of the Unicode Standard is a special release dedicated to the early publication of the newly encoded Turkish lira sign.") If this is true, I think What's New in 3.4 can just say that. The change from 6.1.0 to 6.2.0 is more substantial, so I think it is worth mentioning a few effects so that users don't have to wonder what the upgrade means for them. The effect of the change on Python language and builtins is not at all obvious from the Unicode's own summary of changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:23:00 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 18:23:00 +0000 Subject: [issue12197] non-blocking SSL write fails if a partial write was issued In-Reply-To: <1306519609.32.0.152577977388.issue12197@psf.upfronthosting.co.za> Message-ID: <1371493380.79.0.360827298377.issue12197@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:23:13 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 18:23:13 +0000 Subject: [issue15071] TLS get keys and randoms In-Reply-To: <1339706412.94.0.740645043785.issue15071@psf.upfronthosting.co.za> Message-ID: <1371493393.72.0.117307346234.issue15071@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:23:45 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 18:23:45 +0000 Subject: [issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default In-Reply-To: <1294375380.08.0.187691378511.issue10852@psf.upfronthosting.co.za> Message-ID: <1371493425.02.0.618681245594.issue10852@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:31:04 2013 From: report at bugs.python.org (Edward Catmur) Date: Mon, 17 Jun 2013 18:31:04 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371493864.11.0.886731556845.issue18244@psf.upfronthosting.co.za> Changes by Edward Catmur : ---------- keywords: +patch Added file: http://bugs.python.org/file30623/singledispatch-mro-18244.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:31:57 2013 From: report at bugs.python.org (Edward Catmur) Date: Mon, 17 Jun 2013 18:31:57 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371493917.28.0.799687923224.issue18244@psf.upfronthosting.co.za> Changes by Edward Catmur : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:33:25 2013 From: report at bugs.python.org (py.user) Date: Mon, 17 Jun 2013 18:33:25 +0000 Subject: [issue18245] In itertools.groupby() make data plural Message-ID: <1371494005.37.0.121371971068.issue18245@psf.upfronthosting.co.za> New submission from py.user: http://en.wiktionary.org/wiki/data "data (uncountable) or plural noun" ---------- assignee: docs at python components: Documentation files: issue.diff keywords: patch messages: 191354 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools.groupby() make data plural versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30624/issue.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:35:05 2013 From: report at bugs.python.org (Edward Catmur) Date: Mon, 17 Jun 2013 18:35:05 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371494105.1.0.318589356847.issue18244@psf.upfronthosting.co.za> Edward Catmur added the comment: See attachment for patch and test. Note that reproducing the issue without access to singledispatch internals depends on iteration order of a dict of types and is thus intermittent/environment dependent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:35:43 2013 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 17 Jun 2013 18:35:43 +0000 Subject: [issue18245] In itertools.groupby() make data plural In-Reply-To: <1371494005.37.0.121371971068.issue18245@psf.upfronthosting.co.za> Message-ID: <1371494143.74.0.925661267825.issue18245@psf.upfronthosting.co.za> Ned Batchelder added the comment: Please don't make this change. "Data" is used as a singular collective noun, especially in software contexts. "Data" as a plural noun sounds archaic, or at best, scientific. ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:36:30 2013 From: report at bugs.python.org (Berker Peksag) Date: Mon, 17 Jun 2013 18:36:30 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371494190.05.0.314123330284.issue18244@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- components: +Library (Lib) -Extension Modules nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:40:20 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Jun 2013 18:40:20 +0000 Subject: [issue18228] AIX locale parsing failure In-Reply-To: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> Message-ID: <3bZ1Sg6FGVz7Lk5@mail.python.org> Roundup Robot added the comment: New changeset 00824f9e29f3 by Victor Stinner in branch 'default': Issue #18228: Fix locale test of test.regrtest.saved_test_environment http://hg.python.org/cpython/rev/00824f9e29f3 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:41:31 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 17 Jun 2013 18:41:31 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371494491.13.0.233703843084.issue18244@psf.upfronthosting.co.za> Changes by ?ukasz Langa : ---------- assignee: -> lukasz.langa stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:48:05 2013 From: report at bugs.python.org (dnozay) Date: Mon, 17 Jun 2013 18:48:05 +0000 Subject: [issue14030] Be more careful about selecting the compiler in distutils In-Reply-To: <1329385035.22.0.0715283153402.issue14030@psf.upfronthosting.co.za> Message-ID: <1371494885.74.0.640601598009.issue14030@psf.upfronthosting.co.za> dnozay added the comment: affects PyPy, here are the downstream issues: - https://bugs.pypy.org/issue662 - https://bugs.pypy.org/issue674 - https://bugs.pypy.org/issue1057 ---------- nosy: +dnozay _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:50:04 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Jun 2013 18:50:04 +0000 Subject: [issue18245] In itertools.groupby() make data plural In-Reply-To: <1371494005.37.0.121371971068.issue18245@psf.upfronthosting.co.za> Message-ID: <1371495004.75.0.9644705459.issue18245@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, the way it is now is normal written english, regardless of what any older official stylebooks may say :) ---------- nosy: +r.david.murray resolution: -> invalid stage: -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:51:30 2013 From: report at bugs.python.org (David Edelsohn) Date: Mon, 17 Jun 2013 18:51:30 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <1371495090.63.0.173644707196.issue18238@psf.upfronthosting.co.za> David Edelsohn added the comment: $ ./python -m test --timeout=60 -v test_signal == CPython 3.4.0a0 (default:00824f9e29f3+, Jun 17 2013, 16:44:41) [GCC 4.8.1] == AIX-1-00F84C0C4C00-powerpc-32bit big-endian == /home/dje/src/cpython/build/test_python_5832942 Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1) [1/1] test_signal test_getsignal (test.test_signal.PosixTests) ... ok test_out_of_range_signal_number_raises_error (test.test_signal.PosixTests) ... ok test_setting_signal_handler_to_none_raises_error (test.test_signal.PosixTests) ... ok test_main (test.test_signal.InterProcessSignalTests) ... ok test_invalid_fd (test.test_signal.WakeupFDTests) ... ok test_pending (test.test_signal.WakeupSignalTests) ... ok test_signum (test.test_signal.WakeupSignalTests) ... ok test_wakeup_fd_during (test.test_signal.WakeupSignalTests) ... ok test_wakeup_fd_early (test.test_signal.WakeupSignalTests) ... ok test_siginterrupt_off (test.test_signal.SiginterruptTest) ... ok test_siginterrupt_on (test.test_signal.SiginterruptTest) ... ok test_without_siginterrupt (test.test_signal.SiginterruptTest) ... ok test_itimer_exc (test.test_signal.ItimerTest) ... ok test_itimer_prof (test.test_signal.ItimerTest) ... ok test_itimer_real (test.test_signal.ItimerTest) ... ok test_itimer_virtual (test.test_signal.ItimerTest) ... ok test_issue9324 (test.test_signal.WindowsSignalTests) ... skipped 'Windows specific' test_pthread_kill (test.test_signal.PendingSignalsTests) ... ok test_pthread_kill_main_thread (test.test_signal.PendingSignalsTests) ... ok test_pthread_sigmask (test.test_signal.PendingSignalsTests) ... ok test_pthread_sigmask_arguments (test.test_signal.PendingSignalsTests) ... ok test_sigpending (test.test_signal.PendingSignalsTests) ... ok test_sigpending_empty (test.test_signal.PendingSignalsTests) ... ok test_sigtimedwait (test.test_signal.PendingSignalsTests) ... ok test_sigtimedwait_negative_timeout (test.test_signal.PendingSignalsTests) ... ok test_sigtimedwait_poll (test.test_signal.PendingSignalsTests) ... ok test_sigtimedwait_timeout (test.test_signal.PendingSignalsTests) ... ok test_sigwait (test.test_signal.PendingSignalsTests) ... ok test_sigwait_thread (test.test_signal.PendingSignalsTests) ... ok test_sigwaitinfo (test.test_signal.PendingSignalsTests) ... ok test_sigwaitinfo_interrupted (test.test_signal.PendingSignalsTests) ... Timeout (0:01:00)! Thread 0x00000001: File "/home/dje/src/cpython/Lib/subprocess.py", line 1613 in _communicate_with_poll File "/home/dje/src/cpython/Lib/subprocess.py", line 1533 in _communicate File "/home/dje/src/cpython/Lib/subprocess.py", line 943 in communicate File "/home/dje/src/cpython/Lib/test/script_helper.py", line 36 in _assert_python File "/home/dje/src/cpython/Lib/test/script_helper.py", line 54 in assert_python_ok File "/home/dje/src/cpython/Lib/test/test_signal.py", line 639 in wait_helper File "/home/dje/src/cpython/Lib/test/test_signal.py", line 726 in test_sigwaitinfo_interrupted File "/home/dje/src/cpython/Lib/unittest/case.py", line 496 in run File "/home/dje/src/cpython/Lib/unittest/case.py", line 535 in __call__ File "/home/dje/src/cpython/Lib/unittest/suite.py", line 105 in run File "/home/dje/src/cpython/Lib/unittest/suite.py", line 67 in __call__ File "/home/dje/src/cpython/Lib/unittest/suite.py", line 105 in run File "/home/dje/src/cpython/Lib/unittest/suite.py", line 67 in __call__ File "/home/dje/src/cpython/Lib/unittest/runner.py", line 168 in run File "/home/dje/src/cpython/Lib/test/support.py", line 1566 in _run_suite File "/home/dje/src/cpython/Lib/test/support.py", line 1600 in run_unittest File "/home/dje/src/cpython/Lib/test/test_signal.py", line 873 in test_main File "/home/dje/src/cpython/Lib/test/regrtest.py", line 1307 in runtest_inner File "/home/dje/src/cpython/Lib/test/regrtest.py", line 1011 in runtest File "/home/dje/src/cpython/Lib/test/regrtest.py", line 798 in main File "/home/dje/src/cpython/Lib/test/regrtest.py", line 1592 in main_in_temp_cwd File "/home/dje/src/cpython/Lib/test/__main__.py", line 3 in File "/home/dje/src/cpython/Lib/runpy.py", line 73 in _run_code File "/home/dje/src/cpython/Lib/runpy.py", line 160 in _run_module_as_main ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:54:02 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 17 Jun 2013 18:54:02 +0000 Subject: [issue17121] SSH upload for distutils In-Reply-To: <1359972222.78.0.301395503133.issue17121@psf.upfronthosting.co.za> Message-ID: <1371495242.16.0.364444312612.issue17121@psf.upfronthosting.co.za> ?ric Araujo added the comment: SSH upload is an acceptable new feature for Python 3.4, if it can be done without breaking compat or changing too many internals. (The distutils feature freeze was effectively lifted at PyCon; Nick Coghlan also has a PEP in the plans to discuss how to update distutils for new packaging standards.) ---------- type: security -> enhancement versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 20:59:16 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Mon, 17 Jun 2013 18:59:16 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning In-Reply-To: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> Message-ID: <1371495556.48.0.161518301299.issue18242@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:04:32 2013 From: report at bugs.python.org (Aaron Oakley) Date: Mon, 17 Jun 2013 19:04:32 +0000 Subject: [issue17902] Document that _elementtree C API cannot use custom TreeBuilder for iterparse or IncrementalParser In-Reply-To: <1367614578.64.0.34953241054.issue17902@psf.upfronthosting.co.za> Message-ID: <1371495872.85.0.585056421771.issue17902@psf.upfronthosting.co.za> Aaron Oakley added the comment: So sorry, I just found the emails from the bug tracker in my spam folder. Anyhow, I've now signed the CLA. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:10:04 2013 From: report at bugs.python.org (David Edelsohn) Date: Mon, 17 Jun 2013 19:10:04 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <1371496204.92.0.329322684603.issue18238@psf.upfronthosting.co.za> David Edelsohn added the comment: By the way, if I manually override _has_poll to False, the same test fails similarly in _communicate_with_select, so the failure is not limited to the implementation of poll(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:10:26 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 17 Jun 2013 19:10:26 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1371496226.05.0.0999876723701.issue17206@psf.upfronthosting.co.za> Jeremy Kloth added the comment: Indeed, after debugging, it is a stack overflow caused by the introduction of the different temporary variables in the Py_XINCREF, Py_XDECREF, and Py_DECREF macros. I've attached an updated patch that reuses the _py_tmp variable for those temporary assignments thus keeping the required stack size down. ---------- nosy: +jkloth Added file: http://bugs.python.org/file30625/object.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:17:12 2013 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 17 Jun 2013 19:17:12 +0000 Subject: [issue18245] In itertools.groupby() make data plural In-Reply-To: <1371494005.37.0.121371971068.issue18245@psf.upfronthosting.co.za> Message-ID: <1371496632.3.0.543155398436.issue18245@psf.upfronthosting.co.za> Mark Dickinson added the comment: In any case, the patch only gives half of the correction. The corrected test would have to be "if *those* data are needed later" rather than "if that data are needed later". ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:18:22 2013 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 17 Jun 2013 19:18:22 +0000 Subject: [issue18245] In itertools.groupby() make data plural In-Reply-To: <1371494005.37.0.121371971068.issue18245@psf.upfronthosting.co.za> Message-ID: <1371496702.97.0.965157759909.issue18245@psf.upfronthosting.co.za> Mark Dickinson added the comment: Bah. s/test/text. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:22:43 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Mon, 17 Jun 2013 19:22:43 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1371496963.1.0.836519339228.issue18189@psf.upfronthosting.co.za> R. Jayakrishnan added the comment: The "from test.resource import requires" give me errors saying no module named resource in test (Am I missing anything?) For the moment I use "from test.support import requires" as in test_delegator1.patch ..... from test.support import requires requires('gui') class Test_delegator(unittest.TestCase): def setUp(self): ..... The results follows --------------------------- jaykrish at jaykrish-Vostro-1520:~/gsoc/cpy/cpython$ ./python -m test -ugui test_idle [1/1] test_idle 1 test OK. [189373 refs] -------------------------- jaykrish at jaykrish-Vostro-1520:~/gsoc/cpy/cpython$ ./python -m test test_idle [1/1] test_idle test test_idle failed -- Traceback (most recent call last): File "/home/jaykrish/gsoc/cpy/cpython/Lib/unittest/case.py", line 384, in _executeTestPart function() File "/home/jaykrish/gsoc/cpy/cpython/Lib/unittest/loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: idlelib.idle_test.test_delegator Traceback (most recent call last): File "/home/jaykrish/gsoc/cpy/cpython/Lib/unittest/loader.py", line 261, in _find_tests module = self._get_module_from_name(name) File "/home/jaykrish/gsoc/cpy/cpython/Lib/unittest/loader.py", line 239, in _get_module_from_name __import__(name) File "/home/jaykrish/gsoc/cpy/cpython/Lib/idlelib/idle_test/test_delegator.py", line 8, in requires('gui') File "/home/jaykrish/gsoc/cpy/cpython/Lib/test/support.py", line 390, in requires raise ResourceDenied(msg) test.support.ResourceDenied: Use of the 'gui' resource not enabled 1 test failed: test_idle [189233 refs] --------------------------- And yes, the teardown method using self.root.destroy() now. ---------- Added file: http://bugs.python.org/file30626/test_delegator1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:28:39 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Jun 2013 19:28:39 +0000 Subject: [issue18228] AIX locale parsing failure In-Reply-To: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> Message-ID: <3bZ2XQ4n8LzMK5@mail.python.org> Roundup Robot added the comment: New changeset 6cbd992d3411 by Victor Stinner in branch 'default': Issue #18228: Use locale.setlocale(name, None) instead of http://hg.python.org/cpython/rev/6cbd992d3411 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:29:51 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Mon, 17 Jun 2013 19:29:51 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1371497391.66.0.172664717418.issue18189@psf.upfronthosting.co.za> Changes by R. Jayakrishnan : Removed file: http://bugs.python.org/file30626/test_delegator1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:31:22 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Mon, 17 Jun 2013 19:31:22 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1371497482.05.0.690276308703.issue18189@psf.upfronthosting.co.za> Changes by R. Jayakrishnan : Added file: http://bugs.python.org/file30627/test_delegator1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 21:54:17 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Jun 2013 19:54:17 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <3bZ3604dgXz7Ljt@mail.python.org> Roundup Robot added the comment: New changeset a0e234e10da6 by Victor Stinner in branch '3.3': Issue #18238: Skip test_signal.test_sigwaitinfo_interrupted() on AIX http://hg.python.org/cpython/rev/a0e234e10da6 New changeset 8e277e6bd11b by Victor Stinner in branch 'default': (Merge 3.3) Issue #18238: Skip test_signal.test_sigwaitinfo_interrupted() on AIX http://hg.python.org/cpython/rev/8e277e6bd11b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:04:58 2013 From: report at bugs.python.org (Friedrich Spee von Langenfeld) Date: Mon, 17 Jun 2013 20:04:58 +0000 Subject: [issue18246] tkinter.Text() add a newline to the content - bug? Message-ID: <1371499498.11.0.831187493791.issue18246@psf.upfronthosting.co.za> New submission from Friedrich Spee von Langenfeld: Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> from tkinter import* >>> root = Tk() >>> text = Text() >>> text.pack() >>> text.insert(1.0, "Hello") >>> text.get(1.0, END) 'Hello\n' The tkinter.Text() widget add a newline (\n) to its content. Is this behavior a bug? ---------- components: Tkinter messages: 191370 nosy: Friedrich.Spee.von.Langenfeld priority: normal severity: normal status: open title: tkinter.Text() add a newline to the content - bug? versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:05:03 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 20:05:03 +0000 Subject: [issue18241] Add unique option to heapq functions In-Reply-To: <1371480242.24.0.0078060677529.issue18241@psf.upfronthosting.co.za> Message-ID: <1371499503.0.0.702836521951.issue18241@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: No, it's impossible without additional structure. And with a set it is trivial. def uniqueheappush(heap, inheap, item): if id(item) in inheap: return False heappush(heap, item) inheap.add(id(item)) return True def uniqueheappop(heap, inheap): item = heappop(heap, inheap) inheap.discard(id(item)) return item I recomend reject this issue. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:06:30 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 17 Jun 2013 20:06:30 +0000 Subject: [issue18241] Add unique option to heapq functions In-Reply-To: <1371499503.0.0.702836521951.issue18241@psf.upfronthosting.co.za> Message-ID: <1371499582.2612.5.camel@fsol> Antoine Pitrou added the comment: > No, it's impossible without additional structure. And with a set it is trivial. Yeah, I wanted to avoid the memory overhead of a set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:18:58 2013 From: report at bugs.python.org (=?utf-8?q?Jonas_Borgstr=C3=B6m?=) Date: Mon, 17 Jun 2013 20:18:58 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1371500338.85.0.0412253394961.issue18240@psf.upfronthosting.co.za> Changes by Jonas Borgstr?m : ---------- keywords: +patch Added file: http://bugs.python.org/file30628/hmac.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:22:39 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jun 2013 20:22:39 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1371500559.57.0.284893101507.issue18189@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Yes, 'support', not 'resource'. However, re-read my message for properly using requires to avoid the traceback. def setUpModule(): requires('gui') may also work, but I am assuming that there might be non-gui test cases added later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:24:23 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 20:24:23 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning In-Reply-To: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> Message-ID: <1371500662.99.0.656897008455.issue18242@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +kbk, roger.serwy, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:30:15 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 20:30:15 +0000 Subject: [issue18239] In itertools docstring update arguments in count() example In-Reply-To: <1371452665.1.0.633243797151.issue18239@psf.upfronthosting.co.za> Message-ID: <1371501015.31.0.965723386625.issue18239@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:35:11 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Jun 2013 20:35:11 +0000 Subject: [issue17238] IDLE: Enhance import statement completion In-Reply-To: <1361287971.25.0.643782901011.issue17238@psf.upfronthosting.co.za> Message-ID: <1371501311.07.0.596854562114.issue17238@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:37:03 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 17 Jun 2013 20:37:03 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1371501423.46.0.72000908482.issue18240@psf.upfronthosting.co.za> Christian Heimes added the comment: Thanks for your patch! Please add tests for the new feature. The documentation needs versionchanged tags, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 22:40:08 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jun 2013 20:40:08 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1371501608.72.0.606857491516.issue18189@psf.upfronthosting.co.za> Terry J. Reedy added the comment: As I discovered by experiment, unittest.SkipTest and subclasses are only handled properly inside of functions recognized and called by unittest. This could be better documented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 23:18:31 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 17 Jun 2013 21:18:31 +0000 Subject: [issue18014] Problem compiling on Windows, VC++Express 2010 In-Reply-To: <1368985995.62.0.842732310972.issue18014@psf.upfronthosting.co.za> Message-ID: <1371503911.65.0.174123542035.issue18014@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Windows 3.3 build still failed today. So I updated back to time it worked, and them skipped forward every so ofter to current, compiling each time, and it worked each time except for one problem that was fixed in the next commit. No problems with 3.4 currently, so closing. ---------- resolution: -> works for me status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 23:23:25 2013 From: report at bugs.python.org (Ezio Melotti) Date: Mon, 17 Jun 2013 21:23:25 +0000 Subject: [issue18014] Problem compiling on Windows, VC++Express 2010 In-Reply-To: <1368985995.62.0.842732310972.issue18014@psf.upfronthosting.co.za> Message-ID: <1371504205.62.0.785644605636.issue18014@psf.upfronthosting.co.za> Ezio Melotti added the comment: FYI "hg bisect" makes this kind of tests a lot easier. ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 23:48:35 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Jun 2013 21:48:35 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <3bZ5dt5TrJz7LjS@mail.python.org> Roundup Robot added the comment: New changeset e2ccfb096e6a by Brett Cannon in branch 'default': Issue #17222: fix a mix-up in some exception messages. http://hg.python.org/cpython/rev/e2ccfb096e6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 23:48:53 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 17 Jun 2013 21:48:53 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1371505733.03.0.691816695548.issue17222@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 17 23:54:20 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Mon, 17 Jun 2013 21:54:20 +0000 Subject: [issue17222] py_compile.compile() replaces target files, breaking special files and symlinks In-Reply-To: <1361136224.16.0.490340842207.issue17222@psf.upfronthosting.co.za> Message-ID: <1371506060.15.0.89024381504.issue17222@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- stage: -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 00:42:29 2013 From: report at bugs.python.org (Trent Nelson) Date: Mon, 17 Jun 2013 22:42:29 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1371508949.7.0.684625324064.issue13483@psf.upfronthosting.co.za> Changes by Trent Nelson : ---------- nosy: +trent _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 00:48:09 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jun 2013 22:48:09 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371509289.21.0.792196154183.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: Convert changeset 6661a8154eb3 into a patch: py_setallocators-6.patch. ---------- Added file: http://bugs.python.org/file30629/py_setallocators-6.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 00:48:26 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jun 2013 22:48:26 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371509306.42.0.989928541898.issue3329@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file29324/py_setallocators.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 00:48:28 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jun 2013 22:48:28 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371509308.32.0.0612164280139.issue3329@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file30453/py_setallocators-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 00:48:30 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jun 2013 22:48:30 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371509310.16.0.301555794941.issue3329@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file30538/py_setallocators-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 00:48:43 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jun 2013 22:48:43 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371509323.34.0.754024835113.issue3329@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file30564/py_setallocators-4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 00:48:45 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Jun 2013 22:48:45 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371509325.45.0.606341853883.issue3329@psf.upfronthosting.co.za> Changes by STINNER Victor : Removed file: http://bugs.python.org/file30575/py_setallocators-5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 01:41:45 2013 From: report at bugs.python.org (py.user) Date: Mon, 17 Jun 2013 23:41:45 +0000 Subject: [issue18247] Add Lib/test/data/ to .gitignore Message-ID: <1371512505.36.0.839773102972.issue18247@psf.upfronthosting.co.za> New submission from py.user: have a git repository: http://docs.python.org/devguide/faq.html#i-already-know-how-to-use-git-can-i-use-that-instead git clone git://github.com/akheron/cpython after running tests by "make test" they created some files in "Lib/test/data/" [guest at localhost cpython]$ git st # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: Doc/library/itertools.rst # # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # # modified: Modules/itertoolsmodule.c # # Untracked files: # (use "git add ..." to include in what will be committed) # # Lib/test/data/BIG5.TXT # Lib/test/data/BIG5HKSCS-2004.TXT # Lib/test/data/CP932.TXT # Lib/test/data/CP936.TXT # Lib/test/data/CP949.TXT # Lib/test/data/CP950.TXT # Lib/test/data/EUC-CN.TXT # Lib/test/data/EUC-JISX0213.TXT # Lib/test/data/EUC-JP.TXT # Lib/test/data/EUC-KR.TXT # Lib/test/data/JOHAB.TXT # Lib/test/data/NamedSequences.txt # Lib/test/data/NormalizationTest.txt # Lib/test/data/SHIFTJIS.TXT # Lib/test/data/SHIFT_JISX0213.TXT # Lib/test/data/gb-18030-2000.xml [guest at localhost cpython]$ ---------- components: Build, Devguide messages: 191380 nosy: ezio.melotti, py.user priority: normal severity: normal status: open title: Add Lib/test/data/ to .gitignore type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 02:20:24 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 00:20:24 +0000 Subject: [issue18248] fficonfig.py.in wrong for AIX Message-ID: <1371514824.57.0.542380875815.issue18248@psf.upfronthosting.co.za> New submission from David Edelsohn: fficonfig.py.in incorrectly mixes source files intended for Linux with source files intended for AIX, causing a build failure. AIX uses ffi_darwin.c not ffi.c diff -r f6f70f1ab124 Modules/_ctypes/libffi.diff --- a/Modules/_ctypes/libffi.diff Mon Jun 17 22:02:14 2013 +0200 +++ b/Modules/_ctypes/libffi.diff Mon Jun 17 22:18:44 2013 -0700 @@ -135,7 +135,7 @@ + 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'], + 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'], + 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], -+ 'POWERPC_AIX': ['src/powerpc/ffi.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], ++ 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], + 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'], + 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'], + 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'], diff -r f6f70f1ab124 Modules/_ctypes/libffi/fficonfig.py.in --- a/Modules/_ctypes/libffi/fficonfig.py.in Mon Jun 17 22:02:14 2013 +0200 +++ b/Modules/_ctypes/libffi/fficonfig.py.in Mon Jun 17 22:18:44 2013 -0700 @@ -16,7 +16,7 @@ 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'], 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'], 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], - 'POWERPC_AIX': ['src/powerpc/ffi.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], + 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'], 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'], 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'], ---------- components: Extension Modules messages: 191381 nosy: David.Edelsohn priority: normal severity: normal status: open title: fficonfig.py.in wrong for AIX type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 02:21:47 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jun 2013 00:21:47 +0000 Subject: [issue18248] fficonfig.py.in wrong for AIX In-Reply-To: <1371514824.57.0.542380875815.issue18248@psf.upfronthosting.co.za> Message-ID: <1371514907.95.0.0349983046533.issue18248@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 02:55:10 2013 From: report at bugs.python.org (Dave Angel) Date: Tue, 18 Jun 2013 00:55:10 +0000 Subject: [issue18249] Incorrect and incomplete help docs for close() method Message-ID: <1371516910.55.0.109427807192.issue18249@psf.upfronthosting.co.za> New submission from Dave Angel: Python 3.3.0 (default, Mar 7 2013, 00:24:38) [GCC 4.6.3] on linux q = open('/dev/null') help(q.close) the entire output is: ------------------------------- Help on built-in function close: close(...) (END) ------------------------------- But close() is NOT a built-in, it's a method. (In Python 2.7.* the output is: ------------------------------- Help on built-in function close: close(...) close() -> None or (perhaps) an integer. Close the file. Sets data attribute .closed to True. A closed file cannot be used for further I/O operations. close() may be called more than once without error. Some kinds of file objects (for example, opened by popen()) may return an exit status upon closing. (END) ------------------------------- which is only partially wrong. ---------- assignee: docs at python components: Documentation messages: 191382 nosy: DaveA, docs at python priority: normal severity: normal status: open title: Incorrect and incomplete help docs for close() method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 03:09:13 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 18 Jun 2013 01:09:13 +0000 Subject: [issue18249] Incorrect and incomplete help docs for close() method In-Reply-To: <1371516910.55.0.109427807192.issue18249@psf.upfronthosting.co.za> Message-ID: <1371517753.74.0.0500629604228.issue18249@psf.upfronthosting.co.za> Christian Heimes added the comment: In fact it is a built-in method without a doc string: >>> f = open("/dev/null") >>> f.close >>> f.close.__doc__ All functions and methods that are implemented in C are referred to as built-in functions. It's an implementation detail. ---------- nosy: +christian.heimes priority: normal -> low type: -> behavior versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 03:16:44 2013 From: report at bugs.python.org (py.user) Date: Tue, 18 Jun 2013 01:16:44 +0000 Subject: [issue18250] In itertools.repeat() object shadows object() Message-ID: <1371518204.34.0.993952678875.issue18250@psf.upfronthosting.co.za> New submission from py.user: >>> object >>> ---------- assignee: docs at python components: Documentation files: issue.diff keywords: patch messages: 191384 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools.repeat() object shadows object() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30630/issue.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 03:26:22 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 01:26:22 +0000 Subject: [issue18235] _sysconfigdata.py wrong on AIX installations In-Reply-To: <1371429201.94.0.372851990361.issue18235@psf.upfronthosting.co.za> Message-ID: <1371518782.51.0.711201927301.issue18235@psf.upfronthosting.co.za> David Edelsohn added the comment: This is the cause of the failures in test_distutils. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 04:00:32 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Jun 2013 02:00:32 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1371520832.86.0.0749084470601.issue18162@psf.upfronthosting.co.za> Raymond Hettinger added the comment: -1 on expanding the API for an attribute that is sometimes there and sometimes not. This doesn't add any value, but it does add complication. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 04:17:30 2013 From: report at bugs.python.org (Phil Webster) Date: Tue, 18 Jun 2013 02:17:30 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371521850.51.0.459331879366.issue18103@psf.upfronthosting.co.za> Changes by Phil Webster : ---------- nosy: +philwebster _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 04:26:04 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Tue, 18 Jun 2013 02:26:04 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1371522364.55.0.867766347253.issue18189@psf.upfronthosting.co.za> Changes by R. Jayakrishnan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 05:09:09 2013 From: report at bugs.python.org (Zachary Ware) Date: Tue, 18 Jun 2013 03:09:09 +0000 Subject: [issue17767] Fix test discovery for test_locale.py In-Reply-To: <1366141872.94.0.252098297991.issue17767@psf.upfronthosting.co.za> Message-ID: <1371524949.52.0.301839919789.issue17767@psf.upfronthosting.co.za> Zachary Ware added the comment: Looking at this one again, I missed removing the run_unittest import. Here's a new patch. ---------- Added file: http://bugs.python.org/file30631/test_locale_discovery.v2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 08:43:53 2013 From: report at bugs.python.org (Martin Panter) Date: Tue, 18 Jun 2013 06:43:53 +0000 Subject: [issue16901] In http.cookiejar.FileCookieJar() the .load() and .revert() methods don't work In-Reply-To: <1357688221.9.0.622857187739.issue16901@psf.upfronthosting.co.za> Message-ID: <1371537832.99.0.38339407736.issue16901@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 08:47:41 2013 From: report at bugs.python.org (Martin Panter) Date: Tue, 18 Jun 2013 06:47:41 +0000 Subject: [issue9740] Support for HTTP 1.1 persistent connections throughout the standard library In-Reply-To: <1283428611.84.0.131704513964.issue9740@psf.upfronthosting.co.za> Message-ID: <1371538061.82.0.360737374009.issue9740@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 09:39:48 2013 From: report at bugs.python.org (Jian Wen) Date: Tue, 18 Jun 2013 07:39:48 +0000 Subject: [issue14000] Subprocess stdin.flush does not flush In-Reply-To: <1329126849.72.0.845817080547.issue14000@psf.upfronthosting.co.za> Message-ID: <1371541188.41.0.983990409142.issue14000@psf.upfronthosting.co.za> Jian Wen added the comment: The following code shows how to use pts. #!/usr/bin/env python import os import pty import shlex import time _args = "/usr/bin/ssh example.com" args = shlex.split(_args) pid, child_fd = pty.fork() if pid == 0: # Child os.execv("/usr/bin/ssh", args) else: # Parent while True: os.write(child_fd, '# keep alive\n') os.read(child_fd, 1024) time.sleep(2) ---------- nosy: +Jian.Wen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 09:46:10 2013 From: report at bugs.python.org (Sowmya) Date: Tue, 18 Jun 2013 07:46:10 +0000 Subject: [issue18251] test_subprocess_jy fails when Argument has embedded quote Message-ID: <1371541570.75.0.3271595345.issue18251@psf.upfronthosting.co.za> New submission from Sowmya: test_subprocess_jy fails with below error: test test_subprocess_jy failed -- Traceback (most recent call last): File \'L:\\apps\\ascii\\jython\\70files\\current\\win\\Lib\\test\\test_subprocess_jy.py\', line 13, in testDefaultEnvIsInherited p1 = Popen([sys.executable, \'-c\', File \'L:\\apps\\ascii\\jython\\70files\\current\\win\\Lib\\subprocess.py\', line 755, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File \'L:\\apps\\ascii\\jython\\70files\\current\\win\\Lib\\subprocess.py\', line 1269, in _execute_child raise OSError(e.getMessage() or e) OSError: Argument has embedded quote, use the explicit CMD.EXE call. Solution : This testcase needs to be changed to suit the changes mentioned in Oracle 7u21 - (http://www.oracle.com/technetwork/java/javase/7u21-relnotes-1932873.html#jruntime). Python code needs to be modified to use "Cmd.exe" while running commands that contains quotes in it ---------- files: test_subclasses_jy.py messages: 191389 nosy: sowmyalakkappa priority: normal severity: normal status: open title: test_subprocess_jy fails when Argument has embedded quote type: enhancement versions: Python 2.6 Added file: http://bugs.python.org/file30632/test_subclasses_jy.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 11:25:07 2013 From: report at bugs.python.org (icedream91) Date: Tue, 18 Jun 2013 09:25:07 +0000 Subject: [issue18252] timeit makes code run faster? Message-ID: <1371547507.86.0.372750088046.issue18252@psf.upfronthosting.co.za> New submission from icedream91: I used Python 3.3.2 to try this problem: http://projecteuler.net/problem=23 , and I got a correct answer. When I wanted to check how long it took, I found something strange: When I ran 23.py directly, it showed that it took about 13s. But if I use timeit module, it showed that it only took about 9s! I have tried these for some times, in both Ubuntu 12.10 and Windows 8, I don't understand why timeit will make the same code run faster. Thanks. ---------- components: Benchmarks files: 23.py messages: 191390 nosy: icedream91 priority: normal severity: normal status: open title: timeit makes code run faster? versions: Python 3.3 Added file: http://bugs.python.org/file30633/23.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 11:38:06 2013 From: report at bugs.python.org (icedream91) Date: Tue, 18 Jun 2013 09:38:06 +0000 Subject: [issue18252] timeit makes code run faster? In-Reply-To: <1371547507.86.0.372750088046.issue18252@psf.upfronthosting.co.za> Message-ID: <1371548286.8.0.557698569843.issue18252@psf.upfronthosting.co.za> Changes by icedream91 : Removed file: http://bugs.python.org/file30633/23.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 11:41:24 2013 From: report at bugs.python.org (icedream91) Date: Tue, 18 Jun 2013 09:41:24 +0000 Subject: [issue18252] timeit makes code run faster? In-Reply-To: <1371547507.86.0.372750088046.issue18252@psf.upfronthosting.co.za> Message-ID: <1371548484.24.0.664653154521.issue18252@psf.upfronthosting.co.za> icedream91 added the comment: I used Python 3.3.2 to try this problem: http://projecteuler.net/problem=23 , and I got a correct answer. When I wanted to check how long it took, I found something strange: When I ran 23.py directly, it showed that it took about 13s. But if I use timeit module, it showed that it only took about 9s! I have tried these for some times, in both Ubuntu 12.10 and Windows 8, I don't understand why timeit will make the same code run faster. Thanks. ---------- Added file: http://bugs.python.org/file30634/23.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 11:53:11 2013 From: report at bugs.python.org (Friedrich Spee von Langenfeld) Date: Tue, 18 Jun 2013 09:53:11 +0000 Subject: [issue18253] make standard library PEP8 compliant Message-ID: <1371549191.92.0.460978933788.issue18253@psf.upfronthosting.co.za> New submission from Friedrich Spee von Langenfeld: The modules in the standard library aren?t PEP( compliant. I?ve written a script to change this. It uses autopep8.py (must be in the path) and is written for Windows users. ---------- components: Library (Lib) files: autopepframework.py messages: 191392 nosy: Friedrich.Spee.von.Langenfeld priority: normal severity: normal status: open title: make standard library PEP8 compliant type: enhancement Added file: http://bugs.python.org/file30635/autopepframework.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 12:07:02 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Tue, 18 Jun 2013 10:07:02 +0000 Subject: [issue18252] timeit makes code run faster? In-Reply-To: <1371547507.86.0.372750088046.issue18252@psf.upfronthosting.co.za> Message-ID: <1371550022.96.0.181074153803.issue18252@psf.upfronthosting.co.za> Richard Oudkerk added the comment: I think if you use timeit then the code is wrapped inside a function before it is compiled. This means that your code can mostly use faster local lookups rather than global lookups. ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 12:21:45 2013 From: report at bugs.python.org (Archard Lias) Date: Tue, 18 Jun 2013 10:21:45 +0000 Subject: [issue18254] Accessing attr dict at definition time of a class from a metaclass results in changed type. Message-ID: <1371550905.79.0.414140838637.issue18254@psf.upfronthosting.co.za> New submission from Archard Lias: Accessing (just iterating or accessing in any way) the dict_proxy to the attribute dictionary in the `MessageMeta` metaclass, results in a change of "type" in any metaclass inheriting class definitions. Reproducible in CPython versions (tested so far): 3.2.2 3.2.3 Works as of, or at least behaves as I subjectively intended to use it (only version tested) 3.3.2 ---------- components: Interpreter Core files: bugreport_cpython3.2.3.py messages: 191394 nosy: archardlias priority: normal severity: normal status: open title: Accessing attr dict at definition time of a class from a metaclass results in changed type. versions: Python 3.2 Added file: http://bugs.python.org/file30636/bugreport_cpython3.2.3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 12:49:30 2013 From: report at bugs.python.org (=?utf-8?q?Jonas_Borgstr=C3=B6m?=) Date: Tue, 18 Jun 2013 10:49:30 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1371552570.19.0.657209569764.issue18240@psf.upfronthosting.co.za> Jonas Borgstr?m added the comment: Patch updated to include tests and versionchanged tags ---------- Added file: http://bugs.python.org/file30637/hmac2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 13:40:04 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 18 Jun 2013 11:40:04 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1371555604.17.0.836543735582.issue18240@psf.upfronthosting.co.za> Christian Heimes added the comment: Thanks for your update. As far as I can tell you haven't signed our contributor agreement yet. Can you please do so? http://www.python.org/psf/contrib/ http://www.python.org/psf/contrib/contrib-form/ ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 13:42:25 2013 From: report at bugs.python.org (icedream91) Date: Tue, 18 Jun 2013 11:42:25 +0000 Subject: [issue18252] timeit makes code run faster? In-Reply-To: <1371547507.86.0.372750088046.issue18252@psf.upfronthosting.co.za> Message-ID: <1371555745.34.0.842197445159.issue18252@psf.upfronthosting.co.za> icedream91 added the comment: I did some tests, Richard Oudkerk (sbt) is right. Thanks a lot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 13:48:20 2013 From: report at bugs.python.org (=?utf-8?q?Jonas_Borgstr=C3=B6m?=) Date: Tue, 18 Jun 2013 11:48:20 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1371556100.35.0.894928635486.issue18240@psf.upfronthosting.co.za> Jonas Borgstr?m added the comment: Of course. I've now signed and filed the agreement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 13:53:43 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 18 Jun 2013 11:53:43 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1371556423.27.0.624832526785.issue18240@psf.upfronthosting.co.za> Christian Heimes added the comment: It may take a day or two until your signature makes it through red tape. I'll get back to you. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 14:19:08 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 18 Jun 2013 12:19:08 +0000 Subject: [issue18251] test_subprocess_jy fails when Argument has embedded quote In-Reply-To: <1371541570.75.0.3271595345.issue18251@psf.upfronthosting.co.za> Message-ID: <1371557948.03.0.402413384911.issue18251@psf.upfronthosting.co.za> R. David Murray added the comment: It looks like this bug belongs on the jython tracker at bugs.jython.org. (By the way, it isn't clear if the problem is in the jython code or the test; the stdlib Popen works as expected on Windows.) ---------- nosy: +r.david.murray resolution: -> invalid stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 14:22:50 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 18 Jun 2013 12:22:50 +0000 Subject: [issue18252] timeit makes code run faster? In-Reply-To: <1371547507.86.0.372750088046.issue18252@psf.upfronthosting.co.za> Message-ID: <1371558170.09.0.826966357441.issue18252@psf.upfronthosting.co.za> R. David Murray added the comment: By the way, this kind of question is more suited to the python-list mailing list (where you will in the general case get a faster answer anyway :) ---------- nosy: +r.david.murray stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 14:26:00 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 18 Jun 2013 12:26:00 +0000 Subject: [issue18253] make standard library PEP8 compliant In-Reply-To: <1371549191.92.0.460978933788.issue18253@psf.upfronthosting.co.za> Message-ID: <1371558360.78.0.852315564519.issue18253@psf.upfronthosting.co.za> R. David Murray added the comment: Sorry, but this is not the kind of change that we make to the codebase. It has too many unintended consequences. (Large portions of the stdlib pre-date PEP8, and thus are not PEP8 compliant.) We fix some thing when we modify the code involved, but other things (such as API names) will at this point never get fixed, sad to say. ---------- nosy: +r.david.murray resolution: -> rejected stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 14:38:02 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 18 Jun 2013 12:38:02 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1371559082.13.0.471699261831.issue18162@psf.upfronthosting.co.za> Brett Cannon added the comment: Do you mean "sometimes there sometimes not" because old code won't set it (yet) or because you don't think it will always be appropriate to set the attribute and thus people won't set it when available? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 14:47:39 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Jun 2013 12:47:39 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem In-Reply-To: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> Message-ID: <1371559659.18.0.942285846864.issue18211@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Is "-Werror=statement-after-declaration" the right solution anyway? This errors out on just one of the incompatibilities between C89 and C99, although it is one that is easy to get wrong accidentally. Gcc (and clang) also support '-std=c89' that forces the compiler to support only that standard. Not that switching to that flag would get us closer to closing this issue :-) BTW. To make things more fun: both sysconfig and distutils.sysconfig contain code to parse the Makefile, and those two sets of code are not equivalent (distutils.sysconfig lets you override values using the environment, sysconfig does not). The attached crude hack fixes this particular issue, but I'm far from convinced that is is the right solution for two reasons: first of all it is a hack, second of all it drops the -Werror flag when building CPython's extensions. A better solution would be the introduction of a new variable in the Makefile that contains those CFLAGS that should only be used during the build of Python itself, all those flags can then be ignored by the Makefile parsers in distutils.sysconfig and sysconfig. The disadvantage is that is introduces even more complexity in the Makefile. ---------- Added file: http://bugs.python.org/file30638/issue18211-hack.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 14:59:32 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Tue, 18 Jun 2013 12:59:32 +0000 Subject: [issue18252] timeit makes code run faster? In-Reply-To: <1371547507.86.0.372750088046.issue18252@psf.upfronthosting.co.za> Message-ID: <1371560372.88.0.143436954256.issue18252@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- stage: committed/rejected -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 15:06:55 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Tue, 18 Jun 2013 13:06:55 +0000 Subject: [issue18252] timeit makes code run faster? In-Reply-To: <1371547507.86.0.372750088046.issue18252@psf.upfronthosting.co.za> Message-ID: <1371560815.29.0.928810151839.issue18252@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- stage: -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 15:08:03 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Jun 2013 13:08:03 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem In-Reply-To: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> Message-ID: <1371560883.46.0.497913332253.issue18211@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I had a patch that only changed distutils.sysconfig.get_config_var('CFLAGS') when not building python, but then noticed that this doesn't work: the setup.py file for stdlib extensions fetches information from the toplevel sysconfig file, not distutils.sysconfig and uses that to override some information (look for "make CC=altcc"). There are two problems there, for which I'll file separate issues: 1) setup.py shouldn't use sysconfig but distutils.sysconfig 2) the block of code that I mentioned earlier is not necessary at all, the comment is plain wrong (tested by removing the compiler update and running 'make CC=no-such-file') V2 of the hack triggers the change of BASECFLAGS only when not building the stdlib, but that doesn't work right now because of the issues mentioned earlier. ---------- Added file: http://bugs.python.org/file30639/issue18211-hack-v2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 15:13:06 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Jun 2013 13:13:06 +0000 Subject: [issue18255] CPython setup.py problems Message-ID: <1371561186.46.0.280107378589.issue18255@psf.upfronthosting.co.za> New submission from Ronald Oussoren: While working on a fix for #18211 I noticed two problems with the setup.py that's used to build the stdlib extensions. 1) setup.py uses sysconfig instead of distutils.sysconfig. The sematics of the two modules a slighty different. 2) The block of code starting with the this text is not necessary because distutils.sysconfig (which is used by the build_ext command) already does the right thing for environment variables: # When you run "make CC=altcc" or something similar, you really want # those environment variables passed into the setup.py phase. Here's # a small set of useful ones. ---------- components: Build files: setup-update.txt messages: 191406 nosy: ronaldoussoren priority: normal severity: normal stage: patch review status: open title: CPython setup.py problems type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30640/setup-update.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 15:13:54 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Jun 2013 13:13:54 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem In-Reply-To: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> Message-ID: <1371561234.49.0.837491527881.issue18211@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The setup.py issues are in #18255. ---------- dependencies: +CPython setup.py problems _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 15:47:20 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 18 Jun 2013 13:47:20 +0000 Subject: [issue18162] Add index attribute to IndexError In-Reply-To: <1370638259.99.0.240698145167.issue18162@psf.upfronthosting.co.za> Message-ID: <1371563240.65.0.807683099553.issue18162@psf.upfronthosting.co.za> R. David Murray added the comment: I am in favor of adding meaningful attributes to stdlib exceptions. I've always considered the lack of such an API a wart in Python, though an understandable one (since exceptions started out as simple strings). But yeah, while I hate to say it, this is probably mini-PEP material :(. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 15:52:46 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 18 Jun 2013 13:52:46 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() In-Reply-To: <1370397033.84.0.295479011719.issue18138@psf.upfronthosting.co.za> Message-ID: <1371563566.88.0.884029209542.issue18138@psf.upfronthosting.co.za> Christian Heimes added the comment: Here is a simplified version of the C function. It uses y* or es# "ascii" to parse the argument. The check for trailing data ensures that the user gets an error message if she tries to load a PEM string with multiple certs. She might expect that add_ca_cert(pem) loads all PEM certs from the string while in fact PEM_read_bio_X509() only loads the first cert. The new patch make the check optional. I still need to find a good name for the option, though... ---------- Added file: http://bugs.python.org/file30641/sslctx_add_cert4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 15:58:41 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 13:58:41 +0000 Subject: [issue18256] thread_pthread.h fixes for AIX Message-ID: <1371563921.33.0.845649909744.issue18256@psf.upfronthosting.co.za> New submission from David Edelsohn: Recent releases of AIX do not need to call pthread_init(). The function is provided in libpthread.a for backward compatibility, but not declared in any header. This patch adds a declaration, or it can be removed completely because AIX 4.x no longer is supported. The patch also adds uses of "error" to two functions to silence warnings, in a similar manner to other functions in the file. diff -r f6f70f1ab124 Python/thread_pthread.h --- a/Python/thread_pthread.h Mon Jun 17 22:02:14 2013 +0200 +++ b/Python/thread_pthread.h Tue Jun 18 11:54:50 2013 -0700 @@ -170,6 +170,7 @@ PyThread__init_thread(void) { #if defined(_AIX) && defined(__GNUC__) + extern void pthread_init(void); pthread_init(); #endif } @@ -444,6 +445,7 @@ pthread_lock *thelock = (pthread_lock *)lock; int status, error = 0; + (void) error; /* silence unused-but-set-variable warning */ dprintf(("PyThread_free_lock(%p) called\n", lock)); /* some pthread-like implementations tie the mutex to the cond @@ -530,6 +532,7 @@ pthread_lock *thelock = (pthread_lock *)lock; int status, error = 0; + (void) error; /* silence unused-but-set-variable warning */ dprintf(("PyThread_release_lock(%p) called\n", lock)); status = pthread_mutex_lock( &thelock->mut ); ---------- components: Build messages: 191410 nosy: David.Edelsohn priority: normal severity: normal status: open title: thread_pthread.h fixes for AIX type: compile error versions: Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 15:59:04 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 18 Jun 2013 13:59:04 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() In-Reply-To: <1371563566.88.0.884029209542.issue18138@psf.upfronthosting.co.za> Message-ID: <1059316149.95369608.1371563933030.JavaMail.root@zimbra10-e2.priv.proxad.net> Antoine Pitrou added the comment: > The check for trailing data ensures that the user gets an error > message if she tries to load a PEM string with multiple certs. She > might expect that add_ca_cert(pem) loads all PEM certs from the > string while in fact PEM_read_bio_X509() only loads the first cert. I don't think it is useful. Just make the behaviour well-documented. (there is no security risk in loading too few CA certs) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 16:07:26 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 18 Jun 2013 14:07:26 +0000 Subject: [issue18255] CPython setup.py problems In-Reply-To: <1371561186.46.0.280107378589.issue18255@psf.upfronthosting.co.za> Message-ID: <1371564446.5.0.416096325245.issue18255@psf.upfronthosting.co.za> Changes by Jeremy Kloth : ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 16:10:37 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 14:10:37 +0000 Subject: [issue18228] AIX locale parsing failure In-Reply-To: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> Message-ID: <1371564637.13.0.110743480192.issue18228@psf.upfronthosting.co.za> Changes by David Edelsohn : ---------- versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 16:11:14 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 14:11:14 +0000 Subject: [issue18228] AIX locale parsing failure In-Reply-To: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> Message-ID: <1371564674.86.0.586532587238.issue18228@psf.upfronthosting.co.za> Changes by David Edelsohn : ---------- versions: -Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 16:11:45 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 14:11:45 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <1371564705.15.0.891904733636.issue18238@psf.upfronthosting.co.za> Changes by David Edelsohn : ---------- versions: +Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 16:12:07 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 14:12:07 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <1371564727.48.0.53074466758.issue18238@psf.upfronthosting.co.za> David Edelsohn added the comment: This needs to be backported to Python 2.7 as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 16:16:44 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jun 2013 14:16:44 +0000 Subject: [issue18238] test_signal.py wait_helper hangs on AIX In-Reply-To: <1371435157.92.0.303179116379.issue18238@psf.upfronthosting.co.za> Message-ID: <1371565004.68.0.471812256455.issue18238@psf.upfronthosting.co.za> STINNER Victor added the comment: > This needs to be backported to Python 2.7 as well. signal.sigwaitinfo() was added to Python 3.3 (and doesn't exist in Python 2). ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 16:49:10 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Jun 2013 14:49:10 +0000 Subject: [issue18255] CPython setup.py problems In-Reply-To: <1371561186.46.0.280107378589.issue18255@psf.upfronthosting.co.za> Message-ID: <1371566950.94.0.270257061574.issue18255@psf.upfronthosting.co.za> Ronald Oussoren added the comment: So much for obviously correct changes... 1) fix typo in import statement (from sysconfig import import ...) 2) setup.py uses sysconfig.get_path and that's not present in distutils.sysconfig. (Sigh..., why are there two modules with almost but not entirely equal functionality and APIs?) ---------- Added file: http://bugs.python.org/file30642/setup-update-v2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 17:04:16 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Jun 2013 15:04:16 +0000 Subject: [issue18211] -Werror=statement-after-declaration problem In-Reply-To: <1371210635.81.0.102822533543.issue18211@psf.upfronthosting.co.za> Message-ID: <1371567856.75.0.0291563254252.issue18211@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I just noticed the patch is not good enough: "python-config --cflags" still prints the -Werror flag because it is now a shell script and doesn't use sysconfig data at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 17:04:32 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Jun 2013 15:04:32 +0000 Subject: [issue18257] Two copies of python-config Message-ID: <1371567872.42.0.116049773773.issue18257@psf.upfronthosting.co.za> New submission from Ronald Oussoren: Changeset c0370730b364 introduced a shell-script implementation of python-config (see issue #16235). The older python implementation is still present in $(srcdir)/Misc and generated by Makefile.pre.in. ---------- messages: 191416 nosy: doko, ronaldoussoren priority: normal severity: normal stage: needs patch status: open title: Two copies of python-config type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 17:21:53 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Jun 2013 15:21:53 +0000 Subject: [issue18257] Two copies of python-config In-Reply-To: <1371567872.42.0.116049773773.issue18257@psf.upfronthosting.co.za> Message-ID: <1371568913.36.0.71529286027.issue18257@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Also, the shell-script version of python-config uses the -f option of readlink and that option is not supported on OSX 10.8 (or older versions, I haven't looked at the 10.9 beta yet) Furthermore the entire readlink command is not present in HP-UX (and possibly other "enterpricy" unix flavors) ---------- components: +Demos and Tools _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 17:57:28 2013 From: report at bugs.python.org (alef) Date: Tue, 18 Jun 2013 15:57:28 +0000 Subject: [issue11192] test_socket error on AIX In-Reply-To: <1297436751.32.0.492226695457.issue11192@psf.upfronthosting.co.za> Message-ID: <1371571048.72.0.263504576257.issue11192@psf.upfronthosting.co.za> alef added the comment: Same error with Python 2.7.3 on AIX 6.1 ---------- versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 18:00:53 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 16:00:53 +0000 Subject: [issue11192] test_socket error on AIX In-Reply-To: <1297436751.32.0.492226695457.issue11192@psf.upfronthosting.co.za> Message-ID: <1371571253.91.0.0610069463398.issue11192@psf.upfronthosting.co.za> Changes by David Edelsohn : ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 19:30:00 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 18 Jun 2013 17:30:00 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() In-Reply-To: <1370397033.84.0.295479011719.issue18138@psf.upfronthosting.co.za> Message-ID: <1371576600.34.0.212060664957.issue18138@psf.upfronthosting.co.za> Christian Heimes added the comment: I'm pondering about the error case "cert already in hash table". There should be a way to distinguish the error from other errors. I see three ways to handle the case: 1) introduce SSLCertInStoreError exeption 2) ignore the error and do nothing 3) ignore the error and return True if a cert was added or False if the cert is already in the store I like 3). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 19:35:48 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 18 Jun 2013 17:35:48 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() In-Reply-To: <1371576600.34.0.212060664957.issue18138@psf.upfronthosting.co.za> Message-ID: <1371576940.3834.1.camel@fsol> Antoine Pitrou added the comment: Le mardi 18 juin 2013 ? 17:30 +0000, Christian Heimes a ?crit : > Christian Heimes added the comment: > > I'm pondering about the error case "cert already in hash table". There > should be a way to distinguish the error from other errors. I don't know if you've seen it, but SSLError has "library" and "reason" attributes (they are little known). See SSLErrorTests. > I see three ways to handle the case: > > 1) introduce SSLCertInStoreError exeption > 2) ignore the error and do nothing > 3) ignore the error and return True if a cert was added or False if > the cert is already in the store > > I like 3). Yes, sounds reasonable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 19:40:56 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 18 Jun 2013 17:40:56 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() In-Reply-To: <1370397033.84.0.295479011719.issue18138@psf.upfronthosting.co.za> Message-ID: <1371577256.55.0.0764836562591.issue18138@psf.upfronthosting.co.za> Christian Heimes added the comment: Yes, I have seen them. In fact OpenSSL has library, function and reason. if ((ERR_GET_LIB(errcode) == ERR_LIB_X509) && (ERR_GET_REASON(errcode) == X509_R_CERT_ALREADY_IN_HASH_TABLE)) {} I'm going for 3) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 19:56:16 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 18 Jun 2013 17:56:16 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() In-Reply-To: <1370397033.84.0.295479011719.issue18138@psf.upfronthosting.co.za> Message-ID: <1371578176.55.0.685004125421.issue18138@psf.upfronthosting.co.za> Changes by Christian Heimes : Added file: http://bugs.python.org/file30643/sslctx_add_cert5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 20:00:31 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 18 Jun 2013 18:00:31 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371578431.23.0.235240366741.issue17177@psf.upfronthosting.co.za> Brett Cannon added the comment: Going to temporarily re-open to remind me to add better deprecation docs for imp.load_module() to point to specific loader in importlib.machinery. Should also add example usage as well. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 20:27:08 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 18 Jun 2013 18:27:08 +0000 Subject: [issue17883] Fix buildbot testing of Tkinter In-Reply-To: <1367355915.98.0.26398929673.issue17883@psf.upfronthosting.co.za> Message-ID: <1371580028.44.0.0861209076961.issue17883@psf.upfronthosting.co.za> Jeremy Kloth added the comment: It seems that the changes committed by Ezio are causing the AMD64 Windows buildbot to hang in test_ttk_guionly. A note that this buildbot is running as a service so no desktop is available. The same test however is working (skipped successfully) on the 3.3 branch, if that helps. ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 20:47:19 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 18 Jun 2013 18:47:19 +0000 Subject: [issue15795] Zipfile.extractall does not preserve file permissions In-Reply-To: <1346106964.12.0.723201722432.issue15795@psf.upfronthosting.co.za> Message-ID: <1371581239.24.0.31571114173.issue15795@psf.upfronthosting.co.za> Changes by anatoly techtonik : ---------- nosy: +techtonik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 20:49:36 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 18 Jun 2013 18:49:36 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371581376.68.0.398925930138.issue18244@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Hello, Edward. First of all, thank you for correctly pointing out the problem. We'll integrate your patch but first I'd like to have a unit test that specifically shows why the secondonary `for` loop you introduced is necessary. Currently if we change this: for index, base in enumerate(mro[i + 1:], i + 1): if not issubclass(base, needle): break to this: index = i + 1 the tests still pass. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 20:54:31 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 18 Jun 2013 18:54:31 +0000 Subject: [issue15795] Zipfile.extractall does not preserve file permissions In-Reply-To: <1346106964.12.0.723201722432.issue15795@psf.upfronthosting.co.za> Message-ID: <1371581671.71.0.980498870595.issue15795@psf.upfronthosting.co.za> anatoly techtonik added the comment: There should be an easy way to restore file attributes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 20:57:17 2013 From: report at bugs.python.org (Zachary Ware) Date: Tue, 18 Jun 2013 18:57:17 +0000 Subject: [issue17883] Fix buildbot testing of Tkinter In-Reply-To: <1367355915.98.0.26398929673.issue17883@psf.upfronthosting.co.za> Message-ID: <1371581837.39.0.850671332023.issue17883@psf.upfronthosting.co.za> Zachary Ware added the comment: Jeremy, can you give me the output of a test run with issue17883-tmp-test.diff applied? (Or just what a `python -m test -v test_ttk_guionly` gives with ..\tcltk\bin on the PATH) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 21:04:48 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 18 Jun 2013 19:04:48 +0000 Subject: [issue17934] Add a frame method to clear expensive details In-Reply-To: <1368014042.2.0.41504275061.issue17934@psf.upfronthosting.co.za> Message-ID: <1371582288.21.0.42756353046.issue17934@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- dependencies: +PEP 442 implementation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 21:29:53 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Tue, 18 Jun 2013 19:29:53 +0000 Subject: [issue18255] CPython setup.py problems In-Reply-To: <1371561186.46.0.280107378589.issue18255@psf.upfronthosting.co.za> Message-ID: <1371583793.55.0.273237516402.issue18255@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: distutils.sysconfig module is theoretically deprecated in favor of sysconfig module. It is better to fix sysconfig module than to switch back to distutils.sysconfig module. ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 21:44:29 2013 From: report at bugs.python.org (Thomas Heller) Date: Tue, 18 Jun 2013 19:44:29 +0000 Subject: [issue18058] Define is_package for NamespaceLoader In-Reply-To: <1369496923.18.0.904476367209.issue18058@psf.upfronthosting.co.za> Message-ID: <1371584669.1.0.408311645292.issue18058@psf.upfronthosting.co.za> Thomas Heller added the comment: Brett, can these changes be merged into 3.3 also? ---------- nosy: +theller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 21:49:54 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 18 Jun 2013 19:49:54 +0000 Subject: [issue18058] Define is_package for NamespaceLoader In-Reply-To: <1369496923.18.0.904476367209.issue18058@psf.upfronthosting.co.za> Message-ID: <1371584994.07.0.594608853287.issue18058@psf.upfronthosting.co.za> Brett Cannon added the comment: No because it would mean new functionality in a bugfix release. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 22:21:45 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 18 Jun 2013 20:21:45 +0000 Subject: [issue18256] thread_pthread.h fixes for AIX In-Reply-To: <1371563921.33.0.845649909744.issue18256@psf.upfronthosting.co.za> Message-ID: <3bZggD5LSgzQHG@mail.python.org> Roundup Robot added the comment: New changeset f2e373ddfa00 by Antoine Pitrou in branch '3.3': Issue #18256: Compilation fix for recent AIX releases. Patch by David Edelsohn. http://hg.python.org/cpython/rev/f2e373ddfa00 New changeset 7081859c1e20 by Antoine Pitrou in branch 'default': Issue #18256: Compilation fix for recent AIX releases. Patch by David Edelsohn. http://hg.python.org/cpython/rev/7081859c1e20 New changeset a5ef439f3c9e by Antoine Pitrou in branch '2.7': Issue #18256: Compilation fix for recent AIX releases. Patch by David Edelsohn. http://hg.python.org/cpython/rev/a5ef439f3c9e ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 22:23:39 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 18 Jun 2013 20:23:39 +0000 Subject: [issue18256] thread_pthread.h fixes for AIX In-Reply-To: <1371563921.33.0.845649909744.issue18256@psf.upfronthosting.co.za> Message-ID: <1371587019.2.0.260871829712.issue18256@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Fixed, thank you! ---------- nosy: +pitrou resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: +Python 2.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 22:24:19 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 18 Jun 2013 20:24:19 +0000 Subject: [issue18248] fficonfig.py.in wrong for AIX In-Reply-To: <1371514824.57.0.542380875815.issue18248@psf.upfronthosting.co.za> Message-ID: <1371587059.76.0.92500260704.issue18248@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge stage: -> patch review versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 22:28:38 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 18 Jun 2013 20:28:38 +0000 Subject: [issue1159] os.getenv() not updated after external module uses C putenv() In-Reply-To: <1189668127.19.0.0258251668017.issue1159@psf.upfronthosting.co.za> Message-ID: <1371587318.16.0.00558218722651.issue1159@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The problem is the 'putenv' and 'getenv' appear to be parallel, and seem to be documented as being parallel "Set the environment variable named key to the string value." "Return the value of the environment variable key if it exists," but they are not. Getenv actually looks up the key in the internal os.environ copy while putenv puts to the actual external environment. This tripped-up someone today on python-list, who did putenv(key, val); getenv(key) and wondered why putenv seemed to have no effect. I think the solution for this should be to document the asymmetry by adding ' in os.environ' after 'key' in the getenv doc. -- putenv should not also update os.environ because one can already do that with "os.environ[key] = value" (as recommended) and because the latter uses putenv *if available* to also update the external environment *if possible*. Note that at the time this system was designed, not all systems supported putenv (and perhaps not 'true' getenv either). getenv(key) is not the same as os.environ[key] because the former has an optional 'default' parameter that defaults to None. So aside from back-compatibility, I do not think the behavior of existing code should change. A new parameter might be possible. To implement it, one would have to augment the underlying, undocumented, C-coded (for CPython) os-specific module -- posix, nt, os2, ce -- to define a new os-specific getenv function that parallels the os-specific putenv function. Adding os.environ.update (or .synchronize) to resynchronize os.environ with the external environment would also require a new os-specific function. Currently, the original os.environ is imported as a *data* attribute of the os-specific module. However, neither of these changes are needed for python code that used os.environ as intended. I don't think we should necessarily cater to badly written C libraries that modify the enviroment in a way that cannot be easily intercepted or controlled. So after making a doc change, I would be inclined to close this pending a python-ideas discussion that supported a new feature. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, terry.reedy versions: +Python 2.7, Python 3.3, Python 3.4 -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 22:46:33 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Tue, 18 Jun 2013 20:46:33 +0000 Subject: [issue18248] fficonfig.py.in wrong for AIX In-Reply-To: <1371514824.57.0.542380875815.issue18248@psf.upfronthosting.co.za> Message-ID: <1371588393.67.0.238589916055.issue18248@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: LGTM. I checked in Makefile.am, and the list of platform-specific files is the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 23:16:03 2013 From: report at bugs.python.org (Zachary Ware) Date: Tue, 18 Jun 2013 21:16:03 +0000 Subject: [issue18258] Fix test discovery for test_codecmaps*.py Message-ID: <1371590163.56.0.716538742533.issue18258@psf.upfronthosting.co.za> New submission from Zachary Ware: The test package is almost to the point where I can run `PCbuild\python_d.exe -m unittest discover Lib/test/ "test_*.py"` and get a useful result, the only thing that still blows up is multibytecodec_support.py. I had not previously noticed this problem due to the way support.open_urlresource works, requiring the 'urlfetch' resource if and only if the requested file has not already been fetched before and stored in the Lib/test/data dir. multibytecodec_support.TestBase_Mapping blows things up because it uses __init__ instead of setUp to try opening the needed file, which causes ResourceDenied to be raised at class creation time rather than test run time, which unittest can't handle. The attached patch fixes this (at the expense of opening and closing the file once per test method, rather than once per class) as well as converting the test_codecmaps* scripts from test_main to unittest.main. ---------- components: Tests files: test_codecmaps_discovery.diff keywords: patch messages: 191434 nosy: brett.cannon, ezio.melotti, zach.ware priority: normal severity: normal status: open title: Fix test discovery for test_codecmaps*.py type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30644/test_codecmaps_discovery.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 23:16:21 2013 From: report at bugs.python.org (Zachary Ware) Date: Tue, 18 Jun 2013 21:16:21 +0000 Subject: [issue18258] Fix test discovery for test_codecmaps*.py In-Reply-To: <1371590163.56.0.716538742533.issue18258@psf.upfronthosting.co.za> Message-ID: <1371590181.49.0.034925836277.issue18258@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 23:16:55 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 18 Jun 2013 21:16:55 +0000 Subject: [issue17883] Fix buildbot testing of Tkinter In-Reply-To: <1367355915.98.0.26398929673.issue17883@psf.upfronthosting.co.za> Message-ID: <1371590215.24.0.0877972563732.issue17883@psf.upfronthosting.co.za> Jeremy Kloth added the comment: (Note that the buildbot is 64-bit so the paths need to be tcltk64) The test_ttk_guionly passed successfully *from the command-line*. It is currently hung in that test from the buildbot scheduler *as a service*. I do not know of a simple way to test changes via the buildbot service. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 18 23:52:47 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jun 2013 21:52:47 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371592367.84.0.086613574588.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: Update the patch to follow the API described in the PEP 445 (2013-06-18 22:33:41 +0200). ---------- Added file: http://bugs.python.org/file30645/py_setallocators-7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 00:19:57 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jun 2013 22:19:57 +0000 Subject: [issue18184] Add range check for %c in PyUnicode_FromFormat In-Reply-To: <1370898013.19.0.579439947433.issue18184@psf.upfronthosting.co.za> Message-ID: <1371593997.85.0.878682208795.issue18184@psf.upfronthosting.co.za> STINNER Victor added the comment: Both patches look good to me. Do you feel motivated to check if all formating methods have a test? Here is a list of format methods: PyUnicode_Format(): - 3.3, 3.4: formatchar() raises OverflowError if x > MAX_UNICODE - 2.7: formatchar() raises OverflowError if x > 0x10ffff (or x > 0xffff, in narrow mode) PyUnicode_FromFromatV(): - 2.7: no check, *s++ = va_arg(vargs, int); => BUG - 3.3: indirect check, maxchar = Py_MAX(maxchar, ordinal); and then PyUnicode_New(n, maxchar); should fail => (ok) - 3.4: raise ValueError if ordinal > MAX_UNICODE => OK int.__format__('c'): - 3.3, 3.4: format_long_internal() raises OverflowError if x > 0x10ffff => OK - 2.7: format_int_or_long_internal() raises OverflowError if x > 0x10ffff (or x > 0xffff in narrow mode) => OK IMO a ValueError would be better than OverflowError, it's not really an overflow (limitation of the C language, or a C type). It is maybe too late to change this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 00:24:44 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Jun 2013 22:24:44 +0000 Subject: [issue18202] Minor fixes for test_coding In-Reply-To: <1371110587.57.0.733906103611.issue18202@psf.upfronthosting.co.za> Message-ID: <1371594284.44.0.802255729951.issue18202@psf.upfronthosting.co.za> STINNER Victor added the comment: The patch looks good to me. It may be better to split it in two commits: fix test_exec_valid_coding() in Python 3.3, cleanup test only in python 3.4. As you want. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 00:25:52 2013 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Jun 2013 22:25:52 +0000 Subject: [issue18259] Declare sethostname in socketmodule.c for AIX Message-ID: <1371594352.51.0.0927804743578.issue18259@psf.upfronthosting.co.za> New submission from David Edelsohn: AIX provides sethostname() but it is not declared in any useful header. Fixed as follows: diff -r 626a8e49f2a9 Modules/socketmodule.c --- a/Modules/socketmodule.c Tue Jun 18 23:28:18 2013 +0200 +++ b/Modules/socketmodule.c Tue Jun 18 20:17:37 2013 -0700 @@ -4066,6 +4066,10 @@ Py_buffer buf; int res, flag = 0; +#ifdef _AIX +extern int sethostname(const char *, size_t); +#endif + if (!PyArg_ParseTuple(args, "S:sethostname", &hnobj)) { PyErr_Clear(); if (!PyArg_ParseTuple(args, "O&:sethostname", It seemed best to declare it inside the function. I placed it below the other declarations, not immediately before the function use. ---------- components: Build messages: 191439 nosy: David.Edelsohn, haypo priority: normal severity: normal status: open title: Declare sethostname in socketmodule.c for AIX type: compile error versions: Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 02:09:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 19 Jun 2013 00:09:10 +0000 Subject: [issue18259] Declare sethostname in socketmodule.c for AIX In-Reply-To: <1371594352.51.0.0927804743578.issue18259@psf.upfronthosting.co.za> Message-ID: <3bZmjd6sm6z7Ljh@mail.python.org> Roundup Robot added the comment: New changeset 9f8efcd78d0d by Christian Heimes in branch '3.3': Issue #18259: Declare sethostname in socketmodule.c for AIX http://hg.python.org/cpython/rev/9f8efcd78d0d New changeset 14748397fc57 by Christian Heimes in branch 'default': Issue #18259: Declare sethostname in socketmodule.c for AIX http://hg.python.org/cpython/rev/14748397fc57 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 02:35:11 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 19 Jun 2013 00:35:11 +0000 Subject: [issue18259] Declare sethostname in socketmodule.c for AIX In-Reply-To: <1371594352.51.0.0927804743578.issue18259@psf.upfronthosting.co.za> Message-ID: <1371602111.99.0.599815997536.issue18259@psf.upfronthosting.co.za> Christian Heimes added the comment: Seems to work. I don't have root permission on the box so I can't actually test if the function call succeeds. % ./python Python 3.4.0a0 (default:626a8e49f2a9, Jun 19 2013, 00:19:57) [GCC 4.7.1] on aix7 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.sethostname('python') Traceback (most recent call last): File "", line 1, in PermissionError: [Errno 1] Not owner ---------- nosy: +christian.heimes resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 02:51:52 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 19 Jun 2013 00:51:52 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <3bZnft10R9z7LjX@mail.python.org> Roundup Robot added the comment: New changeset ded443c603f0 by Brett Cannon in branch 'default': Issue #17177: Clarify some deprecations http://hg.python.org/cpython/rev/ded443c603f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 02:52:10 2013 From: report at bugs.python.org (Brett Cannon) Date: Wed, 19 Jun 2013 00:52:10 +0000 Subject: [issue17177] Deprecate imp In-Reply-To: <1360526911.57.0.856873084515.issue17177@psf.upfronthosting.co.za> Message-ID: <1371603130.77.0.5685631219.issue17177@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 06:18:08 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Wed, 19 Jun 2013 04:18:08 +0000 Subject: [issue18260] configparser: TypeError occurs when handling errors in files with binary names Message-ID: <1371615488.35.0.189174506667.issue18260@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis: TypeError occurs when handling errors in files with binary names. configparser.* exceptions are expected. This regression was introduced in Python 3.2. $ cat /tmp/test1 [section] [section] $ cat /tmp/test2 [section] option = value option = value $ python3.1 -c 'import configparser; configparser.ConfigParser().readfp(open("/tmp/test1"))' $ python3.1 -c 'import configparser; configparser.ConfigParser().readfp(open("/tmp/test2"))' $ python3.1 -c 'import configparser; configparser.ConfigParser().readfp(open(b"/tmp/test1"))' $ python3.1 -c 'import configparser; configparser.ConfigParser().readfp(open(b"/tmp/test2"))' $ python3.4 -c 'import configparser; configparser.ConfigParser().read_file(open("/tmp/test1"))' Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.4/configparser.py", line 708, in read_file self._read(f, source) File "/usr/lib64/python3.4/configparser.py", line 1061, in _read lineno) configparser.DuplicateSectionError: While reading from /tmp/test1 [line 2]: section 'section' already exists $ python3.4 -c 'import configparser; configparser.ConfigParser().read_file(open("/tmp/test2"))' Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.4/configparser.py", line 708, in read_file self._read(f, source) File "/usr/lib64/python3.4/configparser.py", line 1087, in _read fpname, lineno) configparser.DuplicateOptionError: While reading from /tmp/test2 [line 3]: option 'option' in section 'section' already exists $ python3.4 -c 'import configparser; configparser.ConfigParser().read_file(open(b"/tmp/test1"))' Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.4/configparser.py", line 708, in read_file self._read(f, source) File "/usr/lib64/python3.4/configparser.py", line 1061, in _read lineno) File "/usr/lib64/python3.4/configparser.py", line 202, in __init__ Error.__init__(self, "".join(msg)) TypeError: sequence item 1: expected str instance, bytes found $ python3.4 -c 'import configparser; configparser.ConfigParser().read_file(open(b"/tmp/test2"))' Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.4/configparser.py", line 708, in read_file self._read(f, source) File "/usr/lib64/python3.4/configparser.py", line 1087, in _read fpname, lineno) File "/usr/lib64/python3.4/configparser.py", line 228, in __init__ Error.__init__(self, "".join(msg)) TypeError: sequence item 1: expected str instance, bytes found ---------- assignee: lukasz.langa components: Library (Lib) keywords: 3.2regression messages: 191443 nosy: Arfrever, lukasz.langa priority: normal severity: normal status: open title: configparser: TypeError occurs when handling errors in files with binary names versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 07:29:27 2013 From: report at bugs.python.org (Emcisq Zhao) Date: Wed, 19 Jun 2013 05:29:27 +0000 Subject: [issue18261] Confusing description in Minimal DOM implementation Message-ID: <1371619767.63.0.501848749792.issue18261@psf.upfronthosting.co.za> New submission from Emcisq Zhao: Visit http://docs.python.org/2.7/library/xml.dom.minidom.html, please notice the first paragraph. The last sentence is " should consider using the xml.etree.ElementTree module for their XML processing instead". Shouldn't it be " should consider using the xml.dom.minidom module for their XML processing instead"? ---------- assignee: docs at python components: Documentation messages: 191444 nosy: docs at python, zhjweizhjwei priority: normal severity: normal status: open title: Confusing description in Minimal DOM implementation type: resource usage versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 07:51:07 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 19 Jun 2013 05:51:07 +0000 Subject: [issue18255] CPython setup.py problems In-Reply-To: <1371561186.46.0.280107378589.issue18255@psf.upfronthosting.co.za> Message-ID: <1371621067.07.0.404545203428.issue18255@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I don't agree. Distutils still uses distutils.sysconfig for configuration information and setup.py wants to adjust that configuration, it should therefore use distutils.sysconfig instead of the global one. That said, it would be better to change distutils to use sysconfig instead of its local configuration information (distutils.sysconfig, distutils.command.install.INSTALL_SCHEMES, ...). That has never been because distutils is frozen due to backward compatibility concerns, but it might be better to actually change distutils for 3.4 when there will be other changes to deal with the new packaging PEPs as well). However: switching distutils to use the toplevel sysconfig will change functionality, as I wrote in my initial message you can use environment variables to override variables for distutils.sysconfig, but that doesn't work for the global sysconfig because the values in _sysconfigdata are expanded at build time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 08:06:31 2013 From: report at bugs.python.org (Ned Deily) Date: Wed, 19 Jun 2013 06:06:31 +0000 Subject: [issue18261] Confusing description in Minimal DOM implementation In-Reply-To: <1371619767.63.0.501848749792.issue18261@psf.upfronthosting.co.za> Message-ID: <1371621991.37.0.963846447023.issue18261@psf.upfronthosting.co.za> Ned Deily added the comment: No, the intent really is to suggest using the ElementTree module rather than either minidom or any of the other XML modules in the standard library. Many people find the ElementTree API easier to understand and to use. ---------- nosy: +ned.deily resolution: -> rejected stage: -> committed/rejected status: open -> closed type: resource usage -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 08:19:22 2013 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 19 Jun 2013 06:19:22 +0000 Subject: [issue18262] ZipInfo.external_attr are not documented Message-ID: <1371622762.23.0.278457180872.issue18262@psf.upfronthosting.co.za> New submission from anatoly techtonik: zipfile doesn't restore file attributes when extracting. Documentation should at least contain example how to do this manually, because the ony way to do this - through ZipInfo.external_attr is too cryptic. ---------- assignee: docs at python components: Documentation messages: 191447 nosy: docs at python, techtonik priority: normal severity: normal status: open title: ZipInfo.external_attr are not documented versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 08:27:22 2013 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Wed, 19 Jun 2013 06:27:22 +0000 Subject: [issue18078] threading.Condition to allow notify on a specific waiter In-Reply-To: <1369712419.12.0.434704480843.issue18078@psf.upfronthosting.co.za> Message-ID: <1371623242.78.0.181604636466.issue18078@psf.upfronthosting.co.za> Jo?o Bernardo added the comment: (ping) It would be nice to have the feature on 3.4. What changes should I do to the patch? Is anyone else working on that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 08:45:43 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 19 Jun 2013 06:45:43 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <1368356222.14.0.0972295622627.issue17961@psf.upfronthosting.co.za> Message-ID: <1371624343.74.0.0549181619169.issue17961@psf.upfronthosting.co.za> Ethan Furman added the comment: Enum members have two pieces of easily accessible information: `name` and `value`. The name is taken from the attribute the value is assigned to; the value, obviously, is the value assigned. The question, then, is what should happen when the function syntax is used, and values are not explicitly given? - use `int`s starting from one - use `int`s starting from zero - use the key name itself - use no value at all Working from the bottom up: - no value: if the enum member has no actual value, the user cannot retrieve the member using the class call syntax (e.g. Color(???) ) - the key name as value: if we go this route, then instead of two pieces of info, our enum member has only one piece in two places - `int`s from zero: falls in line with normal Python counting, but is the zeroth member False? - `int`s from one: avoids the False question, and it's what flufl.enum does. No value is obviously a no-go as it causes more problems than it solves. `str` value is also a no-go as the key name is already available as `name`. `int`s starting from zero or starting from one? Personally, I have no problem with a zero-value enum member that is True -- not every zero should be False. This is the only change I would be willing to make. To sum up: the name is already available in the name, no need to have it be the value as well. I am open to changing the start value to zero instead of one (which is what I do in my customization of Enum in my personal modules ;) . ---------- assignee: -> ethan.furman nosy: +eli.bendersky title: Use enum names as values in enum.Enum convenience API -> Use enum names as values in enum.Enum() functional API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 08:49:11 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 19 Jun 2013 06:49:11 +0000 Subject: [issue18042] Provide enum.unique class decorator In-Reply-To: <1369299378.37.0.789518154232.issue18042@psf.upfronthosting.co.za> Message-ID: <1371624551.37.0.535448828376.issue18042@psf.upfronthosting.co.za> Ethan Furman added the comment: I haven't seen any discouraging words regarding the decorator. If no one has any compelling reasons why it shouldn't be added, I'll craft a version and put it in (only real difference with Nick's would be catching all the duplicates at once instead of one at a time). ---------- assignee: -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 09:01:18 2013 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 19 Jun 2013 07:01:18 +0000 Subject: [issue18262] ZipInfo.external_attr are not documented In-Reply-To: <1371622762.23.0.278457180872.issue18262@psf.upfronthosting.co.za> Message-ID: <1371625278.14.0.412624376877.issue18262@psf.upfronthosting.co.za> anatoly techtonik added the comment: Here is the doc - http://stackoverflow.com/questions/434641/how-do-i-set-permissions-attributes-on-a-file-in-a-zip-file-using-pythons-zip/6297838#6297838 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 09:31:49 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 19 Jun 2013 07:31:49 +0000 Subject: [issue18202] Minor fixes for test_coding In-Reply-To: <1371110587.57.0.733906103611.issue18202@psf.upfronthosting.co.za> Message-ID: <3bZyXP0zM0z7Ll1@mail.python.org> Roundup Robot added the comment: New changeset 410ea970866e by Serhiy Storchaka in branch '3.3': Issue #18202: Fix minor bugs and cleanup test_coding.py. http://hg.python.org/cpython/rev/410ea970866e New changeset 959f4ce4d590 by Serhiy Storchaka in branch 'default': Issue #18202: Fix minor bugs and cleanup test_source_encoding.py. http://hg.python.org/cpython/rev/959f4ce4d590 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 09:35:24 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Jun 2013 07:35:24 +0000 Subject: [issue18202] Minor fixes for test_coding In-Reply-To: <1371110587.57.0.733906103611.issue18202@psf.upfronthosting.co.za> Message-ID: <1371627324.07.0.138416797528.issue18202@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Not all other changes are cleanups and enhancements. Some of them also fix minor bugs. Thank you for review Victor. ---------- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 10:07:25 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Wed, 19 Jun 2013 08:07:25 +0000 Subject: [issue1159] os.getenv() not updated after external module uses C putenv() In-Reply-To: <1189668127.19.0.0258251668017.issue1159@psf.upfronthosting.co.za> Message-ID: <1371629245.61.0.0310463447902.issue1159@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: FYI, PyPy recently got bitten by this: https://bugs.pypy.org/issue1518 A posix.libc_getenv() function could be a solution. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 10:12:08 2013 From: report at bugs.python.org (Edward Catmur) Date: Wed, 19 Jun 2013 08:12:08 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371629528.33.0.772572113644.issue18244@psf.upfronthosting.co.za> Edward Catmur added the comment: ?ukasz, thanks. When the most-derived class virtual-inherits two related ABCs U, V: object / | \ A W V | .` .` B` U` | .` C` The secondary `for` loop is necessary to ensure U and V are ordered correctly. I'll upload a patch with an improved test that covers this case. ---------- Added file: http://bugs.python.org/file30646/singledispatch-mro-composition.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 10:24:16 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 19 Jun 2013 08:24:16 +0000 Subject: [issue18262] ZipInfo.external_attr are not documented In-Reply-To: <1371622762.23.0.278457180872.issue18262@psf.upfronthosting.co.za> Message-ID: <1371630256.06.0.200559325885.issue18262@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I'd be +1 on extending the zipfile API in 3.4 (with a documentation update in older releases as suggested by anatoly): * Add a method or property to ZipInfo for (un)packing the external_attr field * Add an keyword argument to Zipfile.extract and Zipfile.extractall that toggles restoring file permissions. This should be off by default for backward compatibility. The code that restores the file permissions should be careful to avoid security problems, IMHO it should by default ignore the SUID en SGID bits. ---------- components: +Library (Lib) nosy: +ronaldoussoren stage: -> needs patch type: -> enhancement versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 10:24:51 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 19 Jun 2013 08:24:51 +0000 Subject: [issue18262] ZipInfo.external_attr are not documented In-Reply-To: <1371622762.23.0.278457180872.issue18262@psf.upfronthosting.co.za> Message-ID: <1371630291.3.0.96848844939.issue18262@psf.upfronthosting.co.za> Ronald Oussoren added the comment: See also #15795 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 10:26:50 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 19 Jun 2013 08:26:50 +0000 Subject: [issue18262] ZipInfo.external_attr are not documented In-Reply-To: <1371622762.23.0.278457180872.issue18262@psf.upfronthosting.co.za> Message-ID: <1371630410.72.0.536256457964.issue18262@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Closing this as a duplicate of #15795 (which already has a patch) ---------- resolution: -> duplicate superseder: -> Zipfile.extractall does not preserve file permissions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 10:31:53 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 19 Jun 2013 08:31:53 +0000 Subject: [issue15795] Zipfile.extractall does not preserve file permissions In-Reply-To: <1346106964.12.0.723201722432.issue15795@psf.upfronthosting.co.za> Message-ID: <1371630713.22.0.347902726212.issue15795@psf.upfronthosting.co.za> Ronald Oussoren added the comment: On first glance the patch looks good. I haven't tested it with the current trunk though. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 10:44:58 2013 From: report at bugs.python.org (Tshepang Lekhonkhobe) Date: Wed, 19 Jun 2013 08:44:58 +0000 Subject: [issue17894] Edits to descriptor howto In-Reply-To: <1367547112.04.0.920947702161.issue17894@psf.upfronthosting.co.za> Message-ID: <1371631498.21.0.35452584456.issue17894@psf.upfronthosting.co.za> Changes by Tshepang Lekhonkhobe : ---------- nosy: +tshepang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 13:32:02 2013 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 19 Jun 2013 11:32:02 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <1368356222.14.0.0972295622627.issue17961@psf.upfronthosting.co.za> Message-ID: <1371641522.02.0.726953835367.issue17961@psf.upfronthosting.co.za> Nick Coghlan added the comment: OK, I've satisfied myself that the current behaviour is reasonable, and it's specifically the subclassing behaviour of the status quo that works for me. 1. You have to specifically access the "x.value" attribute of a default enum member to see it. "str(x)" shows the fully qualified name, not the value (even for concrete subclasses). 2. The implicitly chosen values are valid for any concrete enum subclass that accepts a single integer as an argument. This covers strings and the whole numeric tower. The same can't be said for using the enum name. 3. The implicitly chosen values are always "true", even when used with a concrete numeric enum subclass. This matches the behaviour of standard user defined classes (where all instances are considered true by default unless you define __len__ or __bool__ to say otherwise). The fact "str(x)" returns the fully qualified name for IntEnum worries me a bit, but if there's a real backwards compatibility problem there (rather than a theoretical one), hopefully we'll see it once we start converting socket and errno. ---------- resolution: -> rejected stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 14:03:01 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Jun 2013 12:03:01 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1371643381.08.0.0142886674901.issue13483@psf.upfronthosting.co.za> STINNER Victor added the comment: > Ah ok. I guess tuples.py then indeed demonstrates a saving. I'll apply the patch. According to my test, the memory usage is a little bit better with the patch. So Martin:,do you plan to commit the patch? Or is a benchmark required? Or should check first check the Low Fragmentation Allocator? I plan to test the Low Fragmentation Allocator, at least on Windows 7. But I prefer to do it later, I'm working on the PEP 445 right now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 14:03:13 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Jun 2013 12:03:13 +0000 Subject: [issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe In-Reply-To: <1356086390.48.0.327620937355.issue16742@psf.upfronthosting.co.za> Message-ID: <1371643393.45.0.417283431726.issue16742@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- dependencies: +API for setting the memory allocator used by Python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 14:14:13 2013 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 Jun 2013 12:14:13 +0000 Subject: [issue18259] Declare sethostname in socketmodule.c for AIX In-Reply-To: <1371594352.51.0.0927804743578.issue18259@psf.upfronthosting.co.za> Message-ID: <1371644053.49.0.590612637407.issue18259@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 14:56:12 2013 From: report at bugs.python.org (Eli Bendersky) Date: Wed, 19 Jun 2013 12:56:12 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <1368356222.14.0.0972295622627.issue17961@psf.upfronthosting.co.za> Message-ID: <1371646572.96.0.00897493083434.issue17961@psf.upfronthosting.co.za> Eli Bendersky added the comment: Nicely done summary, Ethan. I think it would be worthwhile to add the reasoning of "why from 1 and not from 0" into the documentation and maybe the PEP too. I think the "falsiness" answer is reasonable, and since it's a common FAQ it's good to state it explicitly. But make sure to specify that it only applies to IntEnum because Enum values are always truthy :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 14:58:46 2013 From: report at bugs.python.org (Jakub Wilk) Date: Wed, 19 Jun 2013 12:58:46 +0000 Subject: [issue18263] python.man: no documentation for -b, -X Message-ID: <1371646726.0.0.233284633234.issue18263@psf.upfronthosting.co.za> New submission from Jakub Wilk: The -b and -X options are not documented in Misc/python.man. ---------- assignee: docs at python components: Documentation messages: 191463 nosy: docs at python, jwilk priority: normal severity: normal status: open title: python.man: no documentation for -b, -X _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:00:52 2013 From: report at bugs.python.org (Eli Bendersky) Date: Wed, 19 Jun 2013 13:00:52 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <1368356222.14.0.0972295622627.issue17961@psf.upfronthosting.co.za> Message-ID: <1371646852.02.0.678955487556.issue17961@psf.upfronthosting.co.za> Eli Bendersky added the comment: > The fact "str(x)" returns the fully qualified name for IntEnum worries me a bit, but if there's a real backwards compatibility problem there (rather than a theoretical one), hopefully we'll see it once we start converting socket and errno. What is the theoretical problem here? I though that it's an explicit design goal of enums? Which RED - Color.RED, or MeatReadiness.RED? For sockets: >>> class SocketType(IntEnum): ... SOCK_STREAM = 1 ... SOCK_DGRAM = 2 ... >>> str(SocketType.SOCK_STREAM) 'SocketType.SOCK_STREAM' Looks pretty good to me in terms of debuggability. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:02:38 2013 From: report at bugs.python.org (Jakub Wilk) Date: Wed, 19 Jun 2013 13:02:38 +0000 Subject: [issue17121] SSH upload for distutils In-Reply-To: <1359972222.78.0.301395503133.issue17121@psf.upfronthosting.co.za> Message-ID: <1371646958.87.0.759030405618.issue17121@psf.upfronthosting.co.za> Changes by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:31:29 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 19 Jun 2013 13:31:29 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <1371646852.02.0.678955487556.issue17961@psf.upfronthosting.co.za> Message-ID: <20130619093123.2adae1c1@anarchist> Barry A. Warsaw added the comment: On Jun 19, 2013, at 01:00 PM, Eli Bendersky wrote: >What is the theoretical problem here? I though that it's an explicit design >goal of enums? Which RED - Color.RED, or MeatReadiness.RED? For sockets: > >>>> class SocketType(IntEnum): >... SOCK_STREAM = 1 >... SOCK_DGRAM = 2 >... >>>> str(SocketType.SOCK_STREAM) >'SocketType.SOCK_STREAM' > >Looks pretty good to me in terms of debuggability. Me too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:41:29 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 19 Jun 2013 13:41:29 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <1371624343.74.0.0549181619169.issue17961@psf.upfronthosting.co.za> Message-ID: <20130619094124.45ba8e80@anarchist> Barry A. Warsaw added the comment: On Jun 19, 2013, at 06:45 AM, Ethan Furman wrote: >To sum up: the name is already available in the name, no need to have it be >the value as well. I am open to changing the start value to zero instead of >one (which is what I do in my customization of Enum in my personal modules ;) I'm sure it's obvious that I prefer start-from-one, and aside from the truthiness question, it would maximize compatibility with flufl.enum. Besides, the functional API accepts a sequence so if you *really* wanted start-from-zero, then you can do it easily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:45:41 2013 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 19 Jun 2013 13:45:41 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation Message-ID: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> New submission from Nick Coghlan: Replacing an integer constant with the current incarnation of enum.IntEnum breaks JSON serialisation: >>> from enum import Enum >>> from enum import Enum, IntEnum >>> class Example(IntEnum): ... x = 1 ... >>> import json >>> json.dumps(1) '1' >>> json.loads(json.dumps(1)) 1 >>> json.dumps(Example.x) 'Example.x' >>> json.loads(json.dumps(Example.x)) Traceback (most recent call last): File "", line 1, in File "/home/ncoghlan/devel/py3k/Lib/json/__init__.py", line 316, in loads return _default_decoder.decode(s) File "/home/ncoghlan/devel/py3k/Lib/json/decoder.py", line 344, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/home/ncoghlan/devel/py3k/Lib/json/decoder.py", line 362, in raw_decode raise ValueError(errmsg("Expecting value", s, err.value)) from None ValueError: Expecting value: line 1 column 1 (char 0) It breaks for floats as well, but in a slightly different way: >>> class FloatExample(float, Enum): ... x = 1.0 ... >>> json.dumps(FloatExample.x) '' Allowing __str__ to be inherited from Enum rather than from the concrete type will similarly break any serialisation protocol that relies on str() to handle integers. The float case is even trickier, since failing to inherit __repr__ would rather miss the point of the whole exercise... We're going to have to be *very* careful with swapping out existing constants with enums, and we should be warning about the pitfalls in the docs too (where we can't change enum to avoid them). ---------- components: Library (Lib) messages: 191467 nosy: ncoghlan priority: normal severity: normal status: open title: enum.IntEnum is not compatible with JSON serialisation versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:48:14 2013 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 19 Jun 2013 13:48:14 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <1368356222.14.0.0972295622627.issue17961@psf.upfronthosting.co.za> Message-ID: <1371649694.35.0.842317733129.issue17961@psf.upfronthosting.co.za> Nick Coghlan added the comment: I created issue 18264 after I tried it and found my theoretical concern wasn't theoretical at all: swapping a true integer for the current incarnation of enum.IntEnum breaks (at least) JSON serialisation, which means we can't use it in its current form to replace stdlib constants. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:54:54 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 19 Jun 2013 13:54:54 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <1371649694.35.0.842317733129.issue17961@psf.upfronthosting.co.za> Message-ID: <20130619095449.7c7ef695@anarchist> Barry A. Warsaw added the comment: On Jun 19, 2013, at 01:48 PM, Nick Coghlan wrote: >I created issue 18264 after I tried it and found my theoretical concern >wasn't theoretical at all: swapping a true integer for the current >incarnation of enum.IntEnum breaks (at least) JSON serialisation, which means >we can't use it in its current form to replace stdlib constants. JSON has to be taught how to serialize enums. Of course, it also has to be taught how to serialize datetimes, timedeltas, and other common data types. In Mailman, I use the following subclass of json.JSONEncoder. Note though that in my REST API, I always know the class/enum that a string should be associated with so my deserializer always does the right thing. class ExtendedEncoder(json.JSONEncoder): """An extended JSON encoder which knows about other data types.""" def default(self, obj): if isinstance(obj, datetime): return obj.isoformat() elif isinstance(obj, timedelta): # as_timedelta() does not recognize microseconds, so convert these # to floating seconds, but only if there are any seconds. if obj.seconds > 0 or obj.microseconds > 0: seconds = obj.seconds + obj.microseconds / 1000000.0 return '{0}d{1}s'.format(obj.days, seconds) return '{0}d'.format(obj.days) elif isinstance(obj, Enum): # It's up to the decoding validator to associate this name with # the right Enum class. return obj.name return json.JSONEncoder.default(self, obj) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:55:29 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 19 Jun 2013 13:55:29 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371650129.5.0.0687503520781.issue18264@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 15:58:04 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 19 Jun 2013 13:58:04 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <20130619095759.7855f9bc@anarchist> Barry A. Warsaw added the comment: On Jun 19, 2013, at 01:45 PM, Nick Coghlan wrote: >Allowing __str__ to be inherited from Enum rather than from the concrete type >will similarly break any serialisation protocol that relies on str() to >handle integers. The float case is even trickier, since failing to inherit >__repr__ would rather miss the point of the whole exercise... Serialization isn't the only issue - you have to know how to deserialize as well. I use JSON extensively in Mailman's REST API. For enums I always encode them to just the member name, because I always know what enum class will be used to deserialize them. (TBH, I wish the json module had better hooks for extending both serialization and deserialization of non-basic types.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:03:01 2013 From: report at bugs.python.org (Eric Snow) Date: Wed, 19 Jun 2013 14:03:01 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371650581.15.0.105009414635.issue18264@psf.upfronthosting.co.za> Eric Snow added the comment: It's for times like this that I wonder if a simple serialization protocol might be worth it--something separate from __str__() but much simpler than the pickle protocol. __str__() could be the fallback. In the end, though, I always conclude that it's not worth adding yet another optional protocol to objects. Still, it would help in this case (at least for anything that knows to make use of the simple serialization protocol). Alternately, would it make sense to add special handling of enums to the json module? Do we already with pickle? ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:07:53 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 19 Jun 2013 14:07:53 +0000 Subject: [issue17961] Use enum names as values in enum.Enum() functional API In-Reply-To: <20130619095449.7c7ef695@anarchist> Message-ID: <2099081041.98483495.1371650866175.JavaMail.root@zimbra10-e2.priv.proxad.net> Antoine Pitrou added the comment: > JSON has to be taught how to serialize enums. Of course, it also has > to be > taught how to serialize datetimes, timedeltas, and other common data > types. How so? The point of IntEnum was that it derived from int, and therefore would avoid any need for special-casing in C code. (now if json has a PyLong_CheckExact() check, perhaps it can be relaxed to PyLong_Check()...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:09:00 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Wed, 19 Jun 2013 14:09:00 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371650940.82.0.231802176639.issue18264@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: in encoder.py: ... elif instance(value, int): yield buf + str(value) ... What if we use int(str(value)) instead? ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:09:36 2013 From: report at bugs.python.org (Eric Snow) Date: Wed, 19 Jun 2013 14:09:36 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371650976.52.0.358842801962.issue18264@psf.upfronthosting.co.za> Eric Snow added the comment: > Serialization isn't the only issue - you have to know how > to deserialize as well. +1 > (TBH, I wish the json module had better hooks for extending > both serialization and deserialization of non-basic types.) +1 There's at least one stdlib module that does this pretty well (sqlite3, I think). This is where a simple serialization (and deserialization of course) protocol would come in handy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:12:06 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 19 Jun 2013 14:12:06 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371651126.24.0.811347057788.issue18264@psf.upfronthosting.co.za> Ethan Furman added the comment: Nick, in your example it looks like json is using the __str__ for int, but the __repr__ for float -- is this correct? ---------- assignee: -> ethan.furman nosy: +eli.bendersky, ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:13:46 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 19 Jun 2013 14:13:46 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371651226.35.0.0155416418949.issue18264@psf.upfronthosting.co.za> Ethan Furman added the comment: Eric, The pickle support is solely in Enum. No changes were made to pickles. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:21:52 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 19 Jun 2013 14:21:52 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371651712.75.0.901014919356.issue18264@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > What if we use int(str(value)) instead? You mean str(int(value)). Sounds good to me. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:23:12 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 19 Jun 2013 14:23:12 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371651792.4.0.282227157576.issue18264@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Serialization isn't the only issue - you have to know how to > deserialize as well. I think this is pretty much besides the point. IntEnums are meant to be substitutible with plain ints, so you can deserialize as a plain int. Moreoven, JSON doesn't fill the same use cases as pickle: it is meant to communicate with services written in any languages, and those services won't have the same enum mnemonics as your Python library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:23:13 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 19 Jun 2013 14:23:13 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371650976.52.0.358842801962.issue18264@psf.upfronthosting.co.za> Message-ID: <20130619102308.7da720b3@anarchist> Barry A. Warsaw added the comment: On Jun 19, 2013, at 02:09 PM, Eric Snow wrote: >There's at least one stdlib module that does this pretty well (sqlite3, I >think). This is where a simple serialization (and deserialization of course) >protocol would come in handy. Yeah, my database layer also has to be taught how to handle enums! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:32:19 2013 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 19 Jun 2013 14:32:19 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371652339.96.0.43782380471.issue18264@psf.upfronthosting.co.za> Nick Coghlan added the comment: While I agree with forcing int subclasses to true integers in the JSON module, that may not be enough - the problem will affect third party serialisers as well. Whiel the debugging gains won't be as high, we may need to override __str__() in enum.IntEnum to give the "raw" form (leaving the debugging form solely for repr). As for the float behaviour, the JSON serialiser is almost certainly playing games to avoid the truncation that used to occur in float.__str__ (I don't recall if we actually got rid of that, or if it's just a lot harder to trigger these days - it definitely changed when float.__repr__ was updated to prefer human friendly representations that produce the same floating point number). I'm less concerned about that, since we don't plan to swap out any standard library floats for enums. We may still want to mention the potential compatibility issue somewhere in the docs, though. Backwards compatibility is such fun, isn't it? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:42:02 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 19 Jun 2013 14:42:02 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371652922.0.0.98540482915.issue18264@psf.upfronthosting.co.za> Ethan Furman added the comment: I have no problem with leaving __str__ as the inherited type's, and just keeping the __repr__ as the enum add-on; this could be one of the differences between a pure Enum and a hybrid Enum. Is it safe to change the json behaviour back to using __str__ for floats? If so, those two updates and we could be good to go. (Famous last words? ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 16:43:59 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 19 Jun 2013 14:43:59 +0000 Subject: [issue17180] shutil copy* unsafe on POSIX - they preserve setuid/setgit bits In-Reply-To: <1360573856.52.0.124531930967.issue17180@psf.upfronthosting.co.za> Message-ID: <1371653039.95.0.800199447912.issue17180@psf.upfronthosting.co.za> Christian Heimes added the comment: > Shouldn't you try to make the permission removal atomic? Otherwise there's a window of opportunity to exploit the suid bit. Permissions bits are copied from the source file *after* all data has been copied to the destination file. copy() calls copyfile() followed by copymode() copyfile() doesn't create files with SUID. In fact it has 0666 & umask. In worst case the new file is readable and writable by every user. The new patch addresses the unlikely issue with os.open()ing the file with mask=0600. I could also add a create_mode argument to _io.FileIO() in order to make the permission bits of new files more flexible. Modules/_io/fileio.c hard codes mode as 0600. ---------- Added file: http://bugs.python.org/file30647/17180_preserve_sbits2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 17:09:23 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 19 Jun 2013 15:09:23 +0000 Subject: [issue18265] typedef lookupfunc defined by not used Message-ID: <1371654563.07.0.94509759313.issue18265@psf.upfronthosting.co.za> New submission from David Edelsohn: Objects/setobject.c:217:25: warning: typedef 'lookupfunc' locally defined but not used [-Wunused-local-typedefs] This was fixed in trunk (changeset 84208:626a8e49f2a9) and should be backported to 3.3 branch. This is a warning found by GCC 4.8. ---------- components: Build messages: 191483 nosy: David.Edelsohn priority: normal severity: normal status: open title: typedef lookupfunc defined by not used type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 18:02:53 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 19 Jun 2013 16:02:53 +0000 Subject: [issue18248] fficonfig.py.in wrong for AIX In-Reply-To: <1371514824.57.0.542380875815.issue18248@psf.upfronthosting.co.za> Message-ID: <3bb9t42hdCz7LkT@mail.python.org> Roundup Robot added the comment: New changeset 00082406e13f by Benjamin Peterson in branch '3.3': fix libffi build on AIX (closes #18248) http://hg.python.org/cpython/rev/00082406e13f New changeset 974d4844d5a7 by Benjamin Peterson in branch 'default': merge 3.3 (#18248) http://hg.python.org/cpython/rev/974d4844d5a7 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 18:04:41 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Jun 2013 16:04:41 +0000 Subject: [issue18248] fficonfig.py.in wrong for AIX In-Reply-To: <1371514824.57.0.542380875815.issue18248@psf.upfronthosting.co.za> Message-ID: <1371657881.55.0.116580491315.issue18248@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 18:04:56 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 19 Jun 2013 16:04:56 +0000 Subject: [issue18263] python.man: no documentation for -b, -X In-Reply-To: <1371646726.0.0.233284633234.issue18263@psf.upfronthosting.co.za> Message-ID: <1371657896.61.0.0221336605072.issue18263@psf.upfronthosting.co.za> R. David Murray added the comment: I think we tend to forget that that page exists. Patches welcome. ---------- keywords: +easy nosy: +r.david.murray stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 18:31:38 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 19 Jun 2013 16:31:38 +0000 Subject: [issue11016] stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371659498.78.0.863277570363.issue11016@psf.upfronthosting.co.za> Changes by Christian Heimes : Removed file: http://bugs.python.org/file30147/statmodule.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 18:39:32 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 19 Jun 2013 16:39:32 +0000 Subject: [issue11016] stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371659972.76.0.313261284425.issue11016@psf.upfronthosting.co.za> Christian Heimes added the comment: New patch with extensive tests for the stat module. The tests are testing both the new C module and the old stat.py module. ---------- Added file: http://bugs.python.org/file30648/statmodule2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 18:54:28 2013 From: report at bugs.python.org (Zachary Ware) Date: Wed, 19 Jun 2013 16:54:28 +0000 Subject: [issue16748] Make CPython test package discoverable In-Reply-To: <1356138147.12.0.530314626781.issue16748@psf.upfronthosting.co.za> Message-ID: <1371660868.6.0.312486480655.issue16748@psf.upfronthosting.co.za> Zachary Ware added the comment: So many things have been fixed since I last made a list of failing modules that it seemed like time to make a new one. First, failing modules that already have open issues with patches: - test_codecmaps* (issue18258) - test_concurrent_futures (issue16968) - test_locale (issue17767) - test_multiprocessing (issue17778) - test_socket (issue14408 -- incomplete patch, waiting on resolution of issue16968 for how to handle thread/process reaping) Other tests that fail, that may be the fault of my test machine rather than the tests themselves (or, ones that I'd like others to try before I call them broken): - test_urllib2net (fails on my machine on normal runs due to network setup) - test_shutil (fails on my machine on normal runs for unknown reasons relating to symlinks) The below tests fail for reasons that I expect to probably be related to test run order, as all of them pass when narrowing the pattern to match only them (e.g., "test_dbm*.py" rather than "test_*.py"): - test_dbm (had a permission error on a test file) - test_venv (tried to delete a temp dir that was unexpectedly non-empty) - test_wsgiref (failure in testEnviron) - test_logging (failure in test_warnings) - test_inspect (had some issue with locating its test files) This leaves only 6 other tests that fail due to improper inheritance, setup done in test_main rather than setUp/setUpClass/setUpModule, or other reasons directly related to discovery: - test_decimal - test_largefile - test_pickle (pickletester) - test_runpy - test_shelve - test_xml_etree Other tests that need some manner of attention related to discovery: - test_json: it half-uses discovery, it could use it completely - test_importlib: about the same as test_json - leakers package: either rename to non-discoverable names or otherwise make leakers.test_gestalt (in particular) not report an error when discovered. This may not be a comprehensive list, but it does cover all of the most obvious failures that remain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 19:29:12 2013 From: report at bugs.python.org (Zachary Ware) Date: Wed, 19 Jun 2013 17:29:12 +0000 Subject: [issue16662] load_tests not invoked in package/__init__.py In-Reply-To: <1355217291.85.0.41912767842.issue16662@psf.upfronthosting.co.za> Message-ID: <1371662952.52.0.0841463189392.issue16662@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 20:22:03 2013 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 19 Jun 2013 18:22:03 +0000 Subject: [issue18262] ZipInfo.external_attr are not documented In-Reply-To: <1371622762.23.0.278457180872.issue18262@psf.upfronthosting.co.za> Message-ID: <1371666123.6.0.0353356138225.issue18262@psf.upfronthosting.co.za> anatoly techtonik added the comment: 3.4+ feature is not a replacement for proper documentation for 2.7-3.4 ---------- resolution: duplicate -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 20:46:44 2013 From: report at bugs.python.org (Ankur Ankan) Date: Wed, 19 Jun 2013 18:46:44 +0000 Subject: [issue935117] pkgutil doesn't understand case-senseless filesystems Message-ID: <1371667604.22.0.0232900364882.issue935117@psf.upfronthosting.co.za> Changes by Ankur Ankan : ---------- nosy: +Ankur.Ankan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 20:53:56 2013 From: report at bugs.python.org (Ankur Ankan) Date: Wed, 19 Jun 2013 18:53:56 +0000 Subject: [issue3354] Improve error reporting for the argument parsing C API In-Reply-To: <1216040063.73.0.634067891199.issue3354@psf.upfronthosting.co.za> Message-ID: <1371668036.6.0.796809401129.issue3354@psf.upfronthosting.co.za> Changes by Ankur Ankan : ---------- nosy: +Ankur.Ankan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 20:54:47 2013 From: report at bugs.python.org (Corey Brune) Date: Wed, 19 Jun 2013 18:54:47 +0000 Subject: [issue18263] python.man: no documentation for -b, -X In-Reply-To: <1371646726.0.0.233284633234.issue18263@psf.upfronthosting.co.za> Message-ID: <1371668087.91.0.649958944675.issue18263@psf.upfronthosting.co.za> Corey Brune added the comment: Hello, I added the two options requested in python.man in the patch file created from "hg diff > python.man.patch". ---------- keywords: +patch nosy: +cbrune Added file: http://bugs.python.org/file30649/python.man.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 21:09:20 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 19 Jun 2013 19:09:20 +0000 Subject: [issue18265] typedef lookupfunc defined by not used In-Reply-To: <1371654563.07.0.94509759313.issue18265@psf.upfronthosting.co.za> Message-ID: <1371668960.8.0.191186530471.issue18265@psf.upfronthosting.co.za> David Edelsohn added the comment: Will not fix in Python 3.3. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 22:15:25 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 19 Jun 2013 20:15:25 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371672925.54.0.894913100286.issue18264@psf.upfronthosting.co.za> Ethan Furman added the comment: I was unable to find any references to previous problems with json and floats. A quick-n-dirty patch yields the following: --> from json import dumps, loads --> from enum import Enum --> class FE(float, Enum): ... pass ... --> class Test(FE): ... one = 1.0 ... --> Test.one --> str(Test.one) '1.0' --> dumps(Test.one) '1.0' --> loads(dumps(Test.one)) 1.0 All json and enum tests are still passing. If this is an acceptable solution I'll create a nicer patch and post for review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 22:25:38 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 19 Jun 2013 20:25:38 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371673538.37.0.364312075897.issue11016@psf.upfronthosting.co.za> Christian Heimes added the comment: The latest patch comes with more comments and documentation updates. The C implementation defines all existing constants to the hard coded values from stat.py if the platform doesn't provide them. The approach keeps maximum backward compatibility with the old stat module. I have also added the new constants and functions to the pure Python implementation for maximum compatibility with other Python implementation. ---------- title: stat module in C -> Re-implementation of the stat module in C Added file: http://bugs.python.org/file30650/statmodule3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 22:45:38 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 19 Jun 2013 20:45:38 +0000 Subject: [issue16499] CLI option for isolated mode In-Reply-To: <1353248771.63.0.703024605939.issue16499@psf.upfronthosting.co.za> Message-ID: <1371674738.59.0.13490545602.issue16499@psf.upfronthosting.co.za> Christian Heimes added the comment: I'm catching up on some old patches. What shall I do about this patch? Does anybody want to review or intervene it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:00:54 2013 From: report at bugs.python.org (Zachary Ware) Date: Wed, 19 Jun 2013 21:00:54 +0000 Subject: [issue18266] Fix test discovery for test_largefile.py Message-ID: <1371675654.81.0.262540951411.issue18266@psf.upfronthosting.co.za> New submission from Zachary Ware: This one is another inheritance issue. The patch removes unittest.TestCase as a base for LargeFileTest and converts test_main into setUpModule, load_tests, and tearDownModule. This seems like the way to go due to the fact that the order of test execution matters: test_seek must be first and test_truncate must be last. The only way around that restriction would be to create a new copy of the file for test_truncate, which would make the test take even longer and use even more resources. Also, the programmatic creation of the C and Py variants of the test has been changed from creating an empty subclass of LargeFileTest which is then renamed and assigned an 'open' attr, to using the three-arg form of type to create a subclass of LargeFileTest and unittest.TestCase with name set and an 'open' attr pointing to the correct function. Lastly, the superfluous check on whether f.truncate is available that had been in test_main is now removed so that the test is properly marked as skipped if skipped. ---------- components: Tests files: test_largefile_discovery.diff keywords: patch messages: 191494 nosy: brett.cannon, ezio.melotti, zach.ware priority: normal severity: normal status: open title: Fix test discovery for test_largefile.py type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30651/test_largefile_discovery.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:03:25 2013 From: report at bugs.python.org (Bernhard Reiter) Date: Wed, 19 Jun 2013 21:03:25 +0000 Subject: [issue18267] xmlrpc.client documentation multicall example missleading for division behaviour of python3 Message-ID: <1371675805.26.0.18697522409.issue18267@psf.upfronthosting.co.za> New submission from Bernhard Reiter: http://docs.python.org/3.4/library/xmlrpc.client.html as of 2013-06-19 20:35 UTC has a divide example and the output can misslead the learning reader towards the new behaviour of python3 with the '/' binary operator for division. server code: def divide(x, y): return x/y client code: multicall.divide(7,3) [..] print("7+3=%d, 7-3=%d, 7*3=%d, 7/3=%d" % tuple(result)) The client call results into: python3 client.py 7+3=10, 7-3=4, 7*3=21, 7/3=2 This is missleading because '7/3' is now resulting to a float in python3 (see PEP238).The example probably was copied over from the python2 documentation where '7/3' result to int. The implicit conversion from float to int is done in the string formatting. Proposal replace the print line with print("7+3=%d, 7-3=%d, 7*3=%d, 7/3=%g" % tuple(result)) to get 7+3=10, 7-3=4, 7*3=21, 7/3=2.33333 or print(repr(tuple(result))) to get (10, 4, 21, 2.3333333333333335) ---------- assignee: docs at python components: Documentation messages: 191495 nosy: ber, docs at python priority: normal severity: normal status: open title: xmlrpc.client documentation multicall example missleading for division behaviour of python3 versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:20:44 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 19 Jun 2013 21:20:44 +0000 Subject: [issue11185] test_wait4 error on AIX In-Reply-To: <1297424402.38.0.348928652961.issue11185@psf.upfronthosting.co.za> Message-ID: <1371676844.02.0.65449070312.issue11185@psf.upfronthosting.co.za> Changes by David Edelsohn : ---------- nosy: +David.Edelsohn type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:21:54 2013 From: report at bugs.python.org (Brendan O'Connor) Date: Wed, 19 Jun 2013 21:21:54 +0000 Subject: [issue18268] ElementTree.fromstring non-deterministically gives unicode text data Message-ID: <1371676914.3.0.530507394222.issue18268@psf.upfronthosting.co.za> New submission from Brendan O'Connor: (This is Python 2.7 so I'm using string vs unicode terminology.) When I use ElementTree.fromstring(), and use the .text field on nodes, the value is usually a string object, but in rare cases it's a unicode object. I'm parsing many XML documents of newspaper text [1]; on one subset of the data, out of 5 million nodes, ~200 of them have a unicode object for the .text field. I think this is all related to http://bugs.python.org/issue11033 but I can't figure out how, exactly. I'm passing in strings to ElementTree.fromstring() like you're supposed to. The workaround is to defensively convert the .text value to unicode [3]. [1] data is http://www.ldc.upenn.edu/Catalog/catalogEntry.jsp?catalogId=LDC2012T21 [2] my processing code is https://github.com/brendano/gigaword_conversion/blob/master/annogw2justsent.py [3] def convert_to_unicode(mystr): if isinstance(mystr, unicode): return mystr if isinstance(mystr, str): return mystr.decode('utf8') ---------- messages: 191496 nosy: Brendan.OConnor priority: normal severity: normal status: open title: ElementTree.fromstring non-deterministically gives unicode text data type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:23:56 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 19 Jun 2013 21:23:56 +0000 Subject: [issue11193] test_subprocess error on AIX In-Reply-To: <1297438101.89.0.389896513062.issue11193@psf.upfronthosting.co.za> Message-ID: <1371677036.17.0.651618763114.issue11193@psf.upfronthosting.co.za> Changes by David Edelsohn : ---------- components: +Interpreter Core nosy: +David.Edelsohn type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:25:09 2013 From: report at bugs.python.org (Madison May) Date: Wed, 19 Jun 2013 21:25:09 +0000 Subject: [issue18140] urlparse.urlsplit confused to fragment when password include # In-Reply-To: <1370425503.35.0.436511643169.issue18140@psf.upfronthosting.co.za> Message-ID: <1371677109.21.0.158309743789.issue18140@psf.upfronthosting.co.za> Madison May added the comment: Here's a potential patch for the issue, should we decide it's worth fixing. All current tests pass with the update version of _splitnetloc(), and I've added a test to test_urlparse to check that urls with '#' or '?' in the password field are treated properly. ---------- keywords: +patch Added file: http://bugs.python.org/file30652/password_delimiters.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:25:56 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 19 Jun 2013 21:25:56 +0000 Subject: [issue11188] test_time error on AIX In-Reply-To: <1297435870.78.0.786178293384.issue11188@psf.upfronthosting.co.za> Message-ID: <1371677156.93.0.662207106585.issue11188@psf.upfronthosting.co.za> Changes by David Edelsohn : ---------- components: +Extension Modules type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:26:04 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 19 Jun 2013 21:26:04 +0000 Subject: [issue11188] test_time error on AIX In-Reply-To: <1297435870.78.0.786178293384.issue11188@psf.upfronthosting.co.za> Message-ID: <1371677164.43.0.187678738165.issue11188@psf.upfronthosting.co.za> Changes by David Edelsohn : ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 19 23:30:01 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 19 Jun 2013 21:30:01 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371677401.07.0.578871448028.issue18264@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ezio.melotti, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 03:48:06 2013 From: report at bugs.python.org (Ethan Furman) Date: Thu, 20 Jun 2013 01:48:06 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371692886.69.0.90679787314.issue18264@psf.upfronthosting.co.za> Ethan Furman added the comment: Here's the relevant routine from _json.c: ----------------------------------------- static PyObject * encoder_encode_float(PyEncoderObject *s, PyObject *obj) { /* Return the JSON representation of a PyFloat */ double i = PyFloat_AS_DOUBLE(obj); if (!Py_IS_FINITE(i)) { if (!s->allow_nan) { PyErr_SetString(PyExc_ValueError, "Out of range float values are not JSON compliant"); return NULL; } if (i > 0) { return PyUnicode_FromString("Infinity"); } else if (i < 0) { return PyUnicode_FromString("-Infinity"); } else { return PyUnicode_FromString("NaN"); } } /* Use a better float format here? */ return PyObject_Repr(obj); } Possible solutions ------------------ - Use PyObject_Str() instead of PyObject_Repr() I was unable to find any references to why it isn't currently PyObject_Str(), but switching over to it did not break any tests - Coerce the obj to a PyFloat, and take the repr of that (just use the `i`) float subclasses would always lose the subclass status, but that is lost on deserialization anyway unless a custom decoder is used; and if a custom decoder is being used I would think a custom encoder is also being used? Summary ------- Having hybrid Enums not change __str__ would solve most of the json serialization issues; either of the above two changes will solve the json issue of enumerated floats. Thoughts on which route to take for json? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 04:26:38 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Thu, 20 Jun 2013 02:26:38 +0000 Subject: [issue18233] SSLSocket.getpeercertchain() In-Reply-To: <1371415195.44.0.636993698614.issue18233@psf.upfronthosting.co.za> Message-ID: <1371695198.33.0.281287592235.issue18233@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 05:21:33 2013 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 20 Jun 2013 03:21:33 +0000 Subject: [issue18263] python.man: no documentation for -b, -X In-Reply-To: <1371646726.0.0.233284633234.issue18263@psf.upfronthosting.co.za> Message-ID: <1371698493.59.0.919637375775.issue18263@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Thanks for the patch. Committed these changes in: changeset dfead0696a71 changeset e26b00adb7ba ---------- nosy: +orsenthil resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 06:38:36 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Jun 2013 04:38:36 +0000 Subject: [issue18268] ElementTree.fromstring non-deterministically gives unicode text data In-Reply-To: <1371676914.3.0.530507394222.issue18268@psf.upfronthosting.co.za> Message-ID: <1371703116.26.0.327062391311.issue18268@psf.upfronthosting.co.za> R. David Murray added the comment: This kind of thing is why python3 exists. Presumably some bit of the elementree code is successfully converting non-ascii into unicode, and then when that is mixed with the result it is returning, you end up with unicode. But that is just a guess; you'll have to dig into a specific example to figure out why it is happening. Or when you say non-deterministically, do you mean that you have tried to reproduce it with a specific entry that returns unicode in the full run and it does not reproduce? Although even in that case it might be due to some complex interaction in the non-reduced code... It might be interesting to run it under python3 and see if anything odd happens there...but it will probably just work. ---------- components: +XML nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 06:39:40 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Jun 2013 04:39:40 +0000 Subject: [issue18268] ElementTree.fromstring non-deterministically gives unicode text data In-Reply-To: <1371676914.3.0.530507394222.issue18268@psf.upfronthosting.co.za> Message-ID: <1371703180.52.0.722972638523.issue18268@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +eli.bendersky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 06:49:51 2013 From: report at bugs.python.org (Brendan O'Connor) Date: Thu, 20 Jun 2013 04:49:51 +0000 Subject: [issue18268] ElementTree.fromstring non-deterministically gives unicode text data In-Reply-To: <1371676914.3.0.530507394222.issue18268@psf.upfronthosting.co.za> Message-ID: <1371703791.23.0.451588014351.issue18268@psf.upfronthosting.co.za> Brendan O'Connor added the comment: By "non-deterministic" I just mean that the conversion happens for some data but not other data. I should try to find examples that causes it to happen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 08:24:57 2013 From: report at bugs.python.org (anatoly techtonik) Date: Thu, 20 Jun 2013 06:24:57 +0000 Subject: [issue18269] Clarify which integer is required in os.chmod() exception Message-ID: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> New submission from anatoly techtonik: (, '0755') (, '0644') Traceback (most recent call last): File "./tools/bootstrap.py", line 185, in extract_zip os.fchmod(outfile, unixperm) TypeError: an integer is required Here the integer that is required is not `unixperm`, but `outfile`. ---------- assignee: docs at python components: Documentation messages: 191502 nosy: docs at python, techtonik priority: normal severity: normal status: open title: Clarify which integer is required in os.chmod() exception versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 09:54:23 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Thu, 20 Jun 2013 07:54:23 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1371673538.37.0.364312075897.issue11016@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: I still fail to understand why you just don't ditch the Python implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 10:24:56 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 20 Jun 2013 08:24:56 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1371716696.84.0.87003276337.issue13483@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > I plan to test the Low Fragmentation Allocator, at least on Windows 7. I don't think it can be any better than raw mmap() / VirtualAlloc()... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 10:33:40 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 20 Jun 2013 08:33:40 +0000 Subject: [issue18250] In itertools.repeat() object shadows object() In-Reply-To: <1371518204.34.0.993952678875.issue18250@psf.upfronthosting.co.za> Message-ID: <1371717220.19.0.769001200722.issue18250@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I don't think this is a problem, since it is only a local variable in a function. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 10:45:06 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jun 2013 08:45:06 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1371716696.84.0.87003276337.issue13483@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: >> I plan to test the Low Fragmentation Allocator, at least on Windows 7. > I don't think it can be any better than raw mmap() / VirtualAlloc()... I mean using the Low Fragmentation Allocator for PyObject_Malloc() instead of pymalloc. Martin wrote (msg148605): "As an alternative approach, Python could consider completely dropping obmalloc on Windows, and using a Windows Low Fragementation Heap (LFH) instead, with HEAP_NO_SERIALIZE (as the heap would be protected by the GIL)." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 12:50:56 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Thu, 20 Jun 2013 10:50:56 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1371725456.1.0.37455427922.issue13483@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Ok, I'm going to commit this patch. Any further revisions (including reversions) can be done then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 13:16:19 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jun 2013 11:16:19 +0000 Subject: [issue3329] API for setting the memory allocator used by Python In-Reply-To: <1215632933.18.0.0332019532518.issue3329@psf.upfronthosting.co.za> Message-ID: <1371726979.71.0.303751611831.issue3329@psf.upfronthosting.co.za> STINNER Victor added the comment: Update patch according to the last version of the PEP. ---------- Added file: http://bugs.python.org/file30653/py_setallocators-8.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 14:32:24 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Thu, 20 Jun 2013 12:32:24 +0000 Subject: [issue18231] What's new in Python should explain what's new in UCD In-Reply-To: <1371406253.35.0.589040711268.issue18231@psf.upfronthosting.co.za> Message-ID: <1371731544.74.0.786162353352.issue18231@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I don't think anything of this is worth mentioning, except to mention the precise version number of the database. Anybody interested in the consequences of the change should read the announcement of the Unicode Consortium. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 14:57:12 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Thu, 20 Jun 2013 12:57:12 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1371733032.09.0.925638980182.issue18234@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I think the best way would be to provide a function unicodedata.aliases, returning a list of names for a given character or sequence. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 15:46:27 2013 From: report at bugs.python.org (Roundup Robot) Date: Thu, 20 Jun 2013 13:46:27 +0000 Subject: [issue4153] Unicode HOWTO up to date? In-Reply-To: <1224525840.81.0.649106205615.issue4153@psf.upfronthosting.co.za> Message-ID: <3bbkpB3KckzRk0@mail.python.org> Roundup Robot added the comment: New changeset 1dbbed06a163 by Andrew Kuchling in branch '3.3': #4153: update Unicode howto for Python 3.3 http://hg.python.org/cpython/rev/1dbbed06a163 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 15:53:30 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Thu, 20 Jun 2013 13:53:30 +0000 Subject: [issue16507] Patch selectmodule.c to support WSAPoll on Windows In-Reply-To: <1353277974.19.0.012295377293.issue16507@psf.upfronthosting.co.za> Message-ID: <1371736410.31.0.934696004049.issue16507@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- keywords: +gsoc -patch resolution: -> rejected stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:05:48 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 20 Jun 2013 14:05:48 +0000 Subject: [issue16499] CLI option for isolated mode In-Reply-To: <1353248771.63.0.703024605939.issue16499@psf.upfronthosting.co.za> Message-ID: <1371737148.97.0.223863796892.issue16499@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: It applies cleanly, builds without noticeable problems and does what it's advertised to do. In other words, looks great to me! I say go for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:16:18 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Thu, 20 Jun 2013 14:16:18 +0000 Subject: [issue4153] Unicode HOWTO up to date? In-Reply-To: <1224525840.81.0.649106205615.issue4153@psf.upfronthosting.co.za> Message-ID: <1371737778.47.0.0404382875978.issue4153@psf.upfronthosting.co.za> A.M. Kuchling added the comment: As far as I can tell, there are no other outstanding suggestions for howto updates, so I'll now close this item. Feel free to re-open or file a new item if there are further improvements that can be made. ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:24:39 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Thu, 20 Jun 2013 14:24:39 +0000 Subject: [issue9122] Problems with multiprocessing, Python embedding and Windows In-Reply-To: <1277847282.9.0.57284514454.issue9122@psf.upfronthosting.co.za> Message-ID: <1371738279.62.0.261040696237.issue9122@psf.upfronthosting.co.za> Richard Oudkerk added the comment: We don't do non-security updates on Python 2.6 anymore. As a workaround you might be able to do something like import sys, multiprocessing sys.frozen = True # or multiprocessing.forking.WINEXE = True ... if __name__ == '__main__': multiprocessing.freeze_support() ... (I am not familiar with using Cython.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:26:44 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jun 2013 14:26:44 +0000 Subject: [issue16499] CLI option for isolated mode In-Reply-To: <1353248771.63.0.703024605939.issue16499@psf.upfronthosting.co.za> Message-ID: <1371738404.56.0.186757965053.issue16499@psf.upfronthosting.co.za> STINNER Victor added the comment: "python -I" and "spython" sound like two ways to get the same results. I would prefer to only have one way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:35:53 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 Jun 2013 14:35:53 +0000 Subject: [issue16499] CLI option for isolated mode In-Reply-To: <1353248771.63.0.703024605939.issue16499@psf.upfronthosting.co.za> Message-ID: <1371738953.69.0.212917895696.issue16499@psf.upfronthosting.co.za> Christian Heimes added the comment: We don't have "spython" yet. Py_IsolatedFlag is also required if we ever going to have "spython", too. We can always remove the command line flag before Python 3.4 hits beta. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:38:07 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 20 Jun 2013 14:38:07 +0000 Subject: [issue16499] CLI option for isolated mode In-Reply-To: <1371738404.56.0.186757965053.issue16499@psf.upfronthosting.co.za> Message-ID: <20130620103802.73d88a4c@anarchist> Barry A. Warsaw added the comment: On Jun 20, 2013, at 02:26 PM, STINNER Victor wrote: > >"python -I" and "spython" sound like two ways to get the same results. I >would prefer to only have one way. Where does spython come from? Personally, I'd much rather this be an option on the existing python executable (i.e. `python -I`) than some other command. That makes it easier to discover and promote. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:40:02 2013 From: report at bugs.python.org (Dennis Backhaus) Date: Thu, 20 Jun 2013 14:40:02 +0000 Subject: [issue18270] AttributeError: 'NoneType' object has no attribute 'interp' Message-ID: <1371739202.98.0.896833417364.issue18270@psf.upfronthosting.co.za> New submission from Dennis Backhaus: It just worked fine yesterday, but when I start IDLE (with and without trying to open a file at the same time) I get this error. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/bin/idle", line 5, in main() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/PyShell.py", line 1560, in main shell.interp.runcommand(''.join(("print('", tkversionwarning, "')"))) AttributeError: 'NoneType' object has no attribute 'interp' ---------- components: IDLE messages: 191518 nosy: dbackhaus priority: normal severity: normal status: open title: AttributeError: 'NoneType' object has no attribute 'interp' versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:40:11 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 Jun 2013 14:40:11 +0000 Subject: [issue16499] CLI option for isolated mode In-Reply-To: <1353248771.63.0.703024605939.issue16499@psf.upfronthosting.co.za> Message-ID: <1371739211.73.0.15225009249.issue16499@psf.upfronthosting.co.za> Christian Heimes added the comment: It comes from Nick and http://www.python.org/dev/peps/pep-0432/ . Once PEP 432 is in place we can easily create variants of Python binaries with special flags. I'm in favor with python -I, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:40:59 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Thu, 20 Jun 2013 14:40:59 +0000 Subject: [issue6461] multiprocessing: freezing apps on Windows In-Reply-To: <1247292508.31.0.803162103646.issue6461@psf.upfronthosting.co.za> Message-ID: <1371739259.83.0.445372930627.issue6461@psf.upfronthosting.co.za> Richard Oudkerk added the comment: I just tried freezing the program from multiprocessing import freeze_support,Manager if __name__ == '__main__': freeze_support() m=Manager() l = m.list([1,2,3]) l.append(4) print(l) print(repr(l)) using cx_Freeze with Python 2.7, and it worked fine: PS> cxfreeze.bat foo.py copying C:\Python27\lib\site-packages\cx_Freeze\bases\Console.exe -> C:\Tmp\dir\dist\foo.exe copying C:\Windows\system32\python27.dll -> C:\Tmp\dir\dist\python27.dll writing zip file C:\Tmp\dir\dist\foo.exe ... PS> dist\foo [1, 2, 3, 4] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:45:30 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Jun 2013 14:45:30 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1371739530.67.0.0062752129308.issue11390@psf.upfronthosting.co.za> R. David Murray added the comment: Here is a patch that implements the ones I'm interested in (-o for any option, and -f as a shortcut for -o FAIL_FAST). It's a good question whether doctest should support other unittest options, but doing so is more complicated than supporting -o and -f. Adding a couple people to nosy who have an interest in testing and doctest, hoping for a patch review :) ---------- keywords: +patch nosy: +barry, ezio.melotti, r.david.murray stage: needs patch -> patch review versions: +Python 3.4 -Python 3.3 Added file: http://bugs.python.org/file30654/doctest_cli.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:47:05 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Jun 2013 14:47:05 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1371739625.85.0.535005064294.issue11390@psf.upfronthosting.co.za> R. David Murray added the comment: Oh, a documentation update is still needed here, so I guess I'm not really ready for review yet :( ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:51:14 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Thu, 20 Jun 2013 14:51:14 +0000 Subject: [issue17018] Inconsistent behaviour of methods waiting for child process In-Reply-To: <1358954121.08.0.546295178726.issue17018@psf.upfronthosting.co.za> Message-ID: <1371739874.43.0.179966511806.issue17018@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:55:02 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Thu, 20 Jun 2013 14:55:02 +0000 Subject: [issue18270] AttributeError: 'NoneType' object has no attribute 'interp' In-Reply-To: <1371739202.98.0.896833417364.issue18270@psf.upfronthosting.co.za> Message-ID: <1371740102.16.0.183458790201.issue18270@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: PyShell.py, line 1541: if shell and cmd or script: Does it need parentheses? if shell and (cmd or script): ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 16:55:29 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 20 Jun 2013 14:55:29 +0000 Subject: [issue18269] Clarify which integer is required in os.chmod() exception In-Reply-To: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> Message-ID: <1371740129.41.0.421821107444.issue18269@psf.upfronthosting.co.za> Brett Cannon added the comment: os.chmod is implemented in posixmodule.c and the argument parsing code can be found at http://hg.python.org/cpython/file/3acbb23c73bc/Modules/posixmodule.c#l2605 . You will notice that the argument parsing is specified as "O&i|$O&p". That means the first argument is parsed as a Python object which is passed through a converter function and the second argument is required to be an integer. That converter function can be found at http://hg.python.org/cpython/file/3acbb23c73bc/Modules/posixmodule.c#l681. Looking at that code doesn't suggest that TypeError is raised with that message. What were the exact arguments you passed into os.chmod() that triggered the exception? ---------- assignee: docs at python -> components: +Library (Lib) -Documentation nosy: +brett.cannon status: open -> pending versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 17:15:41 2013 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 20 Jun 2013 15:15:41 +0000 Subject: [issue16499] CLI option for isolated mode In-Reply-To: <1371739211.73.0.15225009249.issue16499@psf.upfronthosting.co.za> Message-ID: Nick Coghlan added the comment: CPython's startup sequence and collection of global flags are organically evolved madness, so I think adding even more complexity to them is a bad idea. When you're in a hole, the first thing to do is *stop digging*. I could use help laying the foundations for PEP 432 though - getting the separate Programs directory split out, breaking up the monstrosity that is pythonrun.c, etc. Implementing that basic refactoring in default will make it more feasible to keep the PEP branch up to date without major conflicts. On 21 Jun 2013 00:40, "Christian Heimes" wrote: > > Christian Heimes added the comment: > > It comes from Nick and http://www.python.org/dev/peps/pep-0432/ . Once > PEP 432 is in place we can easily create variants of Python binaries with > special flags. > > I'm in favor with python -I, too. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 17:39:02 2013 From: report at bugs.python.org (Marko Lalic) Date: Thu, 20 Jun 2013 15:39:02 +0000 Subject: [issue18271] get_payload method returns bytes which cannot be decoded using the message's charset Message-ID: <1371742742.04.0.192610725927.issue18271@psf.upfronthosting.co.za> New submission from Marko Lalic: When the message's Content-Transfer-Encoding is set to 8bit, the get_payload(decode=True) method returns the payload encoded using raw-unicode-escape. This means that it is impossible to decode the returned bytes using the content charset obtained by the get_content_charset method. It seems this should be fixed so that get_payload returns the bytes as found in the payload when Content-Transfer-Encoding is 8bit, exactly like Python2.7 handles it. >>> from email import message_from_string >>> message = message_from_string("""MIME-Version: 1.0 ... Content-Type: text/plain; charset=utf-8 ... Content-Disposition: inline ... Content-Transfer-Encoding: 8bit ... ... ?nic?de data..""") >>> message.get_content_charset() 'utf-8' >>> message.get_payload(decode=True) b'\xfcnic\xf6de data..' >>> message.get_payload(decode=True).decode(message.get_content_charset()) Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 0: invalid start byte >>> message.get_payload(decode=True).decode('raw-unicode-escape') '?nic?de data..' ---------- components: email messages: 191526 nosy: barry, mlalic, r.david.murray priority: normal severity: normal status: open title: get_payload method returns bytes which cannot be decoded using the message's charset type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 17:40:26 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Thu, 20 Jun 2013 15:40:26 +0000 Subject: [issue18122] RuntimeError: not holding the import lock In-Reply-To: <1370203633.5.0.234026294285.issue18122@psf.upfronthosting.co.za> Message-ID: <1371742826.64.0.56474267771.issue18122@psf.upfronthosting.co.za> Richard Oudkerk added the comment: See also #9573 and #15914. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 17:41:09 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Jun 2013 15:41:09 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1371742869.32.0.862744275169.issue11390@psf.upfronthosting.co.za> R. David Murray added the comment: Patch updated with documentation. ---------- stage: needs patch -> patch review Added file: http://bugs.python.org/file30655/doctest_cli.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 17:41:31 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Jun 2013 15:41:31 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1371742891.66.0.798468965015.issue11390@psf.upfronthosting.co.za> Changes by R. David Murray : Removed file: http://bugs.python.org/file30654/doctest_cli.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 17:45:22 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Thu, 20 Jun 2013 15:45:22 +0000 Subject: [issue15198] multiprocessing Pipe send of non-picklable objects doesn't raise error In-Reply-To: <1340767549.24.0.475642908305.issue15198@psf.upfronthosting.co.za> Message-ID: <1371743122.3.0.234612167162.issue15198@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- resolution: -> works for me stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 19:35:45 2013 From: report at bugs.python.org (anatoly techtonik) Date: Thu, 20 Jun 2013 17:35:45 +0000 Subject: [issue18269] Clarify which integer is required in os.chmod() exception In-Reply-To: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> Message-ID: <1371749745.5.0.987229552237.issue18269@psf.upfronthosting.co.za> anatoly techtonik added the comment: >>> v = open("VERSION") >>> import os >>> os.fchmod(v, 0664) Traceback (most recent call last): File "", line 1, in TypeError: an integer is required ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 20:35:46 2013 From: report at bugs.python.org (py.user) Date: Thu, 20 Jun 2013 18:35:46 +0000 Subject: [issue18272] In itertools recipes there is a typo in __builtins__ Message-ID: <1371753346.0.0.321196012203.issue18272@psf.upfronthosting.co.za> New submission from py.user: http://docs.python.org/3/library/itertools.html#itertools-recipes "Like __builtin__.iter(func, sentinel)" ---------- assignee: docs at python components: Documentation files: issue.diff keywords: patch messages: 191530 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools recipes there is a typo in __builtins__ type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30656/issue.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 20:45:36 2013 From: report at bugs.python.org (Zachary Ware) Date: Thu, 20 Jun 2013 18:45:36 +0000 Subject: [issue18272] In itertools recipes there is a typo in __builtins__ In-Reply-To: <1371753346.0.0.321196012203.issue18272@psf.upfronthosting.co.za> Message-ID: <1371753936.9.0.651227012947.issue18272@psf.upfronthosting.co.za> Zachary Ware added the comment: Being Python 3, it should actually be "builtins" rather than "__builtins__". Also, imp.rst and importlib.rst have the same issue in the description of reload(). ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 20:46:17 2013 From: report at bugs.python.org (Zachary Ware) Date: Thu, 20 Jun 2013 18:46:17 +0000 Subject: [issue18272] In itertools recipes there is a typo in __builtins__ In-Reply-To: <1371753346.0.0.321196012203.issue18272@psf.upfronthosting.co.za> Message-ID: <1371753977.21.0.625315505163.issue18272@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 20:53:45 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Jun 2013 18:53:45 +0000 Subject: [issue18270] AttributeError: 'NoneType' object has no attribute 'interp' In-Reply-To: <1371739202.98.0.896833417364.issue18270@psf.upfronthosting.co.za> Message-ID: <1371754425.62.0.264968041922.issue18270@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +kbk, roger.serwy, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 20:59:19 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Jun 2013 18:59:19 +0000 Subject: [issue18271] get_payload method returns bytes which cannot be decoded using the message's charset In-Reply-To: <1371742742.04.0.192610725927.issue18271@psf.upfronthosting.co.za> Message-ID: <1371754759.31.0.623177888517.issue18271@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: >>> message.get_payload(decode=True).decode('latin1') '?nic?de data..' ---------- nosy: +serhiy.storchaka versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 21:10:27 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 20 Jun 2013 19:10:27 +0000 Subject: [issue18269] Clarify which integer is required in os.chmod() exception In-Reply-To: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> Message-ID: <1371755427.23.0.892689258705.issue18269@psf.upfronthosting.co.za> Brett Cannon added the comment: That's expected with that kind of argument. os.fchmod() and os.chmod() only accept a path as a string or a file descriptor as an integer as specified in the docs: http://docs.python.org/3/library/os.html#os.chmod ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 21:15:23 2013 From: report at bugs.python.org (Marko Lalic) Date: Thu, 20 Jun 2013 19:15:23 +0000 Subject: [issue18271] get_payload method returns bytes which cannot be decoded using the message's charset In-Reply-To: <1371742742.04.0.192610725927.issue18271@psf.upfronthosting.co.za> Message-ID: <1371755723.91.0.402566650656.issue18271@psf.upfronthosting.co.za> Marko Lalic added the comment: That will work fine as long as the characters are actually latin. We cannot forget the rest of the unicode character planes. Consider:: >>> message = message_from_string("""MIME-Version: 1.0 ... Content-Type: text/plain; charset=utf-8 ... Content-Disposition: inline ... Content-Transfer-Encoding: 8bit ... ... ??????""") >>> message.get_payload(decode=True).decode('latin1') '\\ud55c\\uae00\\u1961\\u2565\\u0eaa\\u090f' >>> message.get_payload(decode=True).decode('raw-unicode-escape') '??????' However, even if latin1 did work, the main point is that a different encoding than the one the message specifies must be used in order to decode the bytes to a unicode string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 21:30:03 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 20 Jun 2013 19:30:03 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1371756603.69.0.503207353444.issue18244@psf.upfronthosting.co.za> ?ukasz Langa added the comment: I meditated on the nature of the problem. A big issue that Edward pointed out is that at times the computed MRO depends on haystack ordering. We should fix that. However, my conclusion is that whatever home-grown algorithm we come up with, it will still be unintuitive for the end user. We should rather adopt C3 linearisation, which Python uses for calculating the method resolution order. Unfortunately, it doesn't specify what to do with virtual bases (either registered or implied). To solve that we need to extend the algorithm to insert the virtual bases in a "correct" place. We have two issues here: 1. How can we determine where this "correct" place is? 2. How can we determine which order unrelated abstract classes should be put in? The correct place for a virtual base class to appear in the MRO is on the level where the functionality it describes first appears. For example: >>> from collections import * >>> class A(object): pass ... >>> class B(A): ... def __len__(self): ... return 0 # implies Sized ... >>> @Container.register ... class C(object): pass ... >>> class D(object): pass # unrelated ... >>> class X(D, C, B): ... def __call__(self): ... return 0 # implies Callable ... If we calculate the C3 MRO for strict bases only, we get the obvious: >>> from functools import _c3_mro >>> _c3_mro(X) [, , , , , ] If we want to insert related abstract base classes, they consistently appear right after the class where functionality has been added (note that the order of the `abcs` here doesn't matter): >>> _c3_mro(X, abcs=[Sized, Callable, Container]) [, , , , , , , , ] This linearisation might be somewhat surprising but I believe it's the correct way. In fact it's only surprising because it exposes ambiguous dispatch when a class virtually subclasses multiple ABCs. For example, having a simple generic function: >>> from functools import singledispatch >>> from collections import * >>> @singledispatch ... def f(arg): ... return "base" ... >>> f.register(Iterable, lambda arg: "iterable") >>> f.register(Sized, lambda arg: "sized") >>> f.register(Set, lambda arg: "set") this class evaluates reasonably: >>> class C(Sized): ... def __len__(self): ... return 0 ... >>> f(C()) 'sized' However, when we register it for another ABC, there has to be a conflict: >>> Iterable.register(C) >>> f(C()) Traceback (most recent call last): ... RuntimeError: Ambiguous dispatch: or It doesn't matter that Sized appears explicitly in the MRO. Class C is-a Sized just as well as it is-a Iterable. However, if we also register it to be a Set as well (which subclasses both Iterable and Sized), this solves the conflict: >>> Set.register(C) >>> f(C()) 'set' Same goes for the case described in PEP 443 where both ABCs appear explicitly in the MRO. No conflict here becase MRO orders both bases unambiguously: >>> class D(Sized, Iterable): ... def __len__(self): ... return 0 ... def __iter__(self): ... return iter([]) ... >>> f(D()) 'sized' The answer to the second question ("How can we determine in which order to put unrelated abstract classes?") is that we can't in general. There's fortunately a common special case that can help here: ABCs often have subclasses which are also bases of the type we're building the MRO for. For example: when inserting Iterable and Sized to the MRO of dict we can derive the correct order from the fact that both Iterable and Sized have a subclass called Mapping which also happens to be a base of dict. This trick cannot be used to fix every case but it's good enough to handle many. Summing up, the new algorithm is an extension of C3, which makes it much more predictable in edge cases. ABCs are introduced in a way that is much more deterministic (and when it depends on haystack ordering it always ends up as a RuntimeError anyway). My only real gripe with the new algorithm is that it's much larger codewise. On the other hand the ABC-aware C3 implementation could be useful for other purposes as well. Nick, Guido, this needs a serious review. Took me a while to get it right. ---------- Added file: http://bugs.python.org/file30657/issue18244.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 21:32:40 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Jun 2013 19:32:40 +0000 Subject: [issue18271] get_payload method returns bytes which cannot be decoded using the message's charset In-Reply-To: <1371742742.04.0.192610725927.issue18271@psf.upfronthosting.co.za> Message-ID: <1371756760.04.0.455880862597.issue18271@psf.upfronthosting.co.za> R. David Murray added the comment: The python3 email package's handling of 8bit definitely has quirks. (So did the python2 email package's, but they were different quirks. :) You can't correctly handle 8bit unless you use message_from_bytes and take the input from a byte string. It is a good question what should be done with a unicode string that claims its payload is 8bit...since that situation can't arise on the wire (or in a disk file), perhaps it should produce an exception ("message must be parsed as binary data"?) The problem with that idea is that the email parser promises to never raise errors, but always produce *some* sort of model from the input, possibly with defects attached. All that aside, here is what you want to be doing: >>> from email import message_from_bytes >>> message = message_from_bytes(b"""MIME-Version: 1.0 ... Content-Type: text/plain; charset=utf-8 ... Content-Disposition: inline ... Content-Transfer-Encoding: 8bit ... ... \xc3\xbcnic\xc3\xb6de data..""") >>> message.get_content_charset() 'utf-8' >>> message.get_payload(decode=True) b'\xc3\xbcnic\xc3\xb6de data..' >>> message.get_payload(decode=True).decode('utf-8') '?nic?de data..' >>> message.get_payload() '?nic?de data..' You will note that get_payload without the decode automatically does the charset decode. I know this is counter-intuitive, but we are dealing with a legacy API that I had to retrofit. Think of decode=True as "produce binary from the wire content transfer encoding", and decode=False as "produce the string representation of the payload". For ASCII content-transfer-encodings, this is more intuitive (the raw quoted printable, for example), but for 8bit we can only produce a python string if we do the unicode decode...so that's what we do. You will also note that the payload in this case really *is* utf-8, whereas in your example it was unicode...and what the python3 email package does with a unicode payload is not well defined and is definitely buggy. I'm going to close this issue, because dealing with the vagaries of 8bit with string input is on my master list of things to tackle this summer, and will be dealt with in the context of other changes. ---------- resolution: -> invalid stage: -> committed/rejected status: open -> closed versions: -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 22:30:20 2013 From: report at bugs.python.org (Zachary Ware) Date: Thu, 20 Jun 2013 20:30:20 +0000 Subject: [issue18273] Simplify calling and discovery of json test package Message-ID: <1371760220.13.0.623339240586.issue18273@psf.upfronthosting.co.za> New submission from Zachary Ware: Technically, test discovery already works for test_json.py / json_tests, but not the way really expected (each test file is discovered individually), and not as simply as it could. The attached patch does the following: - remove test_json.py - rename json_tests to test_json (to match all other tests, following the example of test_email and test_importlib) - remove main() and 'if __name__ == "__main__"' stanza from __init__.py - rename test_suite() to load_tests(*args) - Add test_json/__main__.py, which calls unittest.main I believe this is the simplest, cleanest way to convert the json tests from test_main to unittest.main(). The patch is against 3.3; there are changes in 3.4 that make a patch against it not apply to 3.3. It merges forward easily, though. ---------- components: Tests files: test_json_discovery-3.3.diff keywords: patch messages: 191537 nosy: brett.cannon, ezio.melotti, zach.ware priority: normal severity: normal status: open title: Simplify calling and discovery of json test package type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30658/test_json_discovery-3.3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 22:32:51 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Thu, 20 Jun 2013 20:32:51 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1371760371.17.0.764779253603.issue18234@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: UCD provides more than just a list of aliases: formal name aliases have "type" - control, abbreviation, etc. See . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 23:12:56 2013 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 Jun 2013 21:12:56 +0000 Subject: [issue18270] IDLE on OS X fails with Attribute Error if no initial shell and Tk out-of-date In-Reply-To: <1371739202.98.0.896833417364.issue18270@psf.upfronthosting.co.za> Message-ID: <1371762776.64.0.810054846038.issue18270@psf.upfronthosting.co.za> Ned Deily added the comment: The problem here occurs when IDLE on OS X is launched without an initial shell window, either by setting the option in IDLE preferences or from the command line (/usr/local/bin/idle -e) *and* IDLE detects that the version of Tk in use is one of the suspect OS X versions and is attempting to warn the user with this message in the shell window: WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable. Visit http://www.python.org/download/mac/tcltk/ for current information. Unfortunately, that doesn't work if there is no shell window. The workaround is to follow the instructions at the above link and, if possible, install an up-to-date Tcl/Tk 8.5 from ActiveState. If that is not possible, then launch IDLE from the command line with an initial shell window: /usr/local/bin/idle2.7 -i and be sure to change the preference to always launch with a shell window. ---------- assignee: -> ned.deily nosy: +ned.deily stage: -> needs patch title: AttributeError: 'NoneType' object has no attribute 'interp' -> IDLE on OS X fails with Attribute Error if no initial shell and Tk out-of-date versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 20 23:25:10 2013 From: report at bugs.python.org (Marko Lalic) Date: Thu, 20 Jun 2013 21:25:10 +0000 Subject: [issue18271] get_payload method returns bytes which cannot be decoded using the message's charset In-Reply-To: <1371742742.04.0.192610725927.issue18271@psf.upfronthosting.co.za> Message-ID: <1371763510.82.0.984349990824.issue18271@psf.upfronthosting.co.za> Marko Lalic added the comment: Thank you for your reply. Unfortunately, I have a use case where message_from_bytes has a pretty great disadvantage. I have to parse the received message and then forward it completely unchanged, apart from possibly adding a few new headers. The problem with message_from_bytes is that it changes the Content-Transfer-Encoding header to base64 (and consequently base64 encodes the content). Do you possibly have a suggestion how to currently go about solving this problem? A possible solution I can spot from your answer is to check the Content-Transfer-Encoding before getting the payload and use the version without decode=True when it is 8bit. Maybe there is something more elegant? Thank you in advance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 00:02:59 2013 From: report at bugs.python.org (anatoly techtonik) Date: Thu, 20 Jun 2013 22:02:59 +0000 Subject: [issue18269] Clarify which integer is required in os.chmod() exception In-Reply-To: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> Message-ID: <1371765779.3.0.276411925742.issue18269@psf.upfronthosting.co.za> anatoly techtonik added the comment: Right. This report is about improving error message. It doesn't say what is expected where. If you have a call like: os.fchmod(outfile, unixperm) it is easy to assume that unixperm is not integer, while in fact the problem is in outfile. This could not be actual for Python 3, but it seems that there is bug with it as well. >>> v = open("VERSION") >>> import os >>> os.fchmod(v, 0664) File "", line 1 os.fchmod(v, 0664) ^ SyntaxError: invalid token >>> ---------- assignee: -> docs at python components: +Documentation resolution: invalid -> status: closed -> open versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 00:37:27 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Jun 2013 22:37:27 +0000 Subject: [issue18271] get_payload method returns bytes which cannot be decoded using the message's charset In-Reply-To: <1371742742.04.0.192610725927.issue18271@psf.upfronthosting.co.za> Message-ID: <1371767847.72.0.236889539376.issue18271@psf.upfronthosting.co.za> R. David Murray added the comment: If all you are changing is headers (and you con't change the CTE), then when you use BytesGenerator to re-serialize the message, it is supposed to preserve the existing CTE/payload. (Whether or not you call get_payload, regardless of arguments, does not matter; get_payload does not modify the Message object...though set_payload does, of course). If you have a case where the payload is being re-encoded even though you have not changed the content-type or content-transfer-encoding headers or the payload, then that is a bug. Of course, if you use just Generator (which is what str uses), the output message must be in ASCII, so in that case it does indeed transcode 8bit payloads to base64. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 00:54:33 2013 From: report at bugs.python.org (Brett Cannon) Date: Thu, 20 Jun 2013 22:54:33 +0000 Subject: [issue18269] Add new parameter format for converter function w/ position number In-Reply-To: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> Message-ID: <1371768873.47.0.974058702807.issue18269@psf.upfronthosting.co.za> Brett Cannon added the comment: That is not a documentation bug (i.e. a problem with what is written at docs.python.org), this is a feature request to try to improve the exception message. That would require adding a new parameter format (http://docs.python.org/3/c-api/arg.html?highlight=pyarg_parse#other-objects) which allows for a converter function which also takes the positional number and/or keyword argument that the converter function was called for. ---------- assignee: docs at python -> components: +Interpreter Core -Documentation, Library (Lib) priority: normal -> low title: Clarify which integer is required in os.chmod() exception -> Add new parameter format for converter function w/ position number type: -> enhancement versions: -Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 01:00:28 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Jun 2013 23:00:28 +0000 Subject: [issue18272] In itertools recipes there is a typo in __builtins__ In-Reply-To: <1371753346.0.0.321196012203.issue18272@psf.upfronthosting.co.za> Message-ID: <1371769228.42.0.0100292673944.issue18272@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 02:18:17 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 00:18:17 +0000 Subject: [issue18270] IDLE on OS X fails with Attribute Error if no initial shell and Tk out-of-date In-Reply-To: <1371739202.98.0.896833417364.issue18270@psf.upfronthosting.co.za> Message-ID: <1371773897.06.0.896729031572.issue18270@psf.upfronthosting.co.za> Terry J. Reedy added the comment: In 2.7.5, the offending line is 1558, not 1560. It is clearer to me as shell.interp.runcommand("print('%s')" % tkversionwarning) Amaury is correct about 1541, as seen in the if block itself, but I thing the shell test should be elevated to guard all the shell-dependend actions, not just this one. See below. To me, the problem in the cracked code and convoluted code is this: If enable_shell (1520), call open_shell to set both flist.shell and shell but return if shell is None. But then at 1532, shell is set to flist.shell, and that can only have effect if not enable_shell (as otherwise shell *is* flist.shell due to return if None). In this case I expect flist.shell will always be None (its backup default as 292). But anyway, 1532 should be at least become an else: block for 1520. The following lines up to 1558 all depend on shell not being None, but only one block is guarded. So I think they should all be guarded with one 'if shell:' and 'shell removed from 1541 2.7 patch attached. 3.3 code looks identical in this area, so it should have same problem and patch should apply to that also. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:08:08 2013 From: report at bugs.python.org (William Moreno) Date: Fri, 21 Jun 2013 01:08:08 +0000 Subject: [issue18274] python: not found Message-ID: <1371776888.26.0.530837339341.issue18274@psf.upfronthosting.co.za> New submission from William Moreno: mklib: Making FreeBSD static library: librtasm.a gmake[4]: Leaving directory `/usr/ports/graphics/libGL/work/Mesa-7.6.1/src/gallium/auxiliary/rtasm' gmake[4]: Entering directory `/usr/ports/graphics/libGL/work/Mesa-7.6.1/src/gallium/auxiliary/util' python u_format_access.py u_format.csv > u_format_access.c python u_format_table.py u_format.csv > u_format_table.c python: not found python: not found gmake[4]: *** No rule to make target `u_format_access.c', needed by `depend'. Stop. gmake[4]: Leaving directory `/usr/ports/graphics/libGL/work/Mesa-7.6.1/src/gallium/auxiliary/util' gmake[3]: *** [default] Error 1 gmake[3]: Leaving directory `/usr/ports/graphics/libGL/work/Mesa-7.6.1/src/gallium/auxiliary' gmake[2]: *** [default] Error 1 gmake[2]: Leaving directory `/usr/ports/graphics/libGL/work/Mesa-7.6.1/src/gallium' gmake[1]: *** [subdirs] Error 1 gmake[1]: Leaving directory `/usr/ports/graphics/libGL/work/Mesa-7.6.1/src' gmake: *** [default] Error 1 *** [do-build] Error code 1 Stop in /usr/ports/graphics/libGL. ---------- components: Build messages: 191545 nosy: wmoreno3 priority: normal severity: normal status: open title: python: not found type: compile error versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:09:32 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 01:09:32 +0000 Subject: [issue17630] Create a pure Python zipfile importer In-Reply-To: <1365026756.4.0.0705755124355.issue17630@psf.upfronthosting.co.za> Message-ID: <1371776972.22.0.218148643337.issue17630@psf.upfronthosting.co.za> Brett Cannon added the comment: Here is an initial stab at a zip file importer using importlib. Probably the biggest shortcoming is that it doesn't support bytecode files, but that's because I just have not bothered to add support yet (it's just one method to implement). There is a note in zipimport that the resolution does not match up between zip file modification times and what bytecode files store and so there needs to be a one second fuzzing factor but I'm not seeing why based on the fact that os.stat().st_mtime is used by bytecode files which has a one second resolution already like zip files. The other shortcoming is bytecode-only files are not supported (on purpose as importlib.abc.SourceLoader doesn't support bytecode-only files). ---------- keywords: +patch Added file: http://bugs.python.org/file30659/zip_importlib.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:19:29 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 01:19:29 +0000 Subject: [issue18272] In itertools recipes there is a typo in __builtins__ In-Reply-To: <1371753346.0.0.321196012203.issue18272@psf.upfronthosting.co.za> Message-ID: <3bc29q6lv3zSWv@mail.python.org> Roundup Robot added the comment: New changeset b805506b11e0 by Andrew Kuchling in branch '3.3': Closes #18272: use 'builtins' for 3.3 instead of __builtin__ http://hg.python.org/cpython/rev/b805506b11e0 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:22:06 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 21 Jun 2013 01:22:06 +0000 Subject: [issue18272] In itertools recipes there is a typo in __builtins__ In-Reply-To: <1371753346.0.0.321196012203.issue18272@psf.upfronthosting.co.za> Message-ID: <1371777726.6.0.95485331745.issue18272@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Thanks for your report! I've corrected the error on the 3.3 and 3.4 branches. ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:26:42 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 21 Jun 2013 01:26:42 +0000 Subject: [issue18250] In itertools.repeat() object shadows object() In-Reply-To: <1371518204.34.0.993952678875.issue18250@psf.upfronthosting.co.za> Message-ID: <1371778002.01.0.81672038044.issue18250@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Thanks for your bug report and patch, but I agree that we can't change this. The repeat() function really does take 'object' as the keyword argument: >>> from itertools import * >>> list(repeat(times=3, object='abc')) ['abc', 'abc', 'abc'] >>> repeat(times=3, element='abc') Traceback (most recent call last): File "", line 1, in TypeError: Required argument 'object' (pos 1) not found Using 'object' is a minor wart, but I think it's not worth the backward compatibility risk of changing it. So the documentation needs to describe the actual keyword argument. ---------- nosy: +akuchling resolution: -> wont fix stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:33:23 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 01:33:23 +0000 Subject: [issue18275] Make isinstance() work with super type instances Message-ID: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> New submission from Brett Cannon: class A: pass class B(A): pass sup = super(B, B()) isinstance(sup, A) # returns False Why is that? Is there an explicit reason to prevent that isinstance check from working? How about just for ABCs? Either way it's annoying that at least for ABCs you can't check against a super object. ---------- components: Interpreter Core messages: 191550 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Make isinstance() work with super type instances type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:38:30 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 01:38:30 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371778710.48.0.279748641723.issue17621@psf.upfronthosting.co.za> Brett Cannon added the comment: One problem with the importers code is it doesn't properly clean up after the module if the load failed and it wasn't a reload. Should store an attribute on the module signaling whether it was a reload or not to know whether an exception raised during loading should lead to the module being removed from sys.modules. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:40:25 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 01:40:25 +0000 Subject: [issue18267] xmlrpc.client documentation multicall example missleading for division behaviour of python3 In-Reply-To: <1371675805.26.0.18697522409.issue18267@psf.upfronthosting.co.za> Message-ID: <3bc2f11vgmzQbC@mail.python.org> Roundup Robot added the comment: New changeset 2a3bc6eb2e13 by Andrew Kuchling in branch '3.3': Closes #18267: use floor division in code example http://hg.python.org/cpython/rev/2a3bc6eb2e13 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 03:43:12 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 01:43:12 +0000 Subject: [issue18274] python: not found In-Reply-To: <1371776888.26.0.530837339341.issue18274@psf.upfronthosting.co.za> Message-ID: <1371778992.63.0.0227839507019.issue18274@psf.upfronthosting.co.za> Brett Cannon added the comment: This is not the right place to ask for help with this. This is either a FreeBSD or Mesa issue. Have you tried installing Python using FreeBSD-ports? ---------- nosy: +brett.cannon resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 04:11:23 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 02:11:23 +0000 Subject: [issue17630] Create a pure Python zipfile importer In-Reply-To: <1365026756.4.0.0705755124355.issue17630@psf.upfronthosting.co.za> Message-ID: <1371780683.82.0.923545316889.issue17630@psf.upfronthosting.co.za> Brett Cannon added the comment: I went ahead and added the needed method for bytecode loading; see the new patch. ---------- Added file: http://bugs.python.org/file30660/zip_importlib.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 05:58:38 2013 From: report at bugs.python.org (William Moreno) Date: Fri, 21 Jun 2013 03:58:38 +0000 Subject: [issue18274] python: not found In-Reply-To: <1371778992.63.0.0227839507019.issue18274@psf.upfronthosting.co.za> Message-ID: <1371787115.68461.YahooMailNeo@web142406.mail.bf1.yahoo.com> William Moreno added the comment: Hi ... tks for answer me ? What is the right place ? Yes, I have installed Python using FreeBSD-ports? I am using FreeBSD-ports regulary. William Elasio Moreno Albarracin Ingeniero de Sistemas de la Universidad Antonio Nari?o Universidad Industrial de Santander - Cursos Especializaci?n en Telecomunicaciones ________________________________ De: Brett Cannon Para: wmoreno3 at yahoo.com Enviado: Jueves, 20 de junio, 2013 8:43 P.M. Asunto: [issue18274] python: not found Brett Cannon added the comment: This is not the right place to ask for help with this. This is either a FreeBSD or Mesa issue. Have you tried installing Python using FreeBSD-ports? ---------- nosy: +brett.cannon resolution:? -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 05:58:38 2013 From: report at bugs.python.org (William Moreno) Date: Fri, 21 Jun 2013 03:58:38 +0000 Subject: [issue18274] python: not found In-Reply-To: <1371778992.63.0.0227839507019.issue18274@psf.upfronthosting.co.za> Message-ID: <1371787115.68461.YahooMailNeo@web142406.mail.bf1.yahoo.com> William Moreno added the comment: Hi ... tks for answer me ? What is the right place ? Yes, I have installed Python using FreeBSD-ports? I am using FreeBSD-ports regulary. William Elasio Moreno Albarracin Ingeniero de Sistemas de la Universidad Antonio Nari?o Universidad Industrial de Santander - Cursos Especializaci?n en Telecomunicaciones ________________________________ De: Brett Cannon Para: wmoreno3 at yahoo.com Enviado: Jueves, 20 de junio, 2013 8:43 P.M. Asunto: [issue18274] python: not found Brett Cannon added the comment: This is not the right place to ask for help with this. This is either a FreeBSD or Mesa issue. Have you tried installing Python using FreeBSD-ports? ---------- nosy: +brett.cannon resolution:? -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 08:42:48 2013 From: report at bugs.python.org (Eric Snow) Date: Fri, 21 Jun 2013 06:42:48 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1371796968.62.0.530883221021.issue16991@psf.upfronthosting.co.za> Eric Snow added the comment: I figured out what I hope were the last memory-related issues. Apparently tp_traverse is not inherited if tp_flags is set. I had it set on all the view types and all the iterator types. So during GC it would blow up when it tried to call tp_traverse. Everything is looking pretty good so I'm attaching the latest diff. ---------- Added file: http://bugs.python.org/file30661/cOrderedDict.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 08:43:12 2013 From: report at bugs.python.org (Eric Snow) Date: Fri, 21 Jun 2013 06:43:12 +0000 Subject: [issue16991] Add OrderedDict written in C In-Reply-To: <1358482110.59.0.347859163753.issue16991@psf.upfronthosting.co.za> Message-ID: <1371796992.38.0.673681978851.issue16991@psf.upfronthosting.co.za> Changes by Eric Snow : Removed file: http://bugs.python.org/file30468/cOrderedDict.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 08:48:15 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 21 Jun 2013 06:48:15 +0000 Subject: [issue17630] Create a pure Python zipfile importer In-Reply-To: <1365026756.4.0.0705755124355.issue17630@psf.upfronthosting.co.za> Message-ID: <1371797295.08.0.733598823908.issue17630@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Times in a ZIP files have a two-seconds resolution (in the old DOS FAT format: 5 bits for the hours, 6 bits for the minutes, and only 5 bits left for the seconds) Some fuziness logic is needed when comparing against a time_t. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 10:36:39 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 21 Jun 2013 08:36:39 +0000 Subject: [issue3354] Improve error reporting for the argument parsing C API In-Reply-To: <1216040063.73.0.634067891199.issue3354@psf.upfronthosting.co.za> Message-ID: <1371803799.96.0.0562569006757.issue3354@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 10:52:45 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 21 Jun 2013 08:52:45 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> Message-ID: <1371804765.21.0.326022161238.issue18275@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Does anyone actually check for instance-ness of super objects? I would never have thought of such an idiom. ---------- nosy: +benjamin.peterson, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 10:52:59 2013 From: report at bugs.python.org (Tillmann Karras) Date: Fri, 21 Jun 2013 08:52:59 +0000 Subject: [issue10744] ctypes arrays have incorrect buffer information (PEP-3118) In-Reply-To: <1292882808.9.0.159361940034.issue10744@psf.upfronthosting.co.za> Message-ID: <1371804779.19.0.0023212533057.issue10744@psf.upfronthosting.co.za> Changes by Tillmann Karras : ---------- nosy: +Tilka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 11:23:11 2013 From: report at bugs.python.org (Robert Buchholz) Date: Fri, 21 Jun 2013 09:23:11 +0000 Subject: [issue14776] Add SystemTap static markers In-Reply-To: <1336683916.13.0.827403167525.issue14776@psf.upfronthosting.co.za> Message-ID: <1371806591.37.0.199068325644.issue14776@psf.upfronthosting.co.za> Changes by Robert Buchholz : ---------- nosy: +Robert.Buchholz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 11:24:24 2013 From: report at bugs.python.org (Robert Buchholz) Date: Fri, 21 Jun 2013 09:24:24 +0000 Subject: [issue13405] Add DTrace probes In-Reply-To: <1321299726.66.0.343368151185.issue13405@psf.upfronthosting.co.za> Message-ID: <1371806664.28.0.300708171989.issue13405@psf.upfronthosting.co.za> Changes by Robert Buchholz : ---------- nosy: +Robert.Buchholz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 11:24:36 2013 From: report at bugs.python.org (Robert Buchholz) Date: Fri, 21 Jun 2013 09:24:36 +0000 Subject: [issue14776] Add SystemTap static markers In-Reply-To: <1336683916.13.0.827403167525.issue14776@psf.upfronthosting.co.za> Message-ID: <1371806676.86.0.760585266669.issue14776@psf.upfronthosting.co.za> Robert Buchholz added the comment: It's been a year and the 3.4 alpha is approaching. What's the status of upstream inclusion of this patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 11:27:46 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 21 Jun 2013 09:27:46 +0000 Subject: [issue14776] Add SystemTap static markers In-Reply-To: <1336683916.13.0.827403167525.issue14776@psf.upfronthosting.co.za> Message-ID: <1371806866.5.0.3188442711.issue14776@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Note that feature freeze happens after the first /beta/, so the alpha release isn't a showstopper. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 12:29:53 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jun 2013 10:29:53 +0000 Subject: [issue10744] ctypes arrays have incorrect buffer information (PEP-3118) In-Reply-To: <1292882808.9.0.159361940034.issue10744@psf.upfronthosting.co.za> Message-ID: <1371810593.44.0.429316022213.issue10744@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- versions: +Python 3.4 -Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 12:30:21 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jun 2013 10:30:21 +0000 Subject: [issue10744] ctypes arrays have incorrect buffer information (PEP-3118) In-Reply-To: <1292882808.9.0.159361940034.issue10744@psf.upfronthosting.co.za> Message-ID: <1371810621.73.0.446804386267.issue10744@psf.upfronthosting.co.za> STINNER Victor added the comment: @skrah: What is the status of this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 13:01:34 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 21 Jun 2013 11:01:34 +0000 Subject: [issue14776] Add SystemTap static markers In-Reply-To: <1336683916.13.0.827403167525.issue14776@psf.upfronthosting.co.za> Message-ID: <1371812494.27.0.891954761969.issue14776@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +christian.heimes versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 13:12:42 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 21 Jun 2013 11:12:42 +0000 Subject: [issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor() Message-ID: <1371813162.19.0.902104537883.issue18276@psf.upfronthosting.co.za> New submission from Christian Heimes: I suggest that posixpath.c:_fd_converter() should PyObject_AsFileDescriptor() to convert a Python object to a fd integer. With PyObject_AsFileDescriptor() functions such as os.chmod() can be called with an opened file as first argument: Now: with open("somefile") as f: os.chmod(f.fileno(), 0o644) With PyObject_AsFileDescriptor(): with open("somefile") as f: os.chmod(f, 0o644) _fd_converter() also has more elaborate overflow checks. These checks should be added to PyObject_AsFileDescriptor(), too. ---------- messages: 191563 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor() type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 13:20:52 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 21 Jun 2013 11:20:52 +0000 Subject: [issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor() In-Reply-To: <1371813162.19.0.902104537883.issue18276@psf.upfronthosting.co.za> Message-ID: <1371813652.51.0.814055427641.issue18276@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Do we want the low-level os.write() to work with file objects, or sockets? ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 13:29:57 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jun 2013 11:29:57 +0000 Subject: [issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor() In-Reply-To: <1371813162.19.0.902104537883.issue18276@psf.upfronthosting.co.za> Message-ID: <1371814197.05.0.935930557146.issue18276@psf.upfronthosting.co.za> STINNER Victor added the comment: This issue looks to be related to #18269. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 13:30:16 2013 From: report at bugs.python.org (shwouchk) Date: Fri, 21 Jun 2013 11:30:16 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread Message-ID: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> New submission from shwouchk: Consider this: $ python Python 2.7.4 (default, Apr 19 2013, 18:28:01) [GCC 4.7.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import multiprocessing as mp >>> q = mp.Queue() >>> while True: q.put(1) q.get_nowait() Traceback (most recent call last): File "", line 3, in File "/usr/lib/python2.7/multiprocessing/queues.py", line 152, in get_nowait return self.get(False) File "/usr/lib/python2.7/multiprocessing/queues.py", line 134, in get raise Empty Queue.Empty I believe that similar behavior could be seen in cPython 2.7.3 with the Queue.Queue implementation, but I can't reproduce it now and don't have the old version to test. And it is irrelevant anyway since it work "correctly" now. I think this behavior is counter intuitive and hampers the development of code that performs stuff with queues in a generic way and works in both single and multi-process environments. ---------- components: IO, Interpreter Core messages: 191566 nosy: shwouchk priority: normal severity: normal status: open title: Queue is empty right after put from the same process/thread type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 13:33:45 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 21 Jun 2013 11:33:45 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371814425.95.0.569555638464.issue18220@psf.upfronthosting.co.za> A.M. Kuchling added the comment: This bug is entirely too cryptic. What exactly is the problem you're trying to fix? ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 13:45:03 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 11:45:03 +0000 Subject: [issue18247] Add Lib/test/data/ to .gitignore In-Reply-To: <1371512505.36.0.839773102972.issue18247@psf.upfronthosting.co.za> Message-ID: <3bcJ3f1vknz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset 68e1eec01113 by Andrew Kuchling in branch 'default': Closes #18247: add Lib/test/data/* to .gitignore http://hg.python.org/cpython/rev/68e1eec01113 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 13:52:17 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 21 Jun 2013 11:52:17 +0000 Subject: [issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor() In-Reply-To: <1371813162.19.0.902104537883.issue18276@psf.upfronthosting.co.za> Message-ID: <1371815537.43.0.698978328307.issue18276@psf.upfronthosting.co.za> Christian Heimes added the comment: os.write() already works with file and sockets object but you have to call ob.fileno() first. The select module uses PyObject_AsFileDescriptor() all over the module to get the file descriptor number from file and socket objects. Let's unify os' and select's behavior! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 14:05:57 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 12:05:57 +0000 Subject: [issue18239] In itertools docstring update arguments in count() example In-Reply-To: <1371452665.1.0.633243797151.issue18239@psf.upfronthosting.co.za> Message-ID: <3bcJWm53dfz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset ad0b44cdae41 by Andrew Kuchling in branch '3.3': Closes #18239: correct description of count() in module docstring http://hg.python.org/cpython/rev/ad0b44cdae41 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 14:05:58 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 12:05:58 +0000 Subject: [issue18218] In itertools.count() clarify the starting point In-Reply-To: <1371270577.83.0.291953378937.issue18218@psf.upfronthosting.co.za> Message-ID: <3bcJWn3BFkz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset 12478f549ed8 by Andrew Kuchling in branch '3.3': Closes #18218: use correct variable name for starting point http://hg.python.org/cpython/rev/12478f549ed8 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 14:08:07 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 21 Jun 2013 12:08:07 +0000 Subject: [issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor() In-Reply-To: <1371813162.19.0.902104537883.issue18276@psf.upfronthosting.co.za> Message-ID: <1371816487.67.0.0460340242862.issue18276@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: > Let's unify os' and select's behavior! OK, let's do that on Windows first :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 14:11:07 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 21 Jun 2013 12:11:07 +0000 Subject: [issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor() In-Reply-To: <1371813162.19.0.902104537883.issue18276@psf.upfronthosting.co.za> Message-ID: <1371816667.21.0.125148304882.issue18276@psf.upfronthosting.co.za> Christian Heimes added the comment: > OK, let's do that on Windows first :-) Gotcha :( Damn you winsock.dll! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 14:27:27 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jun 2013 12:27:27 +0000 Subject: [issue18276] posixpath.c:_fd_converter() should use PyObject_AsFileDescriptor() In-Reply-To: <1371813162.19.0.902104537883.issue18276@psf.upfronthosting.co.za> Message-ID: <1371817647.05.0.713157058648.issue18276@psf.upfronthosting.co.za> STINNER Victor added the comment: > OK, let's do that on Windows first :-) For the PEP 433, I did something like that in os.get_cloexec() and os.set_cloexec(): http://hg.python.org/features/pep-433/file/f32c2b09f332/Modules/posixmodule.c#l10198 On Windows, I added two code paths: one for HANDLE (to support sockets), one for file descriptors (classic files). It means that you need a C function supports HANDLE as input type, rather than int (file descriptor). Can't we raise a nice error message when we get a socket, whereas the function does not support HANDLE? What is the current message on Windows when passing sock.fileno() to a function expecting a file descriptor? Would it be worse if Python implictly call .fileno() on a socket? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 14:57:59 2013 From: report at bugs.python.org (Stefan Krah) Date: Fri, 21 Jun 2013 12:57:59 +0000 Subject: [issue10744] ctypes arrays have incorrect buffer information (PEP-3118) In-Reply-To: <1371810621.73.0.446804386267.issue10744@psf.upfronthosting.co.za> Message-ID: <20130621125759.GA29492@sleipnir.bytereef.org> Stefan Krah added the comment: Basically someone has to review the patch and commit it. I'm not really using ctypes, so for me a decent review would take a while. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 15:03:38 2013 From: report at bugs.python.org (Richard Milne) Date: Fri, 21 Jun 2013 13:03:38 +0000 Subject: [issue17913] stat.filemode returns "-" for sockets and unknown types In-Reply-To: <1367831480.84.0.461149512803.issue17913@psf.upfronthosting.co.za> Message-ID: <1371819818.66.0.966848674241.issue17913@psf.upfronthosting.co.za> Richard Milne added the comment: I've added some changes to the module which (I believe) not only fix this bug, but add the reverse function, converting a permission string to a number. The diff was made against Lib/stat.py @ 84234:f32dad3a243e, which was the most recent version of the file I could find. My patch is intended for Python 2.7, but should work on 3.3 (though I haven't tested it there). My 'filemode' function ('mode2str') is not as short and elegant as the current one, but then it should fix this bug, and it doesn't require duplicating so many of the module's constants in a lookup table. It also includes a check to make sure mode characters (like 'p', 's', '-', etc) are defined for every numeric mode in the module... so long as their names start with the prefix "S_IF" (... which may lead to conflicts with issue 17924). I may also have gone beyond the scope, and added code to recognise the git link file mode (see http://stackoverflow.com/questions/737673/how-to-read-the-mode-field-of-git-ls-trees-output), but this extension should be easy to recognise and remove. Lastly, there are some minor whitespace and sorting changes (notably, S_IF* defs sorted by mode num). As for tests, I couldn't find any for this module in Lib/test. I have at least included a command line test which exhaustively tests the encoding and decoding of every valid file mode. If you want, I've even a test script which creates an example of every valid file type (apart from socket and git link types), with every valid file mode! ---------- nosy: +rmilne versions: +Python 2.7 Added file: http://bugs.python.org/file30662/file_modes_strings.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 15:29:13 2013 From: report at bugs.python.org (anatoly techtonik) Date: Fri, 21 Jun 2013 13:29:13 +0000 Subject: [issue18269] Add new parameter format for converter function w/ position number In-Reply-To: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> Message-ID: <1371821353.71.0.0261073321963.issue18269@psf.upfronthosting.co.za> anatoly techtonik added the comment: This is more sophisticated that I thought. Thank for the explanation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 15:34:43 2013 From: report at bugs.python.org (Richard Milne) Date: Fri, 21 Jun 2013 13:34:43 +0000 Subject: [issue17913] stat.filemode returns "-" for sockets and unknown types In-Reply-To: <1367831480.84.0.461149512803.issue17913@psf.upfronthosting.co.za> Message-ID: <1371821683.84.0.183153156249.issue17913@psf.upfronthosting.co.za> Richard Milne added the comment: I already see my name change will cause problems. The tarfile.py (Lib/tarfile.py:277) module relies on the function being named 'filemode'. As the stat.filemode function is relatively new, I don't know how many other modules rely on it. I changed the name because I thought the new name (mode2str) better described what the function does, and is orthogonal to the reverse function (str2mode). But, of course, I've no issue with whatever the functions are finally named... I'll leave the decision to someone with a bit more experience. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 15:46:20 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 13:46:20 +0000 Subject: [issue18274] python: not found In-Reply-To: <1371776888.26.0.530837339341.issue18274@psf.upfronthosting.co.za> Message-ID: <1371822380.83.0.281986712007.issue18274@psf.upfronthosting.co.za> Brett Cannon added the comment: It would either be with freebsd-ports for having packaged Mesa incorrectly or with Mesa for having something wrong with their build setup. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 15:48:38 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 13:48:38 +0000 Subject: [issue17630] Create a pure Python zipfile importer In-Reply-To: <1365026756.4.0.0705755124355.issue17630@psf.upfronthosting.co.za> Message-ID: <1371822518.51.0.103837010663.issue17630@psf.upfronthosting.co.za> Brett Cannon added the comment: A two second granularity? Ugh. That will require a new (possibly private) API to abstract that out in order to handle that case. What a pain. While I look into that if people can look at the code and let me know if they see anything wrong with it, hard to understand, or a way to improve I would appreciate it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 15:55:49 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 13:55:49 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> Message-ID: <1371822949.07.0.28180155675.issue18275@psf.upfronthosting.co.za> Brett Cannon added the comment: So I have a use case for this actually. =) http://bugs.python.org/issue17621 is about trying to finally add a lazy mixin to importlib so people stop asking for it. I have a version already written externally at https://code.google.com/p/importers/source/browse/importers/lazy.py. Part of the trick of making it work is having a way to drop the lazy mixin from the loader MRO for all future uses (which is important for reloads) is to assign __loader__ to super(Mixin, self). The problem is that if you use isinstance on that loader with any of the ABCs in importlib.abc it will always come back false no matter whether the interface is actually implemented or not. While I consider it a marginal thing for people to do (importlib.abc is for making sure people implement the right methods and providing default implementations, not for interface checking), I'm sure someone will do it and I would like one less possible warning in any future docs about this lazy mixin regarding isinstance checks. ---------- priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 16:02:22 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 21 Jun 2013 14:02:22 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371822949.07.0.28180155675.issue18275@psf.upfronthosting.co.za> Message-ID: <1454941013.104749188.1371823335809.JavaMail.root@zimbra10-e2.priv.proxad.net> Antoine Pitrou added the comment: > http://bugs.python.org/issue17621 is about trying to finally add a > lazy mixin to importlib so people stop asking for it. I have a > version already written externally at > https://code.google.com/p/importers/source/browse/importers/lazy.py. > Part of the trick of making it work is having a way to drop the lazy > mixin from the loader MRO for all future uses (which is important > for reloads) is to assign __loader__ to super(Mixin, self). That sounds like a better job for a proxy rather than a mixin. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 16:23:22 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 21 Jun 2013 14:23:22 +0000 Subject: [issue10744] ctypes arrays have incorrect buffer information (PEP-3118) In-Reply-To: <1292882808.9.0.159361940034.issue10744@psf.upfronthosting.co.za> Message-ID: <1371824602.35.0.297401792277.issue10744@psf.upfronthosting.co.za> Ronald Oussoren added the comment: The correct format string for Py_ssize_t with sprintf is "%"PY_FORMAT_SIZE_T"d" (defined and explained in pyport.h). ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 16:34:58 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 21 Jun 2013 14:34:58 +0000 Subject: [issue3354] Improve error reporting for the argument parsing C API In-Reply-To: <1216040063.73.0.634067891199.issue3354@psf.upfronthosting.co.za> Message-ID: <1371825298.42.0.105912575403.issue3354@psf.upfronthosting.co.za> Ronald Oussoren added the comment: See also #18269. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 16:42:10 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 21 Jun 2013 14:42:10 +0000 Subject: [issue18269] Add new parameter format for converter function w/ position number In-Reply-To: <1371709497.35.0.24521044136.issue18269@psf.upfronthosting.co.za> Message-ID: <1371825730.24.0.270146840533.issue18269@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I don't think that a new parameter format is sufficient. For the message in this call the new parameter isn't even needed, you'd "just" have to ensure that enough information is available in convertsimple to create a more useful message. That said, that is far from a trivial change, more so because the PyArg_Parse family of functions can parse fairly complicated argument structures in one go (such as using ``PyArg_Parse(args, "(si)", &host, port)`` to unpack the tuple in the first (and only) argument). ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 16:49:03 2013 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jun 2013 14:49:03 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371826143.64.0.582581016441.issue18264@psf.upfronthosting.co.za> Guido van Rossum added the comment: The proposal to change json from using repr() to str() has unknown dangers. I don't want the str() of IntEnum to return just the decimal string (e.g. "42"), since that breaks half of the usefulness of using the enum in the first place -- people will write print(x) and be confused. Unfortunately the json module doesn't have a way to define *in the object* how to customize its serialization -- this is always done in the json encoder/decoder. Maybe we can add something to the JSON encoder and decoder class that looks for a special method, e.g. __json_encode__ etc.? (OR maybe this would be a use case for PEP 443?) ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 16:50:57 2013 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jun 2013 14:50:57 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371826257.16.0.413797672448.issue18264@psf.upfronthosting.co.za> Guido van Rossum added the comment: Modifying json to use str(int(value)) (if it detects isinstance(value, int)) is fine with me too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 16:51:51 2013 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 21 Jun 2013 14:51:51 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371826311.87.0.395086864127.issue18264@psf.upfronthosting.co.za> Guido van Rossum added the comment: And similar for floats, really. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 17:00:42 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 15:00:42 +0000 Subject: [issue13226] Expose RTLD_* constants in the posix module In-Reply-To: <1319061944.29.0.561087845829.issue13226@psf.upfronthosting.co.za> Message-ID: <3bcNPP3g6JzQl7@mail.python.org> Roundup Robot added the comment: New changeset 1da78c7d382b by Andrew Kuchling in branch 'default': #13226: update references from ctypes/DLFCN modules to os module http://hg.python.org/cpython/rev/1da78c7d382b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 17:01:38 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 15:01:38 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1454941013.104749188.1371823335809.JavaMail.root@zimbra10-e2.priv.proxad.net> Message-ID: Brett Cannon added the comment: On Fri, Jun 21, 2013 at 10:02 AM, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > > http://bugs.python.org/issue17621 is about trying to finally add a > > lazy mixin to importlib so people stop asking for it. I have a > > version already written externally at > > https://code.google.com/p/importers/source/browse/importers/lazy.py. > > Part of the trick of making it work is having a way to drop the lazy > > mixin from the loader MRO for all future uses (which is important > > for reloads) is to assign __loader__ to super(Mixin, self). > > That sounds like a better job for a proxy rather than a mixin. > I'm attracted to the idea of making a loader lazy by simply doing something like ``class LazySourceFileLoader(LazyMixin, SourceFileLoader): ...``. The key thing is that it doesn't require proxying the constructor in situations like PathEntryFinder where the finder is going to be making your loader instance (or at least calling the object). I mean you could override __call__ to store the arguments and then simply use them when needed to construct the real loader, but I don't know if that makes the code simpler without actually coding it up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 17:02:04 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 21 Jun 2013 15:02:04 +0000 Subject: [issue12716] Reorganize os docs for files/dirs/fds In-Reply-To: <1312900904.97.0.581848486096.issue12716@psf.upfronthosting.co.za> Message-ID: <1371826924.35.0.201735824982.issue12716@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Mike Hoy: a later patch (http://bugs.python.org/issue14626) changed the API in the os module so that the wrappers for *at() functions went away; fchmod() now takes several different forms of argument and calls the correct function under the hood. ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 17:11:22 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 21 Jun 2013 15:11:22 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: Message-ID: <321168303.104948717.1371827476523.JavaMail.root@zimbra10-e2.priv.proxad.net> Antoine Pitrou added the comment: > I'm attracted to the idea of making a loader lazy by simply doing > something > like ``class LazySourceFileLoader(LazyMixin, SourceFileLoader): > ...``. But then you have to make a specific Lazy subclass for each delegated loader implementation. With a proxy class you would simply proxy each loader instance: existing_loader = SourceFileLoader(...) lazy_loader = LazyLoader(existing_loader) ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 17:50:14 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 15:50:14 +0000 Subject: [issue12716] Reorganize os docs for files/dirs/fds In-Reply-To: <1312900904.97.0.581848486096.issue12716@psf.upfronthosting.co.za> Message-ID: <3bcPVY4LgVz7Ljs@mail.python.org> Roundup Robot added the comment: New changeset 88edac3bc2fc by Andrew Kuchling in branch 'default': #12716: reorganize docs for os module a bit http://hg.python.org/cpython/rev/88edac3bc2fc ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 17:51:48 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Fri, 21 Jun 2013 15:51:48 +0000 Subject: [issue12716] Reorganize os docs for files/dirs/fds In-Reply-To: <1312900904.97.0.581848486096.issue12716@psf.upfronthosting.co.za> Message-ID: <1371829908.08.0.557527273688.issue12716@psf.upfronthosting.co.za> A.M. Kuchling added the comment: I didn't see any other constants that aren't close to the function they're used with. Can this issue be closed, or are there other changes to make? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 18:18:20 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 21 Jun 2013 16:18:20 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1371831500.06.0.308987223365.issue18217@psf.upfronthosting.co.za> ?ric Araujo added the comment: Working with an explicit translator object sounds much better to me too. I haven?t used it yet, but Babel has been on my radar for long, and does that (like flufl.i18n from what I can tell). ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 18:26:27 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 16:26:27 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <3bcQJM1sc4z7Lkd@mail.python.org> Roundup Robot added the comment: New changeset f8ff61f44aca by Christian Heimes in branch '3.3': Add tests for untested features of the 'stat' module (part of issue #11016) http://hg.python.org/cpython/rev/f8ff61f44aca New changeset d15aee50e4a0 by Christian Heimes in branch 'default': Add tests for untested features of the 'stat' module (part of issue #11016) http://hg.python.org/cpython/rev/d15aee50e4a0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 18:35:09 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 21 Jun 2013 16:35:09 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371831500.06.0.308987223365.issue18217@psf.upfronthosting.co.za> Message-ID: <20130621123506.40d445e4@anarchist> Barry A. Warsaw added the comment: On Jun 21, 2013, at 04:18 PM, ?ric Araujo wrote: >Working with an explicit translator object sounds much better to me too. I >haven?t used it yet, but Babel has been on my radar for long, and does that >(like flufl.i18n from what I can tell). flufl.enum didn't make it into the stdlib. Think I'd have more luck with flufl.i18n? ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 19:15:22 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 21 Jun 2013 17:15:22 +0000 Subject: [issue18235] _sysconfigdata.py wrong on AIX installations In-Reply-To: <1371429201.94.0.372851990361.issue18235@psf.upfronthosting.co.za> Message-ID: <1371834922.21.0.64375982376.issue18235@psf.upfronthosting.co.za> ?ric Araujo added the comment: Can you suggest how to fix this? ---------- components: +Build -Extension Modules nosy: +eric.araujo versions: +Python 3.3, Python 3.4 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 19:31:21 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 17:31:21 +0000 Subject: [issue18278] Clarify the loader requirements for importlib.machinery.FileFinder Message-ID: <1371835881.83.0.662808557913.issue18278@psf.upfronthosting.co.za> New submission from Brett Cannon: Should specify the loader needs to be a callable which accepts two arguments: module name and found file path. ---------- assignee: brett.cannon components: Documentation messages: 191599 nosy: brett.cannon priority: low severity: normal stage: needs patch status: open title: Clarify the loader requirements for importlib.machinery.FileFinder versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 19:31:33 2013 From: report at bugs.python.org (py.user) Date: Fri, 21 Jun 2013 17:31:33 +0000 Subject: [issue18220] In itertools.islice() make prototype like in help() In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371835893.84.0.35746444083.issue18220@psf.upfronthosting.co.za> py.user added the comment: [guest at localhost cpython]$ ./python Python 3.4.0a0 (default, Jun 22 2013, 04:24:17) [GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> import itertools >>> print(range.__doc__, slice.__doc__, itertools.islice.__doc__, sep='\n***\n') range(stop) -> range object range(start, stop[, step]) -> range object Returns a virtual sequence of numbers from start to stop by step. *** slice(stop) slice(start, stop[, step]) Create a slice object. This is used for extended slicing (e.g. a[0:10:2]). *** islice(iterable, [start,] stop [, step]) --> islice object Return an iterator whose next() method returns selected values from an iterable. If start is specified, will skip all preceding elements; otherwise, start defaults to zero. Step defaults to one. If specified as another value, step determines how many values are skipped between successive calls. Works like a slice() on a list but returns an iterator. >>> I have updated the patch ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 19:35:59 2013 From: report at bugs.python.org (Ethan Furman) Date: Fri, 21 Jun 2013 17:35:59 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371649541.07.0.776235119954.issue18264@psf.upfronthosting.co.za> Message-ID: <1371836159.69.0.175455919906.issue18264@psf.upfronthosting.co.za> Ethan Furman added the comment: I'd be in favor of the __protocol__ route first and the PEP 443 route second. The problem with just tacking in `str(int(value))` or `str(float(value))` is where does it stop? StrEnum, TupleEnum, BytesEnum, ComplexEnum, SomeOtherInterestingConstantEnum, etc., etc.. If we go the __protocol__ route we add one method to Enum which returns the `str` of its `.value`, and we're set for every Enum.* As a bonus, any other object that needs special json (or yaml or whatever) consideration has a fairly easy way to make it happen. *Every normal Enum, anyway. ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 19:51:14 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 17:51:14 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <321168303.104948717.1371827476523.JavaMail.root@zimbra10-e2.priv.proxad.net> Message-ID: Brett Cannon added the comment: On Fri, Jun 21, 2013 at 11:11 AM, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > > I'm attracted to the idea of making a loader lazy by simply doing > > something > > like ``class LazySourceFileLoader(LazyMixin, SourceFileLoader): > > ...``. > > But then you have to make a specific Lazy subclass for each delegated > loader implementation. With a proxy class you would simply proxy each > loader instance: > > existing_loader = SourceFileLoader(...) > lazy_loader = LazyLoader(existing_loader) > ... But the point I tried to make earlier is that approach doesn't work directly when you are creating the loader instances dynamically within a finder. E.g. FileFinder ( http://docs.python.org/3/library/importlib.html#importlib.machinery.FileFinder) instantiates the loader for you. Now you could tweak things to make this work, but it isn't quite as straightforward as you suggest because of this need to have a callable for finders to use to create new loaders: class LazyProxy(importlib.abc.Loader): def __init__(self, loader): self.loader = loader def __call__(self, *args, **kwargs): self.args = args self.kwargs = kwargs return self def load_module(self, fullname): # XXX ignoring sys.modules details, e.g. if module already existed. lazy_module = LazyModule(fullname, proxy=self, name=fullname) sys.modules[fullname] = lazy_module return lazy_module class LazyModule(types.ModuleType): def __init__(*args, proxy, name, **kwargs): self.__proxy = proxy self.__name = name super().__init__(*args, **kwargs) def __getattribute__(self, attr): self.__class__ = Module state = self.__dict__.copy() loader = self.__proxy.loader(*self.proxy.args, **self.proxy.kwargs) # XXX ignoring sys.modules details, e.g. removing module on load failure. loader.load_module(self.__name) self.__dict__.update(state) return getattr(module, attr) That's all totally untested (not even verified to compile) but I think that would do what you are suggesting. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 19:56:15 2013 From: report at bugs.python.org (Daniel Farina) Date: Fri, 21 Jun 2013 17:56:15 +0000 Subject: [issue14903] dictobject infinite loop while importing socket In-Reply-To: <1337890784.99.0.00556765207687.issue14903@psf.upfronthosting.co.za> Message-ID: <1371837375.8.0.85220131074.issue14903@psf.upfronthosting.co.za> Changes by Daniel Farina : ---------- title: dictobject infinite loop -> dictobject infinite loop while importing socket _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 20:21:38 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 18:21:38 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1371838898.94.0.00494242283018.issue18217@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The rationale for install is "For convenience, you want the _() function to be installed in Python?s builtins namespace, so it is easily accessible in all modules of your application." As David noted, this also make it easy to update _ in just one place when a new language is selected. Alex disagrees and would like to break any code that uses install, which I thing is much code, by removing it. This would force writers to do something else that will be *much* more work and which might make code harder to read. We do not do this without much greater reason than Alex has given. I think this a bad deprecation proposal and should be rejected. I also think the idea should have been posted to python-ideas first. I do think that this should become a doc issue to clarify the meaning and usage of install. The link Alex gave was to NullTranslations.install. The module install function itself is at http://hg.python.org/cpython/file/01da7bf11ca1/Lib/gettext.py#l424 The doc for install could be much improved to say what it actually does. "Pass *domain*, *localedir*, fallback=True, and *codeset* to translation, which returns translation instance t. Pass *names* to t.install. The default install method, NullTranslations.install , which is inherited by GNUTranslations , installs t.gettext in builtins as _. See the description of translation and NullTranslations.install for the meaning of the parameters." + rationale quoted above This expanded doc would make it clearer that one can write a custom subclass of NullTranslations with a custom .install method that would do something different, such as bind _ to a dynamic (indirect) gettext, whether in builtins or in a project module that is explicitly imported by every module that needs it. The doc for NullTranslations.install needs the erroneous '()'s removed to make clear that the bindings are to bound methods and not the result of calls to bound methods. Ie, self.gettest() should be just self.gettext. ---------- nosy: +terry.reedy type: -> enhancement versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 20:29:53 2013 From: report at bugs.python.org (Ned Deily) Date: Fri, 21 Jun 2013 18:29:53 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1371839393.89.0.301649001898.issue18277@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 21:05:40 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 19:05:40 +0000 Subject: [issue18219] csv.DictWriter is slow when writing files with large number of columns In-Reply-To: <1371273159.09.0.766674685212.issue18219@psf.upfronthosting.co.za> Message-ID: <1371841540.31.0.50246057942.issue18219@psf.upfronthosting.co.za> Terry J. Reedy added the comment: What is the purpose in touching fieldnames, either in tuple-izing it or in making it private and wrapped with a property. If someone wants to modify it, that is up to them. In any case, this change is not germane to the issue and could break code, so I would not make it. wrong_fields could be calculated with any(k for k in rowdict if k not in self._fieldset) to stop on the first extra, if any. That said, in 3.x, replacing wrong_fields = if wrong_fields: with if rowdict.keys() - self._fieldset: should be even faster because the iteration, which will nearly always go to completion, is entirely in C (or whatever). Does test/text_cvs have tests for DictWriter, both with and without rowdict errors? If so, or if added, I would be willing to commit a patch that simply added ._fieldset and used it as above for a set difference. Also, if you have not done so yet, please go to http://www.python.org/psf/contrib/ and http://www.python.org/psf/contrib/contrib-form/ new electronic form and submit a contributor agreement. An '*' will appear after your name here when it is processed. ---------- nosy: +terry.reedy versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 21:22:20 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 Jun 2013 19:22:20 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> Message-ID: <1371842540.1.0.271199353216.issue18275@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'm not sure this is a theoretically sound idea. Do you know what CLOS does in the same circumstance? ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 21:55:52 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 19:55:52 +0000 Subject: [issue18220] Expand itertools.islice docstring signature to 2 lines In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <1371844552.22.0.797785297748.issue18220@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The problem with all of range, slice, and islice is that [start,] stop [, step] is an impossible signature and needed to be changed. The actual signature is start_or_stop, [stop, [step]] with customized processing to interpret start_or_stop according to the presence of stop (which is not really optional). We suggestion to doc it this was rejected as equally confusing. In 3.3, we decided to stop trying to force all signatures presented to the user into one line and instead use multiple lines to present what are multiple signatures from a user view. So this alternative was used for range and slice (and other functions). For islice, the islice entry has itertools.islice(iterable, stop) itertools.islice(iterable, start, stop[, step]) Py.user is corrrect in suggesting the same change for islice docstring. I have changed the title to be clearer. The itertools function table has islice() seq, [start,] stop [, step] elements from ... I thing this should be changed also. A new line for arguments 'seq, stop' would say 'elements from seq[0:stop]' example 'islice('ABCDEFG', 2) --> A B Then remove brackets from [start] in the current line. Py.user: To accept non-trival patches (typos, grammar corrections are trivial) we need a signed contributor agreement http://www.python.org/psf/contrib/ and http://www.python.org/psf/contrib/contrib-form/ new electronic form An '*' will appear after your name here when it is processed. I presume this will need a real (legal) name on the form, even though not in the tracker user list. ---------- nosy: +terry.reedy stage: -> patch review title: In itertools.islice() make prototype like in help() -> Expand itertools.islice docstring signature to 2 lines _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 21:57:06 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 19:57:06 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> Message-ID: <1371844626.54.0.756982497065.issue18275@psf.upfronthosting.co.za> Brett Cannon added the comment: I have no idea what CLOS does in this situation. I'm fine with this never being changed, but I wanted to at least file the bug to have the discussion in case it ever comes up again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 22:26:09 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 20:26:09 +0000 Subject: [issue18222] os.path.abspath should accept multiple path parts and join them In-Reply-To: <1371300014.52.0.302689191901.issue18222@psf.upfronthosting.co.za> Message-ID: <1371846369.56.0.887831311443.issue18222@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Ditto, for reasons given ---------- nosy: +terry.reedy resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 22:26:40 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Fri, 21 Jun 2013 20:26:40 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1371846400.81.0.94556679197.issue18277@psf.upfronthosting.co.za> Richard Oudkerk added the comment: This is a very similar issue to #17985. While it may seem counter-intuitive, I don't see how it makes any difference. Another thread/process might remove the item before you can get it. I find it very difficult to imagine a real program where you can safely use get_nowait() without being prepared to handle an Empty exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 23:19:28 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Jun 2013 21:19:28 +0000 Subject: [issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL In-Reply-To: <1371338869.58.0.00725626403199.issue18227@psf.upfronthosting.co.za> Message-ID: <1371849568.85.0.449262986394.issue18227@psf.upfronthosting.co.za> STINNER Victor added the comment: It looks like CRYPTO_set_mem_functions() of OpenSSL 1.0.1e-4.fc18 does not work: CRYPTO_set_mem_functions() calls indirectly CRYPTO_malloc() which sets "allow_customize = 0;" and so CRYPTO_set_mem_functions() does nothing (just return 0, instead of 1). Gdb trace with a modified _ssl module: #0 0x0000003803463100 in CRYPTO_malloc () from /lib64/libcrypto.so.10 #1 0x0000003803542fae in FIPS_drbg_new () from /lib64/libcrypto.so.10 #2 0x00000038035448e1 in FIPS_drbg_health_check () from /lib64/libcrypto.so.10 #3 0x0000003803542e88 in FIPS_drbg_init () from /lib64/libcrypto.so.10 #4 0x00000038034cf9d1 in RAND_init_fips () from /lib64/libcrypto.so.10 #5 0x0000003803465764 in OPENSSL_init_library () from /lib64/libcrypto.so.10 #6 0x0000003803462c61 in CRYPTO_set_mem_functions () from /lib64/libcrypto.so.10 #7 0x00007ffff135bc6c in PyInit__ssl () at /home/haypo/prog/python/default/Modules/_ssl.c:3180 See the code: http://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=crypto/mem.c;h=f7984fa958eb1edd6c61f6667f3f2b29753be662;hb=HEAD#l124 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 23:27:00 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 21:27:00 +0000 Subject: [issue18232] running a suite with no tests is not an error In-Reply-To: <1371411159.89.0.919313216558.issue18232@psf.upfronthosting.co.za> Message-ID: <1371850020.11.0.528920121115.issue18232@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I do not quite see the need to complicate the interface for most users in a way that does not really solve all of the realistic problems. import unittest unittest.main() # Ran 0 tests in 0.000s OK --- It seems to me that a continuous integration system should parse out the tests run, ok, failed or errored, skipped (or use a lower level interface to grab the numbers before being printed), report them, and compare to previous numbers. Even one extra skip might be something to be explained. An 'arbitrary' figure could easily not detect real problems. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 23:54:51 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 21:54:51 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371851691.46.0.362394730024.issue18236@psf.upfronthosting.co.za> Terry J. Reedy added the comment: You stated facts: what is your proposal? The fact that unicode calls characters 'space' does not make then whitespace as commonly understood, or as defined by C, or even as defined by the Unicode database. Unicode apparently has a WSpace property. According to the table in https://en.wikipedia.org/wiki/Whitespace_%28computer_science%29 1C - 1F are not included by that definition either. For ascii chars, that table matches the C definition, with \r included. So I think your implied proposal to treat them as whitespace (in strings but not bytes) should be rejected as invalid. For 3.x, the manual should specify that it follows the C definition of 'whitespace' (\r included) for bytes and the extended unicode definition for strings. >>> int('3\r') 3 >>> int('3\u00a0') 3 >>> int('3\u2000') 3 >>> int(b'3\r') 3 >>> int(b'3\u00a0') Traceback (most recent call last): File "", line 1, in int(b'3\u00a0') ValueError: invalid literal for int() with base 10: '3\\u00a0' ---------- nosy: +terry.reedy type: behavior -> enhancement versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 21 23:57:46 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 21:57:46 +0000 Subject: [issue18237] unittest.assertRaisesRegex(p) example is wrong in docs In-Reply-To: <1371432897.82.0.367432880569.issue18237@psf.upfronthosting.co.za> Message-ID: <1371851866.95.0.34744532801.issue18237@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:12:42 2013 From: report at bugs.python.org (shwouchk) Date: Fri, 21 Jun 2013 22:12:42 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1371852762.88.0.0227614178626.issue18277@psf.upfronthosting.co.za> shwouchk added the comment: The major difference with the issue you referenced is that the behavior in #17985 is clearly stated and warned against in the docs (Queue.Empty being inconsistent with Queue.size), whereas this is not. As for the actual behavior problem: Imagine you build an abstraction atop Queue (For example and specifically, a queue iterator). This iterator might return None or a similar sentinel if there is nothing on the queue. Since you find the construct useful and would like to keep uniformity in the program, there is a place you use this abstraction in a fairly tight loop to pass messages from one part of the program to another part, in the same process and thread. Now the logic of the program does not work correctly as it was based on the assumption that in a single process Queue would work "as expected". The problem is not the exception but with having an abstraction built atop Queue that works right with respect to program logic both when you use it in one thread and in multiple ones. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:19:21 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Jun 2013 22:19:21 +0000 Subject: [issue18246] tkinter.Text() add a newline to the content - bug? In-Reply-To: <1371499498.11.0.831187493791.issue18246@psf.upfronthosting.co.za> Message-ID: <1371853161.19.0.610561964014.issue18246@psf.upfronthosting.co.za> Terry J. Reedy added the comment: You omitted the crucial control experiment. >>> t2=tk.Text() >>> t2.get(1.0, tk.END) '\n' Text widgets are initialized to end with \n. I suspect that this is an intentional invariant of tk Text widgets, done by tk itself and not out tkinter wrapper, even if not well documented in the tkinter doc strings. .insert works as documented. So unless you can determine that this initialization is a recent and unintentional change, we would not change it. Hence closing at least for now. (G.P., if you think this is wrong, re-open) PS. python-list mirrrored on comp.lang.python and gmane.comp.python.general is a better place to ask 'Is this a bug?' and similar questions. ---------- nosy: +gpolo, terry.reedy resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:22:49 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 Jun 2013 22:22:49 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> Message-ID: <1371853369.59.0.358455846241.issue18275@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > I have no idea what CLOS does in this situation. No worries, I was just curious whether you knew whether this was a solved problem in Dylan or CLOS or some other language. When faced with a diamond diagram, what are the semantics for isinstance(super_instance, cls)? I worked on it for a little bit and came up with the following: def super_isinstance(super_inst, cls): 'Is the cls in the mro somewhere after the current class?' mro = super_inst.__self__.__class__.__mro__ thisclass = super_inst.__thisclass__ return cls in mro and mro.index(thisclass) < mro.index(cls) ---------- Added file: http://bugs.python.org/file30663/simple_diamond_example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:35:08 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 22:35:08 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371854108.78.0.634044723991.issue17621@psf.upfronthosting.co.za> Brett Cannon added the comment: While seing if it was worth making isinstance work with super(), I came up with this at Antoine's suggestion of using a proxy instead of a mixin: class LazyProxy(importlib.abc.Loader): def __init__(self, loader): self.loader = loader def __call__(self, *args, **kwargs): self.args = args self.kwargs = kwargs return self def load_module(self, fullname): # XXX ignoring sys.modules details, e.g. if module already existed. lazy_module = LazyModule(fullname, proxy=self, name=fullname) sys.modules[fullname] = lazy_module return lazy_module class LazyModule(types.ModuleType): def __init__(*args, proxy, name, **kwargs): self.__proxy = proxy self.__name = name super().__init__(*args, **kwargs) def __getattribute__(self, attr): self.__class__ = Module state = self.__dict__.copy() loader = self.__proxy.loader(*self.proxy.args, **self.proxy.kwargs) # XXX ignoring sys.modules details, e.g. removing module on load failure. loader.load_module(self.__name) self.__dict__.update(state) return getattr(module, attr) ---------- dependencies: +Make isinstance() work with super type instances _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:37:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 21 Jun 2013 22:37:10 +0000 Subject: [issue18278] Clarify the loader requirements for importlib.machinery.FileFinder In-Reply-To: <1371835881.83.0.662808557913.issue18278@psf.upfronthosting.co.za> Message-ID: <3bcZX55Xj6z7LjZ@mail.python.org> Roundup Robot added the comment: New changeset 6978d7a6692a by Brett Cannon in branch '3.3': Issue #18278: properly document how the loaders are called for FileFinder http://hg.python.org/cpython/rev/6978d7a6692a New changeset a089a8b1f93d by Brett Cannon in branch 'default': merge for issue #18278 http://hg.python.org/cpython/rev/a089a8b1f93d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:37:48 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 22:37:48 +0000 Subject: [issue18278] Clarify the loader requirements for importlib.machinery.FileFinder In-Reply-To: <1371835881.83.0.662808557913.issue18278@psf.upfronthosting.co.za> Message-ID: <1371854268.93.0.6510132292.issue18278@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:37:53 2013 From: report at bugs.python.org (Phil Webster) Date: Fri, 21 Jun 2013 22:37:53 +0000 Subject: [issue18279] IDLE Unit test for RstripExtension.py Message-ID: <1371854273.68.0.541594598967.issue18279@psf.upfronthosting.co.za> New submission from Phil Webster: This is a single test for RstripExtension.py, following from #15392. I also added a mock EditorWindow module with a Text widget for testing. test_rstripextension.py seems to run fine inside IDLE and produces the following output: >>> test_do_rstrip (__main__.Test_rstripextension) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.100s OK However, when I run via the command line, I get the following output: philwebster at ubuntu:~/Dev/cpython$ ./python -m test -ugui test_idle [1/1] test_idle Warning -- warnings.showwarning was modified by test_idle 1 test altered the execution environment: test_idle I attempted to replicate the results from #18189, but saw the same message. Any thoughts? ---------- components: IDLE messages: 191618 nosy: JayKrish, philwebster priority: normal severity: normal status: open title: IDLE Unit test for RstripExtension.py type: enhancement versions: Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:38:14 2013 From: report at bugs.python.org (Phil Webster) Date: Fri, 21 Jun 2013 22:38:14 +0000 Subject: [issue18279] IDLE Unit test for RstripExtension.py In-Reply-To: <1371854273.68.0.541594598967.issue18279@psf.upfronthosting.co.za> Message-ID: <1371854294.63.0.500302926997.issue18279@psf.upfronthosting.co.za> Changes by Phil Webster : ---------- nosy: +Todd.Rovito _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:38:33 2013 From: report at bugs.python.org (Phil Webster) Date: Fri, 21 Jun 2013 22:38:33 +0000 Subject: [issue18279] IDLE Unit test for RstripExtension.py In-Reply-To: <1371854273.68.0.541594598967.issue18279@psf.upfronthosting.co.za> Message-ID: <1371854313.04.0.61460800438.issue18279@psf.upfronthosting.co.za> Changes by Phil Webster : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:38:46 2013 From: report at bugs.python.org (Phil Webster) Date: Fri, 21 Jun 2013 22:38:46 +0000 Subject: [issue18279] IDLE Unit test for RstripExtension.py In-Reply-To: <1371854273.68.0.541594598967.issue18279@psf.upfronthosting.co.za> Message-ID: <1371854326.85.0.716384813228.issue18279@psf.upfronthosting.co.za> Changes by Phil Webster : ---------- keywords: +patch Added file: http://bugs.python.org/file30664/test_rstripext.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:40:13 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 22:40:13 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> Message-ID: <1371854413.32.0.204040067782.issue18275@psf.upfronthosting.co.za> Brett Cannon added the comment: That solution looks right. Problem is that it would need to either go directly into isinstance() or type would need to grow an __instancecheck__ to deal with this case since you can't override isinstance from the instance end. That I'm not sure people are okay with. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 00:47:25 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Fri, 21 Jun 2013 22:47:25 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1371854845.19.0.345680989638.issue18277@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Why would you use a multi-process queue to "pass messages from one part of the program to another part, in the same process and thread"? Why not just use a deque? Is this something you actually did, or are you just trying to come up with a plausible example? And, of course, if you are sure there must be an item available, you could just use get() instead of get_nowait(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 01:04:26 2013 From: report at bugs.python.org (shwouchk) Date: Fri, 21 Jun 2013 23:04:26 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1371855866.06.0.839294319728.issue18277@psf.upfronthosting.co.za> shwouchk added the comment: Richard, I think you missed my point. First, yes I did do that. Second ("the point"): I did this to use the same abstraction that was used extensively for other purposes, instead of recreating the same abstraction with a deque as its basis. Component reusability is one of the main points of OOP, after all... And no, an item is not necessarily available - sometimes there is a message and sometimes there isn't. But if one was put into the queue, I claim that I should be able to rely on it being available right away in the application logic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 01:05:32 2013 From: report at bugs.python.org (shwouchk) Date: Fri, 21 Jun 2013 23:05:32 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1371855932.57.0.813899141162.issue18277@psf.upfronthosting.co.za> shwouchk added the comment: Also, of course I did this or I would not have stumbled into this issue... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 01:33:12 2013 From: report at bugs.python.org (Brett Cannon) Date: Fri, 21 Jun 2013 23:33:12 +0000 Subject: [issue15693] expose glossary link on hover In-Reply-To: <1345132108.78.0.567099034623.issue15693@psf.upfronthosting.co.za> Message-ID: <1371857592.79.0.949942015568.issue15693@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 02:33:16 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 22 Jun 2013 00:33:16 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371861196.28.0.632172891101.issue17621@psf.upfronthosting.co.za> Brett Cannon added the comment: I think the first step for this bug, now that I have two possible approaches, is to write the unit tests. That way both approaches can equally be validated based on their merits of complexity, etc. while verifying the work properly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 02:35:37 2013 From: report at bugs.python.org (David Edelsohn) Date: Sat, 22 Jun 2013 00:35:37 +0000 Subject: [issue18235] _sysconfigdata.py wrong on AIX installations In-Reply-To: <1371429201.94.0.372851990361.issue18235@psf.upfronthosting.co.za> Message-ID: <1371861337.4.0.488479329759.issue18235@psf.upfronthosting.co.za> David Edelsohn added the comment: It looks like someone already tried to fix part of this, but reversed the assignment diff -r a089a8b1f93d Lib/sysconfig.py --- a/Lib/sysconfig.py Fri Jun 21 18:37:02 2013 -0400 +++ b/Lib/sysconfig.py Fri Jun 21 22:33:15 2013 -0700 @@ -368,7 +368,7 @@ # -- these paths are relative to the Python source, but when installed # the scripts are in another directory. if _PYTHON_BUILD: - vars['LDSHARED'] = vars['BLDSHARED'] + vars['BLDSHARED'] = vars['LDSHARED'] # There's a chicken-and-egg situation on OS X with regards to the # _sysconfigdata module after the changes introduced by #15298: BLDSHARED is relative to srcdir and LDSHARED is relative to the install directory BINLIBDEST. LDSHARED= $(BINLIBDEST)/config/ld_so_aix $(CC) -bI:$(BINLIBDEST)/config/python.exp $(PY_LDFLAGS) BLDSHARED= $(srcdir)/Modules/ld_so_aix $(CC) -bI:$(srcdir)/Modules/python.exp $(PY_LDFLAGS) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 02:43:40 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 22 Jun 2013 00:43:40 +0000 Subject: [issue16803] Make test_importlib run tests under both _frozen_importlib and importlib._bootstrap In-Reply-To: <1356718069.62.0.143946538677.issue16803@psf.upfronthosting.co.za> Message-ID: <1371861820.58.0.94063857059.issue16803@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 02:44:25 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 22 Jun 2013 00:44:25 +0000 Subject: [issue18056] Document importlib._bootstrap.NamespaceLoader In-Reply-To: <1369496751.81.0.344197180241.issue18056@psf.upfronthosting.co.za> Message-ID: <1371861865.63.0.628236814339.issue18056@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- assignee: barry -> docs at python keywords: +easy -3.3regression nosy: +docs at python versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 03:08:31 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 22 Jun 2013 01:08:31 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <1371836159.69.0.175455919906.issue18264@psf.upfronthosting.co.za> Message-ID: Nick Coghlan added the comment: Can I vote for something like "__builtin__" as the protocol, rather than something entirely specific to serialisation? As in "return the most appropriate builtin type with the same value"? Then a converter ("operator.builtin"?) could coerce builtin subclasses to their base classes by default, rather than needing to implement the protocol on every type. Such a design would need a PEP, of course. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 03:17:52 2013 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 22 Jun 2013 01:17:52 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: Message-ID: Guido van Rossum added the comment: Hm. Then I prefer just calling the appropriate builtin, e.g. int(). --Guido van Rossum (sent from Android phone) On Jun 21, 2013 6:08 PM, "Nick Coghlan" wrote: > > Nick Coghlan added the comment: > > Can I vote for something like "__builtin__" as the protocol, rather than > something entirely specific to serialisation? As in "return the most > appropriate builtin type with the same value"? Then a converter > ("operator.builtin"?) could coerce builtin subclasses to their base classes > by default, rather than needing to implement the protocol on every type. > > Such a design would need a PEP, of course. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 03:35:29 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Jun 2013 01:35:29 +0000 Subject: [issue18279] IDLE Unit test for RstripExtension.py In-Reply-To: <1371854273.68.0.541594598967.issue18279@psf.upfronthosting.co.za> Message-ID: <1371864929.22.0.632236095315.issue18279@psf.upfronthosting.co.za> Terry J. Reedy added the comment: There is a separate issue about killing that warning. If you leave off '-ugui', you will see the traceback and why I said that requires('gui') should be wrapped for unittest discovery. As the code is, the call is executed when the file is imported, possibly during discovery, before the unittest or regrtest runner starts running tests and counting success, fail, skip. Two other thoughts before I look as rstrip and the content of the new test file. I would like to just call it test_rstrip. I have thought of having just one mock_idle.py for mock Idle classes (as opposed to mock_tk with mock tk classes. I am not sure how many will will need. Since your mock_ewin uses a real tk.Text widget, hence requiring gui, what is its purpose? The point of the mock_tk classes is to avoid gui and make the test text only. I am not saying that this is the only purpose, but other purposes should be stated and documented. ---------- versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 03:59:05 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 22 Jun 2013 01:59:05 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: Message-ID: <20130621215901.5b83a09d@limelight.wooz.org> Barry A. Warsaw added the comment: On Jun 22, 2013, at 01:08 AM, Nick Coghlan wrote: >Can I vote for something like "__builtin__" as the protocol, rather than >something entirely specific to serialisation? As in "return the most >appropriate builtin type with the same value"? Then a converter >("operator.builtin"?) could coerce builtin subclasses to their base classes >by default, rather than needing to implement the protocol on every type. Such a protocol needs a way to deserialize as well. You can't necessarily assume (or shouldn't impose) that the __init__() can do that conversion. In any case... >Such a design would need a PEP, of course. ...yes, definitely. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 04:38:31 2013 From: report at bugs.python.org (Phil Webster) Date: Sat, 22 Jun 2013 02:38:31 +0000 Subject: [issue18279] IDLE Unit test for RstripExtension.py In-Reply-To: <1371854273.68.0.541594598967.issue18279@psf.upfronthosting.co.za> Message-ID: <1371868711.73.0.783966669191.issue18279@psf.upfronthosting.co.za> Phil Webster added the comment: Thank you for the feedback Terry. I'm not seeing the traceback without '-ugui' either, so I'm going to look into that. I get the same results with requires('gui') moved inside of setUp, is that what you mean by wrapping? For mock_ewin I used a real Text widget because RstripExtension uses index(), get(), and delete() and I was not able to figure out how the widget implemented these (is there a single string with the contents?). I can work on a non-gui test though if that's what needs to be done. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 04:45:35 2013 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 22 Jun 2013 02:45:35 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <20130621215901.5b83a09d@limelight.wooz.org> Message-ID: Eli Bendersky added the comment: On Fri, Jun 21, 2013 at 6:59 PM, Barry A. Warsaw wrote: > > Barry A. Warsaw added the comment: > > On Jun 22, 2013, at 01:08 AM, Nick Coghlan wrote: > > >Can I vote for something like "__builtin__" as the protocol, rather than > >something entirely specific to serialisation? As in "return the most > >appropriate builtin type with the same value"? Then a converter > >("operator.builtin"?) could coerce builtin subclasses to their base > classes > >by default, rather than needing to implement the protocol on every type. > > Such a protocol needs a way to deserialize as well. You can't necessarily > assume (or shouldn't impose) that the __init__() can do that conversion. > In > any case... > > >Such a design would need a PEP, of course. > > ...yes, definitely. Practically speaking, what should be done to make enum play well with JSON without writing new PEPs? I think we still want to convert those stdlib constants to IntEnums... Eli ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 04:49:12 2013 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 22 Jun 2013 02:49:12 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: Message-ID: Guido van Rossum added the comment: Change json to call int() first. --Guido van Rossum (sent from Android phone) On Jun 21, 2013 7:45 PM, "Eli Bendersky" wrote: > > Eli Bendersky added the comment: > > On Fri, Jun 21, 2013 at 6:59 PM, Barry A. Warsaw >wrote: > > > > > Barry A. Warsaw added the comment: > > > > On Jun 22, 2013, at 01:08 AM, Nick Coghlan wrote: > > > > >Can I vote for something like "__builtin__" as the protocol, rather than > > >something entirely specific to serialisation? As in "return the most > > >appropriate builtin type with the same value"? Then a converter > > >("operator.builtin"?) could coerce builtin subclasses to their base > > classes > > >by default, rather than needing to implement the protocol on every type. > > > > Such a protocol needs a way to deserialize as well. You can't > necessarily > > assume (or shouldn't impose) that the __init__() can do that conversion. > > In > > any case... > > > > >Such a design would need a PEP, of course. > > > > ...yes, definitely. > > Practically speaking, what should be done to make enum play well with JSON > without writing new PEPs? I think we still want to convert those stdlib > constants to IntEnums... > > Eli > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 05:23:26 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 22 Jun 2013 03:23:26 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: Message-ID: <51C518AD.4000900@stoneleaf.us> Ethan Furman added the comment: On 06/21/2013 07:49 PM, Guido van Rossum wrote: > Eli Bendersky added the comment: >> >> Practically speaking, what should be done to make enum play well with JSON >> without writing new PEPs? I think we still want to convert those stdlib >> constants to IntEnums... > > Change json to call int() first. Should we have json call float() and str() first as well? I'm thinking less of the stdlib and more of the unsuspecting user. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 06:55:33 2013 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 22 Jun 2013 04:55:33 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <51C518AD.4000900@stoneleaf.us> Message-ID: Guido van Rossum added the comment: Yes for float() -- but for str() it would seem redundant? (Or what's the context?) On Fri, Jun 21, 2013 at 8:23 PM, Ethan Furman wrote: > > Ethan Furman added the comment: > > On 06/21/2013 07:49 PM, Guido van Rossum wrote: >> Eli Bendersky added the comment: >>> >>> Practically speaking, what should be done to make enum play well with JSON >>> without writing new PEPs? I think we still want to convert those stdlib >>> constants to IntEnums... >> >> Change json to call int() first. > > Should we have json call float() and str() first as well? I'm thinking less of the stdlib and more of the unsuspecting > user. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 07:08:17 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 22 Jun 2013 05:08:17 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: Message-ID: <51C53141.4010105@stoneleaf.us> Ethan Furman added the comment: Guido van Rossum added the comment: > > Yes for float() -- but for str() it would seem redundant? (Or what's > the context?) If a user has class Color(StrEnum): red = 'ff0000' green = '00ff00' blue = '0000ff' .. .. .. oh. `str()` isn't going to give is the `value`'s string, is it? Hmmm... Instead of calling int() or float() on an enum member, perhaps we could make json smart enough to use the `value`? That would also cover pure Enums. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 07:23:35 2013 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 22 Jun 2013 05:23:35 +0000 Subject: [issue18264] enum.IntEnum is not compatible with JSON serialisation In-Reply-To: <51C53141.4010105@stoneleaf.us> Message-ID: Nick Coghlan added the comment: Whatever we do needs to be something third party serialisation libraries can also adopt with minimal compatibility risk for older versions of Python. Yes, that serialisation will lose the new debugging information. That's fine - if people want to map from a standard format like JSON to enums, they have to handle that themselves anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 10:28:34 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Jun 2013 08:28:34 +0000 Subject: [issue18280] Documentation is too personalized Message-ID: <1371889714.5.0.753258621658.issue18280@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Some documentation files contain a number of I/my/me. Looks like they grew from personal modules and personal articles. Perhaps the official documentation needs more depersonalized style. Here is full list of such files: Doc/c-api/exceptions.rst Doc/c-api/long.rst Doc/distutils/builtdist.rst Doc/extending/extending.rst Doc/extending/windows.rst Doc/howto/argparse.rst Doc/howto/curses.rst Doc/howto/functional.rst Doc/howto/regex.rst Doc/howto/sockets.rst Doc/howto/urllib2.rst Doc/install/index.rst Doc/library/audioop.rst Doc/library/ctypes.rst Doc/library/doctest.rst Doc/library/heapq.rst Doc/library/numbers.rst Doc/library/ossaudiodev.rst Doc/library/tk.rst Doc/library/unittest.mock-examples.rst Doc/library/unittest.mock.rst Doc/reference/introduction.rst Doc/tutorial/classes.rst The list doesn't include FAQs where it may be appropriate and whatsnew files. Andrew Kuchling recently has fixed Doc/howto/unicode.rst for this issue (as part of issue4153). ---------- assignee: docs at python components: Documentation messages: 191636 nosy: akuchling, docs at python, eric.araujo, ezio.melotti, georg.brandl, serhiy.storchaka priority: normal severity: normal status: open title: Documentation is too personalized versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 10:31:07 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Jun 2013 08:31:07 +0000 Subject: [issue18280] Documentation is too personalized In-Reply-To: <1371889714.5.0.753258621658.issue18280@psf.upfronthosting.co.za> Message-ID: <1371889867.41.0.893149600917.issue18280@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Here is a filtered results of find * -name '*.rst' -exec egrep -n -w -B1 -A1 'I|me|my' '{}' + ---------- Added file: http://bugs.python.org/file30665/Imemy.grep _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 11:11:32 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Jun 2013 09:11:32 +0000 Subject: [issue4153] Unicode HOWTO up to date? In-Reply-To: <1224525840.81.0.649106205615.issue4153@psf.upfronthosting.co.za> Message-ID: <1371892292.1.0.225752825964.issue4153@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Most of changes are applicable to Python 2 too. Do you want backport part of your patch to 2.7? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 11:43:05 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 22 Jun 2013 09:43:05 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371894185.81.0.802418282262.issue17621@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 11:44:49 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 22 Jun 2013 09:44:49 +0000 Subject: [issue18275] Make isinstance() work with super type instances In-Reply-To: <1371778403.78.0.702907758656.issue18275@psf.upfronthosting.co.za> Message-ID: <1371894289.55.0.628116193255.issue18275@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 15:53:32 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Jun 2013 13:53:32 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1371909212.03.0.0723416919744.issue11390@psf.upfronthosting.co.za> R. David Murray added the comment: I will probably commit this tomorrow if there are no objections. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 16:28:14 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 22 Jun 2013 14:28:14 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371911294.01.0.385234570538.issue11016@psf.upfronthosting.co.za> Christian Heimes added the comment: New patch People demand a _stat module in C and now they are getting a _stat module in C. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 16:28:32 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 22 Jun 2013 14:28:32 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371911312.97.0.0023926578432.issue11016@psf.upfronthosting.co.za> Changes by Christian Heimes : Added file: http://bugs.python.org/file30666/statmodule4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 16:41:18 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 22 Jun 2013 14:41:18 +0000 Subject: [issue18281] tarfile defines stat constants Message-ID: <1371912078.43.0.227039082522.issue18281@psf.upfronthosting.co.za> New submission from Christian Heimes: The tarfile module defines a bunch of stat constants: http://hg.python.org/cpython/file/4465f273a8a4/Lib/tarfile.py#l142 These constants aren't documented but they look like public API constants. I would like to replace them with values from the stat module: TUREAD = stat.S_IRUSR ---------- components: Library (Lib) messages: 191641 nosy: christian.heimes priority: low severity: normal stage: needs patch status: open title: tarfile defines stat constants type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 16:41:55 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Jun 2013 14:41:55 +0000 Subject: [issue18206] license url in site.py should always use X.Y.Z form of version number In-Reply-To: <1371162560.09.0.685782864566.issue18206@psf.upfronthosting.co.za> Message-ID: <1371912115.6.0.281684250297.issue18206@psf.upfronthosting.co.za> R. David Murray added the comment: It would be nice to add a test (guarded by the network resource) that checks that the generated url in license is not a 404. Would you be interested in tackling that, Berker? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 16:54:24 2013 From: report at bugs.python.org (Sworddragon) Date: Sat, 22 Jun 2013 14:54:24 +0000 Subject: [issue18282] Ugly behavior of binary and unicode handling on reading unknown encoded files Message-ID: <1371912864.83.0.123376262998.issue18282@psf.upfronthosting.co.za> New submission from Sworddragon: Currently Python 3 has some problems of handling files with an unknown encoding. In this example we have a file encoded as ISO-8859-1 with the content "?" which should be tried to be read. Lets see what Python 3 can currently do here: 1. We can simply open the file and try to read the content. The encoding will be set in my case automatically to UTF-8. But the read() operation will throw an exception: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 0: unexpected end of data 2. Now lets look a little more into the arguments of open(): We will find an errors argument which could maybe be useful: 2.1. "strict" is the default behavior which was already tested. 2.2. "ignore" will not throw any exception but delete any character which can't be read. This would be problematic in many cases. 2.3. "replace" will replace any character which can't be read which will be problematic in many cases too. 2.4. "surrogateescape" can throw exceptions too: UnicodeEncodeError: 'utf-8' codec can't encode character '\udce4' in position 0: surrogates not allowed 2.5. "xmlcharrefreplace" and "backslashreplace" are not used for reading. 3. Since trying to decode the file will make many problems we can try to read the file as binary content. This will work in all cases but causing another problem: Any unicode string that must be concatenated with the content of the file must be converted to a binary string too (like b'some_unicode_content' or some_unicode_variable.encode()). The same happens for unicode strings that must be concatenated somewhere else with the newly converted unicode_to_binary variable even if they doesn't touch the file content. This behavior can affect the maintainability in a bad way. As you can see all current solutions of Python 3 have big disadvantages. If I'm overlooking something feel free to correct me. Currently I have developed my own solution in Python which solved the problem: A function that autodetects the encoding of the file. Maybe there could also be a native way to do this on open() or maybe there could be another way found to solve this problem. ---------- components: IO messages: 191643 nosy: Sworddragon priority: normal severity: normal status: open title: Ugly behavior of binary and unicode handling on reading unknown encoded files type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 17:29:11 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 22 Jun 2013 15:29:11 +0000 Subject: [issue18283] shutil.which() should support bytes Message-ID: <1371914951.06.0.665120918364.issue18283@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis: shutil.which() should support bytes. Some other functions in shutil module support bytes. >>> shutil.which("echo") '/bin/echo' >>> shutil.which(b"echo") Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.3/shutil.py", line 1126, in which name = os.path.join(dir, thefile) File "/usr/lib64/python3.3/posixpath.py", line 92, in join "components.") from None TypeError: Can't mix strings and bytes in path components. >>> shutil.which("echo", path="/bin") '/bin/echo' >>> shutil.which("echo", path=b"/bin") Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.3/shutil.py", line 1098, in which path = path.split(os.pathsep) TypeError: Type str doesn't support the buffer API >>> shutil.which(b"echo", path=b"/bin") Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.3/shutil.py", line 1098, in which path = path.split(os.pathsep) TypeError: Type str doesn't support the buffer API ---------- components: Library (Lib) messages: 191644 nosy: Arfrever, hynek, tarek priority: normal severity: normal status: open title: shutil.which() should support bytes versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 17:30:11 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Jun 2013 15:30:11 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1371915011.53.0.530156877497.issue11390@psf.upfronthosting.co.za> R. David Murray added the comment: Patch updated per Barry's review comments. ---------- Added file: http://bugs.python.org/file30667/doctest_cli.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 18:33:20 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 22 Jun 2013 16:33:20 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <3bd2Pr0ZRPzSg9@mail.python.org> Roundup Robot added the comment: New changeset 99733ff98a50 by Andrew Kuchling in branch '2.7': #18113: avoid segfault if Py_XDECREF triggers code that calls set_panel_userptr again http://hg.python.org/cpython/rev/99733ff98a50 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 18:33:59 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 22 Jun 2013 16:33:59 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371918839.62.0.773637572005.issue18236@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: > You stated facts: what is your proposal? There is a bug somewhere. We cannot simultaneously have >>> '\N{RS}'.isspace() True and not accept '\N{RS}' as whitespace when parsing numbers. I believe int(x) should be equivalent to int(x.strip()). This is not the case now: >>> '123\N{RS}'.strip() '123' >>> int('123\N{RS}') Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '123\x1e' The reason I did not clearly state my proposal is because I am not sure whether bytes.isspace or str.isspace is correct, but I don't see any justification for having them defined differently in the ASCII range. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 18:48:03 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 22 Jun 2013 16:48:03 +0000 Subject: [issue18281] tarfile defines stat constants In-Reply-To: <1371912078.43.0.227039082522.issue18281@psf.upfronthosting.co.za> Message-ID: <1371919683.59.0.712742916512.issue18281@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 19:15:05 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Jun 2013 17:15:05 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371921305.94.0.434169032488.issue18236@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I see your point now. Since RS is not whitespace by any definition I knew of previously, why is RS.isspace True? Apparent answer: Doc says '''Return true if there are only whitespace characters in the string and there is at least one character, false otherwise. Whitespace characters are those characters defined in the Unicode character database as ?Other? or ?Separator? and those with bidirectional property being one of ?WS?, ?B?, or ?S?.''' I suspect this is a more expansive definition than WSpace chars, which seems to be the one used by int(), but you could check the int code. Bytes docs says: "Whenever a bytes or bytearray method needs to interpret the bytes as characters (e.g. the is...() methods, split(), strip()), the ASCII character set is assumed (text strings use Unicode semantics)." This says to me that str.isxxx and bytes.isxxx should match on ascii chars and not otherwise. That would happen is the bytes methods check for all ascii and decoded to unicode and used str method. Since they do not match, bytes must do something different. I think there is one definite bug: the discrepancy between str.isspace and bytes.isspace. There is possibly another bug: the discrepancy between 'whitespace' for str.isspace and int/float. After pinning down the details, I think you should ask how to resolve these on py-dev, and which versions to patch. ---------- type: enhancement -> behavior versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 19:47:40 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Jun 2013 17:47:40 +0000 Subject: [issue18283] shutil.which() should support bytes In-Reply-To: <1371914951.06.0.665120918364.issue18283@psf.upfronthosting.co.za> Message-ID: <1371923260.21.0.909586627567.issue18283@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- type: -> enhancement versions: -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 19:55:10 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 22 Jun 2013 17:55:10 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371923710.1.0.487747196864.issue18236@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: It looks like str.isspace() is incorrect. The proper definition of unicode whitespace seems to include 26 characters: # ================================================ 0009..000D ; White_Space # Cc [5] .. 0020 ; White_Space # Zs SPACE 0085 ; White_Space # Cc 00A0 ; White_Space # Zs NO-BREAK SPACE 1680 ; White_Space # Zs OGHAM SPACE MARK 180E ; White_Space # Zs MONGOLIAN VOWEL SEPARATOR 2000..200A ; White_Space # Zs [11] EN QUAD..HAIR SPACE 2028 ; White_Space # Zl LINE SEPARATOR 2029 ; White_Space # Zp PARAGRAPH SEPARATOR 202F ; White_Space # Zs NARROW NO-BREAK SPACE 205F ; White_Space # Zs MEDIUM MATHEMATICAL SPACE 3000 ; White_Space # Zs IDEOGRAPHIC SPACE # Total code points: 26 http://www.unicode.org/Public/UNIDATA/PropList.txt Python's str.isspace() uses the following definition: "Whitespace characters are those characters defined in the Unicode character database as ?Other? or ?Separator? and those with bidirectional property being one of ?WS?, ?B?, or ?S?." Information separators are swept in because they have bidirectional property "B": >>> unicodedata.bidirectional('\N{RS}') 'B' See also #10587. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:19:51 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 22 Jun 2013 18:19:51 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371925191.7.0.840684249635.issue18236@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I did a little more investigation and it looks like information separators have been included in whitespace since unicode type was first implemented in Python: guido 11967 Fri Mar 10 22:52:46 2000 +0000: /* Returns 1 for Unicode characters having the type 'WS', 'B' or 'S', guido 11967 Fri Mar 10 22:52:46 2000 +0000: 0 otherwise. */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: guido 11967 Fri Mar 10 22:52:46 2000 +0000: int _PyUnicode_IsWhitespace(register const Py_UNICODE ch) guido 11967 Fri Mar 10 22:52:46 2000 +0000: { guido 11967 Fri Mar 10 22:52:46 2000 +0000: switch (ch) { guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x0009: /* HORIZONTAL TABULATION */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x000A: /* LINE FEED */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x000B: /* VERTICAL TABULATION */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x000C: /* FORM FEED */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x000D: /* CARRIAGE RETURN */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x001C: /* FILE SEPARATOR */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x001D: /* GROUP SEPARATOR */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x001E: /* RECORD SEPARATOR */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x001F: /* UNIT SEPARATOR */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x0020: /* SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x1680: /* OGHAM SPACE MARK */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2000: /* EN QUAD */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2001: /* EM QUAD */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2002: /* EN SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2003: /* EM SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2004: /* THREE-PER-EM SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2005: /* FOUR-PER-EM SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2006: /* SIX-PER-EM SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2007: /* FIGURE SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2008: /* PUNCTUATION SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2009: /* THIN SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x200A: /* HAIR SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x2028: /* LINE SEPARATOR */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x202F: /* NARROW NO-BREAK SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: case 0x3000: /* IDEOGRAPHIC SPACE */ guido 11967 Fri Mar 10 22:52:46 2000 +0000: return 1; guido 11967 Fri Mar 10 22:52:46 2000 +0000: default: guido 11967 Fri Mar 10 22:52:46 2000 +0000: return 0; guido 11967 Fri Mar 10 22:52:46 2000 +0000: } guido 11967 Fri Mar 10 22:52:46 2000 +0000: } guido 11967 Fri Mar 10 22:52:46 2000 +0000: (hg blame -u -d -n -r 11967 Objects/unicodectype.c) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:24:46 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sat, 22 Jun 2013 18:24:46 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371925486.22.0.448433653654.issue17621@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Apologies for being dense, but how would you actually use such a loader? Would you need to install something in sys.meta_path/sys.path_hooks? Would it make all imports lazy or only imports of specified modules? ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:35:27 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 22 Jun 2013 18:35:27 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371926127.52.0.975788658875.issue18236@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Martin v. L?wis wrote at #13391 (msg147634): > I do think that _PyUnicode_IsWhitespace should use the White_Space > property (from PropList.txt). I'm not quite sure how they computed > that property (or whether it's manually curated). Since that's a > behavioral change, it can only go into 3.3. I am adding Martin and Ezio to the "nosy." ---------- nosy: +ezio.melotti, loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:43:25 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Jun 2013 18:43:25 +0000 Subject: [issue18282] Ugly behavior of binary and unicode handling on reading unknown encoded files In-Reply-To: <1371912864.83.0.123376262998.issue18282@psf.upfronthosting.co.za> Message-ID: <1371926605.49.0.401187705011.issue18282@psf.upfronthosting.co.za> R. David Murray added the comment: In python we have a saying that we follow most of the time: if you don't know, refuse the temptation to guess. So currently this is all working as designed: you have to know the encoding of the file you are trying to read as unicode. Adding a 'guess' function that could be called explicitly is a possibility, but if we were to go that route we'd probably really want something general to guess the encoding of strings, such as (I think) ICU has. This larger topic is a topic more suited to python-ideas, probably followed, if response is positive, by a PEP. So I'm closing this issue as rejected, but feel free to bring it up on python-ideas. (Search for existing threads about it first, please.) ---------- nosy: +r.david.murray resolution: -> rejected stage: -> committed/rejected status: open -> closed versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:44:35 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Jun 2013 18:44:35 +0000 Subject: [issue18284] Doc make html: KeyError: 'howto/advocacy' Message-ID: <1371926675.0.0.253994093951.issue18284@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Win 7, make html, 2.7 and 3.3. writing output... [ 20%] howto/advocacy Exception occurred: File "F:\Python\dev\py33\Doc\tools\sphinx\environment.py", line 1063, in get_toc_for toc = self.tocs[docname].deepcopy() KeyError: 'howto/advocacy' and process stops. Since update did not change the sphinx install that worked when I last tried this (April), I presume error is in our sources rather than Sphinx. ---------- assignee: docs at python components: Documentation files: sphinx-err-xoinkq.log messages: 191654 nosy: docs at python, eric.araujo, ezio.melotti, georg.brandl, terry.reedy priority: normal severity: normal status: open title: Doc make html: KeyError: 'howto/advocacy' type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30668/sphinx-err-xoinkq.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:51:15 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 22 Jun 2013 18:51:15 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <3bd5Sy3Pgjz7LjM@mail.python.org> Roundup Robot added the comment: New changeset 61fafef4c8a2 by Andrew Kuchling in branch '3.3': #18113: avoid segfault if Py_XDECREF triggers code that calls set_panel_userptr again http://hg.python.org/cpython/rev/61fafef4c8a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:51:56 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Jun 2013 18:51:56 +0000 Subject: [issue18284] Doc make html: KeyError: 'howto/advocacy' In-Reply-To: <1371926675.0.0.253994093951.issue18284@psf.upfronthosting.co.za> Message-ID: <1371927116.24.0.988877585137.issue18284@psf.upfronthosting.co.za> R. David Murray added the comment: I just did a clean doc build on 2.7 (on linux) on 2.7 head without error. Maybe you need to do a 'make clean' and rebuild? Our Makefile ought to have a target that just throws away the build dir, instead of throwing away the checked out software as well, but it doesn't. So instead of make clean you might want to try just deleting the build dir and rebuilding first. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:53:06 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Jun 2013 18:53:06 +0000 Subject: [issue18284] Doc make html: KeyError: 'howto/advocacy' In-Reply-To: <1371926675.0.0.253994093951.issue18284@psf.upfronthosting.co.za> Message-ID: <1371927186.41.0.43651345215.issue18284@psf.upfronthosting.co.za> R. David Murray added the comment: Oh, right, the advocacy howto was deleted recently. So it is almost certainly your stale pickles in the build dir that are the issue. ---------- resolution: -> invalid stage: -> committed/rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:55:09 2013 From: report at bugs.python.org (py.user) Date: Sat, 22 Jun 2013 18:55:09 +0000 Subject: [issue18285] In itertools.product() add argument repeat to the docstring Message-ID: <1371927309.79.0.490510498207.issue18285@psf.upfronthosting.co.za> New submission from py.user: >>> import itertools >>> print(itertools.product.__doc__) product(*iterables) --> product object Cartesian product of input iterables. Equivalent to nested for-loops. ... ---------- assignee: docs at python components: Documentation messages: 191658 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools.product() add argument repeat to the docstring versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:55:45 2013 From: report at bugs.python.org (py.user) Date: Sat, 22 Jun 2013 18:55:45 +0000 Subject: [issue18285] In itertools.product() add argument repeat to the docstring In-Reply-To: <1371927309.79.0.490510498207.issue18285@psf.upfronthosting.co.za> Message-ID: <1371927345.78.0.0833623137069.issue18285@psf.upfronthosting.co.za> Changes by py.user : ---------- keywords: +patch Added file: http://bugs.python.org/file30669/issue18285.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 20:56:47 2013 From: report at bugs.python.org (py.user) Date: Sat, 22 Jun 2013 18:56:47 +0000 Subject: [issue18285] In itertools.product() add argument repeat to the docstring In-Reply-To: <1371927309.79.0.490510498207.issue18285@psf.upfronthosting.co.za> Message-ID: <1371927407.95.0.64239260457.issue18285@psf.upfronthosting.co.za> Changes by py.user : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:05:11 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 22 Jun 2013 19:05:11 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <3bd5n316QRzNRr@mail.python.org> Roundup Robot added the comment: New changeset 420f70a22b9d by Christian Heimes in branch 'default': Issue #11016: Add C implementation of the stat module as _stat http://hg.python.org/cpython/rev/420f70a22b9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:12:11 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 22 Jun 2013 19:12:11 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371928331.93.0.744568334252.issue17621@psf.upfronthosting.co.za> Brett Cannon added the comment: So the approaches I have been using make a loader lazy, so what you have to change in terms of sys.meta_path, sys.path_hooks, etc. would very from loader to loader. I have realized one tricky thing with all of this is that importlib itself inspects modules post-import to verify that __loader__ and __package__ have been set. That typically triggers an immediate load and so might need to be special-cased. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:14:48 2013 From: report at bugs.python.org (Jon Irenicus) Date: Sat, 22 Jun 2013 19:14:48 +0000 Subject: [issue18286] Python 3.3 - Slowing down computer Message-ID: <1371928488.87.0.904340213253.issue18286@psf.upfronthosting.co.za> New submission from Jon Irenicus: Python's really slowing my computer down. After running my script, the computer grinds to a halt and it's performance drops. Even after a reboot, the problem still persists. ---------- components: Windows messages: 191661 nosy: jon_irenicus priority: normal severity: normal status: open title: Python 3.3 - Slowing down computer type: performance versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:18:31 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 22 Jun 2013 19:18:31 +0000 Subject: [issue18286] Python 3.3 - Slowing down computer In-Reply-To: <1371928488.87.0.904340213253.issue18286@psf.upfronthosting.co.za> Message-ID: <1371928711.28.0.913313537604.issue18286@psf.upfronthosting.co.za> Antoine Pitrou added the comment: You're not giving enough information to help us make sense of your problem. If you don't know how to describe the problem precisely, you should try the mailing-list: http://mail.python.org/mailman/listinfo/python-list ---------- nosy: +pitrou status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:18:43 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jun 2013 19:18:43 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <3bd5n316QRzNRr@mail.python.org> Message-ID: STINNER Victor added the comment: buf[9] is not initialized in stat_filemode(). Use a shorter buffer (9 bytes) or set it to NUL. Le 22 juin 2013 21:05, "Roundup Robot" a ?crit : > > Roundup Robot added the comment: > > New changeset 420f70a22b9d by Christian Heimes in branch 'default': > Issue #11016: Add C implementation of the stat module as _stat > http://hg.python.org/cpython/rev/420f70a22b9d > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:32:10 2013 From: report at bugs.python.org (Jon Irenicus) Date: Sat, 22 Jun 2013 19:32:10 +0000 Subject: [issue18286] Python 3.3 - Slowing down computer In-Reply-To: <1371928488.87.0.904340213253.issue18286@psf.upfronthosting.co.za> Message-ID: <1371929530.99.0.715238869273.issue18286@psf.upfronthosting.co.za> Jon Irenicus added the comment: The problem is when i run my python script, it somehow slows the whole computer down. I checked my cpu usage, ram usage and disk usage, but nothing comes up. The script isn't big, it's only about 10kb big. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:34:03 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 22 Jun 2013 19:34:03 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371929643.21.0.380386418043.issue11016@psf.upfronthosting.co.za> Christian Heimes added the comment: All 10 chars are set: buf[0] = filetype(mode); fileperm(mode, &buf[1]); buf[0] is set by filetype(). fileperm() sets 9 chars in buf[1] to buf[9]. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:37:21 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 22 Jun 2013 19:37:21 +0000 Subject: [issue18286] Python 3.3 - Slowing down computer In-Reply-To: <1371928488.87.0.904340213253.issue18286@psf.upfronthosting.co.za> Message-ID: <1371929841.65.0.40724120261.issue18286@psf.upfronthosting.co.za> Antoine Pitrou added the comment: We can't make anything useful of such a bug report. At a minimum, please post your entire script and explain how you are running it. Also explain what your system configuration is (operating system, etc.). That said, it's highly unlikely that Python is responsible for slowing your computer down *after* it has finished running. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:45:44 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 22 Jun 2013 19:45:44 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371930344.17.0.90281985941.issue17621@psf.upfronthosting.co.za> Changes by Brett Cannon : Added file: http://bugs.python.org/file30670/test_lazy_loader.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:46:00 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 22 Jun 2013 19:46:00 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371930360.5.0.858824093269.issue17621@psf.upfronthosting.co.za> Changes by Brett Cannon : Added file: http://bugs.python.org/file30671/lazy_mixin.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:48:23 2013 From: report at bugs.python.org (Brett Cannon) Date: Sat, 22 Jun 2013 19:48:23 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371930503.42.0.252896628746.issue17621@psf.upfronthosting.co.za> Brett Cannon added the comment: I have attached the test suite and two versions: one using a mixin and one using a proxy. Neither solve the issue of import touching the module in any way to check __loader__ and __package__. The mixin version is also failing one test which could quite possibly be a pain to fix and so it might cause me to prefer the proxy solution. ---------- Added file: http://bugs.python.org/file30672/lazy_proxy.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 21:48:50 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 22 Jun 2013 19:48:50 +0000 Subject: [issue18282] Ugly behavior of binary and unicode handling on reading unknown encoded files In-Reply-To: <1371912864.83.0.123376262998.issue18282@psf.upfronthosting.co.za> Message-ID: <1371930530.37.0.316706047939.issue18282@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: You can try to use charade (https://pypi.python.org/pypi/charade) or potential another encoding detector. ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 22:02:14 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Jun 2013 20:02:14 +0000 Subject: [issue18152] Idle: add 2.7 backport script In-Reply-To: <1370543391.75.0.919797325796.issue18152@psf.upfronthosting.co.za> Message-ID: <1371931334.29.0.211584796387.issue18152@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I am not sure what you mean by 'rollback'. My experience and understanding is that once I start a merge, I must finish it somehow before doing anything else. Do you mean revert a particular problematic file (like NEWS), and hand edit? Another backport item. test.support <-> test.test_support. ---------- components: +IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 22:12:00 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Jun 2013 20:12:00 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1371931920.58.0.494645071015.issue18103@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Must mention that 'support' was 'test_support' in 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 22:34:42 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Jun 2013 20:34:42 +0000 Subject: [issue18284] Doc make html: KeyError: 'howto/advocacy' In-Reply-To: <1371926675.0.0.253994093951.issue18284@psf.upfronthosting.co.za> Message-ID: <1371933282.04.0.930606245832.issue18284@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Nuking build worked. So did, with less re-work, deleting the advocacy doctree and html files ;-). Too bad this is not somehow automated. ---------- status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 22:49:22 2013 From: report at bugs.python.org (David Edelsohn) Date: Sat, 22 Jun 2013 20:49:22 +0000 Subject: [issue18286] Python 3.3 - Slowing down computer In-Reply-To: <1371928488.87.0.904340213253.issue18286@psf.upfronthosting.co.za> Message-ID: <1371934162.53.0.50620876558.issue18286@psf.upfronthosting.co.za> David Edelsohn added the comment: Is the script changing any configuration settings in your system that reduces available system resources without occupying CPU, RAM or disk? ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 22:56:34 2013 From: report at bugs.python.org (Jon Irenicus) Date: Sat, 22 Jun 2013 20:56:34 +0000 Subject: [issue18286] Python 3.3 - Slowing down computer In-Reply-To: <1371928488.87.0.904340213253.issue18286@psf.upfronthosting.co.za> Message-ID: <1371934594.81.0.127603213191.issue18286@psf.upfronthosting.co.za> Jon Irenicus added the comment: #David Edelsohn It's not changing anything. with open('url_list.txt') as f: content = f.readlines() content = ''.join(content) content = list(content) if content[0] == 'h' and content[1] == 't' and content[2] =='t': print("Make sure that you remove http:/ !") time.sleep(1) sys.exit("") elif content[0] != 'w' and content[1] != 'w' and content[2] != 'w': print("Make sure that you have the www. at the start!") print(content[0],content[1]) time.sleep(1) sys.exit("") os.system("CLS") else: print("Configuration looks fine!") time.sleep(1) with open('url_list.txt') as f: content_url = f.readlines() content_join = ''.join(content_url) print("You will load video url",content_join,".") time.sleep(1) os.system("CLS") print("Processing...") time.sleep(1) global x x = 0 time.sleep(1) if x > 35: print("Warning! Your computer could go unstable!") time.sleep(1) os.system("CLS") print("Are you sure you want to select that many? - yes - no") while "1" == "1": _answer_ = input("|yes| |no| - ") if _answer == "yes": break elif answer == "no": sys.exit("Quitting application") else: print("Invalid input!") time.sleep(1) os.system("CLS") elif x in range(1,35): print("Seems fine") elif x < 0: print("Warning!") print("Out of range value!") os.system("CLS") time.sleep(5) sys.exit("") os.system("CLS") time.sleep(5) print("Starting now!") while x > 0: x = x - 1 os.system("start "+content_join) time.sleep(10) os.system("taskkill /f /im chrome.exe") os.system("start test.py") sys.exit("restarting") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 23:00:02 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Jun 2013 21:00:02 +0000 Subject: [issue18284] Doc make html: KeyError: 'howto/advocacy' In-Reply-To: <1371926675.0.0.253994093951.issue18284@psf.upfronthosting.co.za> Message-ID: <1371934802.44.0.753790119763.issue18284@psf.upfronthosting.co.za> R. David Murray added the comment: Automating it could be a sphinx enhancement request. Or maybe a bug report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 22 23:41:23 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sat, 22 Jun 2013 21:41:23 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1371937283.77.0.00244665174022.issue17621@psf.upfronthosting.co.za> Richard Oudkerk added the comment: Shouldn't the import lock be held to make it threadsafe? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 00:06:24 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jun 2013 22:06:24 +0000 Subject: [issue18283] shutil.which() should support bytes In-Reply-To: <1371914951.06.0.665120918364.issue18283@psf.upfronthosting.co.za> Message-ID: <1371938784.75.0.219986865722.issue18283@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 00:33:52 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jun 2013 22:33:52 +0000 Subject: [issue18227] Use Python memory allocators in external libraries like zlib or OpenSSL In-Reply-To: <1371338869.58.0.00725626403199.issue18227@psf.upfronthosting.co.za> Message-ID: <1371940432.23.0.420074503554.issue18227@psf.upfronthosting.co.za> STINNER Victor added the comment: Here is an initial attempt: set a custom allocator for bz2, lzma and zlib modules. The allocator is only replaced for an instance of a compressor or decompress, the change does not affect the library globally. PyMem_RawMalloc() is used instead of PyMem_Malloc() because the GIL is always released. ---------- keywords: +patch Added file: http://bugs.python.org/file30673/set_custom_alloc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 00:38:04 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 22 Jun 2013 22:38:04 +0000 Subject: [issue18151] Idlelib: update to "with open ... except OSError" (in 2.7, leave IOError) In-Reply-To: <1370538152.36.0.501706446334.issue18151@psf.upfronthosting.co.za> Message-ID: <3bdBVg42FYz7LjM@mail.python.org> Roundup Robot added the comment: New changeset 3c0e8e910125 by Terry Jan Reedy in branch '2.7': #18151, part 2: Silence debug build resource warning for each file opened by http://hg.python.org/cpython/rev/3c0e8e910125 New changeset c541073173bb by Terry Jan Reedy in branch '3.3': #18151, part 2: Silence debug build resource warning for each file opened by http://hg.python.org/cpython/rev/c541073173bb New changeset 1d67c0893719 by Terry Jan Reedy in branch 'default': #18151 Merge from 3.3 http://hg.python.org/cpython/rev/1d67c0893719 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 01:18:08 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jun 2013 23:18:08 +0000 Subject: [issue18281] tarfile defines stat constants In-Reply-To: <1371912078.43.0.227039082522.issue18281@psf.upfronthosting.co.za> Message-ID: <1371943088.92.0.110878699247.issue18281@psf.upfronthosting.co.za> STINNER Victor added the comment: Interesting commit: changeset: 76949:492e6c6a01bb user: Giampaolo Rodola' date: Tue May 15 15:30:25 2012 +0200 files: Doc/library/stat.rst Doc/whatsnew/3.3.rst Lib/stat.py Lib/tarfile.py Lib/test/test_stat.py Misc/NEWS description: #14807: move undocumented tarfile.filemode() to stat.filemode(). Add tarfile.filemode alias with deprecation warning. > I would like to replace them with values from the stat module I would prefer to simply drop all these constants. None is used by the tarfile module. *If* an application uses tarfile to get stat constants, this application must be fixed to use the stat module which contain thse constants since the creation of the stat module, something like 23 years ago... changeset: 20:118545312f3b branch: legacy-trunk user: Guido van Rossum date: Sun Oct 21 16:17:08 1990 +0000 files: Lib/stat.py description: Initial revision ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 01:26:09 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 22 Jun 2013 23:26:09 +0000 Subject: [issue18285] In itertools.product() add argument repeat to the docstring In-Reply-To: <1371927309.79.0.490510498207.issue18285@psf.upfronthosting.co.za> Message-ID: <3bdCZ86cVnz7Lk3@mail.python.org> Roundup Robot added the comment: New changeset 1fad7a709aae by Andrew Kuchling in branch '3.3': Close #18285: add 'repeat' parameter to docstring for product http://hg.python.org/cpython/rev/1fad7a709aae ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 01:26:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 22 Jun 2013 23:26:10 +0000 Subject: [issue18220] Expand itertools.islice docstring signature to 2 lines In-Reply-To: <1371277773.13.0.969293608974.issue18220@psf.upfronthosting.co.za> Message-ID: <3bdCZ94s7nz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset 7ecca1a98220 by Andrew Kuchling in branch '3.3': Closes #18220: expand itertools.islice docstring to 2 lines http://hg.python.org/cpython/rev/7ecca1a98220 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 01:49:53 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 22 Jun 2013 23:49:53 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <3bdD5X5ZFzz7LjM@mail.python.org> Roundup Robot added the comment: New changeset e5427b0b2bf7 by Victor Stinner in branch 'default': Issue #11016: Try to fix compilaton of the new _stat.c module on Windows http://hg.python.org/cpython/rev/e5427b0b2bf7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 01:51:07 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jun 2013 23:51:07 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371945067.66.0.809975158098.issue11016@psf.upfronthosting.co.za> STINNER Victor added the comment: > fileperm() sets 9 chars in buf[1] to buf[9]. Ah ok, fine, I missed the "&buf[1]" hack. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 01:53:34 2013 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Jun 2013 23:53:34 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371945214.35.0.606300223477.issue11016@psf.upfronthosting.co.za> STINNER Victor added the comment: > New changeset e5427b0b2bf7 by Victor Stinner in branch 'default': > Issue #11016: Try to fix compilaton of the new _stat.c module on Windows > http://hg.python.org/cpython/rev/e5427b0b2bf7 @Christian: Can you please review this commit? By the way, mode_t is also defined in import.c: #ifdef MS_WINDOWS /* for stat.st_mode */ typedef unsigned short mode_t; /* for _mkdir */ #include #endif And stat_filemode() should detect integer overflow. mode_t is a 32-bit unsigned integer on Linux, and now a 16-bit integer on Windows, whereas stat_filemode() uses an unsigned long (which 32 bit on Windows, and 32 or 64 bits on Linux). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 02:21:36 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 00:21:36 +0000 Subject: [issue18283] shutil.which() should support bytes In-Reply-To: <1371914951.06.0.665120918364.issue18283@psf.upfronthosting.co.za> Message-ID: <1371946896.27.0.162756695735.issue18283@psf.upfronthosting.co.za> STINNER Victor added the comment: Here is an implementation. ---------- keywords: +patch Added file: http://bugs.python.org/file30674/which_bytes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 02:37:00 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sun, 23 Jun 2013 00:37:00 +0000 Subject: [issue18280] Documentation is too personalized In-Reply-To: <1371889714.5.0.753258621658.issue18280@psf.upfronthosting.co.za> Message-ID: <1371947820.73.0.458835500193.issue18280@psf.upfronthosting.co.za> A.M. Kuchling added the comment: I've looked through the matches. "I/O" and the -I command-line switch are false positives. Many references in the FAQ ("How do I do X?"), but those don't need to be fixed. I think personalized references are most problematic when they're expressing uncertainty ("I don't know if we implement all of the spec") or opinions. Sentences like "When I run this command under Linux, I see..." could be rewritten as "When *you* run this command...", but they don't seem worth fixing to me. Files with personalized text are: c-api/exceptions.rst c-api/long.rst distutils/builtdist.rst extending/extending.rst install/index.rst library/audioop.rst library/ctypes.rst library/doctest.rst library/heapq.rst library/imaplib.rst library/numbers.rst library/ossaudiodev.rst library/unittest.mock-examples.rst library/unittest.mock.rst reference/introduction.rst tutorial/classes.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 09:41:24 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jun 2013 07:41:24 +0000 Subject: [issue18283] shutil.which() should support bytes In-Reply-To: <1371914951.06.0.665120918364.issue18283@psf.upfronthosting.co.za> Message-ID: <1371973284.28.0.784373606805.issue18283@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What about bytearrays and other byte-like objects? However I'm not sure this enhancement is worth to be accepted. Many other high-level functions in os and shutil modules do not support bytes paths. For shutil.which() there is no backward compatibility with Python 2 which we should support. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 09:59:48 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 23 Jun 2013 07:59:48 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371974388.46.0.618338051298.issue18236@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I stand by that comment: IsWhiteSpace should use the Unicode White_Space property. Since FS/GS/RS/US are not in the White_Space property, it's correct that the int conversion fails. It's incorrect that .isspace() gives true. There are really several bugs here: - .isspace doesn't use the White_List property - int conversion ultimately uses Py_ISSPACE, which conceptually could deviate from the Unicode properties (as it is byte-based). This is not really an issue, since they indeed match. I propose to fix this by parsing PropList.txt, and generating _PyUnicode_IsWhitespace based on the White_Space property. For efficiency, it should also generate a fast-lookup array for the ASCII case, or just use _Py_ctype_table (with a comment that this table needs to match PropList White_Space). _Py_ascii_whitespace should go. Contributions are welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 11:50:38 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sun, 23 Jun 2013 09:50:38 +0000 Subject: [issue9097] os.chdir(path) to return current dir In-Reply-To: <1277725409.82.0.324179081421.issue9097@psf.upfronthosting.co.za> Message-ID: <1371981038.24.0.139534347349.issue9097@psf.upfronthosting.co.za> anatoly techtonik added the comment: ..and still I miss: with os.chdir(path): do_something() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 12:54:21 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sun, 23 Jun 2013 10:54:21 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371984861.74.0.060579581187.issue18236@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: I agree with Martin. At the time Unicode was added to Python, there was no single Unicode property for white space, so I had to deduce this from the other available properties. Now that we have a white space property in Unicode, we should start using it. Fortunately, the difference in Python's set of white space chars and the ones having the Unicode white space property are minimal. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 13:36:13 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 11:36:13 +0000 Subject: [issue9097] os.chdir(path) to return current dir In-Reply-To: <1277725409.82.0.324179081421.issue9097@psf.upfronthosting.co.za> Message-ID: <1371987373.81.0.369376665711.issue9097@psf.upfronthosting.co.za> STINNER Victor added the comment: The idea was discussed many times, and there are existing implementations: http://mail.python.org/pipermail/python-ideas/2013-January/018756.html http://www.astropython.org/snippet/2009/10/chdir-context-manager http://stackoverflow.com/questions/169070/python-how-do-i-write-a-decorator-that-restores-the-cwd ... The idea was rejected because it is "an anti-pattern" "encouraging a bad habit". The current working directory is something global, as locales on UNIX: in a multithreaded application, all threads would be affected by such change. It's better to work only with absolute paths and never call os.chdir(). ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 13:42:32 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 11:42:32 +0000 Subject: [issue18283] shutil.which() should support bytes In-Reply-To: <1371914951.06.0.665120918364.issue18283@psf.upfronthosting.co.za> Message-ID: <1371987752.39.0.670359506629.issue18283@psf.upfronthosting.co.za> STINNER Victor added the comment: "What about bytearrays and other byte-like objects? However I'm not sure this enhancement is worth to be accepted. Many other high-level functions in os and shutil modules do not support bytes paths. For shutil.which() there is no backward compatibility with Python 2 which we should support." Bytes is the native type for path on all platforms... except Windows. So I fixed many functions of the os module to support bytes parameters. For example, functions of os.path support str and bytes types, but not bytearray. I also prefer to reject byte-like objects, to keep it simple. The bytes type should be accepted for any kind of os function parameter: path, environment variable, command line argument, etc. It's not a question of being compatible with Python 2, an application can make the choice of only used bytes because bytes is the native type for OS data on UNIX. Python 3 supports also "bytes stored in Unicode" thanks to the PEP 393, but it's not exactly the same: a path stored as str depends on the filesystem locale, whereas a bytes string is well defined (it's just an array of 8-bit unsigned numbers) and doesn't depend on any configuration variable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 13:44:16 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 11:44:16 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371987856.92.0.811146616526.issue18236@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 13:44:22 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 11:44:22 +0000 Subject: [issue18283] shutil.which() should support bytes In-Reply-To: <1371914951.06.0.665120918364.issue18283@psf.upfronthosting.co.za> Message-ID: <1371987862.94.0.600205943857.issue18283@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 13:51:39 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 11:51:39 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371988299.33.0.468485221652.issue11016@psf.upfronthosting.co.za> STINNER Victor added the comment: > And stat_filemode() should detect integer overflow. Attached stat_mode_overflow.patch should fix this issue. (I would also suggest to inline fileperm() into stat_filemode(), or pass buf instead of &buf[1]. But you may not agree, as you want :-)) ---------- Added file: http://bugs.python.org/file30675/stat_mode_overflow.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 14:57:35 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 23 Jun 2013 12:57:35 +0000 Subject: [issue18137] format(float, str): integer overflow for huge precision In-Reply-To: <1370387490.7.0.925760036374.issue18137@psf.upfronthosting.co.za> Message-ID: <3bdYZQ4GdbzMJ9@mail.python.org> Roundup Robot added the comment: New changeset ef5175d08e7e by Victor Stinner in branch '3.3': Issue #18137: Detect integer overflow on precision in float.__format__() and http://hg.python.org/cpython/rev/ef5175d08e7e New changeset 81fef2666ebb by Victor Stinner in branch 'default': (Merge 3.3) Issue #18137: Detect integer overflow on precision in http://hg.python.org/cpython/rev/81fef2666ebb New changeset d2b4f59943fa by Victor Stinner in branch '2.7': Issue #18137: Detect integer overflow on precision in float.__format__() http://hg.python.org/cpython/rev/d2b4f59943fa ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 14:57:47 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 12:57:47 +0000 Subject: [issue18137] format(float, str): integer overflow for huge precision In-Reply-To: <1370387490.7.0.925760036374.issue18137@psf.upfronthosting.co.za> Message-ID: <1371992267.3.0.328243378431.issue18137@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:18:47 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 23 Jun 2013 13:18:47 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <3bdZ2t5C69z7LjM@mail.python.org> Roundup Robot added the comment: New changeset f0d934732ab1 by Victor Stinner in branch '3.3': Issue #18135: Fix a possible integer overflow in ssl.SSLSocket.write() http://hg.python.org/cpython/rev/f0d934732ab1 New changeset f90d82a75a43 by Victor Stinner in branch 'default': (Merge 3.3) Issue #18135: Fix a possible integer overflow in http://hg.python.org/cpython/rev/f90d82a75a43 New changeset d7e22acb2315 by Victor Stinner in branch '2.7': Issue #18135: Fix a possible integer overflow in ssl.SSLSocket.write() http://hg.python.org/cpython/rev/d7e22acb2315 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:19:11 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 13:19:11 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1371993551.81.0.110303156527.issue18135@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:21:43 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sun, 23 Jun 2013 13:21:43 +0000 Subject: [issue9097] os.chdir(path) to return current dir In-Reply-To: <1277725409.82.0.324179081421.issue9097@psf.upfronthosting.co.za> Message-ID: <1371993703.15.0.986353451009.issue9097@psf.upfronthosting.co.za> anatoly techtonik added the comment: "an anti-pattern" and "encouraging a bad habit" are subjective non-arguments as long as they fail to answer why. With or without the helper you still write this code: prev = os.getcwd() os.chdir(SDKPATH) ... os.chdir(prev) And because os.chdir() doesn't do anything high-level, there is no place for the multithreading warning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:31:25 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 23 Jun 2013 13:31:25 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1371994285.92.0.474695570092.issue18135@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'm sorry to chime in a bit late, but I think this isn't the correct solution. Right now partial writes are not possible on a SSL socket, but this commit makes them possible. See http://bugs.python.org/issue8240 and http://bugs.python.org/issue12197 for some background. I think the right solution here would be to raise OverflowError, not truncate the output. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:32:29 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 13:32:29 +0000 Subject: [issue9097] os.chdir(path) to return current dir In-Reply-To: <1277725409.82.0.324179081421.issue9097@psf.upfronthosting.co.za> Message-ID: <1371994349.45.0.232028888483.issue9097@psf.upfronthosting.co.za> STINNER Victor added the comment: > "an anti-pattern" and "encouraging a bad habit" are subjective non-arguments as long as they fail to answer why. The reasons are explained in the python-idea thread. Please read it. > With or without the helper you still write this code: Adding more functions using os.chdir() would "encoure a bad habit". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:33:40 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 13:33:40 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371994420.8.0.873399913803.issue11016@psf.upfronthosting.co.za> STINNER Victor added the comment: My changeset e5427b0b2bf7 is not enough: "import _stat" still fail on Windows. See for example: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/2164/steps/test/logs/stdio ====================================================================== ERROR: test_directory (test.test_stat.TestFilemodeCStat) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_stat.py", line 128, in test_directory st_mode, modestr = self.get_mode() File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_stat.py", line 67, in get_mode modestr = self.statmod.filemode(st_mode) AttributeError: 'NoneType' object has no attribute 'filemode' ====================================================================== ERROR: test_mode (test.test_stat.TestFilemodeCStat) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_stat.py", line 119, in test_mode st_mode, modestr = self.get_mode() File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_stat.py", line 67, in get_mode modestr = self.statmod.filemode(st_mode) AttributeError: 'NoneType' object has no attribute 'filemode' ====================================================================== ERROR: test_module_attributes (test.test_stat.TestFilemodeCStat) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_stat.py", line 169, in test_module_attributes modvalue = getattr(self.statmod, key) AttributeError: 'NoneType' object has no attribute 'ST_DEV' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:35:33 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 13:35:33 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371994533.64.0.499218723962.issue11016@psf.upfronthosting.co.za> STINNER Victor added the comment: test_stat.test_devices() fail on Solaris: it looks like os.devnull is a symlink. You should probably use os.stat() instead of os.lstat() for this specific test. http://buildbot.python.org/all/builders/SPARC%20Solaris%2010%20%28cc%2C%2032b%29%20%5BSB%5D%203.x/builds/708/steps/test/logs/stdio ====================================================================== FAIL: test_devices (test.test_stat.TestFilemodeCStat) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cpython/buildslave/cc-32/3.x.snakebite-sol10-sparc-cc-32/build/Lib/test/test_stat.py", line 157, in test_devices self.assertEqual(modestr[0], 'c') AssertionError: 'l' != 'c' - l + c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:45:54 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 13:45:54 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1371995154.18.0.0542911541037.issue18135@psf.upfronthosting.co.za> STINNER Victor added the comment: > Right now partial writes are not possible on a SSL socket, but this commit makes them possible. Oh, I didn't know (forgot) that SSL does allow partial write by default. > I think the right solution here would be to raise OverflowError, not truncate the output. Do you mean always? Or only if the SSL_MODE_ENABLE_PARTIAL_WRITE option is not set? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:48:01 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 23 Jun 2013 13:48:01 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1371995154.18.0.0542911541037.issue18135@psf.upfronthosting.co.za> Message-ID: <1371995273.2569.0.camel@fsol> Antoine Pitrou added the comment: > > I think the right solution here would be to raise OverflowError, not truncate the output. > > Do you mean always? Or only if the SSL_MODE_ENABLE_PARTIAL_WRITE option is not set? SSL_MODE_ENABLE_PARTIAL_WRITE is never set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:48:14 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 13:48:14 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371995294.43.0.829006578055.issue18236@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- hgrepos: +201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 15:56:11 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 13:56:11 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1371995771.34.0.315648379858.issue18135@psf.upfronthosting.co.za> STINNER Victor added the comment: > I think the right solution here would be to raise OverflowError, not truncate the output. Here is a new patch (for Python 3.3) always raising OverflowError if the string is longer than INT_MAX bytes. ---------- Added file: http://bugs.python.org/file30676/ssl_overflow.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 16:02:05 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 14:02:05 +0000 Subject: [issue12520] spurious output in test_warnings In-Reply-To: <1310162087.96.0.0645657657853.issue12520@psf.upfronthosting.co.za> Message-ID: <1371996125.82.0.699801298609.issue12520@psf.upfronthosting.co.za> STINNER Victor added the comment: I cannot reproduce this isuse, was it fixed? $ ./python -m test test_warnings [1/1] test_warnings 1 test OK. > Also, I don't understand how test_filename_none is supposed to check for issue #12467 (it doesn't use a subprocess). You don't need a subprocess to reproduce the issue, you just have to emit a warning with __file__=None. At shutdown, __file__ is set to None by Py_Finalize, whereas a warning is emitted because a file was not closed explicitly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 16:13:54 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 14:13:54 +0000 Subject: [issue18236] int() and float() do not accept strings with trailing separators In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1371996834.16.0.18870860885.issue18236@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- keywords: +patch Added file: http://bugs.python.org/file30677/5c934626d44d.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 16:30:49 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 23 Jun 2013 14:30:49 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1371997849.9.0.522758301391.issue11016@psf.upfronthosting.co.za> Christian Heimes added the comment: I have addressed the Windows build issue in http://hg.python.org/cpython/rev/838f04e5a690 and the failing test on Solaris in http://hg.python.org/cpython/rev/6c23ca1982b3 (also 2.7 and default). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 16:57:49 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 23 Jun 2013 14:57:49 +0000 Subject: [issue7267] format method: c presentation type broken In-Reply-To: <1257438168.68.0.774312526176.issue7267@psf.upfronthosting.co.za> Message-ID: <1371999469.89.0.444315383779.issue7267@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- stage: test needed -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 17:12:52 2013 From: report at bugs.python.org (Niklas Koep) Date: Sun, 23 Jun 2013 15:12:52 +0000 Subject: [issue18287] PyType_Ready() should sanity-check the tp_name field Message-ID: <1372000372.42.0.425313116494.issue18287@psf.upfronthosting.co.za> New submission from Niklas Koep: I noticed that defining a new type where the tp_name field is NULL causes segfaults, for instance, when calling pydoc on the extension module. This particular segfault traces back to type_module() in Objects/typeobject.c where tp_name is passed to strrchr(). Raising an appropriate exception from PyType_Ready() seems sensible to avoid this kind of issue. The field is also used in two calls to PyErr_Format() in PyType_Ready() itself where it'll cause segfaults if not handled properly. While we're on the subject, pydoc doesn't list the type documentation if the tp_name string does not have a dot in it. I didn't research this any further as omitting dots seems to be valid according to the docs. However, at the very least it seems like this side effect should be mentioned in the documentation to avoid confusion when someone omits/forgets the package..module.type hierarchy in the field definition. I attached a tiny patch which just jumps to PyType_Ready()'s error label if the field is NULL. I also added a comment about pydoc in the two places of the documentation I could think of where tp_name is mentioned. ---------- components: Interpreter Core files: patch messages: 191705 nosy: nkoep priority: normal severity: normal status: open title: PyType_Ready() should sanity-check the tp_name field type: crash versions: Python 3.5 Added file: http://bugs.python.org/file30678/patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 17:15:05 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 15:15:05 +0000 Subject: [issue18236] str.isspace should use the Unicode White_Space property In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1372000505.62.0.878427969896.issue18236@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I have updated the title to focus this issue on the behavior of str.isspace(). I'll pick up remaining int/float issues in #10581. ---------- assignee: -> belopolsky title: int() and float() do not accept strings with trailing separators -> str.isspace should use the Unicode White_Space property _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 17:15:29 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 15:15:29 +0000 Subject: [issue18236] str.isspace should use the Unicode White_Space property In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1372000529.14.0.520329114285.issue18236@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file30679/3ed5bb7fcee9.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 17:16:02 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 15:16:02 +0000 Subject: [issue18236] str.isspace should use the Unicode White_Space property In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1372000562.04.0.911088172768.issue18236@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file30677/5c934626d44d.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 17:17:29 2013 From: report at bugs.python.org (Brian Curtin) Date: Sun, 23 Jun 2013 15:17:29 +0000 Subject: [issue9097] os.chdir(path) to return current dir In-Reply-To: <1277725409.82.0.324179081421.issue9097@psf.upfronthosting.co.za> Message-ID: <1372000649.86.0.606309205219.issue9097@psf.upfronthosting.co.za> Changes by Brian Curtin : ---------- nosy: -brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 18:13:14 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sun, 23 Jun 2013 16:13:14 +0000 Subject: [issue9097] os.chdir(path) to return current dir In-Reply-To: <1371994349.45.0.232028888483.issue9097@psf.upfronthosting.co.za> Message-ID: anatoly techtonik added the comment: On Sun, Jun 23, 2013 at 4:32 PM, STINNER Victor wrote: > > STINNER Victor added the comment: > > > "an anti-pattern" and "encouraging a bad habit" are subjective > non-arguments as long as they fail to answer why. > > The reasons are explained in the python-idea thread. Please read it. > This operation is time consuming. I counted +5 votes for the idea and then it turned into some complicated reading. If you know the reasons, why can't you do good for other people and summarize them here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 18:32:58 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 23 Jun 2013 16:32:58 +0000 Subject: [issue9097] os.chdir(path) to return current dir In-Reply-To: <1277725409.82.0.324179081421.issue9097@psf.upfronthosting.co.za> Message-ID: <1372005178.97.0.484125526665.issue9097@psf.upfronthosting.co.za> R. David Murray added the comment: I would prefer that Haypo spend his time contributing code to Python. If someone else wants to summarize the arguments in the thread for this issue, that would be great. Absent that, the link to the discussion is sufficient for the curious. In any case, the arguments already in this issue are sufficient. ---------- resolution: -> rejected stage: -> committed/rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 18:59:58 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 16:59:58 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1372006798.06.0.82188600287.issue10581@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Martin v. L?wis wrote at #18236 (msg191687): > int conversion ultimately uses Py_ISSPACE, which conceptually could > deviate from the Unicode properties (as it is byte-based). This is not > really an issue, since they indeed match. Py_ISSPACE matches Unicode White_Space property in the ASII range (first 128 code points) it differs for byte (code point) values from 128 through 255. This leads to the following discrepancy: >>> int('123\xa0') 123 but >>> int(b'123\xa0') Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 3: invalid start byte >>> int('123\xa0'.encode()) Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '123\xa0' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 19:00:17 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 17:00:17 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1372006817.32.0.134355930899.issue10581@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 19:03:23 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jun 2013 17:03:23 +0000 Subject: [issue18184] Add range check for %c in PyUnicode_FromFormat In-Reply-To: <1370898013.19.0.579439947433.issue18184@psf.upfronthosting.co.za> Message-ID: <1372007003.36.0.0780520576903.issue18184@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: No, I don't feel motivated right now (and this is a case when even never is better than right now). I checked other format methods and found a bug only in PyUnicode_FromFormatV(). I had added test for 3.3+ because 3.3+ already have a test for PyUnicode_FromFormatV(). I hadn't add test for 2.7 because there is no test for PyUnicode_FromFormatV() on 2.7. ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 19:12:54 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 23 Jun 2013 17:12:54 +0000 Subject: [issue18260] configparser: TypeError occurs when handling errors in files with binary names In-Reply-To: <1371615488.35.0.189174506667.issue18260@psf.upfronthosting.co.za> Message-ID: <3bdgF155B6z7Lkx@mail.python.org> Roundup Robot added the comment: New changeset 56c1227f21f5 by ?ukasz Langa in branch '3.3': Fixed issue #18260: configparser TypeError on source name specified as bytes http://hg.python.org/cpython/rev/56c1227f21f5 New changeset 06e70937364b by ?ukasz Langa in branch 'default': Merged fix for issue #18260 from 3.3 http://hg.python.org/cpython/rev/06e70937364b ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 19:15:09 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 23 Jun 2013 17:15:09 +0000 Subject: [issue18260] configparser: TypeError occurs when handling errors in files with binary names In-Reply-To: <1371615488.35.0.189174506667.issue18260@psf.upfronthosting.co.za> Message-ID: <1372007709.74.0.766254714543.issue18260@psf.upfronthosting.co.za> ?ukasz Langa added the comment: 1. Duplicate sections and options are consciously reported as errors now. This is a documented backwards-incompatible change [1]_. If you wish to revert to previous behaviour, you can set strict=False on parser creation. 2. It's really just a coincidence that specifying the filename as bytes worked in this case before on Python 3. That being said, it is indeed an unfortunate regression and was fixed in 56c1227f21f5 for 3.3 and 06e70937364b for 3.4. As a workaround for Python versions < 3.3.3 you can specify the source name as a Unicode string (e.g. `read_file(f, source=path_str)`. .. [1] http://docs.python.org/3/library/configparser.html#customizing-parser-behaviour ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 19:55:56 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 23 Jun 2013 17:55:56 +0000 Subject: [issue18184] Add range check for %c in PyUnicode_FromFormat In-Reply-To: <1370898013.19.0.579439947433.issue18184@psf.upfronthosting.co.za> Message-ID: <3bdhBg4svjz7LkS@mail.python.org> Roundup Robot added the comment: New changeset f8ede55cf92b by Serhiy Storchaka in branch '3.3': Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise http://hg.python.org/cpython/rev/f8ede55cf92b New changeset 42def600210e by Serhiy Storchaka in branch 'default': Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise http://hg.python.org/cpython/rev/42def600210e New changeset 2f1e8b7fa534 by Serhiy Storchaka in branch '2.7': Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise http://hg.python.org/cpython/rev/2f1e8b7fa534 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 20:09:48 2013 From: report at bugs.python.org (frattaroli.nicolas) Date: Sun, 23 Jun 2013 18:09:48 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: <1311699751.35.0.569127767575.issue12641@psf.upfronthosting.co.za> Message-ID: <1372010988.65.0.950848304265.issue12641@psf.upfronthosting.co.za> frattaroli.nicolas added the comment: It's cool that you guys are discussing semantics of who said what and how, but that still doesn't fix this very simple issue that breaks compiling for everyone on Windows who uses MinGW. -mno-cygwin, was, as far as I know, only ever required to build from cygwin as host to mingw as target. It is very unlikely that anyone who'd upgrade python still needs this option and is running a gcc cygwin 3.x version. And if it breaks for them it's still better than the current state, which is "broken for everyone else". Sorry if this sounds snarky, but the fact that this issue has been open for almost 2 years is quite ridiculous. ---------- nosy: +fratti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 20:18:14 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 18:18:14 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372011494.95.0.635422982666.issue18234@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Rather than adding a new method to unicodedata, what do you think about adding a type keyword argument to unicodedata.name()? It can default to "canonical" and have possible values "control", "abbreviation", etc. See also #12753. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 20:24:26 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 23 Jun 2013 18:24:26 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <3bdhqY3CTLz7Ljp@mail.python.org> Roundup Robot added the comment: New changeset ae802dc4dcd4 by R David Murray in branch 'default': #11390: convert doctest CLI to argparse and add -o and -f options. http://hg.python.org/cpython/rev/ae802dc4dcd4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 20:25:14 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 23 Jun 2013 18:25:14 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1372011914.59.0.591941546494.issue11390@psf.upfronthosting.co.za> R. David Murray added the comment: Committed. Thanks for the review, Barry. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 20:35:55 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jun 2013 18:35:55 +0000 Subject: [issue18184] Add range check for %c in PyUnicode_FromFormat In-Reply-To: <1370898013.19.0.579439947433.issue18184@psf.upfronthosting.co.za> Message-ID: <1372012555.96.0.792007154703.issue18184@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I agree, a ValueError may be better than OverflowError, but all other formattings raise OverflowError, and we should support them consistent. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 21:02:23 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jun 2013 19:02:23 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372014143.69.0.479427904876.issue18234@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Can a character or sequence have multiple aliases? What will be a result type of unicodedata.name() with "abbreviation" keyword value? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 21:06:17 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Jun 2013 19:06:17 +0000 Subject: [issue10581] Review and document string format accepted in numeric data type constructors In-Reply-To: <1291053358.57.0.165550567454.issue10581@psf.upfronthosting.co.za> Message-ID: <1372014377.22.0.941250667018.issue10581@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: For the last discrepancy see issue16741. It have a patch which should fix this. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 21:10:49 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 23 Jun 2013 19:10:49 +0000 Subject: [issue18288] Idle 2.7: Run Module does not set __file__ Message-ID: <1372014649.46.0.451507262065.issue18288@psf.upfronthosting.co.za> New submission from Terry J. Reedy: This is a 2.7 only bug. F:\Python\mypy\tem2.py ---- print (__file__) __file__ should be set to relative or absolute path. >From command line: F:\Python\mypy> c:/programs/python27/python.exe tem2.py tem2.py F:\Python\mypy> c:/programs/python27/python.exe -m tem2 F:\Python\mypy\tem2.py 3.3 gives same results. >From Idle editor window with Run Module (F5): 3.3: >>> F:\Python\mypy\tem2.py # same as python -m above, and same as when file is imported. 2.7: >>> Traceback (most recent call last): File "F:\Python\mypy\tem2.py", line 1, in print (__file__) NameError: name '__file__' is not defined This is the bug to be fixed, if reasonably possible. Both 2.7 and 3.3 set __file__ on regular import (or rather, Idle does not disable this). >>> import tem2 F:\Python\mypy\tem2.py I think the first step should be to try this on non-Windows systems. ---------- components: IDLE messages: 191721 nosy: Todd.Rovito, roger.serwy, terry.reedy priority: normal severity: normal stage: test needed status: open title: Idle 2.7: Run Module does not set __file__ type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 21:29:42 2013 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sun, 23 Jun 2013 19:29:42 +0000 Subject: [issue14264] Comparison bug in distutils2.version In-Reply-To: <1331580673.39.0.274980477917.issue14264@psf.upfronthosting.co.za> Message-ID: <1372015782.88.0.819742278526.issue14264@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: What the status of this issue?: the changeset http://hg.python.org/distutils2/rev/1e0ca4594a2a mentioned in msg155480 seems to add tests (but it hasn't been add to the issue explicitly). Can the issue be closed? ---------- nosy: +francismb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 21:40:47 2013 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sun, 23 Jun 2013 19:40:47 +0000 Subject: [issue18288] Idle 2.7: Run Module does not set __file__ In-Reply-To: <1372014649.46.0.451507262065.issue18288@psf.upfronthosting.co.za> Message-ID: <1372016447.27.0.575493502415.issue18288@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: On Debian: * Command line 2.7.3 ~/Prog/mypy$ python2.7 tem2.py tem2.py ~/Prog/mypy$ python2.7 -m tem2 /home/ci/Prog/mypy/tem2.py * IDLE 2.7.3 >>> print(__file__) Traceback (most recent call last): File "", line 1, in print(__file__) NameError: name '__file__' is not defined >>> >>> import tem2 tem2.pyc >>> ---------- nosy: +francismb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 21:41:26 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 19:41:26 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372016486.66.0.0240512667644.issue18234@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: > Can a character or sequence have multiple aliases? Yes, for example, most control characters have two aliases (and no name). 0000;NULL;control 0000;NUL;abbreviation 0001;START OF HEADING;control 0001;SOH;abbreviation 0002;START OF TEXT;control 0002;STX;abbreviation (See ) > What will be a result type of unicodedata.name() with "abbreviation" keyword value? Under my proposal: >>> unicodedata.name('\N{ESCAPE}', type='abbreviation') 'ESC' I would also like to consider changing the default slightly. I find the following behavior rather unhelpful: >>> unicodedata.name('\N{ESC}') Traceback (most recent call last): File "", line 1, in ValueError: no such name I think most users would expect 'ESCAPE' instead. The following is more of a curiosity rather than a genuine problem, but is a good illustration for a general point: >>> unicodedata.name('\N{PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRACKET}') 'PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET' (Note misspelled word "BRACKET" in the output.) Since "correction" alias is the official method of publishing corrections to unicode names, I think unicodedata.name() should return correct name by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 21:44:37 2013 From: report at bugs.python.org (=?utf-8?q?Francisco_Mart=C3=ADn_Brugu=C3=A9?=) Date: Sun, 23 Jun 2013 19:44:37 +0000 Subject: [issue18288] Idle 2.7: Run Module does not set __file__ In-Reply-To: <1372014649.46.0.451507262065.issue18288@psf.upfronthosting.co.za> Message-ID: <1372016677.88.0.00589965503891.issue18288@psf.upfronthosting.co.za> Francisco Mart?n Brugu? added the comment: >From Idle editor window (F5): >>> Traceback (most recent call last): File "/home/ci/Prog/mypy/tem2.py", line 1, in print(__file__) NameError: name '__file__' is not defined >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 22:12:49 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 23 Jun 2013 20:12:49 +0000 Subject: [issue18179] SMTP.local_hostname is undocumented In-Reply-To: <1370859868.96.0.822120662228.issue18179@psf.upfronthosting.co.za> Message-ID: <3bdlDd0S6fz7Lk5@mail.python.org> Roundup Robot added the comment: New changeset 3685d8074203 by R David Murray in branch '3.3': #18179: document the local_hostname parameter. http://hg.python.org/cpython/rev/3685d8074203 New changeset b10fae8c185c by R David Murray in branch 'default': Merge #18179: document the local_hostname parameter. http://hg.python.org/cpython/rev/b10fae8c185c New changeset c8914dbe6ead by R David Murray in branch '2.7': #18179: document the local_hostname parameter. http://hg.python.org/cpython/rev/c8914dbe6ead New changeset ffcf46316e1f by R David Murray in branch '3.3': #18179: reflow paragraphs. http://hg.python.org/cpython/rev/ffcf46316e1f New changeset 627e3096340e by R David Murray in branch 'default': Merge #18179: reflow paragraphs. http://hg.python.org/cpython/rev/627e3096340e New changeset 9f1f83d23ec4 by R David Murray in branch '2.7': #18179: reflow paragraphs. http://hg.python.org/cpython/rev/9f1f83d23ec4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 22:16:19 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 23 Jun 2013 20:16:19 +0000 Subject: [issue18179] SMTP.local_hostname is undocumented In-Reply-To: <1370859868.96.0.822120662228.issue18179@psf.upfronthosting.co.za> Message-ID: <1372018579.59.0.0953731390534.issue18179@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks Berker. I edited your patch to (a) use 'Otherwise' instead of 'By default', which is a change from the original docstring that I think makes it clearer, (b) add words about what the local_hostname is used for (the HELO/EHLO commands) and (c) in SMTP_SSL and LMTP, just refer to the SMTP class (like LMTP already did). I also updated the docstrings similarly. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 22:34:01 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 20:34:01 +0000 Subject: [issue9097] os.chdir(path) to return current dir In-Reply-To: Message-ID: STINNER Victor added the comment: > anatoly techtonik added the comment: >> The reasons are explained in the python-idea thread. Please read it. > > This operation is time consuming. I counted +5 votes for the idea and then > it turned into some complicated reading. > If you know the reasons, why can't you do good for other people and > summarize them here? I'm sure that other core developers already explained you how Python is developed. It's not because someone proposed an idea and he/she has 5 supporters that the idea will be implemented. If you want to change Python, you have to explain your usecase, others will ask you questions, you will have to answer to answer to questions and propose technical solutions. For this issue, many questions have no answer. (Just one example, the fact that os.chdir() is process-wide.) I don't know why I'm repeating myself, I already told you something like that at least once on another topic. It's just a lack of respect of answering "This operation is time consuming." If you don't respect the rules (understand how Python is developed), we cannot work together. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 22:43:45 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 20:43:45 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372020225.63.0.919311160342.issue18234@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: unicodedata.name() was discussed in #12353 (msg144739) where MvL argued that misspelled names are better than corrected because they are more likely to appear misspelled in other sources. I am not sure I buy this argument. Someone googling for 'BYZANTINE MUSICAL SYMBOL FHTORA SKLIRON CHROMA VASIS' will probably just enter BYZANTINE VASIS and find what he or she needs. A more likely scenario is someone trying to get all FTHORA symbols using a naive code like this: [hex(i) for i in range(1114112) if 'FTHORA' in ud.name(chr(i), '')]. Even more likely scenario is someone seeing a fancy symbol on the web and wanting to use it in a python program. Such programmer would copy the symbol to python prompt, call unicode.name() and copy the result in the program. Do we want to encourage people to perpetuate the mistake that Unicode has corrected? I don't think the issue of control codes names was discussed in #12353. I see no downside with returning the first alias in case no name is present. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 22:58:18 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 23 Jun 2013 20:58:18 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <3bdmF51f56z7LlW@mail.python.org> Roundup Robot added the comment: New changeset 44c8a9d80595 by Victor Stinner in branch 'default': Issue #11016: Detect integer conversion on conversion from Python int to C mode_t http://hg.python.org/cpython/rev/44c8a9d80595 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 23:01:18 2013 From: report at bugs.python.org (STINNER Victor) Date: Sun, 23 Jun 2013 21:01:18 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372021278.19.0.88761859809.issue17206@psf.upfronthosting.co.za> STINNER Victor added the comment: > I've attached an updated patch that reuses the _py_tmp variable for those temporary assignments thus keeping the required stack size down. I don't understand how it would change the size of the C stack, could you please explain? object.patch looks like refactoring to simplify the work of the C preprocessor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 23:09:23 2013 From: report at bugs.python.org (Bernhard Reiter) Date: Sun, 23 Jun 2013 21:09:23 +0000 Subject: [issue18267] xmlrpc.client documentation multicall example missleading for division behaviour of python3 In-Reply-To: <1371675805.26.0.18697522409.issue18267@psf.upfronthosting.co.za> Message-ID: <1372021763.36.0.750255345973.issue18267@psf.upfronthosting.co.za> Bernhard Reiter added the comment: Andrew, thanks for caring! Seeing your fix 2a3bc6eb2e13 I believe it does not fully resolv the issue. Now the code reads "return x // y" "multicall.divide(7,3)" and the client prints "7/3=2" I think you probably should change "7/3=" to "7//3=" in the client code as well to be instructive to learners. By the way: your change also introduced whitespace around the operator. Now it is the only one out of the four. I guess they should be consistent. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 23:48:58 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sun, 23 Jun 2013 21:48:58 +0000 Subject: [issue13276] bdist_wininst-created installer does not run the postinstallation script when uninstalling In-Reply-To: <1319729455.78.0.312367178712.issue13276@psf.upfronthosting.co.za> Message-ID: <1372024138.8.0.289861595222.issue13276@psf.upfronthosting.co.za> Changes by anatoly techtonik : ---------- nosy: +techtonik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 23:49:08 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 21:49:08 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372024148.26.0.422338110243.issue18234@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I mistyped issue reference above it should be #12753, not 12353. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 23 23:51:02 2013 From: report at bugs.python.org (anatoly techtonik) Date: Sun, 23 Jun 2013 21:51:02 +0000 Subject: [issue13276] bdist_wininst-created installer does not run the postinstallation script when uninstalling In-Reply-To: <1319729455.78.0.312367178712.issue13276@psf.upfronthosting.co.za> Message-ID: <1372024262.31.0.754690265551.issue13276@psf.upfronthosting.co.za> anatoly techtonik added the comment: @Pierre.Raybaut: Looking at the stage of this ticker, I believe you need to write unittest. Then attach a patch. If patch is attached, the issue is more visible among developers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 00:00:48 2013 From: report at bugs.python.org (Jeffrey Armstrong) Date: Sun, 23 Jun 2013 22:00:48 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: <1311699751.35.0.569127767575.issue12641@psf.upfronthosting.co.za> Message-ID: <1372024848.03.0.481302684047.issue12641@psf.upfronthosting.co.za> Jeffrey Armstrong added the comment: > ...the fact that this issue has been open for almost 2 years is quite ridiculous. I thought that I'd add a little statistic for everyone that might put this bug into perspective. Since this bug was opened, the MinGW installer has been downloaded about 32,000,000 (32 million) times per sf.net: http://sourceforge.net/projects/mingw/files/Installer/stats/timeline?dates=2011-07-26+to+2013-06-23 If we take a naive approach, that's 32 million compiler installations that can't build Python extensions without manually modifying distutils first. That statistic doesn't include the multitude of people installing other builds of GCC for Windows (including MinGW-W64, a whole other unsupported version of GCC, but that's a different bug). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 00:04:51 2013 From: report at bugs.python.org (Jeffrey Armstrong) Date: Sun, 23 Jun 2013 22:04:51 +0000 Subject: [issue11723] Add support for mingw64 compiler In-Reply-To: <1301503307.11.0.347710648609.issue11723@psf.upfronthosting.co.za> Message-ID: <1372025091.47.0.456449432122.issue11723@psf.upfronthosting.co.za> Changes by Jeffrey Armstrong : ---------- nosy: +Jeffrey.Armstrong _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 00:13:22 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 23 Jun 2013 22:13:22 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <3bdnvj5PhMz7Ll4@mail.python.org> Roundup Robot added the comment: New changeset 75bc0ae02bcd by Christian Heimes in branch 'default': Issue #11016: Don't define macros and constants that are already set by pyport.h http://hg.python.org/cpython/rev/75bc0ae02bcd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 00:32:03 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 22:32:03 +0000 Subject: [issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace In-Reply-To: <1313430514.3.0.983525514499.issue12753@psf.upfronthosting.co.za> Message-ID: <1372026723.16.0.994189753192.issue12753@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: > about the problems you mentioned in msg144836, can you report > it in a new issue or, if there are already issues about them, > add a message there? I believe that would be #4610. ---------- nosy: +belopolsky superseder: -> Unicode case mappings are incorrect _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 00:52:54 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 22:52:54 +0000 Subject: [issue4610] Unicode case mappings are incorrect In-Reply-To: <1228834230.47.0.479389214751.issue4610@psf.upfronthosting.co.za> Message-ID: <1372027974.81.0.239544434741.issue4610@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: There has been a relatively recent discussion of case mappings under #12753 (msg144836). I personally agree with Martin: str.upper/lower should remain the way it is - a simplistic 1-to-1 mapping using UnicodeData.txt fields. More sophisticated case mapping algorithms belong to a specialized library module not python core. The behavior of .title() and .capitalize() is harder to defend, so if someone can point out to a python library (PyICU?) that gets it right we can reference it in the documentation. ---------- versions: +Python 3.4 -Python 2.6, Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 01:15:24 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 23:15:24 +0000 Subject: [issue18236] str.isspace should use the Unicode White_Space property In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1372029324.64.0.967975337474.issue18236@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file30680/42973dfea391.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 01:22:13 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 23:22:13 +0000 Subject: [issue18236] str.isspace should use the Unicode White_Space property In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1372029733.88.0.771310936676.issue18236@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file30679/3ed5bb7fcee9.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 01:34:30 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 23:34:30 +0000 Subject: [issue18236] str.isspace should use the Unicode White_Space property In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1372030470.42.0.563940518339.issue18236@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: I would like someone review this change: https://bitbucket.org/alexander_belopolsky/cpython/commits/92c187025d0a8a989d9f81f2cb4c96f4eecb81cb?at=issue-18236 The patch can go in without this optimization, but I think this is the right first step towards removing _Py_ascii_whitespace. I don't think there is a need to generate ASCII optimization in makeunicodedata. While technically Unicode stability policy only guarantees that White_Space property will not be removed from code point s that have it, I think there is little chance that they will ever add White_Space property to another code point in the ASCII range and if they do, I am not sure Python will have to follow. ---------- components: +Interpreter Core, Unicode keywords: +needs review stage: -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 01:56:10 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Sun, 23 Jun 2013 23:56:10 +0000 Subject: [issue4610] Unicode case mappings are incorrect In-Reply-To: <1228834230.47.0.479389214751.issue4610@psf.upfronthosting.co.za> Message-ID: <1372031770.82.0.0999420846928.issue4610@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: It looks like at least the OP issue has been fixed in #12736: >>> '?'.upper() 'SS' ---------- resolution: -> out of date status: open -> closed superseder: -> Request for python casemapping functions to use full not simple casemaps per Unicode's recommendation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 05:27:22 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 24 Jun 2013 03:27:22 +0000 Subject: [issue15223] datetime instances lack __module__ attribute In-Reply-To: <1340985927.81.0.282972335734.issue15223@psf.upfronthosting.co.za> Message-ID: <1372044442.13.0.55356901381.issue15223@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 06:08:38 2013 From: report at bugs.python.org (Max Kaye) Date: Mon, 24 Jun 2013 04:08:38 +0000 Subject: [issue18289] Segmentation Fault using round() Message-ID: <1372046917.43.0.988841016926.issue18289@psf.upfronthosting.co.za> New submission from Max Kaye: Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> print round(1.123456, 3) 1.123 >>> print round(1.123756, 3) Segmentation fault: 11 This doesn't happen if you just do the second round, only if you do both. `python -c "print round(1.123456, 3); print round(1.123756, 3)"` doesn't segfault. Doesn't segfault on brew's python: Python 2.7.3 (default, May 19 2013, 04:22:38) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.51)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> print round(1.123456, 3) 1.123 >>> print round(1.123756, 3) 1.124 >>> Doesn't segfault on another box: Python 2.7.2+ (default, Jul 20 2012, 22:12:53) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print round(1.123456, 3) 1.123 >>> print round(1.123756, 3) 1.124 >>> OSX Log File: (goes to EOF) Process: Python [5423] Path: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 2.7.3 (2.7.3) Code Type: X86-64 (Native) Parent Process: bash [1219] Responsible: iTerm [442] User ID: 501 Date/Time: 2013-06-24 13:55:56.871 +1000 OS Version: Mac OS X 10.9 (13A476u) Report Version: 11 Anonymous UUID: D8CE5653-35DD-5963-C8C9-E5012E41FDEE Sleep/Wake UUID: 9C40804C-F025-4E16-A61A-D1E9D9F68DD3 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Regions Near 0: --> __TEXT 0000000100000000-0000000100001000 [ 4K] r-x/rwx SM=COW /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 readline.so 0x00000001002eff97 call_readline + 647 1 org.python.python 0x0000000100008852 PyOS_Readline + 274 2 org.python.python 0x000000010000a0a8 tok_nextc + 104 3 org.python.python 0x000000010000a853 PyTokenizer_Get + 147 4 org.python.python 0x000000010000544a parsetok + 218 5 org.python.python 0x00000001000e7722 PyParser_ASTFromFile + 146 6 org.python.python 0x00000001000e8983 PyRun_InteractiveOneFlags + 243 7 org.python.python 0x00000001000e8c6e PyRun_InteractiveLoopFlags + 78 8 org.python.python 0x00000001000e9451 PyRun_AnyFileExFlags + 161 9 org.python.python 0x000000010010006d Py_Main + 3085 10 org.python.python 0x0000000100000f14 0x100000000 + 3860 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x0000000100600000 rcx: 0x0000000100600000 rdx: 0x0000000000002800 rdi: 0x0000000000000000 rsi: 0x00000001002f0254 rbp: 0x00007fff5fbff620 rsp: 0x00007fff5fbff550 r8: 0x0000000100600000 r9: 0x0000000000000000 r10: 0x0000000000000007 r11: 0x0000000000000001 r12: 0x0000000000000001 r13: 0x0000000000000018 r14: 0x00007fff5fbff5e0 r15: 0x00007fff5fbff560 rip: 0x00000001002eff97 rfl: 0x0000000000010206 cr2: 0x0000000000000000 Logical CPU: 4 Error Code: 0x00000004 Trap Number: 14 Binary Images: 0x100000000 - 0x100000fff +org.python.python (2.7.3 - 2.7.3) /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 0x100003000 - 0x10016dff7 +org.python.python (2.7.3, [c] 2004-2012 Python Software Foundation. - 2.7.3) <4F9EF48A-7D0C-0C1A-670B-3BF4E72C8696> /Library/Frameworks/Python.framework/Versions/2.7/Python 0x1002ee000 - 0x1002f0fff +readline.so (???) /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so 0x1004f0000 - 0x10050effb libedit.2.dylib (39) <24343EDB-E64F-34DC-8632-68C9E44E0FF7> /usr/lib/libedit.2.dylib 0x7fff66a19000 - 0x7fff66a4c987 dyld (236) /usr/lib/dyld 0x7fff8201f000 - 0x7fff82026ff3 libcopyfile.dylib (103) <7925E83E-6C96-38AD-9E53-AA9AE7C9E406> /usr/lib/system/libcopyfile.dylib 0x7fff82062000 - 0x7fff82063ff7 libsystem_blocks.dylib (63) /usr/lib/system/libsystem_blocks.dylib 0x7fff823cd000 - 0x7fff823f4ff3 libsystem_info.dylib (449) <6080681C-A561-3458-AA51-4DBE6D4E36B2> /usr/lib/system/libsystem_info.dylib 0x7fff82460000 - 0x7fff82466fef libsystem_platform.dylib (20.0.0.0.1) /usr/lib/system/libsystem_platform.dylib 0x7fff82514000 - 0x7fff8251bff7 liblaunch.dylib (841) <0554A59B-30EE-3E01-A5F6-3676F4B060B2> /usr/lib/system/liblaunch.dylib 0x7fff826d3000 - 0x7fff826d3ff7 libkeymgr.dylib (28) /usr/lib/system/libkeymgr.dylib 0x7fff829d4000 - 0x7fff829d5ffb libremovefile.dylib (33) /usr/lib/system/libremovefile.dylib 0x7fff83972000 - 0x7fff839b4ff7 libauto.dylib (185.4) <4B2CABC5-1F75-3225-81B4-882AEAE31ADC> /usr/lib/libauto.dylib 0x7fff84188000 - 0x7fff8418ffff libcompiler_rt.dylib (35) <9348DDF4-A5A7-3FDA-95E8-5018F88DC3AE> /usr/lib/system/libcompiler_rt.dylib 0x7fff84190000 - 0x7fff84191fff libunc.dylib (28) <34E818C3-373C-3564-8941-D9161473FD8A> /usr/lib/system/libunc.dylib 0x7fff8478c000 - 0x7fff8478ffff libsystem_stats.dylib (91.0.0.1.5) /usr/lib/system/libsystem_stats.dylib 0x7fff84790000 - 0x7fff847b7ff7 libsystem_network.dylib (241.2) <377DF6DA-A545-3146-A2B0-69B7D4492FB2> /usr/lib/system/libsystem_network.dylib 0x7fff85ae6000 - 0x7fff85ae9ff7 libdyld.dylib (236) <35641DC4-9D32-302F-BBE4-2B2E8A3D1D6B> /usr/lib/system/libdyld.dylib 0x7fff86229000 - 0x7fff8624afff libc++abi.dylib (41) /usr/lib/libc++abi.dylib 0x7fff87095000 - 0x7fff870c4fd2 libsystem_m.dylib (3047.15) <471B9063-4C93-3157-A862-AD84E3620182> /usr/lib/system/libsystem_m.dylib 0x7fff870c6000 - 0x7fff870d7ff7 libsystem_asl.dylib (215) <0995D278-3165-324E-8B35-936EA612ACD1> /usr/lib/system/libsystem_asl.dylib 0x7fff88073000 - 0x7fff8808dfff libsystem_malloc.dylib (23) <987C72AA-A2B3-3AD8-8616-D8A04B7440EF> /usr/lib/system/libsystem_malloc.dylib 0x7fff88c56000 - 0x7fff88c58ff3 libsystem_configuration.dylib (589) /usr/lib/system/libsystem_configuration.dylib 0x7fff88ce4000 - 0x7fff88ce5ff7 libsystem_sandbox.dylib (272) /usr/lib/system/libsystem_sandbox.dylib 0x7fff88f00000 - 0x7fff88f01ff7 libDiagnosticMessagesClient.dylib (100) /usr/lib/libDiagnosticMessagesClient.dylib 0x7fff88f02000 - 0x7fff88f0cfff libcommonCrypto.dylib (60047) <68F03BCA-58FD-39CC-878D-B7F6283102E5> /usr/lib/system/libcommonCrypto.dylib 0x7fff88f82000 - 0x7fff8900bff7 libsystem_c.dylib (995) <82F1BDE9-FD58-3749-9837-15ADC6909E0A> /usr/lib/system/libsystem_c.dylib 0x7fff89b93000 - 0x7fff89d4bffb libicucore.A.dylib (511.13) <552A1606-39B8-3A4F-A975-73838AC1FDD6> /usr/lib/libicucore.A.dylib 0x7fff8a265000 - 0x7fff8a267fff libquarantine.dylib (65) <8791F59F-9F9F-3A24-83C4-BFD04CF589EA> /usr/lib/system/libquarantine.dylib 0x7fff8a5ec000 - 0x7fff8a5f5ff3 libsystem_notify.dylib (121) <549072AF-B6C9-3F63-8027-72E70CAF91E4> /usr/lib/system/libsystem_notify.dylib 0x7fff8a5fc000 - 0x7fff8a62cfff libncurses.5.4.dylib (42) /usr/lib/libncurses.5.4.dylib 0x7fff8af11000 - 0x7fff8af63fff libc++.1.dylib (118) /usr/lib/libc++.1.dylib 0x7fff8c7e4000 - 0x7fff8c7e8ff7 libcache.dylib (61) /usr/lib/system/libcache.dylib 0x7fff8d234000 - 0x7fff8d24eff7 libdispatch.dylib (338.0.0.0.1) <280908EF-A853-3653-A5B0-ED2668057F26> /usr/lib/system/libdispatch.dylib 0x7fff8d262000 - 0x7fff8d263ff3 libSystem.B.dylib (1197) <3EE2A53C-6274-3FE4-AF73-E6BC8054D6EB> /usr/lib/libSystem.B.dylib 0x7fff8d6d1000 - 0x7fff8d6d6ff7 libunwind.dylib (35.3) <56390AC7-A945-3A4B-9E83-305EF4828104> /usr/lib/system/libunwind.dylib 0x7fff8e439000 - 0x7fff8e440ff7 libsystem_pthread.dylib (52) /usr/lib/system/libsystem_pthread.dylib 0x7fff8e441000 - 0x7fff8e625fff com.apple.CoreFoundation (6.9 - 839.13) <048EF287-A909-3CF5-B077-D885BCC0CE5F> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x7fff8e9ba000 - 0x7fff8e9d5ff7 libsystem_kernel.dylib (2422.1.4.1.8) <49597BCD-66AE-3511-A739-ADCC5F15EBF5> /usr/lib/system/libsystem_kernel.dylib 0x7fff8ea31000 - 0x7fff8ea39fff libsystem_dnssd.dylib (519.0.71) <69EC92C2-E2E4-315E-AE65-B20E6BA117F8> /usr/lib/system/libsystem_dnssd.dylib 0x7fff8ea74000 - 0x7fff8eac2ff7 libcorecrypto.dylib (159) <9597C75C-2559-319C-B991-9A955C69C325> /usr/lib/system/libcorecrypto.dylib 0x7fff8eb14000 - 0x7fff8eb36fff libxpc.dylib (296.0.0.1.1) <4D58910D-3A78-3E94-A00F-C8184A51592B> /usr/lib/system/libxpc.dylib 0x7fff8ebaa000 - 0x7fff8ed57f37 libobjc.A.dylib (548) /usr/lib/libobjc.A.dylib 0x7fff8efcb000 - 0x7fff8efd0fff libmacho.dylib (845) <042598A7-4439-3CF6-8D51-FA41B43A52E7> /usr/lib/system/libmacho.dylib 0x7fff8f2d1000 - 0x7fff8f2e2ff7 libz.1.dylib (53) <372E2641-66CA-3B13-8BE6-3A4335F861A6> /usr/lib/libz.1.dylib External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 698403 thread_create: 0 thread_set_state: 0 VM Region Summary: ReadOnly portion of Libraries: Total=74.5M resident=14.9M(20%) swapped_out_or_unallocated=59.6M(80%) Writable regions: Total=19.9M written=2144K(11%) resident=2816K(14%) swapped_out=0K(0%) unallocated=17.2M(86%) REGION TYPE VIRTUAL =========== ======= Kernel Alloc Once 4K MALLOC 11.6M MALLOC (admin) 16K STACK GUARD 56.0M Stack 8192K VM_ALLOCATE 8K __DATA 1452K __LINKEDIT 64.1M __TEXT 10.4M __UNICODE 544K shared memory 4K =========== ======= TOTAL 152.1M Model: MacBookPro10,1, BootROM MBP101.00EE.B02, 4 processors, Intel Core i7, 2.3 GHz, 8 GB, SMC 2.3f35 Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In, 1024 MB Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533642465238432D50422020 Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533642465238432D50422020 AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (6.30.223.82.10) Bluetooth: Version 4.2.0b3 12469, 3 services, 21 devices, 3 incoming serial ports Network Service: Wi-Fi, AirPort, en0 Serial ATA Device: APPLE SSD SM256E, 251 GB USB Device: hub_device USB Device: FaceTime HD Camera (Built-in) USB Device: hub_device USB Device: hub_device USB Device: BRCM20702 Hub USB Device: Bluetooth USB Host Controller USB Device: Apple Internal Keyboard / Trackpad ---------- messages: 191741 nosy: Max.Kaye priority: normal severity: normal status: open title: Segmentation Fault using round() versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 06:46:19 2013 From: report at bugs.python.org (Antti Haapala) Date: Mon, 24 Jun 2013 04:46:19 +0000 Subject: [issue18290] json encoder does not support JSONP/JavaScript safe escaping Message-ID: <1372049179.79.0.237326954931.issue18290@psf.upfronthosting.co.za> New submission from Antti Haapala: JSON is not a strict superset of JavaScript (http://timelessrepo.com/json-isnt-a-javascript-subset). However, certain web technologies use JSON values as a part of JavaScript code (JSONP, inline tag, no < cannot be escaped; however only the string '' (or sometimes "} embedded in inline javascript. The only correct way to escape such content in inline html is to escape all / into \/. The \u2028, \u2029 problem is more subtle and can break not only inline javascript but also JSONP. Thus there an incorrect value injected by a malicious or unwitting user to the database might break the entire protocol. The current solution is to re-escape everything that comes out of JSON encoder. The best solution for python would be to make these 3 escapes default in the python json module (notice again that the current set of default escapes when ensure_ascii=False is chosen arbitrarily), or if not default, then at least they could be enabled by a switch. Furthermore, documentation should be updated appropriately, to explain why such escape is needed. ---------- components: Library (Lib) messages: 191742 nosy: Ztane priority: normal severity: normal status: open title: json encoder does not support JSONP/JavaScript safe escaping type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 06:54:05 2013 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 Jun 2013 04:54:05 +0000 Subject: [issue18289] python.org Interactive interpreter linked with libedit can segfault on future OS X In-Reply-To: <1372046917.43.0.988841016926.issue18289@psf.upfronthosting.co.za> Message-ID: <1372049645.03.0.232455568787.issue18289@psf.upfronthosting.co.za> Ned Deily added the comment: The crash report indicates that the operating system is a OS X 10.9 Developer Preview (which is under NDA at the moment) and that you are using the python2.7.3 from the python.org 64-bit/32-bit 2.7.3 installer. The readline module include with that installer dynamically links with the OS-provided libedit.dylib for terminal editing functions in the interactive interpreter. I can also reproduce a similar crash using the python.org 3.3.2 installer and just by entering "print('a')" twice; no need to use round(). The problem is not reproducible on current OS X 10.8 systems. Almost certainly this is due to some incompatible change in libedit.dylib. You should open an issue with Apple reporting the compatibility problem. The Homebrew Python most likely is linked with its own copy of the GNU readline library rather than the system libedit. ---------- assignee: -> ned.deily nosy: +ned.deily title: Segmentation Fault using round() -> python.org Interactive interpreter linked with libedit can segfault on future OS X versions: +Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 06:56:15 2013 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 Jun 2013 04:56:15 +0000 Subject: [issue18289] python.org Interactive interpreter linked with libedit can segfault on future OS X In-Reply-To: <1372046917.43.0.988841016926.issue18289@psf.upfronthosting.co.za> Message-ID: <1372049775.49.0.676174178929.issue18289@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- components: +Macintosh nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 06:57:24 2013 From: report at bugs.python.org (Antti Haapala) Date: Mon, 24 Jun 2013 04:57:24 +0000 Subject: [issue18290] json encoder does not support JSONP/JavaScript safe escaping In-Reply-To: <1372049179.79.0.237326954931.issue18290@psf.upfronthosting.co.za> Message-ID: <1372049844.15.0.180497813978.issue18290@psf.upfronthosting.co.za> Antti Haapala added the comment: My mistake in writing, json ofc does specify that "control characters" be escaped. Then, it needs to be pointed out that JSON module DOES not currently escape \u007f-\u009f as it maybe strictly should >>> unicodedata.category('\u007f') 'Cc' >>> json.dumps({'a': '\u007f'}, ensure_ascii=False) '{"a": "\x7f"}' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 07:52:13 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jun 2013 05:52:13 +0000 Subject: [issue18288] Idle 2.7: Run Module does not set __file__ In-Reply-To: <1372014649.46.0.451507262065.issue18288@psf.upfronthosting.co.za> Message-ID: <1372053133.13.0.312643476992.issue18288@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thanks, not specifically Windows then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 07:52:28 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 24 Jun 2013 05:52:28 +0000 Subject: [issue18236] str.isspace should use the Unicode White_Space property In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1372053148.32.0.180986907382.issue18236@psf.upfronthosting.co.za> Martin v. L?wis added the comment: -1 on that patch. It's using trickery to implement the test, and it's not clear that it is actually as efficient as the previous version. The previous version was explicitly modified to use a table lookup for performance reasons. I'd be fine with not generating PyUnicode_IsWhiteSpace at all, but instead hand-coding it. I suspect that we might want to use more of PropList at some point, so an effort to parse it might not be wasted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 09:54:05 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 24 Jun 2013 07:54:05 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1372020225.63.0.919311160342.issue18234@psf.upfronthosting.co.za> Message-ID: <51C7FB18.6040001@egenix.com> Marc-Andre Lemburg added the comment: On 23.06.2013 22:43, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > unicodedata.name() was discussed in #12353 (msg144739) where MvL argued that misspelled names are better than corrected because they are more likely to appear misspelled in other sources. I am not sure I buy this argument. Someone googling for 'BYZANTINE MUSICAL SYMBOL FHTORA SKLIRON CHROMA VASIS' will probably just enter BYZANTINE VASIS and find what he or she needs. A more likely scenario is someone trying to get all FTHORA symbols using a naive code like this: [hex(i) for i in range(1114112) if 'FTHORA' in ud.name(chr(i), '')]. > > Even more likely scenario is someone seeing a fancy symbol on the web and wanting to use it in a python program. Such programmer would copy the symbol to python prompt, call unicode.name() and copy the result in the program. Do we want to encourage people to perpetuate the mistake that Unicode has corrected? > > I don't think the issue of control codes names was discussed in #12353. I see no downside with returning the first alias in case no name is present. We should stick to the rules. Please leave the function as it is, i.e. a 1-1 mapping to the official, non-changing Unicode name reference (including spelling errors, etc). Same with code points that have no name. If you want to expose the aliases, you can do so in a new function, say .aliases() which then returns the list of aliases of a character (including the original name, if available). If we change the return values of .name() to whatever we think would be more usable, we'd be modifying how Python programmers see the Unicode database. That's not the purpose of the module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 10:05:08 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jun 2013 08:05:08 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372061108.52.0.184003892985.issue18234@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Perhaps unicodedata.aliases() should return not a list, but an ordered dict. What name should use the "namereplace" error handler? Original or corrected? Should it use first alias if there is no original name? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 10:07:35 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 24 Jun 2013 08:07:35 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: <1372024848.03.0.481302684047.issue12641@psf.upfronthosting.co.za> Message-ID: <51C7FE43.3030206@egenix.com> Marc-Andre Lemburg added the comment: On 24.06.2013 00:00, Jeffrey Armstrong wrote: > > Jeffrey Armstrong added the comment: > >> ...the fact that this issue has been open for almost 2 years is quite ridiculous. > > I thought that I'd add a little statistic for everyone that might put this bug into perspective. Since this bug was opened, the MinGW installer has been downloaded about 32,000,000 (32 million) times per sf.net: > > http://sourceforge.net/projects/mingw/files/Installer/stats/timeline?dates=2011-07-26+to+2013-06-23 > > If we take a naive approach, that's 32 million compiler installations that can't build Python extensions without manually modifying distutils first. > > That statistic doesn't include the multitude of people installing other builds of GCC for Windows (including MinGW-W64, a whole other unsupported version of GCC, but that's a different bug). Could someone perhaps produce a single final patch file which can be applied to Python 2.7 and 3.2+ ? It is not clear at the moment which of all those patches on the ticket should be applied. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 10:08:20 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jun 2013 08:08:20 +0000 Subject: [issue18290] json encoder does not support JSONP/JavaScript safe escaping In-Reply-To: <1372049179.79.0.237326954931.issue18290@psf.upfronthosting.co.za> Message-ID: <1372061300.29.0.153180578758.issue18290@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +ezio.melotti, pitrou, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 10:11:49 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jun 2013 08:11:49 +0000 Subject: [issue18236] str.isspace should use the Unicode White_Space property In-Reply-To: <1371431190.78.0.117337167573.issue18236@psf.upfronthosting.co.za> Message-ID: <1372061509.6.0.0312484478517.issue18236@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 10:23:50 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 24 Jun 2013 08:23:50 +0000 Subject: [issue4610] Unicode case mappings are incorrect In-Reply-To: <1372027974.81.0.239544434741.issue4610@psf.upfronthosting.co.za> Message-ID: <51C80212.1060904@egenix.com> Marc-Andre Lemburg added the comment: On 24.06.2013 00:52, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > There has been a relatively recent discussion of case mappings under #12753 (msg144836). > > I personally agree with Martin: str.upper/lower should remain the way it is - a simplistic 1-to-1 mapping using UnicodeData.txt fields. More sophisticated case mapping algorithms belong to a specialized library module not python core. > > The behavior of .title() and .capitalize() is harder to defend, so if someone can point out to a python library (PyICU?) that gets it right we can reference it in the documentation. .title() and .capitalize() are 1-1 mappings as well. Python only supports "Simple Case Operations" and does not support "Full Case Operations" which require parsing context (SpecialCasing.txt). ICU does provide support for both: http://userguide.icu-project.org/transforms/casemappings PyICU wraps ICU, but it is not clear to me how you'd access those mappings (the package doesn't provide dcoumentation on the API, instead just gives a description of how to map the C++ API to a Python one): https://pypi.python.org/pypi/PyICU ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 10:32:19 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jun 2013 08:32:19 +0000 Subject: [issue9369] const char* for PyObject_CallMethod and PyObject_CallFunction In-Reply-To: <1279965202.04.0.507207277215.issue9369@psf.upfronthosting.co.za> Message-ID: <1372062739.7.0.439231526658.issue9369@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 10:32:53 2013 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 24 Jun 2013 08:32:53 +0000 Subject: [issue16396] Importing ctypes.wintypes on Linux gives a traceback In-Reply-To: <1351956172.0.0.64927799046.issue16396@psf.upfronthosting.co.za> Message-ID: <1372062773.56.0.460590962261.issue16396@psf.upfronthosting.co.za> Changes by Jason R. Coombs : ---------- nosy: +jason.coombs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 11:24:57 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 24 Jun 2013 09:24:57 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1372061108.52.0.184003892985.issue18234@psf.upfronthosting.co.za> Message-ID: <51C81065.60206@egenix.com> Marc-Andre Lemburg added the comment: On 24.06.2013 10:05, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Perhaps unicodedata.aliases() should return not a list, but an ordered dict. > > What name should use the "namereplace" error handler? Original or corrected? Should it use first alias if there is no original name? For compatibility with other tools, it should use .name(), not .aliases() to determine the name. Please note that the aliases are not the official Unicode names of the code points. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 13:19:59 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 24 Jun 2013 11:19:59 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372072798.98.0.0208994714789.issue17206@psf.upfronthosting.co.za> Jeremy Kloth added the comment: At least in a debug build, the MSVC 64-bit compiler seems to allocate space for each unique variable declared in the function body. Therefore, by changing the temporary variables to be named identically, the amount of required space is minimized. The refactoring of Py_DECREF is needed to prevent an error for local variable defined before use when Py_DECREF is nested within another macro already defining _py_tmp (it would expand to roughly PyObject *_py_tmp = _py_tmp). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 13:53:52 2013 From: report at bugs.python.org (Oscar Benjamin) Date: Mon, 24 Jun 2013 11:53:52 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: <51C7FE43.3030206@egenix.com> Message-ID: Oscar Benjamin added the comment: On 24 June 2013 09:07, Marc-Andre Lemburg wrote: > > Could someone perhaps produce a single final patch file which can > be applied to Python 2.7 and 3.2+ ? I've attached two patches "check_mno_cywin_py27.patch" for Python 2.7 and "check_mno_cywin_py3.patch" for Python 3.2 and 3.3. The changes are identical but the 2.7 patch didn't apply cleanly against 3.x. I'll upload the files used to test the patches in "test_mno_cygwin.tar.gz". The patches are as I described previously and check the output of 'gcc -dumpmachine' to see if the gcc on PATH is from cygwin. With the patch '-mno-cygwin' will be passed if gcc version < 4 or the gcc is from cygwin. Otherwise it will not be passed. I've tested with versions: Python 2.7.5, 3.2.5 and 3.3.2 MinGW gcc 4.7.2 Cygwin gcc 3.4.4 and 4.5.3 The results of the patch are the same for all versions of Python tested: Cygwin gcc 3.x - still works Cygwin gcc 4.x - still doesn't work (same error message) MinGW gcc 4.7 - fixed after the patch This patch does not attempt to add support for the newer (gcc 4.x) Cygwin cross-compilers. I have experimented with what it would take to have those work and it is something like: if is_cygwingcc() and version >= 4: platform = platform_map[get_platform()] use platform + '-pc-cygwin-gcc' as gcc use platform + '-pc-cygwin-g++' as g++ etc. Then there would also need to modifications to the linker settings to fix the problem that Martin mentioned (a long way above) that it would link against the wrong MSVC runtime. I started writing the patch to do these things as well as fix MinGW support and it became more and more of a mess. I don't think that distutils should be trying to guess whether or not people intended to use the Cygwin cross-compilers. If these are to be supported then they should have a new --compiler=cygwin-cross and a separate subclass of CygwinCCompiler to avoid more issues like this one arising in the future. Oscar ---------- Added file: http://bugs.python.org/file30681/check_mno_cywin_py27.patch Added file: http://bugs.python.org/file30682/check_mno_cywin_py3.patch _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff -r a7db9f505e88 Lib/distutils/cygwinccompiler.py --- a/Lib/distutils/cygwinccompiler.py Sun Jun 23 16:12:32 2013 -0400 +++ b/Lib/distutils/cygwinccompiler.py Mon Jun 24 12:03:15 2013 +0100 @@ -319,13 +319,18 @@ else: entry_point = '' - self.set_executables(compiler='gcc -mno-cygwin -O -Wall', - compiler_so='gcc -mno-cygwin -mdll -O -Wall', - compiler_cxx='g++ -mno-cygwin -O -Wall', - linker_exe='gcc -mno-cygwin', - linker_so='%s -mno-cygwin %s %s' - % (self.linker_dll, shared_option, - entry_point)) + if self.gcc_version < '4' or is_cygwingcc(): + no_cygwin = ' -mno-cygwin' + else: + no_cygwin = '' + + self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin, + compiler_so='gcc%s -mdll -O -Wall' % no_cygwin, + compiler_cxx='g++%s -O -Wall' % no_cygwin, + linker_exe='gcc%s' % no_cygwin, + linker_so='%s%s %s %s' + % (self.linker_dll, no_cygwin, + shared_option, entry_point)) # Maybe we should also append -mthreads, but then the finished # dlls need another dll (mingwm10.dll see Mingw32 docs) # (-mthreads: Support thread-safe exception handling on `Mingw32') @@ -447,3 +452,16 @@ else: dllwrap_version = None return (gcc_version, ld_version, dllwrap_version) + + +def is_cygwingcc(): + '''Try to determine if the gcc that would be used is from cygwin.''' + from subprocess import Popen, PIPE + out = Popen(['gcc', '-dumpmachine'], shell=True, stdout=PIPE).stdout + try: + out_string = out.read() + finally: + out.close() + # out_string is the target triplet cpu-vendor-os + # Cygwin's gcc sets the os to 'cygwin' + return out_string.strip().endswith('cygwin') -------------- next part -------------- diff -r b9b521efeba3 Lib/distutils/cygwinccompiler.py --- a/Lib/distutils/cygwinccompiler.py Sat May 18 17:56:42 2013 +0200 +++ b/Lib/distutils/cygwinccompiler.py Mon Jun 24 12:20:07 2013 +0100 @@ -291,13 +291,18 @@ else: entry_point = '' - self.set_executables(compiler='gcc -mno-cygwin -O -Wall', - compiler_so='gcc -mno-cygwin -mdll -O -Wall', - compiler_cxx='g++ -mno-cygwin -O -Wall', - linker_exe='gcc -mno-cygwin', - linker_so='%s -mno-cygwin %s %s' - % (self.linker_dll, shared_option, - entry_point)) + if self.gcc_version < '4' or is_cygwingcc(): + no_cygwin = ' -mno-cygwin' + else: + no_cygwin = '' + + self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin, + compiler_so='gcc%s -mdll -O -Wall' % no_cygwin, + compiler_cxx='g++%s -O -Wall' % no_cygwin, + linker_exe='gcc%s' % no_cygwin, + linker_so='%s%s %s %s' + % (self.linker_dll, no_cygwin, + shared_option, entry_point)) # Maybe we should also append -mthreads, but then the finished # dlls need another dll (mingwm10.dll see Mingw32 docs) # (-mthreads: Support thread-safe exception handling on `Mingw32') @@ -390,3 +395,15 @@ """ commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version'] return tuple([_find_exe_version(cmd) for cmd in commands]) + +def is_cygwingcc(): + '''Try to determine if the gcc that would be used is from cygwin.''' + from subprocess import Popen, PIPE + out = Popen(['gcc', '-dumpmachine'], shell=True, stdout=PIPE).stdout + try: + out_string = out.read() + finally: + out.close() + # out_string is the target triplet cpu-vendor-os + # Cygwin's gcc sets the os to 'cygwin' + return out_string.decode('ascii').strip().endswith('cygwin') From report at bugs.python.org Mon Jun 24 13:54:29 2013 From: report at bugs.python.org (Oscar Benjamin) Date: Mon, 24 Jun 2013 11:54:29 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: <1311699751.35.0.569127767575.issue12641@psf.upfronthosting.co.za> Message-ID: <1372074869.0.0.123338983902.issue12641@psf.upfronthosting.co.za> Changes by Oscar Benjamin : Added file: http://bugs.python.org/file30683/test_mno_cygwin.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 14:11:37 2013 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 24 Jun 2013 12:11:37 +0000 Subject: [issue2292] Missing *-unpacking generalizations In-Reply-To: <1205595680.3.0.859525264867.issue2292@psf.upfronthosting.co.za> Message-ID: <1372075897.97.0.998031161534.issue2292@psf.upfronthosting.co.za> Nick Coghlan added the comment: Since this question just came up on python-ideas again, here's a summary of the current status: 1. The current patch is known to be outdated due to the inclusion of PEP 380 in Python 3.3 ("yield from itr" eliminates any need for "yield *itr") 2. Since this is a syntax change, a PEP is needed to elaborate on the exact details of what will be added (see PEP 3132 as an example of a PEP that covered a similar change for assignment *targets*) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 14:15:47 2013 From: report at bugs.python.org (Oscar Benjamin) Date: Mon, 24 Jun 2013 12:15:47 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: Message-ID: Oscar Benjamin added the comment: On 24 June 2013 12:53, Oscar Benjamin wrote: > The changes > are identical but the 2.7 patch didn't apply cleanly against 3.x. I'll > upload the files used to test the patches in "test_mno_cygwin.tar.gz". Correction: the patches are not quite identical as the py3 patch decodes the output of the subprocess as ascii. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 14:17:08 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 12:17:08 +0000 Subject: [issue16396] Importing ctypes.wintypes on Linux gives a traceback In-Reply-To: <1351956172.0.0.64927799046.issue16396@psf.upfronthosting.co.za> Message-ID: <1372076228.83.0.225702203255.issue16396@psf.upfronthosting.co.za> Christian Heimes added the comment: The fix is trivial: - define VARIANT_FALSE and VARIANT_BOOL according to specs - enable 'v' on non-Windows systems - enable tests for vbool Done ---------- keywords: +patch nosy: +christian.heimes Added file: http://bugs.python.org/file30684/16396_vbool.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 14:26:21 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 12:26:21 +0000 Subject: [issue18240] hmac unnecessarily restricts input to "bytes" In-Reply-To: <1371465508.71.0.540084524464.issue18240@psf.upfronthosting.co.za> Message-ID: <1372076781.44.0.859014348295.issue18240@psf.upfronthosting.co.za> Christian Heimes added the comment: Your account hasn't been flagged yet. I'm going to ping the person in charge. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:11:12 2013 From: report at bugs.python.org (Paul) Date: Mon, 24 Jun 2013 13:11:12 +0000 Subject: [issue18291] codecs.open interprets space as line ends Message-ID: <1372079472.71.0.230881178227.issue18291@psf.upfronthosting.co.za> New submission from Paul: I hope I am writing in the right place. When using codecs.open with UTF-8 encoding, it seems characters \x12, \x13, and \x14 are interpreted as end-of-line. Example code: >>> with open('unicodetest.txt', 'w') as f: >>> f.write('a'+chr(28)+'b'+chr(29)+'c'+chr(30)+'d'+chr(31)+'e') >>> with open('unicodetest.txt', 'r') as f: >>> for i,l in enumerate(f): >>> print i, l 0 a\x12b\x13c\x14d\x15e The point here is that it reads it as one line, as I would expect. But using codecs.open with UTF-8 encoding it reads it as many lines: >>> import codecs >>> with codecs.open('unicodetest.txt', 'r', 'UTF-8') as f: >>> for i,l in enumerate(f): >>> print i, l 0 a\x12 1 b\x13 2 c\x14 3 d\x15e The characters \x12 through \x15 are described as "Information Separator Four" through "One" (in that order). As far as I can see they never mark line ends. Also interestingly, \x15 isn't interpreted as such. As a sidenote, I tested and verified that io.open is correct (but when reading loads of data it appears to be 5 times slower than codecs): >>> import io >>> with io.open('unicodetest.txt', encoding='UTF-8') as f: >>> for i,l in enumerate(f): >>> print i, l 0 a\x12b\x13c\x14d\x15e ---------- components: IO, Unicode messages: 191758 nosy: ezio.melotti, wpk priority: normal severity: normal status: open title: codecs.open interprets space as line ends type: behavior versions: Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:11:59 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 13:11:59 +0000 Subject: [issue16595] Add resource.prlimit In-Reply-To: <1354446881.9.0.288115855459.issue16595@psf.upfronthosting.co.za> Message-ID: <1372079519.95.0.873113221634.issue16595@psf.upfronthosting.co.za> Christian Heimes added the comment: Updated patch, now raises PermissionError on EPERM. ---------- Added file: http://bugs.python.org/file30685/prlimit2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:12:08 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 13:12:08 +0000 Subject: [issue16595] Add resource.prlimit In-Reply-To: <1354446881.9.0.288115855459.issue16595@psf.upfronthosting.co.za> Message-ID: <1372079528.23.0.653742856753.issue16595@psf.upfronthosting.co.za> Changes by Christian Heimes : Removed file: http://bugs.python.org/file28184/prlimit.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:16:00 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 13:16:00 +0000 Subject: [issue1763] Winpath module - easy access to Windows directories like My Documents In-Reply-To: <1199812378.67.0.278096816271.issue1763@psf.upfronthosting.co.za> Message-ID: <1372079760.74.0.699840008468.issue1763@psf.upfronthosting.co.za> Christian Heimes added the comment: Oh my, this patch is rather ancient. Is this feature still of interest? I'm happy to port it from 2.6 to 3.4. ---------- status: languishing -> open versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:19:07 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 13:19:07 +0000 Subject: [issue1542] Ship 32 and 64bit libs with MSI installer In-Reply-To: <1196621987.22.0.834586722022.issue1542@psf.upfronthosting.co.za> Message-ID: <1372079947.43.0.00241895922081.issue1542@psf.upfronthosting.co.za> Christian Heimes added the comment: Nobody has shown interest in this ticket in more than five years. I'm closing it. ---------- status: open -> closed versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:28:09 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 13:28:09 +0000 Subject: [issue1953] Compact int and float freelists In-Reply-To: <1201491269.72.0.799398122167.issue1953@psf.upfronthosting.co.za> Message-ID: <1372080489.84.0.510997152733.issue1953@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:42:35 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 13:42:35 +0000 Subject: [issue18143] ssl.get_default_verify_paths() In-Reply-To: <1370447060.67.0.813432963563.issue18143@psf.upfronthosting.co.za> Message-ID: <1372081355.88.0.903105287329.issue18143@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:53:26 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 13:53:26 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <3bfBmQ0fTTz7Lls@mail.python.org> Roundup Robot added the comment: New changeset 8dcc4e017d42 by Richard Oudkerk in branch '2.7': Issue #18277: Document quirks of multiprocessing queue. http://hg.python.org/cpython/rev/8dcc4e017d42 New changeset 0f921e73433a by Richard Oudkerk in branch '3.3': Issue #18277: Document quirks of multiprocessing queue. http://hg.python.org/cpython/rev/0f921e73433a New changeset 06b1447becdc by Richard Oudkerk in branch 'default': Issue #18277: Merge. http://hg.python.org/cpython/rev/06b1447becdc ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 15:56:57 2013 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 24 Jun 2013 13:56:57 +0000 Subject: [issue16396] Importing ctypes.wintypes on Linux gives a traceback In-Reply-To: <1351956172.0.0.64927799046.issue16396@psf.upfronthosting.co.za> Message-ID: <1372082217.94.0.51046752683.issue16396@psf.upfronthosting.co.za> Jason R. Coombs added the comment: Looks good to me. Ben, any objections to applying this to 2.7? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:00:01 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 24 Jun 2013 14:00:01 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1372082401.45.0.506055820067.issue18277@psf.upfronthosting.co.za> Richard Oudkerk added the comment: > I did this to use the same abstraction that was used extensively for > other purposes, instead of recreating the same abstraction with a deque > as its basis. So you wanted a FIFO queue and preferred the API of Queue to that of deque? Well it will be *much* less efficient. queue.Queue is also less efficient, but not by such a wide margin. I have added a documentation note. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:08:46 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 14:08:46 +0000 Subject: [issue4558] ./configure --with-stdc89 to test ANSI C conformity In-Reply-To: <1228530326.9.0.419197104424.issue4558@psf.upfronthosting.co.za> Message-ID: <1372082926.81.0.711112610956.issue4558@psf.upfronthosting.co.za> Christian Heimes added the comment: Updated patch for Python 3.4. The feature is still useful. For example I found a bug in pymacro.h and fixed it in r84306. ---------- title: with_stdc89 -> ./configure --with-stdc89 to test ANSI C conformity versions: +Python 3.3, Python 3.4 -Python 3.2 Added file: http://bugs.python.org/file30686/with_stdc89_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:09:26 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 14:09:26 +0000 Subject: [issue4558] ./configure --with-stdc89 to test ANSI C conformity In-Reply-To: <1228530326.9.0.419197104424.issue4558@psf.upfronthosting.co.za> Message-ID: <1372082966.53.0.733122948017.issue4558@psf.upfronthosting.co.za> Christian Heimes added the comment: Make that r6915dfddb3f6 ---------- Added file: http://bugs.python.org/file30687/with_stdc89_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:28:24 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jun 2013 14:28:24 +0000 Subject: [issue1763] Winpath module - easy access to Windows directories like My Documents In-Reply-To: <1199812378.67.0.278096816271.issue1763@psf.upfronthosting.co.za> Message-ID: <1372084104.68.0.967208313176.issue1763@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See also PyXDG (http://freedesktop.org/wiki/Software/pyxdg/) and winpaths (http://ginstrom.com/code/winpaths.html). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:32:02 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 24 Jun 2013 14:32:02 +0000 Subject: [issue7292] Multiprocessing Joinable race condition? In-Reply-To: <1257748286.94.0.346139031927.issue7292@psf.upfronthosting.co.za> Message-ID: <1372084322.72.0.156619379187.issue7292@psf.upfronthosting.co.za> Richard Oudkerk added the comment: unfinished_tasks is simply used as a counter. It is only accessed while holding self._cond. If you get this error then I think the error text is correct -- your progam calls task_done() to many times. The proposed patch silences the sanity check by making it block for a while instead. The fact the program seems to work without deadlocking does not mean the program or the patch is correct. Without more information I will close this. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:32:39 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Jun 2013 14:32:39 +0000 Subject: [issue18291] codecs.open interprets space as line ends In-Reply-To: <1372079472.71.0.230881178227.issue18291@psf.upfronthosting.co.za> Message-ID: <1372084359.82.0.518191053584.issue18291@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could you please provide an example which exposes slowness of io.open() by comparison with codecs.open(). ---------- nosy: +belopolsky, doerwalter, haypo, lemburg, serhiy.storchaka versions: -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:33:54 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 14:33:54 +0000 Subject: [issue17791] PC/pyconfig.h defines PREFIX macro In-Reply-To: <1366314379.89.0.227357780835.issue17791@psf.upfronthosting.co.za> Message-ID: <1372084434.67.0.20882120812.issue17791@psf.upfronthosting.co.za> Christian Heimes added the comment: It looks like we can drop PREFIX and EXEC_PREFIX from PC/pyconfig.h all along. Only Modules/getpath.c uses PREFIX and EXEC_PREFIX but MSVC build use PC/getpathp.c instead of Modules/getpath.c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:35:14 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 24 Jun 2013 14:35:14 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372084514.95.0.693019342702.issue18234@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: MAL> Please leave the function as it is, i.e. a 1-1 mapping to the MAL> official, non-changing Unicode name reference (including MAL> spelling errors, etc). Same with code points that have no name. Since we have code points with no name - it is not 1-1 mapping but 1 to 0 or 1. Unicode Standard recommends using "Code Point Labels" "To provide unique, meaningful labels for code points that do not have character names." (Section 4.9.) These labels are not very useful: Control: control-NNNN Reserved: reserved-NNNN Noncharacter: noncharacter-NNNN Private-Use: private-use-NNNN Surrogate: surrogate-NNNN According to the description in NameAliases.txt: # The formal name aliases are part of the Unicode character namespace, which # includes the character names and the names of named character sequences. I believe this means that formal name aliases are as official as the character names. If we don't change the default, what is the downside in adding an optional type argument to unicodedata.name()? After all, according to the standard, aliases *are* names, just a different *type* of names. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:38:37 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 24 Jun 2013 14:38:37 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1372084717.11.0.1238817794.issue17621@psf.upfronthosting.co.za> Brett Cannon added the comment: Import manages the lock, not loaders. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:44:40 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 14:44:40 +0000 Subject: [issue15818] multiprocessing documentation of Process.exitcode In-Reply-To: <1346294988.32.0.746763914895.issue15818@psf.upfronthosting.co.za> Message-ID: <3bfCvX1bYPz7LmF@mail.python.org> Roundup Robot added the comment: New changeset f50bbae95bc8 by Richard Oudkerk in branch '2.7': Issue #15818: Typo in docs. http://hg.python.org/cpython/rev/f50bbae95bc8 New changeset 3a5e2f1dce5c by Richard Oudkerk in branch '3.3': Issue #15818: Typo in docs. http://hg.python.org/cpython/rev/3a5e2f1dce5c New changeset 4f08d4647f75 by Richard Oudkerk in branch 'default': Issue #15818: Merge. http://hg.python.org/cpython/rev/4f08d4647f75 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:45:54 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 24 Jun 2013 14:45:54 +0000 Subject: [issue15818] multiprocessing documentation of Process.exitcode In-Reply-To: <1346294988.32.0.746763914895.issue15818@psf.upfronthosting.co.za> Message-ID: <1372085154.02.0.513256487466.issue15818@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:58:11 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 24 Jun 2013 14:58:11 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372085891.98.0.811610593661.issue18234@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Here is an example of "prior art" that is relevant to this discussion: """ charnames::viacode(code) .. As mentioned above under ALIASES, Unicode 6.1 defines extra names (synonyms or aliases) for some code points, most of which were already available as Perl extensions. All these are accepted by \N{...} and the other functions in this module, but viacode has to choose which one name to return for a given input code point, so it returns the "best" name. To understand how this works, it is helpful to know more about the Unicode name properties. All code points actually have only a single name, which (starting in Unicode 2.0) can never change once a character has been assigned to the code point. But mistakes have been made in assigning names, for example sometimes a clerical error was made during the publishing of the Standard which caused words to be misspelled, and there was no way to correct those. The Name_Alias property was eventually created to handle these situations. If a name was wrong, a corrected synonym would be published for it, using Name_Alias. viacode will return that corrected synonym as the "best" name for a code point. (It is even possible, though it hasn't happened yet, that the correction itself will need to be corrected, and so another Name_Alias can be created for that code point; viacode will return the most recent correction.) The Unicode name for each of the control characters (such as LINE FEED) is the empty string. However almost all had names assigned by other standards, such as the ASCII Standard, or were in common use. viacode returns these names as the "best" ones available. Unicode 6.1 has created Name_Aliases for each of them, including alternate names, like NEW LINE. viacode uses the original name, "LINE FEED" in preference to the alternate. Similarly the name returned for U+FEFF is "ZERO WIDTH NO-BREAK SPACE", not "BYTE ORDER MARK". """ If .name() cannot be touched, what about implementing .bestname() with the above semantics? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 16:58:44 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 24 Jun 2013 14:58:44 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1372084514.95.0.693019342702.issue18234@psf.upfronthosting.co.za> Message-ID: <51C85EA1.6030408@egenix.com> Marc-Andre Lemburg added the comment: On 24.06.2013 16:35, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > MAL> Please leave the function as it is, i.e. a 1-1 mapping to the > MAL> official, non-changing Unicode name reference (including > MAL> spelling errors, etc). Same with code points that have no name. > > Since we have code points with no name - it is not 1-1 mapping but 1 to 0 or 1. True, it's not 1-1 in the mathematical sense (bijective), only surjective. However, it is 1-1 for all code points which have a name assigned. > Unicode Standard recommends using "Code Point Labels" "To provide unique, meaningful labels for code points that do not have character names." (Section 4.9.) > > These labels are not very useful: > > Control: control-NNNN > Reserved: reserved-NNNN > Noncharacter: noncharacter-NNNN > Private-Use: private-use-NNNN > Surrogate: surrogate-NNNN I don't any advantage of using these over plain \uXXXX codes. > According to the description in NameAliases.txt: > > # The formal name aliases are part of the Unicode character namespace, which > # includes the character names and the names of named character sequences. > > I believe this means that formal name aliases are as official as the character names. Yes, but they are official aliases, not official code point names :-) > If we don't change the default, what is the downside in adding an optional type argument to unicodedata.name()? After all, according to the standard, aliases *are* names, just a different *type* of names. The .aliases() function would have to return a list, not a single name, so a parameter would cause the return type to change, which is not a good idea. A new function also makes the origin of these names clear to the user. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 17:06:30 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 24 Jun 2013 15:06:30 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1372086390.75.0.586339364638.issue17621@psf.upfronthosting.co.za> Richard Oudkerk added the comment: I was thinking about the line self.__dict__.update(state) overwriting new data with stale data. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 17:07:49 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 24 Jun 2013 15:07:49 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1372085891.98.0.811610593661.issue18234@psf.upfronthosting.co.za> Message-ID: <51C860C1.9080305@egenix.com> Marc-Andre Lemburg added the comment: On 24.06.2013 16:58, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > Here is an example of "prior art" that is relevant to this discussion: > > """ > charnames::viacode(code) > .. > As mentioned above under ALIASES, Unicode 6.1 defines extra names (synonyms or aliases) for some code points, most of which were already available as Perl extensions. All these are accepted by \N{...} and the other functions in this module, but viacode has to choose which one name to return for a given input code point, so it returns the "best" name. To understand how this works, it is helpful to know more about the Unicode name properties. All code points actually have only a single name, which (starting in Unicode 2.0) can never change once a character has been assigned to the code point. But mistakes have been made in assigning names, for example sometimes a clerical error was made during the publishing of the Standard which caused words to be misspelled, and there was no way to correct those. The Name_Alias property was eventually created to handle these situations. If a name was wrong, a corrected synonym would be published for it, using Name_Alias. viacode will return t > hat corr > ected synonym as the "best" name for a code point. (It is even possible, though it hasn't happened yet, that the correction itself will need to be corrected, and so another Name_Alias can be created for that code point; viacode will return the most recent correction.) > > The Unicode name for each of the control characters (such as LINE FEED) is the empty string. However almost all had names assigned by other standards, such as the ASCII Standard, or were in common use. viacode returns these names as the "best" ones available. Unicode 6.1 has created Name_Aliases for each of them, including alternate names, like NEW LINE. viacode uses the original name, "LINE FEED" in preference to the alternate. Similarly the name returned for U+FEFF is "ZERO WIDTH NO-BREAK SPACE", not "BYTE ORDER MARK". > """ > > If .name() cannot be touched, what about implementing .bestname() with the above semantics? I think it's better to let the programmer decide what the "best" name should be, e.g. some people will like ESC better than ESCAPE or \u001b or \x1b. unicodedata only provides neutral access to what's in the Unicode database. It doesn't make any decisions on what's good or bad ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 17:17:19 2013 From: report at bugs.python.org (Paul) Date: Mon, 24 Jun 2013 15:17:19 +0000 Subject: [issue18291] codecs.open interprets space as line ends In-Reply-To: <1372079472.71.0.230881178227.issue18291@psf.upfronthosting.co.za> Message-ID: <1372087039.28.0.62728169396.issue18291@psf.upfronthosting.co.za> Paul added the comment: Sorry for bringing that up as I suppose it is unrelated to the bug I am reporting, but you can an example file attached with timings. ---------- Added file: http://bugs.python.org/file30688/codecs-io-example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 17:23:52 2013 From: report at bugs.python.org (Brett Cannon) Date: Mon, 24 Jun 2013 15:23:52 +0000 Subject: [issue17621] Create a lazy import loader mixin In-Reply-To: <1364925647.64.0.233663837419.issue17621@psf.upfronthosting.co.za> Message-ID: <1372087432.22.0.801510494984.issue17621@psf.upfronthosting.co.za> Brett Cannon added the comment: It still falls under the purview of import to manage that lock. It's just the design of the API from PEP 302. Otherwise it's just like any other reload. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 18:04:30 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 24 Jun 2013 16:04:30 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372089870.22.0.49556571662.issue17206@psf.upfronthosting.co.za> Benjamin Peterson added the comment: We've "fixed" this debug-problem in other cases simply by skipping the test in question on debug builds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 18:10:08 2013 From: report at bugs.python.org (Alexander Belopolsky) Date: Mon, 24 Jun 2013 16:10:08 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372090208.06.0.650807676162.issue18234@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: > The .aliases() function would have to return a list, not a single > name, so a parameter would cause the return type to change, which > is not a good idea. You misunderstood my proposal. .name() will still return a single name, but the type parameter will control which name to return: name(ch[, type=(None|'correction'|'control'|'alternate'|'figment'|'abbreviation')]) None - default, same as current behavior. correction - indicates that the returned name is a corrected form for the original name (which remains valid) for the same code point. control - return a new name added for a control character. alternate - return an alternate name for a character figment - return a name for a character that has been documented but was never in any actual standard. abbreviation - return a common abbreviation for a character ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 18:20:57 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Mon, 24 Jun 2013 16:20:57 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1371428658.79.0.833817613364.issue18234@psf.upfronthosting.co.za> Message-ID: <1372090857.21.0.151424642755.issue18234@psf.upfronthosting.co.za> Martin v. L?wis added the comment: But some of these types could still have lists as values, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 18:22:42 2013 From: report at bugs.python.org (shwouchk) Date: Mon, 24 Jun 2013 16:22:42 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1372090962.34.0.504758385975.issue18277@psf.upfronthosting.co.za> shwouchk added the comment: I agree it might be less efficient, but sometimes it is the price to pay for greater generality/simplicity. After all, If I *really* wanted efficiency perhaps I would have written everything in C++. Anyway, thanks! n.p. 1. "but should not cause any pratical difficulties" <-- you have a typo in 'pratical' there. 2. What exactly do you mean by "managed" queues in the new addition? Also, did part #2 of the note come up in other reports? It seemed somewhat trivial (can't hurt though)... Finally, I don't know whether I'm supposed to close the issue, but its a good solution as far as I'm concerned. Thanks again! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 18:33:39 2013 From: report at bugs.python.org (R. David Murray) Date: Mon, 24 Jun 2013 16:33:39 +0000 Subject: [issue18291] codecs.open interprets space as line ends In-Reply-To: <1372079472.71.0.230881178227.issue18291@psf.upfronthosting.co.za> Message-ID: <1372091619.05.0.760047816325.issue18291@psf.upfronthosting.co.za> R. David Murray added the comment: Is the "slower" test on 2.6? io would definitely be slower there, since it is pure python. 2.7 has the C accelerated version. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 18:44:06 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 24 Jun 2013 16:44:06 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372092246.57.0.307950817752.issue17206@psf.upfronthosting.co.za> Jeremy Kloth added the comment: Except, in this case, it actually crashes the interpreter. I would hope to think that it isn't common practice to just hide crashers especially when there is a fix available. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 18:47:27 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 24 Jun 2013 16:47:27 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372092447.58.0.416510307627.issue17206@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Could you please wrap your new macros in the do .. while boilerplate? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 19:01:03 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 17:01:03 +0000 Subject: [issue1763] Get path to shell/known folders on Windows In-Reply-To: <1199812378.67.0.278096816271.issue1763@psf.upfronthosting.co.za> Message-ID: <1372093262.99.0.273621420883.issue1763@psf.upfronthosting.co.za> Christian Heimes added the comment: Here is a patch that returns the paths of all known SHGetKnownFolderPath() and SHGetFolderPath(). SHGetKnownFolderPath() is currently not available for Python 3.4 as Python 3.4 still uses Windows XP API but SHGetKnownFolderPath() requires Vista or newer. http://msdn.microsoft.com/en-us/library/windows/desktop/bb776911%28v=vs.85%29.aspx ---------- title: Winpath module - easy access to Windows directories like My Documents -> Get path to shell/known folders on Windows Added file: http://bugs.python.org/file30689/1763_knownfolders.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 19:04:16 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Mon, 24 Jun 2013 17:04:16 +0000 Subject: [issue18234] Unicodedata module should provide access to codepoint aliases In-Reply-To: <1372090208.06.0.650807676162.issue18234@psf.upfronthosting.co.za> Message-ID: <51C87C0D.30900@egenix.com> Marc-Andre Lemburg added the comment: On 24.06.2013 18:10, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > >> The .aliases() function would have to return a list, not a single >> name, so a parameter would cause the return type to change, which >> is not a good idea. > > You misunderstood my proposal. .name() will still return a single name, but the type parameter will control which name to return: > > name(ch[, type=(None|'correction'|'control'|'alternate'|'figment'|'abbreviation')]) > > None - default, same as current behavior. > > correction - indicates that the returned name is a corrected form for the original name (which remains valid) for the same code point. > > control - return a new name added for a control character. > > alternate - return an alternate name for a character > > figment - return a name for a character that has been documented but was never in any actual standard. > > abbreviation - return a common abbreviation for a character How can you be sure that each of those alias types occurs only once ? The NameAliases.txt doesn't say anything about this, AFAIK: http://www.unicode.org/Public/UNIDATA/NameAliases.txt Also, what would name() return in case to alias of a particular type is defined ? I think it would be easier and more future proof to have a function aliases(code) -> [(type, alias),...] which simply returns all defined aliases. Applications could then add helpers for select the type they would like to use. It may make sense to also add the name(code) value as e.g. ('standard', name(code)) to that list. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jun 24 2013) >>> Python Projects, Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2013-06-18: Released mxODBC Django DE 1.2.0 ... http://egenix.com/go47 2013-07-01: EuroPython 2013, Florence, Italy ... 7 days to go 2013-07-16: Python Meeting Duesseldorf ... 22 days to go 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/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 19:09:01 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 17:09:01 +0000 Subject: [issue1257] atexit errors should result in nonzero exit code In-Reply-To: <1192046186.55.0.804669715206.issue1257@psf.upfronthosting.co.za> Message-ID: <1372093741.28.0.606224869921.issue1257@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- assignee: christian.heimes -> versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 19:12:27 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 17:12:27 +0000 Subject: [issue1423] wave sunau aifc 16bit errors In-Reply-To: <1194812128.3.0.121145701122.issue1423@psf.upfronthosting.co.za> Message-ID: <1372093947.43.0.316054002047.issue1423@psf.upfronthosting.co.za> Christian Heimes added the comment: Is somebody interested in this bug? ---------- assignee: christian.heimes -> status: open -> languishing versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 19:19:03 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 24 Jun 2013 17:19:03 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1372090962.34.0.504758385975.issue18277@psf.upfronthosting.co.za> Message-ID: <51C87F81.1070202@gmail.com> Richard Oudkerk added the comment: > 1. "but should not cause any pratical difficulties" <-- you have a typo in 'pratical' there. > 2. What exactly do you mean by "managed" queues in the new addition? Woops. Fixed now see 860fc6a2bd21, 347647a1f798. A managed queue is one created like manager = multiprocessing.Manager() queue = manager.Queue() queue is a proxy for a conventional queue object in a "manager" process. > Also, did part #2 of the note come up in other reports? > It seemed somewhat trivial (can't hurt though)... Yes it did (but I can't find the report now). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 19:20:36 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 24 Jun 2013 17:20:36 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372094436.12.0.220410857872.issue17206@psf.upfronthosting.co.za> Jeremy Kloth added the comment: FYI, however, the new macro is designed as an internal implementation detail along the lines of the other _Py_* macros. That is, just a tiny piece of a larger function to be used at your own risk. Either way, I've uploaded another version with the do { } while (0) wrapping. ---------- Added file: http://bugs.python.org/file30690/object-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 19:20:36 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 24 Jun 2013 17:20:36 +0000 Subject: [issue18277] Queue is empty right after put from the same process/thread In-Reply-To: <1371814216.9.0.944814100336.issue18277@psf.upfronthosting.co.za> Message-ID: <1372094436.55.0.708953785244.issue18277@psf.upfronthosting.co.za> Changes by Richard Oudkerk : ---------- assignee: -> docs at python components: +Documentation -IO, Interpreter Core nosy: +docs at python resolution: -> fixed stage: -> committed/rejected status: open -> closed type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 19:47:48 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 24 Jun 2013 17:47:48 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372096068.49.0.887340702672.issue17206@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Yes, but in case someone else mindlessly starts using it elsewhere, let's spare them the macro bugz. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 20:14:46 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Mon, 24 Jun 2013 18:14:46 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1372097686.35.0.920016418629.issue18189@psf.upfronthosting.co.za> R. Jayakrishnan added the comment: I wrapped requires('gui') as submitted in patch2. But this time commands "python -m test test_idle" and with -ugui does not skip delegatortest (it runs successfully to both). I took Lib/test/test_tk.py as an example. It calls runtktests.get_tests using support.run_unittest from test module. Exploring Lib/tkinter/test/runtktests.py the get_tests method begins like .... def get_tests(text=True, gui=True, packages=None): """Yield all the tests in the modules found by get_tests_modules. If nogui is True, only tests that do not require a GUI will be returned.""" attrs = [] if text: attrs.append('tests_nogui') if gui: attrs.append('tests_gui') .... .... also notice the main method calles "test.support.use_resources = ['gui']" Now the tktests have the line * require('gui') * before the class bigins, for example have a look on test_textensions.py So do we have to come up with the same procedure to skip and play with gui and non-gui tests for IDLE ? correct me if I am wrong anywhere. ---------- Added file: http://bugs.python.org/file30691/test_delegator2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 20:25:02 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Mon, 24 Jun 2013 18:25:02 +0000 Subject: [issue17985] multiprocessing Queue.qsize() and Queue.empty() with different results In-Reply-To: <1368650472.41.0.00471316865127.issue17985@psf.upfronthosting.co.za> Message-ID: <1372098302.59.0.69069344939.issue17985@psf.upfronthosting.co.za> Richard Oudkerk added the comment: This is really a documentation issue. The doc fix for #18277 covers this. ---------- components: +Library (Lib) -Extension Modules resolution: -> wont fix stage: -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 20:29:14 2013 From: report at bugs.python.org (R. Jayakrishnan) Date: Mon, 24 Jun 2013 18:29:14 +0000 Subject: [issue18292] IDLE Improvements: Unit test for AutoExpand.py Message-ID: <1372098554.92.0.798687151295.issue18292@psf.upfronthosting.co.za> New submission from R. Jayakrishnan: Continuing the IDLE unittest framework initiated in #15392. Writing test for AutoExpand.py ---------- components: IDLE, Tests messages: 191795 nosy: JayKrish priority: normal severity: normal status: open title: IDLE Improvements: Unit test for AutoExpand.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 21:04:53 2013 From: report at bugs.python.org (mpb) Date: Mon, 24 Jun 2013 19:04:53 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates Message-ID: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> New submission from mpb: At present (Python 2.7.[45] and 3.3.[12]), the cert_reqs parameter of ssl.wrap_socket can be one of: ssl.CERT_NONE ssl.CERT_OPTIONAL ssl.CERT_REQUIRED I would find the following additional modes to be useful: ssl.CERT_OPTIONAL_NO_VERIFY ssl.CERT_REQUIRED_NO_VERIFY In these cases, the server's certificate would be available via the .getpeercert () method, even if the certificate does not pass verification. The use case for these modes would be connecting to servers, some of which may use valid certificates, and others of which may be using self signed certificates. Another use case might be an "ssh-like" mode of operation. ssh will warn the user of possible man-in-the-middle attacks if a server's public key has changed. Thanks! ---------- components: Library (Lib) messages: 191796 nosy: mpb priority: normal severity: normal status: open title: ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates type: enhancement versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 21:05:34 2013 From: report at bugs.python.org (mpb) Date: Mon, 24 Jun 2013 19:05:34 +0000 Subject: [issue18293] ssl sni In-Reply-To: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> Message-ID: <1372100734.01.0.694432807164.issue18293@psf.upfronthosting.co.za> Changes by mpb : ---------- title: ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates -> ssl sni _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 21:06:20 2013 From: report at bugs.python.org (mpb) Date: Mon, 24 Jun 2013 19:06:20 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates In-Reply-To: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> Message-ID: <1372100779.99.0.97755918365.issue18293@psf.upfronthosting.co.za> mpb added the comment: (Oops, I changed the title when I meant to do a search. Changing it back now.) ---------- title: ssl sni -> ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 21:12:59 2013 From: report at bugs.python.org (mpb) Date: Mon, 24 Jun 2013 19:12:59 +0000 Subject: [issue8109] Server-side support for TLS Server Name Indication extension In-Reply-To: <1268234047.5.0.702223567094.issue8109@psf.upfronthosting.co.za> Message-ID: <1372101179.91.0.239050053814.issue8109@psf.upfronthosting.co.za> Changes by mpb : ---------- nosy: +mpb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 21:17:42 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 24 Jun 2013 19:17:42 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates In-Reply-To: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> Message-ID: <1372101462.22.0.608252398457.issue18293@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 22:20:10 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 20:20:10 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1372105210.7.0.823911186761.issue18135@psf.upfronthosting.co.za> STINNER Victor added the comment: Fixed patch: ssl_overflow-2.patch. ---------- Added file: http://bugs.python.org/file30692/ssl_overflow-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:04:43 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 21:04:43 +0000 Subject: [issue18294] zlib module is not completly 64-bit safe Message-ID: <1372107882.97.0.731855490225.issue18294@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached patch fixes different compiler warnings on Windows x64 in the zlib module. The module raises OverflowError if some values are longer than INT_MAX, but not all parameters are checked. ---------- files: zlib_64bit.patch keywords: patch messages: 191799 nosy: haypo, loewis, serhiy.storchaka priority: normal severity: normal status: open title: zlib module is not completly 64-bit safe versions: Python 3.4 Added file: http://bugs.python.org/file30693/zlib_64bit.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:05:01 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 21:05:01 +0000 Subject: [issue18294] zlib module is not completly 64-bit safe In-Reply-To: <1372107882.97.0.731855490225.issue18294@psf.upfronthosting.co.za> Message-ID: <1372107901.62.0.694297474696.issue18294@psf.upfronthosting.co.za> STINNER Victor added the comment: Related issue: #9566. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:05:20 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 21:05:20 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bfNLl41wsz7Lpk@mail.python.org> Roundup Robot added the comment: New changeset 5c407b64920c by Victor Stinner in branch 'default': Issue #9566: _io: Use Py_SAFE_DOWNCAST for fix a compiler warning on Windows x64 http://hg.python.org/cpython/rev/5c407b64920c New changeset 931e1bc090f6 by Victor Stinner in branch 'default': Issue #9566: zlib: Explicit cast to unsigned int to fix a compiler warning on Windows x64 http://hg.python.org/cpython/rev/931e1bc090f6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:06:02 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 21:06:02 +0000 Subject: [issue18294] zlib module is not completly 64-bit safe In-Reply-To: <1372107882.97.0.731855490225.issue18294@psf.upfronthosting.co.za> Message-ID: <1372107962.1.0.880162614048.issue18294@psf.upfronthosting.co.za> STINNER Victor added the comment: The changeset 931e1bc090f6 fixes warnings in adler32 and crc32. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:07:02 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 21:07:02 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <1372108022.6.0.946438305053.issue9566@psf.upfronthosting.co.za> STINNER Victor added the comment: I created #18294 for the warnings in the zlib module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:15:09 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 21:15:09 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bfNZ42y8Rz7Lkq@mail.python.org> Roundup Robot added the comment: New changeset c75ab7b802df by Victor Stinner in branch 'default': Issue #9566: _winapi.WriteFile() now truncates length to DWORD_MAX (4294967295) http://hg.python.org/cpython/rev/c75ab7b802df ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:19:05 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 21:19:05 +0000 Subject: [issue18295] Possible integer overflow in PyCode_New() Message-ID: <1372108745.44.0.114375127897.issue18295@psf.upfronthosting.co.za> New submission from STINNER Victor: On Windows x64, we get the following warning: ..\Objects\codeobject.c(106): warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\pythoncore.vcxproj] Code: unsigned char *cell2arg = NULL; Py_ssize_t total_args = argcount + kwonlyargcount + ((flags & CO_VARARGS) != 0) + ((flags & CO_VARKEYWORDS) != 0); PyObject *cell = PyTuple_GET_ITEM(cellvars, i); for (j = 0; j < total_args; j++) { PyObject *arg = PyTuple_GET_ITEM(varnames, j); if (!PyUnicode_Compare(cell, arg)) { ====> cell2arg[i] = j; <===== HERE used_cell2arg = 1; break; } } total_args is not checked for being smaller than 256. Related issue: #9566. ---------- components: Interpreter Core messages: 191805 nosy: haypo priority: normal severity: normal status: open title: Possible integer overflow in PyCode_New() versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:23:21 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 21:23:21 +0000 Subject: [issue18295] Possible integer overflow in PyCode_New() In-Reply-To: <1372108745.44.0.114375127897.issue18295@psf.upfronthosting.co.za> Message-ID: <1372109001.9.0.446670926937.issue18295@psf.upfronthosting.co.za> STINNER Victor added the comment: Similar issue: ..\Objects\funcobject.c(636): warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\pythoncore.vcxproj] ..\Objects\funcobject.c(637): warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\pythoncore.vcxproj] ..\Objects\funcobject.c(637): warning C4244: 'function' : conversion from 'Py_ssize_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\pythoncore.vcxproj] Extract of function_call() function: result = PyEval_EvalCodeEx( PyFunction_GET_CODE(func), PyFunction_GET_GLOBALS(func), (PyObject *)NULL, &PyTuple_GET_ITEM(arg, 0), PyTuple_GET_SIZE(arg), k, nk, d, nd, PyFunction_GET_KW_DEFAULTS(func), PyFunction_GET_CLOSURE(func)); argcount, kwcount and defcount are int, whereas function_call() pass Py_ssize_t values. function_call() should check PyTuple_GET_SIZE(arg) <= INT_MAX, nk <= INT_MAX and nd <= INT_MAX. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:24:11 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 21:24:11 +0000 Subject: [issue18164] Embedding Python doc incorrectly refers to LINKFORSHARED In-Reply-To: <1370638344.32.0.268021495329.issue18164@psf.upfronthosting.co.za> Message-ID: <3bfNmV3Zx2z7Lp2@mail.python.org> Roundup Robot added the comment: New changeset e18b92bae4d6 by Ned Deily in branch '2.7': Issue #18164: Backport the more detailed embedding compile-and-link section http://hg.python.org/cpython/rev/e18b92bae4d6 New changeset 4a114b0db866 by Ned Deily in branch '3.3': Issue #18164: Clarify the embedding docs regarding link options. http://hg.python.org/cpython/rev/4a114b0db866 New changeset 262689e0fa2a by Ned Deily in branch 'default': Issue #18164: merge from 3.3 http://hg.python.org/cpython/rev/262689e0fa2a ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:26:50 2013 From: report at bugs.python.org (SpaghettiToastBook) Date: Mon, 24 Jun 2013 21:26:50 +0000 Subject: [issue2292] Missing *-unpacking generalizations In-Reply-To: <1205595680.3.0.859525264867.issue2292@psf.upfronthosting.co.za> Message-ID: <1372109210.51.0.873609320255.issue2292@psf.upfronthosting.co.za> Changes by SpaghettiToastBook : ---------- nosy: +SpaghettiToastBook _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:26:58 2013 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 Jun 2013 21:26:58 +0000 Subject: [issue18164] Embedding Python doc incorrectly refers to LINKFORSHARED In-Reply-To: <1370638344.32.0.268021495329.issue18164@psf.upfronthosting.co.za> Message-ID: <1372109218.53.0.386454676926.issue18164@psf.upfronthosting.co.za> Ned Deily added the comment: Patches committed (with consistent use of get_config_var as suggested by Antoine) for 2.7.5, 3.3.3, and 3.4.0 docs. ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:31:06 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 21:31:06 +0000 Subject: [issue18295] Possible integer overflow in PyCode_New() In-Reply-To: <1372108745.44.0.114375127897.issue18295@psf.upfronthosting.co.za> Message-ID: <1372109466.27.0.865439910304.issue18295@psf.upfronthosting.co.za> STINNER Victor added the comment: And another one: ..\Python\ceval.c(4271): warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\pythoncore.vcxproj] ..\Python\ceval.c(4459): warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\pythoncore.vcxproj] First in fast_function(), nd type is int: if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); ==> nd = Py_SIZE(argdefs); <=== HERE } return PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, (*pp_stack)-n, na, (*pp_stack)-2*nk, nk, d, nd, kwdefs, PyFunction_GET_CLOSURE(func)); Second in ext_do_call(), nstar type is int: nstar = PyTuple_GET_SIZE(stararg); Must check: Py_SIZE(argdefs) <= INT_MAX and PyTuple_GET_SIZE(stararg) <= INT_MAX. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:33:40 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 21:33:40 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bfNzR3vwyz7Lp5@mail.python.org> Roundup Robot added the comment: New changeset 6b4d279508a3 by Victor Stinner in branch 'default': Issue #9566: Fix a compiler warning in tupleiter_setstate() on Windows x64 http://hg.python.org/cpython/rev/6b4d279508a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:34:36 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 21:34:36 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bfP0X0MpLz7LlN@mail.python.org> Roundup Robot added the comment: New changeset 72087ebf83f0 by Victor Stinner in branch 'default': Issue #9566: Fix a compiler warning on Windows x64 http://hg.python.org/cpython/rev/72087ebf83f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:35:58 2013 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 Jun 2013 21:35:58 +0000 Subject: [issue1040439] Missing documentation on how to link with libpython Message-ID: <1372109758.42.0.275960150487.issue1040439@psf.upfronthosting.co.za> Ned Deily added the comment: I've now backported the 3.x update to the 2.7 docs in Issue18164 (I hadn't noticed that this issue was still open). As Eli noted, if any updates are needed to cover Windows, a separate issue should be opened. I'm closing this one. ---------- nosy: +ned.deily resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:37:52 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 21:37:52 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bfP4J2b39z7LqR@mail.python.org> Roundup Robot added the comment: New changeset 5a72adc7c8f7 by Victor Stinner in branch 'default': Issue #9566: pystrtod.c: Fix a compiler warnings on Windows x64 http://hg.python.org/cpython/rev/5a72adc7c8f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:48:00 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 21:48:00 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bfPJ01L9qz7Lp5@mail.python.org> Roundup Robot added the comment: New changeset c1a400501db6 by Victor Stinner in branch 'default': Issue #9566: recv(), recvfrom(), send(), sendall() and sendto() methods http://hg.python.org/cpython/rev/c1a400501db6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 24 23:59:38 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 21:59:38 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <3bfPYP6HX3z7LnW@mail.python.org> Roundup Robot added the comment: New changeset 3a393fc86b29 by Victor Stinner in branch 'default': Issue #9566: More long/Py_ssize_t fixes in tuple and list iterators (it_index) http://hg.python.org/cpython/rev/3a393fc86b29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 00:17:51 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 22:17:51 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <3bfPyR1gd1z7LkY@mail.python.org> Roundup Robot added the comment: New changeset 2a9e1eb3719c by Victor Stinner in branch 'default': Issue #18081: Workaround "./python -m test_idle test_logging" failure http://hg.python.org/cpython/rev/2a9e1eb3719c ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 00:20:33 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 22:20:33 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1372112433.34.0.21564872603.issue18081@psf.upfronthosting.co.za> STINNER Victor added the comment: This issue is *really* annoying: it makes buildbots almost useless (it is no more possible to check if a commit introduces a regression). So until the best fix is decided, I applied a temporary fix (based on changes.diff written by Vinay Sajip): New changeset 2a9e1eb3719c by Victor Stinner in branch 'default': Issue #18081: Workaround "./python -m test_idle test_logging" failure http://hg.python.org/cpython/rev/2a9e1eb3719c I checked that "import warnings; warnings.warn('test')" does still use the custom warning hook in IDLE. I don't know how to test all hooks. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 00:44:02 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 22:44:02 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <3bfQXf23Ngz7Lqj@mail.python.org> Roundup Robot added the comment: New changeset bfede07268a1 by Victor Stinner in branch '3.3': Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if the input http://hg.python.org/cpython/rev/bfede07268a1 New changeset 12a388024d5b by Victor Stinner in branch 'default': (Merge 3.3) Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if http://hg.python.org/cpython/rev/12a388024d5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 00:48:27 2013 From: report at bugs.python.org (Roundup Robot) Date: Mon, 24 Jun 2013 22:48:27 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <3bfQdk627Mz7Lnc@mail.python.org> Roundup Robot added the comment: New changeset a29eaffa7d72 by Victor Stinner in branch '2.7': Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if the input http://hg.python.org/cpython/rev/a29eaffa7d72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 00:52:55 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 22:52:55 +0000 Subject: [issue7732] imp.find_module crashes Python if there exists a directory named "__init__.py" In-Reply-To: <1263816426.99.0.320342241745.issue7732@psf.upfronthosting.co.za> Message-ID: <1372114375.85.0.796674284646.issue7732@psf.upfronthosting.co.za> STINNER Victor added the comment: The test just failed on x86 Windows Server 2003 [SB] 3.x: http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%203.x/builds/1077/steps/test/logs/stdio ====================================================================== FAIL: test_bug7732 (test.test_imp.ImportTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\Data\buildslave\cpython\3.x.snakebite-win2k3r2sp2-x86\build\lib\test\test_imp.py", line 285, in test_bug7732 imp.find_module, support.TESTFN, ["."]) AssertionError: ImportError not raised by find_module ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 01:15:17 2013 From: report at bugs.python.org (Phil Webster) Date: Mon, 24 Jun 2013 23:15:17 +0000 Subject: [issue18279] IDLE Unit test for RstripExtension.py In-Reply-To: <1371854273.68.0.541594598967.issue18279@psf.upfronthosting.co.za> Message-ID: <1372115717.82.0.314280758457.issue18279@psf.upfronthosting.co.za> Phil Webster added the comment: Modified the first patch to get rid of mock EditorWindow in favor of the real thing. Also renamed the test to 'test_rstrip'. ---------- Added file: http://bugs.python.org/file30694/test_rstrip.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 01:18:53 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 24 Jun 2013 23:18:53 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1372115933.33.0.106298034234.issue18189@psf.upfronthosting.co.za> Terry J. Reedy added the comment: "test.support.requires" returns True if "called from a context with __name__ = '__main__'" or "'gui' in test.support.use_resources". The first clause is never true for buildbots, so the presumption is that the test was invoked by a user with a gui screen. (Windoes has an extra test that is only relevant to buildbots.) See #18103 for more discussion. Here is a minimal test_gui.py file. In what follows, I only note the print output and skip notices. Running test_gui by itself: F5 when file is in Idle editor; and python -m idlelib.idle_test.test_gui have identical output, as they should, and print 'in gui', 'nogui', because test_gui is main. python -m unittest idlelib.idle_test.test_gui python -m unittest idlelib.idle_test.test_gui.FakeGuiTest have identical output for this simple file and print 'nogui', 'skipped=1', because test_gui is not main. The first of these two lines is not needed; just omit 'unittest'. The second means that we cannot pick out and run just a gui testcase from a file. Running as part of suite: F5 with test_idle loaded in editor window python -m test -v test_idle python -m test.test_idle python -m unittest -v idlelib.idle_test all print 'skipped', 'nogui', 'skipped=1' (and otherwise similar output). because verbosity is set either in the file or command line and because main is not test_gui and 'gui' not in use_resources. python -m test test_idle prints only 'nogui', no skip notice (because skips are ignored by non-verbose regrtest). python -m test -ugui test_idle prints 'in gui', 'nogui' because regrtest sets use_resources to ['gui']. python -m idlelib.idle_test does not run but would if there were a .__main__ similar to test.test_idle. Attribute use_resources can be set by anyone, not just by regrtest. In test_idle, after "if __name__ == '__main__':", add from test import support; support.use_resources = ['gui'] and F5 with test_idle loaded in editor window python -m test.test_idle both print 'in gui', 'nogui'. -- I added test_delegator.py and it skips when it should, but one must get verbose output to tell. (I do not see anything on the screen even when it does run.) Perhaps you mistook the absence of a failure report and the absence of a skip report to mean the absence of skips. It does not. Here is what I see. C:\Users\Terry>python -m test test_idle [1/1] test_idle nogui Warning -- os.environ was modified by test_idle 1 test altered the execution environment: test_idle If I add '-ugui', the *only* visible difference is the added 'in gui' from my file. Prints are really useful for leaving a record. With -v, the difference is skipped "Use of the 'gui' resource not enabled" versus test_setdelegate (idlelib.idle_test.test_delegator.Test_delegator) ... ok It appears that methods within a skipped testcase are not listed, whereas a skipped method within a not-skipped testcase is listed. I believe your patch is working correctly as far is it goes, and that we should move forward. The Delegator.py patch needs something like the use_resource line I added to test_idle in order for the gui test to run when Delegator.py is run. The line I gave will work; I am also thinking of a context manager. As I said on idle-dev, I decided you were right to call your first TestCase 'PathBrowserTest' instead of 'Test_xxx', as I did at first. Having testcases end with 'Test' while methods begin with 'test' is less confusing. So let us make it 'DelegatorTest'. ---------- stage: -> patch review Added file: http://bugs.python.org/file30695/test_gui.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 01:30:36 2013 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Jun 2013 23:30:36 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates In-Reply-To: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> Message-ID: <1372116636.93.0.175947007446.issue18293@psf.upfronthosting.co.za> Christian Heimes added the comment: I'm setting the version to 3.4 as this is a feature request. 2.7 and 3.3 are in feature freeze mode. OpenSSL doesn't support our idea out of the box. OpenSSL either verifies the peer's certificate and chain or doesn't verify the peer's certificate and chain. Optional and required verification makes only a different for client side certs. Server side certs are always verified in both modes. See http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html#NOTES When you are talking to a server the peer's certificate is always available, even in SSL_VERIFY_NONE mode. The server cert's public key is required to asymmetrically encrypt part of the session key. It's Python's ssl module that doesn't return the cert information in getpeercert() when SSL_CTX_get_verify_mode() doesn't have SSL_VERIFY_PEER. You can still get the DER encoded peer cert with getpeercert(True). Now for something completely different: Without verification and the correct root cert it's not possible to get the root cert of a peer's chain (see issue #18233). AFAIK SSL doesn't provide the full root cert as part of the peer chain because the other side is suppose the have a copy of the chain root anyway. Different story, though. ---------- versions: +Python 3.4 -Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 01:59:36 2013 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Jun 2013 23:59:36 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1372118376.85.0.151314600536.issue11390@psf.upfronthosting.co.za> STINNER Victor added the comment: The new tests added in changeset ae802dc4dcd4 are failing on some buildbots. I can reproduce the issue on my Linux box (Fedora 18). First failure of "./python -m test test_doctest": [1/1] test_doctest ********************************************************************** File "/home/haypo/prog/python/default/Lib/test/test_doctest.py", line 2627, in test.test_doctest.test_CLI Failed example: rc1, out1, err1 Expected: (0, b'', b'') Got: (0, b'\x1b[?1034h', b'') The b'\x1b[?1034h' sequence it written by the readline module when it is imported. The readline module is imported by pdb, which is used by doctest. The following article proposes set to TERM environment variable to "linux" to workaround the issue: http://reinout.vanrees.org/weblog/2009/08/14/readline-invisible-character-hack.html It works: $ echo $TERM # yeah, Fedora supports 256 colors! xterm-256color $ ./python -c 'import readline'|hexdump -C 00000000 1b 5b 3f 31 30 33 34 68 |.[?1034h| 00000008 $ TERM=linux ./python -c 'import readline'|hexdump -C This issue was reported to OpenSuse in 2009: http://lists.opensuse.org/opensuse-bugs/2009-05/msg01633.html The issue is not specific to Python. Just one another example with Octave (issue closed as "not a bug"): https://bugzilla.redhat.com/show_bug.cgi?id=304181 The issue was also reported upstream (bug-readline mailing list) a few days ago: http://lists.gnu.org/archive/html/bug-readline/2013-06/msg00000.html ---------- nosy: +haypo resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 02:14:46 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 00:14:46 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1372119286.33.0.0491742660742.issue11390@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached doctest_term_dummy.patch: workaround the issue by setting TERM env var to "dummy". Why is test_CLI() implemented using a doctest? Why not reusing the unittest module to benefit from test.support and test.regrtest? (Hint: I don't like doctests :-)) ---------- Added file: http://bugs.python.org/file30696/doctest_term_dummy.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 02:19:54 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 00:19:54 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1372119594.25.0.204082714884.issue11390@psf.upfronthosting.co.za> STINNER Victor added the comment: test_doctest.test_CLI() is also failing on Windows: http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%203.x/builds/1078/steps/test/logs/stdio It looks like an issue with Windows newline (\r\n) versus UNIX newline (\n). test_CLI() decodes the bytes output from UTF-8, but do not normalize newlines. The universal_newlines=True option can be passed to subprocess, which is not possible currently using script_helper. Is there function somewhere else to normalize newlines? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 02:25:42 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 00:25:42 +0000 Subject: [issue18296] test_os.test_trailers() is failing on AMD64 FreeBSD 9.0 dtrace 3.x Message-ID: <1372119942.09.0.162654139201.issue18296@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%20dtrace%203.x/builds/1560/steps/test/logs/stdio ====================================================================== FAIL: test_trailers (test.test_os.TestSendfile) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd/build/Lib/test/test_os.py", line 1962, in test_trailers self.assertEqual(data, b"abcde12345") AssertionError: b'abcde\x00\x00\x00...\x00\x0012345' != b'abcde12345' Warning -- threading._dangling was modified by test_os test test_os failed (I replaced a long list of \x00 with "...") I don't understand why test_trailers() of test_os tries to copy 4096 bytes using os.sendto(), whereas the input file only contains 5 bytes. ---------- messages: 191827 nosy: haypo priority: normal severity: normal status: open title: test_os.test_trailers() is failing on AMD64 FreeBSD 9.0 dtrace 3.x versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 03:05:37 2013 From: report at bugs.python.org (Brandon Craig Rhodes) Date: Tue, 25 Jun 2013 01:05:37 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372122337.56.0.229188578813.issue16487@psf.upfronthosting.co.za> Brandon Craig Rhodes added the comment: Kristj?n, you are certainly correct that a single-argument that can be either a filename or a cert is inappropriate; we should not be peeking inside of strings to guess what they contain. And I think you also have a good point about Pythonic-ness when it comes to polymorphism; routines that are sensitive to object type have been going more and more out of style for the past twenty years, and for good reason. But, having ceded those points, I still think string-or-file-like-object is the correct approach here, simply because it is the overwhelming approach of the Standard Library; everyone is used to it, and will already "know the ropes" of that approach; and it prevents noisying up the interface with redundant arguments. Were we doing this over again, we would simply not allow a filename at all, and let the user open the file if they needed to. But since a filename is allowed, it feels like the Official Standard Library Approach to also allow a file-like object. Some examples: zipfile.ZipFile: "Open a ZIP file, where file can be either a path to a file (a string) or a file-like object." http://docs.python.org/2/library/zipfile#zipfile.ZipFile binhex.hexbin: "Decode a binhex file input. input may be a filename or a file-like object supporting read() and close() methods." http://docs.python.org/release/2.7.5/library/binhex.html#binhex.hexbin xml.dom.minidom.parse: "filename_or_file may be either a file name, or a file-like object." http://docs.python.org/2/library/xml.dom.minidom.html#xml.dom.minidom.parse mailbox.Mailbox.add: "Parameter message may be a Message instance, an email.message.Message instance, a string, or a file-like object (which should be open in text mode)." http://docs.python.org/2/library/mailbox.html#mailbox.Mailbox.add pickletools.dis: "pickle can be a string or a file-like object." http://docs.python.org/2/library/pickletools.html#pickletools.dis I suggest that these precedents, along with others that I believe we could find with a more exhaustive search of the Standard Library, are sufficient to suggest that in this case the least-surprise approach is a single argument that's either a filename or file-like object. I would suggest reviewing quickly the code for the above examples and following their example for how to distinguish most cleanly between a filename and file-like object; I wonder if they call any common code to get the contents out, or each do it completely by themselves? :) Thanks again for wanting to add this to the SSL module, it will be a *great* addition that solves an important use case! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 03:35:14 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Tue, 25 Jun 2013 01:35:14 +0000 Subject: [issue18113] Memory leak in curses.panel In-Reply-To: <1370054155.63.0.276234204482.issue18113@psf.upfronthosting.co.za> Message-ID: <1372124114.96.0.442081520416.issue18113@psf.upfronthosting.co.za> A.M. Kuchling added the comment: I believe the most recent 2 commits fix the segfault problem, so I'll now close this again. Please re-open if there are further issues with the bugfix. ---------- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 05:13:19 2013 From: report at bugs.python.org (mpb) Date: Tue, 25 Jun 2013 03:13:19 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates In-Reply-To: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> Message-ID: <1372129999.64.0.733403324372.issue18293@psf.upfronthosting.co.za> mpb added the comment: Hi Christian, thanks for the prompt response. Sorry about choosing the wrong versions - I wasn't thinking that enhancements should target future versions, but of course that makes sense. After submitting the enhancement request, I did dig into the OpenSSL docs, and, as Christian points out, I discovered that OpenSSL is not designed in a way that makes it easy to implement the enhancement. Aside: Interestingly, it looks easier to implement the enhancement in PolarSSL, and probably also in MatrixSSL and CyaSSL. Of course, that's not really an option. I did not look at GnuTLS. Thanks for the pointer about being able to get the server's DER certificate. That will be useful. Is there some reason to return DER but not PEM? Or is this perhaps a bug that could be fixed in a future version of Python's ssl module? Christian wrote: "Optional and required verification makes only a differen[ce] for client side certs." I believe there is one small exception: With SSL_VERIFY_NONE, a client will continue talking with a server with an invalid certificate. With SSL_VERIFY_PEER, when a client fails to verify the server's certificate, the client will terminate the connection. Ideally, I would like a client to be able to get both of the following from the API: (a) the server's certificate (and chain?), and (b) whether or not the certificate (and chain?) is valid (against a given sets of root certs). Similarly, I would like a Python server to be able to get both of: (a) the client's certificate, and (b) whether the certificate is valid (against a given set of root certs). In the latter case, it seems that OpenSSL is even more restrictive! With SSL_VERIFY_NONE, the server will not request (and presumably therefore not even receive) a certificate. With SSL_VERIFY_PEER, the server will terminate the connection if the client's certificate does not validate! Very inconvenient! Interestingly, I believe I have worked around this limitation in OpenSSL using M2Crypto (which is built on top of OpenSSL), by installing my own verifier that overrides the built-in verifier. This is done as follows: import M2Crypto.SSL ctx = M2Crypto.SSL.Context () ctx.load_cert ('var/cert.pem') def verify (*args): return True ctx.set_verify (M2Crypto.SSL.verify_peer, 10, verify) After doing this, both the client and the server can see each other's certificates, even if those certificates are invalid. (Of course I'll have to write my own verifier. "return True" is only useful for testing purposes.) I'm not sure how much of this functionality the Python developers might be interested in putting into Python 3.4? Given that M2Crypto does not work with Python 3.x at all (at least not yet?), I am interested in finding something that will work with Python 3.x and give me the functionality I want. I can probably help with the C OpenSSL code, if needed. However, I have no experience writing Python bindings. Your thoughts? Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 05:33:32 2013 From: report at bugs.python.org (mpb) Date: Tue, 25 Jun 2013 03:33:32 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates In-Reply-To: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> Message-ID: <1372131212.28.0.246620756196.issue18293@psf.upfronthosting.co.za> mpb added the comment: Oh, I see. getpeercert (binary_form) is not DER vs. PEM, it is DER vs. dict. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:03:53 2013 From: report at bugs.python.org (py.user) Date: Tue, 25 Jun 2013 05:03:53 +0000 Subject: [issue18297] In range.sample() correct the ValueError message for negative k Message-ID: <1372136633.71.0.576354132285.issue18297@psf.upfronthosting.co.za> New submission from py.user: >>> random.sample('ABC', -1) Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.3/random.py", line 302, in sample raise ValueError("Sample larger than population") ValueError: Sample larger than population >>> ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 191832 nosy: docs at python, py.user priority: normal severity: normal status: open title: In range.sample() correct the ValueError message for negative k type: enhancement versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:04:19 2013 From: report at bugs.python.org (py.user) Date: Tue, 25 Jun 2013 05:04:19 +0000 Subject: [issue18297] In range.sample() correct the ValueError message for negative k In-Reply-To: <1372136633.71.0.576354132285.issue18297@psf.upfronthosting.co.za> Message-ID: <1372136659.76.0.387814828794.issue18297@psf.upfronthosting.co.za> Changes by py.user : ---------- keywords: +patch Added file: http://bugs.python.org/file30697/issue18297.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:14:26 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:14:26 +0000 Subject: [issue17953] sys.modules cannot be reassigned In-Reply-To: <1368260613.85.0.746522318662.issue17953@psf.upfronthosting.co.za> Message-ID: <1372137266.55.0.265606383712.issue17953@psf.upfronthosting.co.za> Eric Snow added the comment: For the record, issue12633 has some more discussion on this. ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:14:51 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:14:51 +0000 Subject: [issue12633] sys.modules doc entry should reflect restrictions In-Reply-To: <1311569390.98.0.906064511142.issue12633@psf.upfronthosting.co.za> Message-ID: <1372137291.22.0.26341960245.issue12633@psf.upfronthosting.co.za> Eric Snow added the comment: issue17953 addressed part of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:16:50 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:16:50 +0000 Subject: [issue15004] add weakref support to types.SimpleNamespace In-Reply-To: <1338865132.4.0.472631439697.issue15004@psf.upfronthosting.co.za> Message-ID: <1372137410.27.0.548118877332.issue15004@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- assignee: -> eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:21:42 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:21:42 +0000 Subject: [issue17421] Drop restriction that meta.__prepare__() must return a dict (subclass) In-Reply-To: <1363292427.77.0.787480674647.issue17421@psf.upfronthosting.co.za> Message-ID: <1372137702.41.0.0261065383048.issue17421@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- assignee: -> eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:26:52 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:26:52 +0000 Subject: [issue17037] Use a test.support helper to wrap the PEP 399 boilerplate In-Reply-To: <1359179328.16.0.396710574984.issue17037@psf.upfronthosting.co.za> Message-ID: <1372138012.72.0.0694114609263.issue17037@psf.upfronthosting.co.za> Eric Snow added the comment: The gains here aren't worth the hassle in my mind, and I've lost interest in pushing this forward any further. If anyone else wants to pick this up, feel free to re-open the issue. ---------- assignee: eric.snow -> resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:27:24 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:27:24 +0000 Subject: [issue16251] pickle special methods are looked up on the instance rather than the type In-Reply-To: <1350411894.01.0.763638555345.issue16251@psf.upfronthosting.co.za> Message-ID: <1372138044.03.0.302427659008.issue16251@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- assignee: -> eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:27:50 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:27:50 +0000 Subject: [issue16223] untokenize returns a string if no encoding token is recognized In-Reply-To: <1350193751.15.0.784217855065.issue16223@psf.upfronthosting.co.za> Message-ID: <1372138070.45.0.978042092345.issue16223@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- assignee: -> eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:29:09 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:29:09 +0000 Subject: [issue12857] Expose called function on frame object In-Reply-To: <1314683667.85.0.876885324202.issue12857@psf.upfronthosting.co.za> Message-ID: <1372138149.52.0.293579810465.issue12857@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- assignee: -> eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:29:25 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 05:29:25 +0000 Subject: [issue12598] Move sys variable initialization from import.c to sysmodule.c In-Reply-To: <1311204284.83.0.766064550687.issue12598@psf.upfronthosting.co.za> Message-ID: <1372138165.8.0.263482324229.issue12598@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- assignee: -> eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:43:17 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 25 Jun 2013 05:43:17 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <3bfbrP09JNz7LpP@mail.python.org> Roundup Robot added the comment: New changeset 76196691b5d0 by Raymond Hettinger in branch 'default': Issue 18111: Add a default argument to min() and max() http://hg.python.org/cpython/rev/76196691b5d0 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 07:44:54 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Jun 2013 05:44:54 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1372139094.94.0.139788750297.issue18111@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 09:30:37 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Jun 2013 07:30:37 +0000 Subject: [issue18297] In range.sample() correct the ValueError message for negative k In-Reply-To: <1372136633.71.0.576354132285.issue18297@psf.upfronthosting.co.za> Message-ID: <1372145437.04.0.014800378029.issue18297@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +mark.dickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 09:35:40 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Jun 2013 07:35:40 +0000 Subject: [issue18297] In random.sample() correct the ValueError message for negative k In-Reply-To: <1372136633.71.0.576354132285.issue18297@psf.upfronthosting.co.za> Message-ID: <1372145740.27.0.820549177462.issue18297@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- title: In range.sample() correct the ValueError message for negative k -> In random.sample() correct the ValueError message for negative k _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 10:01:45 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Jun 2013 08:01:45 +0000 Subject: [issue18294] zlib module is not completly 64-bit safe In-Reply-To: <1372107882.97.0.731855490225.issue18294@psf.upfronthosting.co.za> Message-ID: <1372147305.64.0.241007434147.issue18294@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: +Extension Modules nosy: +nadeem.vawda stage: -> patch review type: -> behavior versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 10:21:10 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Jun 2013 08:21:10 +0000 Subject: [issue18296] test_os.test_trailers() is failing on AMD64 FreeBSD 9.0 dtrace 3.x In-Reply-To: <1372119942.09.0.162654139201.issue18296@psf.upfronthosting.co.za> Message-ID: <1372148470.02.0.205530957955.issue18296@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 10:22:56 2013 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 25 Jun 2013 08:22:56 +0000 Subject: [issue18297] In random.sample() correct the ValueError message for negative k In-Reply-To: <1372136633.71.0.576354132285.issue18297@psf.upfronthosting.co.za> Message-ID: <1372148576.02.0.345668428287.issue18297@psf.upfronthosting.co.za> Mark Dickinson added the comment: This has been proposed and rejected before: see issue #17388. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 10:34:42 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 25 Jun 2013 08:34:42 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372149282.86.0.641621604206.issue16487@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: ok, I concede that a file-like object makes sense from a polymorphism point of view. It makes no sense from a streaming point of view. A caller can then wrap their data into a StringIO instance. I'll rework the patch in the manner you suggest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 11:09:46 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 25 Jun 2013 09:09:46 +0000 Subject: [issue18298] pythonw.exe fails with redirected stdett Message-ID: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> New submission from anatoly techtonik: ---cut test.py--- print("-1-") open("-2-", "w").write("-3-") ---cut test.py--- > C:\Python27\pythonw.exe test.py > -4- > type -4- -1- > C:\Python27\pythonw.exe test.py 2> -4- > type -4- close failed in file object destructor: sys.excepthook is missing lost sys.stderr > C:\Python27\python.exe test.py 2> -4- -1- >type -4- > This may also affect subprocess calls under pythonw.exe I am running Python 2.7.3 ---------- messages: 191839 nosy: techtonik priority: normal severity: normal status: open title: pythonw.exe fails with redirected stdett versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 11:09:58 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 25 Jun 2013 09:09:58 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372151398.88.0.760864747044.issue18298@psf.upfronthosting.co.za> Changes by anatoly techtonik : ---------- title: pythonw.exe fails with redirected stdett -> pythonw.exe fails with redirected stderr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 11:10:27 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 25 Jun 2013 09:10:27 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372151427.16.0.201728609111.issue18298@psf.upfronthosting.co.za> Changes by anatoly techtonik : ---------- components: +Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 11:26:22 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 25 Jun 2013 09:26:22 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372152382.7.0.499650109634.issue18298@psf.upfronthosting.co.za> anatoly techtonik added the comment: This subprocess.communicate() call fails with pythonw.exe --cut testhg.py-- import subprocess hg = "hg" output, _err = subprocess.Popen([hg, 'id', '-nib'], stdout=subprocess.PIPE).communicate() open("-hg-", "w").write(output) --cut testhg.py-- When testhg.py is run with python.exe from cmd.exe session, the -hg- file is created ok. When pythonw.exe is used, nothing happens. When redirecting stderr from pythonw.exe with: C:\Python27\pythonw.exe testhg.py 2>1 1 contains the following stacktrace: Traceback (most recent call last): File "testhg.py", line 5, in stdout=subprocess.PIPE).communicate() File "C:\Python27\lib\subprocess.py", line 672, in __init__ errread, errwrite) = self._get_handles(stdin, stdout, stderr) File "C:\Python27\lib\subprocess.py", line 787, in _get_handles p2cread = self._make_inheritable(p2cread) File "C:\Python27\lib\subprocess.py", line 826, in _make_inheritable _subprocess.DUPLICATE_SAME_ACCESS) WindowsError: [Error 6] The handle is invalid ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 11:28:20 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 25 Jun 2013 09:28:20 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372152500.16.0.0201744845815.issue18298@psf.upfronthosting.co.za> anatoly techtonik added the comment: This was meant to be a separate issue. :/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 11:35:18 2013 From: report at bugs.python.org (koobs) Date: Tue, 25 Jun 2013 09:35:18 +0000 Subject: [issue18296] test_os.test_trailers() is failing on AMD64 FreeBSD 9.0 dtrace 3.x In-Reply-To: <1372119942.09.0.162654139201.issue18296@psf.upfronthosting.co.za> Message-ID: <1372152918.82.0.25156551135.issue18296@psf.upfronthosting.co.za> Changes by koobs : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 12:26:15 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Tue, 25 Jun 2013 10:26:15 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372155975.91.0.953461757081.issue18298@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Yes, in pythonw.exe the C stderr is not really usable, and this leads to unpredictable results. It's difficult to fix in python2 though; python3 has fixed this issue, but in a way that cannot be backported. Some workarounds: - don't use pythonw.exe in a console, it's meant to be a *windows* application, without standard streams. I'm actually surprised of the behavior of your first example. - use python3, where pythonw will set sys.stderr to None, and prints will be silently discarded. ---------- nosy: +amaury.forgeotdarc resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 12:28:43 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Jun 2013 10:28:43 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1372156123.8.0.82300109906.issue11390@psf.upfronthosting.co.za> R. David Murray added the comment: It is implemented as a doctest because everything else in that test module is implemented as a doctest. And clearly this reveals a bug of some sort. Perhaps the dummy trick needs to be done by doctest itself? (I will need to read your post over more carefully and understand the issue better.) As for the windows failures, my apologies. I knew I would need to check windows after the commit when I wrote the code, but I forgot to actually do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 12:46:50 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 10:46:50 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1372156123.8.0.82300109906.issue11390@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > As for the windows failures, my apologies. I knew I would need to check windows after the commit when I wrote the code, but I forgot to actually do it. No problem, it's so easy to forget Windows :-) And we have buildbots for this task (detect regressions). 2013/6/25 R. David Murray : > > R. David Murray added the comment: > > It is implemented as a doctest because everything else in that test module is implemented as a doctest. And clearly this reveals a bug of some sort. Perhaps the dummy trick needs to be done by doctest itself? (I will need to read your post over more carefully and understand the issue better.) > > As for the windows failures, my apologies. I knew I would need to check windows after the commit when I wrote the code, but I forgot to actually do it. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 12:47:06 2013 From: report at bugs.python.org (Oscar Benjamin) Date: Tue, 25 Jun 2013 10:47:06 +0000 Subject: [issue12641] Remove -mno-cygwin from distutils In-Reply-To: Message-ID: Oscar Benjamin added the comment: I'm attaching one more patch "check_mno_cywin_py34.patch". This is my preferred patch for Python 3.4 (default). It fixes building with MinGW and removes all support for using Cygwin gcc with --compiler=mingw32. The user would see the following error message: ''' Q:\current\testing\hello>testbuild q:\tools\cygwin\bin -3.3 running build_ext error: Cygwin gcc cannot be used with --compiler=mingw32 ''' I think that this is reasonable as '-mno-cygwin' is a previously experimental and now long deprecated, discouraged and discontinued feature of Cygwin's gcc. Removing support for it in future Pythons would make problems involving MinGW build (like this one) much easier to solve in future: there would be no need to consider anything other than the behaviour of MinGW's gcc. ---------- Added file: http://bugs.python.org/file30698/check_mno_cywin_py34.patch _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff -r 7aab60b70f90 Lib/distutils/cygwinccompiler.py --- a/Lib/distutils/cygwinccompiler.py Sun Jun 23 15:47:03 2013 -0700 +++ b/Lib/distutils/cygwinccompiler.py Tue Jun 25 11:38:05 2013 +0100 @@ -54,7 +54,8 @@ from distutils.ccompiler import gen_preprocess_options, gen_lib_options from distutils.unixccompiler import UnixCCompiler from distutils.file_util import write_file -from distutils.errors import DistutilsExecError, CompileError, UnknownFileError +from distutils.errors import (DistutilsExecError, CCompilerError, + CompileError, UnknownFileError) from distutils import log from distutils.version import LooseVersion from distutils.spawn import find_executable @@ -294,11 +295,15 @@ else: entry_point = '' - self.set_executables(compiler='gcc -mno-cygwin -O -Wall', - compiler_so='gcc -mno-cygwin -mdll -O -Wall', - compiler_cxx='g++ -mno-cygwin -O -Wall', - linker_exe='gcc -mno-cygwin', - linker_so='%s -mno-cygwin %s %s' + if is_cygwingcc(): + raise CCompilerError( + 'Cygwin gcc cannot be used with --compiler=mingw32') + + self.set_executables(compiler='gcc -O -Wall', + compiler_so='gcc -mdll -O -Wall', + compiler_cxx='g++ -O -Wall', + linker_exe='gcc', + linker_so='%s %s %s' % (self.linker_dll, shared_option, entry_point)) # Maybe we should also append -mthreads, but then the finished @@ -393,3 +398,15 @@ """ commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version'] return tuple([_find_exe_version(cmd) for cmd in commands]) + +def is_cygwingcc(): + '''Try to determine if the gcc that would be used is from cygwin.''' + from subprocess import Popen, PIPE + out = Popen(['gcc', '-dumpmachine'], shell=True, stdout=PIPE).stdout + try: + out_string = out.read() + finally: + out.close() + # out_string is the target triplet cpu-vendor-os + # Cygwin's gcc sets the os to 'cygwin' + return out_string.decode('ascii').strip().endswith('cygwin') From report at bugs.python.org Tue Jun 25 12:50:32 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 10:50:32 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1372157432.36.0.322605189386.issue11390@psf.upfronthosting.co.za> STINNER Victor added the comment: > Perhaps the dummy trick needs to be done by doctest itself? The issue really comes from the readline module. The workaround is to set an environment variable, which affects the whole process (all threads). Only setting TERM for test_CLI() is fine, because it's the only test running doctest in a subprocess. Hum, we may set TERM=dummy in script_helper directly, because this module tries to run Python in a fresh environment. It uses "python -E" for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 13:04:08 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 25 Jun 2013 11:04:08 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372158248.51.0.330312003354.issue16487@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Agreed, a file-like object is the way to go. I don't think you need to write the logic in C, by the way. You can write a high-level function and defer to a low-level C func for the basic API wrapping. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 13:11:18 2013 From: report at bugs.python.org (Paul) Date: Tue, 25 Jun 2013 11:11:18 +0000 Subject: [issue18291] codecs.open interprets space as line ends In-Reply-To: <1372079472.71.0.230881178227.issue18291@psf.upfronthosting.co.za> Message-ID: <1372158678.38.0.189117353173.issue18291@psf.upfronthosting.co.za> Paul added the comment: You're absolutely right. I tested it on another machine now, with Python 2.7.3 installed and it is actually twice as fast as codecs. Thanks. So I guess there is little interest in fixing codecs because io is the preferred package for reading unicode files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 13:14:14 2013 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 25 Jun 2013 11:14:14 +0000 Subject: [issue18297] In random.sample() correct the ValueError message for negative k In-Reply-To: <1372136633.71.0.576354132285.issue18297@psf.upfronthosting.co.za> Message-ID: <1372158854.81.0.00122984793984.issue18297@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- resolution: -> duplicate status: open -> closed superseder: -> Providing invalid value to random.sample can result in incorrect error message _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 13:33:37 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Jun 2013 11:33:37 +0000 Subject: [issue18291] codecs.open interprets space as line ends In-Reply-To: <1372079472.71.0.230881178227.issue18291@psf.upfronthosting.co.za> Message-ID: <1372160017.04.0.153777991289.issue18291@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I guess Victor have an interest. ;) ---------- versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 14:11:45 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 25 Jun 2013 12:11:45 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <3bfmSd0NjXz7Lpv@mail.python.org> Roundup Robot added the comment: New changeset 8f22e03f5f07 by R David Murray in branch 'default': #11390: fix test failures due to readline and windows lineneds. http://hg.python.org/cpython/rev/8f22e03f5f07 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 14:13:38 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Jun 2013 12:13:38 +0000 Subject: [issue11390] doctest: add cmdline parameters In-Reply-To: <1299184426.69.0.480744886707.issue11390@psf.upfronthosting.co.za> Message-ID: <1372162418.74.0.902059079057.issue11390@psf.upfronthosting.co.za> R. David Murray added the comment: Fixed for this test. It would probably be worthwhile to improve script_helpers, I'll open a new issue for that. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 14:18:14 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 12:18:14 +0000 Subject: [issue18294] zlib module is not completly 64-bit safe In-Reply-To: <1372107882.97.0.731855490225.issue18294@psf.upfronthosting.co.za> Message-ID: <1372162694.79.0.793704601687.issue18294@psf.upfronthosting.co.za> STINNER Victor added the comment: @Serhiy: Oh, thanks for your review. My patch was far from being perfect, a review was necessary! (I hesitated to commit it directly.) Here is a new patch using unsigned int is most places, parsing arguments with "I" format, and explicit cast to (size_t) to not compare unsigned with signed. ---------- Added file: http://bugs.python.org/file30699/zlib_64bit-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 14:20:54 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 12:20:54 +0000 Subject: [issue18291] codecs.open interprets space as line ends In-Reply-To: <1372160017.04.0.153777991289.issue18291@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: >> So I guess there is little interest in fixing codecs because io is the >> preferred package for reading unicode files. > I guess Victor have an interest. ;) Ah ah, good joke. I wrote the PEP 400: http://www.python.org/dev/peps/pep-0400/ And yes, for best performances, you have to choose between codecs and io module depending on the Python version. It suggest to always use the io module because it has more features, like universal newline, and less bugs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 14:31:30 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 12:31:30 +0000 Subject: [issue18294] zlib module is not completly 64-bit safe In-Reply-To: <1372162694.79.0.793704601687.issue18294@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: "Here is a new patch using unsigned int is most places, parsing arguments with "I" format, and explicit cast to (size_t) to not compare unsigned with signed." Oh oh, it's still wrong. The "I" parser format does not check for integer overflow. _PyBytes_Resize() also uses "Py_DECREF(retVal); retVal = NULL;" on failure, instead of Py_CLEAR(retVal), whereas _PyBytes_Resize(&retVal, ...) sets retVal to NULL... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 14:31:30 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Jun 2013 12:31:30 +0000 Subject: [issue18299] Change script_helper to use universal_newlines=True in _assert_python Message-ID: <1372163490.54.0.858843080501.issue18299@psf.upfronthosting.co.za> New submission from R. David Murray: A look at a random selection of tests that use script_helper indicates that using universal_newlines=True would either simplify or make no difference to the usage of the script_helper assert_python functions in the majority of the tests that use it. Even if there turn out to be a few uses where having bytes is required, it would probably be worth catering to the common case and making those exceptional cases use Popen directly. (Or alternatively provide assert_python_xxx_binary helpers.) ---------- keywords: easy messages: 191854 nosy: r.david.murray priority: normal severity: normal stage: needs patch status: open title: Change script_helper to use universal_newlines=True in _assert_python type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 14:40:40 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Jun 2013 12:40:40 +0000 Subject: [issue18300] script_helper._asert_python should set TERM='' by default. Message-ID: <1372164040.52.0.568545505593.issue18300@psf.upfronthosting.co.za> New submission from R. David Murray: See issue 11390 for a discussion, but briefly: there is a bug in the readline library that causes it, on some systems, to emit a control sequence on stdout when readline is first initialized and TERM is set to xterm. The bug can be avoided by setting TERM='', and since assert_python is often used to test output, the bogus characters can cause tests to fail on just some systems. _assert_python should therefore set TERM='' unless the TERM environment variable is passed explicitly by the caller. While this issue probably has minimal impact on the earlier python versions (where only doctest is likely to trigger this bug, because it calls pdb which calls readline), on 3.4 readline is always initialized, and therefore the bug is more likely to cause unexpected test failures. ---------- messages: 191856 nosy: r.david.murray priority: normal severity: normal stage: needs patch status: open title: script_helper._asert_python should set TERM='' by default. type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 14:40:56 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 25 Jun 2013 12:40:56 +0000 Subject: [issue18299] Change script_helper to use universal_newlines=True in _assert_python In-Reply-To: <1372163490.54.0.858843080501.issue18299@psf.upfronthosting.co.za> Message-ID: <1372164056.72.0.746903257043.issue18299@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 15:00:35 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 Jun 2013 13:00:35 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates In-Reply-To: <1372129999.64.0.733403324372.issue18293@psf.upfronthosting.co.za> Message-ID: <51C99471.1090706@cheimes.de> Christian Heimes added the comment: > Thanks for the pointer about being able to get the server's DER certificate. That will be useful. Is there some reason to return DER but not PEM? Or is this perhaps a bug that could be fixed in a future version of Python's ssl module? It doesn't matter how getpeercert() returns the raw cert. PEM and DER encode the X.509 same in ASN.1 notation. PEM is just the base64 representation with some line breaks surrounded BEGIN/END CERTIFICATE lines. > Christian wrote: "Optional and required verification makes only a differen[ce] for client side certs." > > I believe there is one small exception: With SSL_VERIFY_NONE, a client will continue talking with a server with an invalid certificate. With SSL_VERIFY_PEER, when a client fails to verify the server's certificate, the client will terminate the connection. You are referring to server side certs, that is the server provides a cert and the client verifies it. I was talking about client side cert (aka server mode), a rarely used mode in which the client side provides a cert to the server. In CERT_OPTIONAL mode the client is allowed to send no cert. CERT_REQUIRED is mapped to SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT. > Ideally, I would like a client to be able to get both of the following from the API: (a) the server's certificate (and chain?), and (b) whether or not the certificate (and chain?) is valid (against a given sets of root certs). In client mode you already have the server's cert and as much of the chain as the peer (server) provides. SSL_VERIFY_NONE makes no difference because the server cert is used in the ClientHello / ServerHello handshake and session key negotiation. Perhaps you are a bit confused by Python's ssl API. Somebody once made the choice to return an empty dict from getpeercert(False) when SSL_VERIFY_NONE is used. That's all. :) http://hg.python.org/cpython/file/76196691b5d0/Modules/_ssl.c#l1098 > I'm not sure how much of this functionality the Python developers might be interested in putting into Python 3.4? Given that M2Crypto does not work with Python 3.x at all (at least not yet?), I am interested in finding something that will work with Python 3.x and give me the functionality I want. I'd rather not implement a full wrapper for X509_STORE_CTX and X509 certs. It's way too much code, super complex and easily confuses even experienced developers. Python's ssl module is limited to core functionality by design and choice. However I might be intrigue to implement support for SSL_CTX_set_cert_verify_callback() or SSL_CTX_set_verify(). SSL_CTX_set_cert_verify_callback() has more potential, e.g. def cert_verify_callback(sslsocket, storectx, verify_ok): context = sslsocket.context storectx is a minimal X509_STORE_CTX object and verify_ok the boolean return value of X509_verify_cert(). Without a cert verify callback OpenSSL just uses the return value of X509_verify_cert() (ssl/ssl_cert.c:ssl_verify_cert_chain()). sslsocket gives you access to the peer's cert and chain (with #18233). The callback could be used for multiple uses cases like cert blacklisting, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 15:14:17 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Jun 2013 13:14:17 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates In-Reply-To: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> Message-ID: <1372166057.74.0.224928904147.issue18293@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 15:49:14 2013 From: report at bugs.python.org (koobs) Date: Tue, 25 Jun 2013 13:49:14 +0000 Subject: [issue18296] test_os.test_trailers() is failing on AMD64 FreeBSD 9.0 dtrace 3.x In-Reply-To: <1372119942.09.0.162654139201.issue18296@psf.upfronthosting.co.za> Message-ID: <1372168154.15.0.182102776523.issue18296@psf.upfronthosting.co.za> koobs added the comment: I recently updated the buildbot host to the latest 9-STABLE sources (changeset delta is approximately 4-6 weeks) On a hunch I asked our src committers if there had been any sendfile related changes and was pointed to 3 changesets that were merged from current (MFC) to stable/9 4 weeks ago: http://svnweb.freebsd.org/base?view=revision&revision=250907 I reverted the kernel to r250906 (hunch commit -1) that resulted in a clean run: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%20dtrace%203.x/builds/1563 Manual Rebuild: Trying to isolate test_trailing with older kernel I have it on preliminary evidence that our regression tests are passing on this functionality, but analysis at the Python end for a root cause and details on how the test implementation plays a role would be helpful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 15:59:45 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Tue, 25 Jun 2013 13:59:45 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372168785.83.0.534081227874.issue16487@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Antoine, are you suggesting that we remove the current c-level capability to use file system files (using open()) and just go with raw bytes data at the C api level, and then do the 'filename or filelike object' in Python land? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 16:00:58 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 Jun 2013 14:00:58 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372168858.47.0.387893917284.issue16487@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 16:39:19 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 25 Jun 2013 14:39:19 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1372168785.83.0.534081227874.issue16487@psf.upfronthosting.co.za> Message-ID: <110833482.115207088.1372171152959.JavaMail.root@zimbra10-e2.priv.proxad.net> Antoine Pitrou added the comment: > Antoine, are you suggesting that we remove the current c-level > capability to use file system files (using open()) and just go with > raw bytes data at the C api level, and then do the 'filename or > filelike object' in Python land? Yes, I think that's reasonable. Hopefully it won't break any existing uses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 16:50:27 2013 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 25 Jun 2013 14:50:27 +0000 Subject: [issue14264] Comparison bug in distutils2.version In-Reply-To: <1331580673.39.0.274980477917.issue14264@psf.upfronthosting.co.za> Message-ID: <1372171827.22.0.393319342294.issue14264@psf.upfronthosting.co.za> ?ric Araujo added the comment: Yes. ---------- resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed versions: -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 16:52:29 2013 From: report at bugs.python.org (Christian Heimes) Date: Tue, 25 Jun 2013 14:52:29 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372171949.96.0.00847102007089.issue16487@psf.upfronthosting.co.za> Christian Heimes added the comment: I didn't know about this issue and have worked on a similar feature in #18138. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 17:33:05 2013 From: report at bugs.python.org (anatoly techtonik) Date: Tue, 25 Jun 2013 15:33:05 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372174385.69.0.84405834023.issue18298@psf.upfronthosting.co.za> anatoly techtonik added the comment: It is not about modifying Python in general, it is about patching pythonw.exe or subprocess or documenting how to make subprocess calls compatible with pythonw.exe "don't use pythonw.exe in a console" And how to debug the issue? Maybe the only solution in not using pythonw.exe at all if you want *windows* app solution, and do custom management of hidden windows. http://code.google.com/p/spyderlib/source/browse/CHANGELOG http://code.google.com/p/spyderlib/source/browse/spyderlib/utils/windows.py ---------- resolution: wont fix -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 17:49:03 2013 From: report at bugs.python.org (Brett Cannon) Date: Tue, 25 Jun 2013 15:49:03 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1372112433.34.0.21564872603.issue18081@psf.upfronthosting.co.za> Message-ID: Brett Cannon added the comment: I replied on python-checkins, I'll state here as well: the fix is still off as warnings.formatwarning is still being replaced. On Jun 24, 2013 6:20 PM, "STINNER Victor" wrote: > > STINNER Victor added the comment: > > This issue is *really* annoying: it makes buildbots almost useless (it is > no more possible to check if a commit introduces a regression). So until > the best fix is decided, I applied a temporary fix (based on changes.diff > written by Vinay Sajip): > > New changeset 2a9e1eb3719c by Victor Stinner in branch 'default': > Issue #18081: Workaround "./python -m test_idle test_logging" failure > http://hg.python.org/cpython/rev/2a9e1eb3719c > > I checked that "import warnings; warnings.warn('test')" does still use the > custom warning hook in IDLE. I don't know how to test all hooks. > > ---------- > nosy: +haypo > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 18:18:32 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 16:18:32 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: Message-ID: STINNER Victor added the comment: > I replied on python-checkins, I'll state here as well: the fix is still off > as warnings.formatwarning is still being replaced. My changeset only fixes the unit test (test_idle), it's just to fix buildbots. As I wrote, it's just a workaround. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 18:19:36 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Tue, 25 Jun 2013 16:19:36 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372177176.07.0.835847495272.issue18298@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: The proper solution if you use pythonw.exe is to define sys.stdout/sys.stderr yourself in pythonw.exe:: sys.stdout = open('c:/temp/output.txt', 'w') IOW, do the redirect from inside the program, don't rely on the shell which (by design?) does not work correctly with "/subsytem:windows" binaries. Again, this is a workaround for 2.7, because no backward-compatible fix could be found. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 18:41:31 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 16:41:31 +0000 Subject: [issue15729] PyStructSequence_NewType enhancement In-Reply-To: <1345407378.13.0.964225258094.issue15729@psf.upfronthosting.co.za> Message-ID: <1372178491.55.0.14903847668.issue15729@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 18:42:15 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 16:42:15 +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: <1372178535.53.0.169095263714.issue11698@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 18:43:14 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 16:43:14 +0000 Subject: [issue7434] general pprint rewrite In-Reply-To: <1259944363.21.0.149882342014.issue7434@psf.upfronthosting.co.za> Message-ID: <1372178594.2.0.841086699941.issue7434@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 18:48:31 2013 From: report at bugs.python.org (Zachary Ware) Date: Tue, 25 Jun 2013 16:48:31 +0000 Subject: [issue17883] Fix buildbot testing of Tkinter In-Reply-To: <1367355915.98.0.26398929673.issue17883@psf.upfronthosting.co.za> Message-ID: <1372178911.72.0.651557811914.issue17883@psf.upfronthosting.co.za> Zachary Ware added the comment: Ok, I've managed to cobble together a buildbot setup to test the hang myself and have come up with a couple possible solutions. The first is to change the buildbot service on the slaves to allow desktop interaction. This way, the tests can actually run. If that's not possible, it's probably simplest to just pass -u-gui to the buildslaves in question, since there is in fact no gui available. That should at least fix the test_ttk_guionly problem. As for the test_tcl problem, how about this patch? It simply wraps the Popen call in a try/except, and converts to a skip in case of an 'Access is denied' error. ---------- nosy: +pitrou resolution: fixed -> Added file: http://bugs.python.org/file30700/issue17883-skip-on-error.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 18:51:30 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 25 Jun 2013 16:51:30 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372179090.91.0.858388566719.issue16487@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ha, funny. Now it's time to reconciliate your respective patches :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 19:08:36 2013 From: report at bugs.python.org (py.user) Date: Tue, 25 Jun 2013 17:08:36 +0000 Subject: [issue18297] In random.sample() correct the ValueError message for negative k In-Reply-To: <1372136633.71.0.576354132285.issue18297@psf.upfronthosting.co.za> Message-ID: <1372180116.76.0.709396433793.issue18297@psf.upfronthosting.co.za> py.user added the comment: it was rejected by Raymond Hettinger because the proposed message wasn't informative ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 19:31:10 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 17:31:10 +0000 Subject: [issue7796] No way to find out if an object is an instance of a namedtuple In-Reply-To: <1264608669.85.0.379125118171.issue7796@psf.upfronthosting.co.za> Message-ID: <1372181470.03.0.616740640058.issue7796@psf.upfronthosting.co.za> Eric Snow added the comment: A NamedTuple ABC doesn't have to define any API (so that part could wait?)[1]. I see it as most useful for isinstance checks. Here's a solution along those lines: class NamedTuple(Sequence): @classmethod def __subclasshook__(cls, C): if cls is NamedTuple: if any("_fields" in B.__dict__ for B in C.__mro__): return True return NotImplemented def namedtuple(...): ... NamedTuple.register(result) return result (or include NamedTuple in the bases in the template) For structseq support: class NamedTuple(Sequence): @classmethod def __subclasshook__(cls, C): if cls is NamedTuple: if any("_fields" in B.__dict__ or # for namedtuple "n_fields" in B.__dict__ # for structseq for B in C.__mro__): return True return NotImplemented [1] I agree there is still a problem if we define an ABC here with no API and then add some later. Then classes that inherit from NamedTuple would break later when we add an API (just `_fields`?). Not sure how much that is a concern though. Then again we could just close out issue1820 and actually establish the API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 19:48:13 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Jun 2013 17:48:13 +0000 Subject: [issue1745722] please add wsgi to SimpleXMLRPCServer Message-ID: <1372182493.32.0.790876701856.issue1745722@psf.upfronthosting.co.za> R. David Murray added the comment: I've had a pep8-ification of this patch sitting on my disk for a while. Uploading it here so it doesn't get lost. It feels like there is a lot of redundancy now in the docs. But, it also seems to make sense to provide a wsgi version of this. So I'm inclined to commit it, but would appreciate second opinions. ---------- nosy: +r.david.murray Added file: http://bugs.python.org/file30701/wsgi_xml_rpc_pep8.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 20:09:02 2013 From: report at bugs.python.org (Eric Snow) Date: Tue, 25 Jun 2013 18:09:02 +0000 Subject: [issue1820] Enhance Object/structseq.c to match namedtuple and tuple api In-Reply-To: <1200284428.58.0.762384814897.issue1820@psf.upfronthosting.co.za> Message-ID: <1372183742.82.0.875860302969.issue1820@psf.upfronthosting.co.za> Eric Snow added the comment: Would we also want to implement _make(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 20:36:38 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 25 Jun 2013 18:36:38 +0000 Subject: [issue17883] Fix buildbot testing of Tkinter In-Reply-To: <1367355915.98.0.26398929673.issue17883@psf.upfronthosting.co.za> Message-ID: <1372185398.94.0.159181208086.issue17883@psf.upfronthosting.co.za> Jeremy Kloth added the comment: Although the solution for test_ttk_guionly of disabling the gui resource is a good quick fix, I'm curious as to why there isn't the same issue (test hangs) when run using 3.3 on the same machine. Note that by running as a service without desktop interaction several assumptions wrt permissions have been uncovered, so I'm quite hesitant to flip that switch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 20:58:43 2013 From: report at bugs.python.org (py.user) Date: Tue, 25 Jun 2013 18:58:43 +0000 Subject: [issue18301] In itertools.chain.from_iterable() there is no cls argument Message-ID: <1372186723.21.0.67533324157.issue18301@psf.upfronthosting.co.za> New submission from py.user: http://docs.python.org/2/library/itertools.html#itertools.chain.from_iterable >>> class A: ... @classmethod ... def from_iterable(iterables): ... for it in iterables: ... for element in it: ... yield element ... >>> A.from_iterable(['ABC', 'DEF']) Traceback (most recent call last): File "", line 1, in TypeError: from_iterable() takes 1 positional argument but 2 were given >>> ---------- assignee: docs at python components: Documentation files: issue.diff keywords: patch messages: 191874 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools.chain.from_iterable() there is no cls argument type: enhancement versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30702/issue.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 20:59:22 2013 From: report at bugs.python.org (py.user) Date: Tue, 25 Jun 2013 18:59:22 +0000 Subject: [issue18301] In itertools.chain.from_iterable() there is no cls argument In-Reply-To: <1372186723.21.0.67533324157.issue18301@psf.upfronthosting.co.za> Message-ID: <1372186762.59.0.370856530625.issue18301@psf.upfronthosting.co.za> py.user added the comment: http://docs.python.org/3/library/itertools.html#itertools.chain.from_iterable ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 21:06:45 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 19:06:45 +0000 Subject: [issue18302] test_multiprocessing: test.support.import_module() does not ignore the ImportError on SemLock Message-ID: <1372187205.63.0.099845572882.issue18302@psf.upfronthosting.co.za> New submission from STINNER Victor: test.support.import_module() catchs ModuleNotFoundError instead of ImportError since the following changeset: changeset: 84106:c4d7228421df user: Brett Cannon date: Wed Jun 12 20:12:30 2013 -0400 files: Lib/test/regrtest.py Lib/test/support.py Lib/test/test___all__.py Lib/xmlrpc/server.py Lib/zipfile.py description: Move test___all__ over to unittest.main() and use ModuleNotFoundError The problem is that multiprocessing.synchronize raises an ImportError if _multiprocess.SemLock does not exist: # Try to import the mp.synchronize module cleanly, if it fails # raise ImportError for platforms lacking a working sem_open implementation. # See issue 3770 try: from X_multiprocessing import SemLock except (ImportError): raise ImportError("This platform lacks a functioning sem_open" + " implementation, therefore, the required" + " synchronization primitives needed will not" + " function, see issue 3770.") As a result, test_multiprocessing is no more skipped on FreeBSD 6.4, but the following traceback is written: http://buildbot.python.org/all/builders/x86%20FreeBSD%206.4%203.x/builds/3771/steps/test/logs/stdio Re-running test 'test_multiprocessing' in verbose mode test test_multiprocessing crashed -- Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/multiprocessing/synchronize.py", line 27, in from _multiprocessing import SemLock ModuleNotFoundError: cannot import name SemLock During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/regrtest.py", line 1300, in runtest_inner the_module = importlib.import_module(abstest) File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/importlib/__init__.py", line 93, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1614, in _gcd_import File "", line 1595, in _find_and_load File "", line 1562, in _find_and_load_unlocked File "", line 609, in _check_name_wrapper File "", line 1058, in load_module File "", line 928, in load_module File "", line 274, in _call_with_frames_removed File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_multiprocessing.py", line 30, in test.support.import_module('multiprocessing.synchronize') File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/support.py", line 123, in import_module return importlib.import_module(name) File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/importlib/__init__.py", line 93, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1614, in _gcd_import File "", line 1595, in _find_and_load File "", line 1562, in _find_and_load_unlocked File "", line 609, in _check_name_wrapper File "", line 1058, in load_module File "", line 928, in load_module File "", line 274, in _call_with_frames_removed File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/multiprocessing/synchronize.py", line 32, in " function, see issue 3770.") ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770. ---------- messages: 191876 nosy: brett.cannon, haypo, sbt priority: normal severity: normal status: open title: test_multiprocessing: test.support.import_module() does not ignore the ImportError on SemLock versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 21:15:41 2013 From: report at bugs.python.org (Mark Shannon) Date: Tue, 25 Jun 2013 19:15:41 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372187741.43.0.999000805487.issue17206@psf.upfronthosting.co.za> Mark Shannon added the comment: I think blaming the crash in test_marshall http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/2009/steps/test/logs/stdio on the new macros (change aff41a6421c2) is correct. It may be the proximate cause, but that doesn't make it the underlying one. The interpreter should be more resilient against minor changes to the amount of C stack used per call. Can we get a full stack trace (for the C stack not the Python one) for the failure? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 21:25:13 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 25 Jun 2013 19:25:13 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <3bfy4n1vNgz7Ljs@mail.python.org> Roundup Robot added the comment: New changeset c31bec42e411 by Victor Stinner in branch 'default': Issue #17206: test.regrtest and test.script_helper enable faulthandler module http://hg.python.org/cpython/rev/c31bec42e411 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 21:44:47 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 25 Jun 2013 19:44:47 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372189487.71.0.983388604684.issue17206@psf.upfronthosting.co.za> Jeremy Kloth added the comment: I'm unsure as to how to get a stack trace from Visual Studio, but I can assure you that the changes introduced by the change aff41a6421c2 *is* the cause of the failure in test_marshal. In a nutshell, the overflow happens in a recursion on the marhsal.c:r_object() function for the test_marshal test of BugsTestCase.test_loads_recursion(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 21:54:49 2013 From: report at bugs.python.org (Roundup Robot) Date: Tue, 25 Jun 2013 19:54:49 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <3bfykw73WDzRqk@mail.python.org> Roundup Robot added the comment: New changeset 1a9367d5aabc by Victor Stinner in branch 'default': Issue #17206: Fix test_cmd_line and test_faulthandler for my previous change http://hg.python.org/cpython/rev/1a9367d5aabc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 21:58:58 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 19:58:58 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372190338.58.0.643213238633.issue17206@psf.upfronthosting.co.za> STINNER Victor added the comment: > Can we get a full stack trace (for the C stack not the Python one) for the failure? Yes, using a debugger on Windows x64. I'm waiting for a renewal of my MSDN account to get Visual Studio (full version, not the Express version limited to 32-bit). Until this, I enabled faulthandler in subprocesses created by test.regrtest and test.script_helper because it may help this issue, but also others future crashes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 22:08:54 2013 From: report at bugs.python.org (mpb) Date: Tue, 25 Jun 2013 20:08:54 +0000 Subject: [issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates In-Reply-To: <1372100693.76.0.99629035685.issue18293@psf.upfronthosting.co.za> Message-ID: <1372190934.91.0.343069920029.issue18293@psf.upfronthosting.co.za> mpb added the comment: Christian wrote: > sslsocket gives you access to the peer's cert and chain (with > #18233). Very interesting (and useful). I've mostly been working with Python 2.7, and I had not fully noticed that Python 3.2+ has a ssl.SSLContext class. > I'd rather not implement a full wrapper for X509_STORE_CTX and X509 > certs. It's way too much code, super complex and easily confuses even > experienced developers. Python's ssl module is limited to core > functionality by design and choice. > However I might be intrigue to implement support for > SSL_CTX_set_cert_verify_callback() or SSL_CTX_set_verify(). SSL_CTX_set_verify() seems (mostly) redundant SSLContext.verify_mode. Or am I missing something? > SSL_CTX_set_cert_verify_callback() has more potential, e.g. > > def cert_verify_callback(sslsocket, storectx, verify_ok): > context = sslsocket.context > > storectx is a minimal X509_STORE_CTX object and verify_ok the boolean > return value of X509_verify_cert(). Without a cert verify callback > OpenSSL just uses the return value of X509_verify_cert() > (ssl/ssl_cert.c:ssl_verify_cert_chain()). I believe support for SSL_CTX_set_cert_verify_callback() would allow customized certificate verification, which is what I am looking for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 22:12:08 2013 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Jun 2013 20:12:08 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372191128.29.0.753195079295.issue17206@psf.upfronthosting.co.za> STINNER Victor added the comment: "I enabled faulthandler in subprocesses created by test.regrtest and test.script_helper..." Oh, it doesn't help for this issue. On Windows, faulthandler is unable to dump the Python traceback on a stack overflow. On UNIX, it allocates a diffrent stack for its signal handler, and so the signal handler can run even on a stack overflow. The Windows exit code 0xC00000FD (3221225725) means "Stack overflow / exhaustion". [ 81/375] test_marshal Traceback (most recent call last): File "../lib/test/regrtest.py", line 1618, in main_in_temp_cwd() File "../lib/test/regrtest.py", line 1593, in main_in_temp_cwd main() File "../lib/test/regrtest.py", line 775, in main raise Exception("Child error on {}: {}".format(test, result[1])) Exception: Child error on test_marshal: Exit code 3221225725 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 22:35:31 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Jun 2013 20:35:31 +0000 Subject: [issue18301] In itertools.chain.from_iterable() there is no cls argument In-Reply-To: <1372186723.21.0.67533324157.issue18301@psf.upfronthosting.co.za> Message-ID: <1372192531.22.0.322141259374.issue18301@psf.upfronthosting.co.za> R. David Murray added the comment: It is implemented as a classmethod, but the "equivalent" code doesn't need to be part of the class all. I'm not sure what should be done here (say @staticmethod? Leave the decorator off?). We should probably see what Raymond thinks. I lean toward the latter, that's the way it is in the python2 docs, and it doesn't seem to have caused any confusion. ---------- nosy: +r.david.murray, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 23:07:19 2013 From: report at bugs.python.org (Zachary Ware) Date: Tue, 25 Jun 2013 21:07:19 +0000 Subject: [issue17883] Fix buildbot testing of Tkinter In-Reply-To: <1372185398.94.0.159181208086.issue17883@psf.upfronthosting.co.za> Message-ID: Zachary Ware added the comment: > Jeremy Kloth added the comment: > > Although the solution for test_ttk_guionly of disabling the gui resource is a good quick fix, I'm curious as to why there isn't the same issue (test hangs) when run using 3.3 on the same machine. As it turns out, 3.3(+)'s test.support has an _is_gui_available function that prevents the hang, added in issue9931. Ironically, it was not added to 2.7 because the 2.7 buildbots weren't showing symptoms...because the tests weren't actually being run. I'll work on trying to backport the patch that added _is_gui_available, but my experience with ctypes is practically nil, so if anyone can get to it before I can post a patch, don't hold off on my account. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 23:37:51 2013 From: report at bugs.python.org (Zachary Ware) Date: Tue, 25 Jun 2013 21:37:51 +0000 Subject: [issue17883] Fix buildbot testing of Tkinter In-Reply-To: <1367355915.98.0.26398929673.issue17883@psf.upfronthosting.co.za> Message-ID: <1372196271.48.0.826496429908.issue17883@psf.upfronthosting.co.za> Zachary Ware added the comment: It seems all it took to backport was a copy and paste. Here's the patch. ---------- Added file: http://bugs.python.org/file30703/issue17883-add_is_gui_available.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 25 23:43:54 2013 From: report at bugs.python.org (miscjunk) Date: Tue, 25 Jun 2013 21:43:54 +0000 Subject: [issue18303] json.dumps() claims numpy.bool_ is not serializable Message-ID: <1372196634.42.0.973833785971.issue18303@psf.upfronthosting.co.za> New submission from miscjunk: When json.dumps() is called on a numpy.bool_ object, it crashes. To recreate: import numpy as np import json a = np.array([1,2,3,4,5,6]) a = a < 5 json.dumps(a) #crash json.dumps(a[0]) #crash json.dumps(a.tolist()) #this works! Example of error output Traceback (most recent call last): File "", line 1, in File "..\python-3.3.2.amd64\lib\json\__init__.py", line 236, in dumps return _default_encoder.encode(obj) File "..\python-3.3.2.amd64\lib\json\encoder.py", line 191, in encode chunks = self.iterencode(o, _one_shot=True) File "..\python-3.3.2.amd64\lib\json\encoder.py", line 249, in iterencode return _iterencode(o, 0) File "..\python-3.3.2.amd64\lib\json\encoder.py", line 173, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: False is not JSON serializable ---------- components: Extension Modules, Library (Lib) messages: 191887 nosy: miscjunk priority: normal severity: normal status: open title: json.dumps() claims numpy.bool_ is not serializable type: crash versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 00:00:32 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 25 Jun 2013 22:00:32 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372197632.52.0.902454933651.issue17206@psf.upfronthosting.co.za> Jeremy Kloth added the comment: Here are some results after a detailed investigation: - in debug, each variable declaration in a block is allocated on the stack - in debug, r_object() uses 1416 bytes of stack - in release, r_object() uses 512 bytes of stack - default stack size is 1MB - stack for python_d.exe has been already up'ed to 2100000 So it seems that the best option would be to increase the stack size used when linking (/STACK:). I would suggest increasing it to 3MB using /STACK:3145728. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 00:11:04 2013 From: report at bugs.python.org (miscjunk) Date: Tue, 25 Jun 2013 22:11:04 +0000 Subject: [issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable In-Reply-To: <1372196634.42.0.973833785971.issue18303@psf.upfronthosting.co.za> Message-ID: <1372198264.59.0.446980060787.issue18303@psf.upfronthosting.co.za> miscjunk added the comment: numpy.ndarray is also not serializable by json.dumps() import numpy as np import json a = np.array([1,2,3,4]) json.dumps(a) #crash json.dumps(a[0]) #this works! ---------- title: json.dumps() claims numpy.bool_ is not serializable -> json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 00:55:07 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Tue, 25 Jun 2013 22:55:07 +0000 Subject: [issue18138] ssl.SSLContext.add_cert() In-Reply-To: <1370397033.84.0.295479011719.issue18138@psf.upfronthosting.co.za> Message-ID: <1372200907.4.0.456337100642.issue18138@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 01:02:32 2013 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Jun 2013 23:02:32 +0000 Subject: [issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable In-Reply-To: <1372196634.42.0.973833785971.issue18303@psf.upfronthosting.co.za> Message-ID: <1372201352.15.0.842862101184.issue18303@psf.upfronthosting.co.za> R. David Murray added the comment: I would (naively) not expect either of these to be serializable. They are not base data types, which is all the json module handles unless you add extra handlers yourself. 'crash' means interpreter crash (segfault), by the way. ---------- nosy: +r.david.murray type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 01:21:54 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 25 Jun 2013 23:21:54 +0000 Subject: [issue18159] ConfigParser getters not available on SectionProxy In-Reply-To: <1370627030.12.0.961792763365.issue18159@psf.upfronthosting.co.za> Message-ID: <1372202514.95.0.554098281936.issue18159@psf.upfronthosting.co.za> ?ukasz Langa added the comment: There are several reasons why `get*()` methods are redefined on the section proxy. First of all, explicit is better than implicit. Secondly, the order of arguments is different: `parser.get()` has the fallback argument as the last (and keyword-only), whereas `parser['section'].get()` behaves like a mapping. You can do `parser['section'].get('key', 'some-fallback-value')` and `parser['section'].get('no-such-key')` returns None instead of raising `NoOptionError`. This makes it difficult to automagically support parser `get*()` methods on the section proxy. This is why I decided to adapt a different mechanism: register a converter and a getter is automatically available: >>> cp = ConfigParser() >>> cp.converters['list'] = lambda value: value.strip().split() >>> cp.getlist('section', 'l') ['a', 'b', 'c'] >>> cp['section'].getlist('l') ['a', 'b', 'c'] >>> cp.getdict('section', 'd') Traceback (most recent call last): ... AttributeError: 'ConfigParser' object has no attribute 'getdict' >>> cp['section'].getdict('d') Traceback (most recent call last): ... AttributeError: 'ConfigParser' object has no attribute 'getdict' This ensures that you can easily add new converters in subclasses or single instances and that the parser-level API and section-level API work like they should. This also makes implementing custom getters easier since there's no logic involved besides the conversion. And if you happen to need custom logic anyway, you can register a converter that is a callable class. ---------- keywords: +patch stage: -> patch review type: behavior -> enhancement Added file: http://bugs.python.org/file30704/issue18159-3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 01:30:38 2013 From: report at bugs.python.org (miscjunk) Date: Tue, 25 Jun 2013 23:30:38 +0000 Subject: [issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable In-Reply-To: <1372196634.42.0.973833785971.issue18303@psf.upfronthosting.co.za> Message-ID: <1372203038.02.0.849849377383.issue18303@psf.upfronthosting.co.za> miscjunk added the comment: Thanks for the explanation. I suppose this should be posted to the numpy tracker then? Would it be possible for numpy to 'just work' with the json module? Or will the final resolution be to use a handler (the default= parameter in json.loads) ? Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 02:47:09 2013 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 26 Jun 2013 00:47:09 +0000 Subject: [issue16114] incorrect path in subprocess.Popen() FileNotFoundError message In-Reply-To: <1349237807.22.0.592724343556.issue16114@psf.upfronthosting.co.za> Message-ID: <1372207629.51.0.363709768502.issue16114@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I backported the fix to this in the subprocess32 3.2.5rc1 release I made a week or two ago. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 05:48:17 2013 From: report at bugs.python.org (Bryce Nesbitt) Date: Wed, 26 Jun 2013 03:48:17 +0000 Subject: [issue18304] ElementTree gets awkward to use if there is an xmlns Message-ID: <1372218497.28.0.26294900817.issue18304@psf.upfronthosting.co.za> New submission from Bryce Nesbitt: ElementTree offers a wonderful and easy API for parsing XML... but if there is a namespace involved it suddenly gets ugly. This is a proposal to fix that. First an example: ------------------ !/usr/bin/python # Demonstrate awkward behavior of namespaces in ElementTree import xml.etree.cElementTree as ET xml_sample_one = """\ """ root = ET.fromstring(xml_sample_one) for child in root.iter('thing'): print child.tag xml_sample_two = """\ """ root = ET.fromstring(xml_sample_two) for child in root.iter('{http://josm.openstreetmap.de/tagging-preset-1.0}thing'): print child.tag ------------------ Because of the namespace in the 2nd example, a {namespace} name keeps {namespace} getting {namespace} in {namespace} {namespace} the way. Online there are dozens of question on how to deal with this, for example: http://stackoverflow.com/questions/11226247/python-ignore-xmlns-in-elementtree-elementtree With wonderfully syntactic solutions like 'item.tag.split("}")[1][0:]' ----- How about if I could set any root to have an array of namespaces to suppress: root = ET.fromstring(xml_sample_two) root.xmlns_at_root.append('{namespace}') Or even just a boolean that says I'll take all my namespaces without qualification? ---------- components: Extension Modules messages: 191894 nosy: brycenesbitt priority: normal severity: normal status: open title: ElementTree gets awkward to use if there is an xmlns type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 07:54:44 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 Jun 2013 05:54:44 +0000 Subject: [issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable In-Reply-To: <1372196634.42.0.973833785971.issue18303@psf.upfronthosting.co.za> Message-ID: <1372226084.18.0.184881536219.issue18303@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 08:09:58 2013 From: report at bugs.python.org (Ethan Furman) Date: Wed, 26 Jun 2013 06:09:58 +0000 Subject: [issue18303] json.dumps() claims numpy.ndarray and numpy.bool_ are not serializable In-Reply-To: <1372196634.42.0.973833785971.issue18303@psf.upfronthosting.co.za> Message-ID: <1372226998.35.0.570802795479.issue18303@psf.upfronthosting.co.za> Ethan Furman added the comment: For the curious, here are all the tracebacks: --> json.dumps(a) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.3/json/__init__.py", line 236, in dumps return _default_encoder.encode(obj) File "/usr/lib/python3.3/json/encoder.py", line 191, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python3.3/json/encoder.py", line 249, in iterencode return _iterencode(o, 0) File "/usr/lib/python3.3/json/encoder.py", line 173, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: array([ True, True, True, True, False, False], dtype=bool) is not JSON serializable --> json.dumps(a[0]) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.3/json/__init__.py", line 236, in dumps return _default_encoder.encode(obj) File "/usr/lib/python3.3/json/encoder.py", line 191, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python3.3/json/encoder.py", line 249, in iterencode return _iterencode(o, 0) File "/usr/lib/python3.3/json/encoder.py", line 173, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: True is not JSON serializable While the repr says 'True', the type is . and the success: --> json.dumps(a.tolist()) #this works! '[true, true, true, true, false, false]' Summary ======= No bug here, defined behavior. Raising the issue with NumPy won't help as this is not a bug... although perhaps they have a json handler already written somewhere? At any rate, yes, said handler would have to be specified as the 'default' parameter. ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 08:33:59 2013 From: report at bugs.python.org (Sergey) Date: Wed, 26 Jun 2013 06:33:59 +0000 Subject: [issue18305] [patch] Fast sum() for non-numbers Message-ID: <1372228439.5.0.789865081817.issue18305@psf.upfronthosting.co.za> New submission from Sergey: Problem ======= Code: sum([[1,2,3]]*1000000, []) takes forever to complete. Suggestion ========== Patch sum() function so that it did not created 1000000 copies of result, but created just one. Attached patch does that. Before patch: $ ./python -mtimeit --setup="x=[[1,2,3]]*10000" "sum(x,[])" 10 loops, best of 3: 915 msec per loop After patch: $ ./python -mtimeit --setup="x=[[1,2,3]]*10000" "sum(x,[])" 1000 loops, best of 3: 469 usec per loop 200000% boost! :) Details ======= Built-in sum function could look like this: def sum(seq, start = 0): for item in seq: start += item return start But that would be bad, becaust in cases like: empty = [] result = sum(list_of_lists, empty) content of "empty" would be modified. So instead it looks like this: def sum(seq, start = 0): for item in seq: start = start + item return start it creates a copy of the entire partial result on EVERY "start + item". While instead it could look like this: def sum(seq, start = 0): start = start + seq[0:1] for item in seq[1:]: start += item return start create just ONE copy, and use it. That's what attached patch is doing. An alternative is something like this: def sum(seq, start = 0): start = copy.copy(start) for item in seq: start += item return start But I'm not sure how to make a copy of arbitrary object yet. ---------- components: Interpreter Core files: fastsum.patch keywords: patch messages: 191896 nosy: Sergey priority: normal severity: normal status: open title: [patch] Fast sum() for non-numbers type: performance versions: Python 2.7 Added file: http://bugs.python.org/file30705/fastsum.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 09:25:59 2013 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 26 Jun 2013 07:25:59 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372231559.13.0.811580663574.issue18298@psf.upfronthosting.co.za> anatoly techtonik added the comment: I am not using pythonw.exe, it is the option users prefer to run the program. pythonw.exe is a binary, how do you propose to patch that? Or is it translated to .exe with RPython? Can you be more specific what shell does not work correctly, what exactly does not work correctly, and what is the backward-incompatible behaviour that you want to avoid? pythonw.exe is meant to suppresses the terminal window on startup (console window to be exact), but not to kill vital streams for an application. I posted links Spyder IDE source to show how it should be done. ---------- resolution: wont fix -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 09:46:33 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Wed, 26 Jun 2013 07:46:33 +0000 Subject: [issue18298] pythonw.exe fails with redirected stderr In-Reply-To: <1372151386.07.0.939463937551.issue18298@psf.upfronthosting.co.za> Message-ID: <1372232793.39.0.780986803436.issue18298@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: RPython... let's be serious. The code of pythonw.exe is very simple, see PC/WinMain.c. No, pythonw.exe is not "meant to suppresses the terminal window on startup". This is only a consequence of being a "windows application". There is a lot of documentation about this, for example: http://comsci.liu.edu/~murali/win32gui/Win32Apps.htm - python.exe is a regular console application, with a main() function. - pythonw.exe is a gui application, with a WinMain() function; as a consequence, stdout/stderr won't work properly. Again, it's a won't fix for 2.7, unless someone comes with a patch. But this has already been tried, and be careful, different versions of the msvcrt differ in behavior here. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 10:45:00 2013 From: report at bugs.python.org (John Jefferies) Date: Wed, 26 Jun 2013 08:45:00 +0000 Subject: [issue18306] os.stat gives exception for Windows junctions in v3.3 Message-ID: <1372236300.43.0.559187613539.issue18306@psf.upfronthosting.co.za> New submission from John Jefferies: If os.stat is executed on a Windows junction with Python 3.3 I see an exception: ------------ >>> import os >>> os.stat('C:\Windows\System32\config\systemprofile\SendTo') Traceback (most recent call last): File "", line 1, in FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Windows\\System32\\config\\systemprofile\\SendTo' ------------ whereas with Python 3.2 it works without error: ------------ >>> import os >>> os.stat('C:\Windows\System32\config\systemprofile\SendTo') nt.stat_result(st_mode=16895, st_ino=281474977136630, st_dev=0, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1295885671, st_mtime=1295885671, st_ctime=1295885671) ------------ FTR. Some background: It's a pity that Python doesn't just treat Windows junctions as a normal soft link. But given that islink() returns False for a junction, I was able to work around that in Python 3.2 like this: ------------ if os.path.islink(fullname) or \ os.stat(fullname)[stat.ST_INO] != os.lstat(fullname)[stat.ST_INO]: # If it's not a link, it's probably a junction... ------------ Many thanks for looking. John ---------- components: Library (Lib) messages: 191899 nosy: John.Jefferies priority: normal severity: normal status: open title: os.stat gives exception for Windows junctions in v3.3 type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 11:17:22 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Wed, 26 Jun 2013 09:17:22 +0000 Subject: [issue18295] Possible integer overflow in PyCode_New() In-Reply-To: <1372108745.44.0.114375127897.issue18295@psf.upfronthosting.co.za> Message-ID: <1372238242.51.0.291402614903.issue18295@psf.upfronthosting.co.za> Martin v. L?wis added the comment: I don't think they are actually the *same* issue. For the limitations wrt. code objects (maximum size of byte code, maximum number of local variables, maximum number of parameters, etc.), I recommend the following thorough procedure: 1. document in a single text file all the limitations 2. check for each one whether an int is sufficient to represent them at runtime. 3. if yes: leave all structure definitions as-is. Local variables might be changed to size_t where this simplifies the code. Otherwise, Py_SAFE_DOWNCAST should be used where the actual value ought to be valid already. Runtime errors where a value may come from the outside that might be out of range. 4. if not: widen the structures to Py_ssize_t. ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 12:34:56 2013 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 26 Jun 2013 10:34:56 +0000 Subject: [issue706263] print in pythonw raises silent exception when no console available Message-ID: <1372242896.97.0.570961130475.issue706263@psf.upfronthosting.co.za> anatoly techtonik added the comment: This is still an issue for Python 2 users. Most important that pythonw.exe has a magic ability to fail silently leaving users with no means to create valid bug reports (the reason why StackOverflow questions are downvoted and erased). http://bugs.ascend4.org/print_bug_page.php?bug_id=471 stream https://code.google.com/p/spyderlib/issues/detail?id=1260 The argument in msg15198 is somewhat misleading. If pythonw.exe fails because of print statement or because other issue, there is no way to report that. Anyway, this reminds me very much of mod_wsgi, with only problem that Python developers don't receive as much feedback as Graham to make the change: http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output.html ---------- nosy: +techtonik title: print raises exception when no console available -> print in pythonw raises silent exception when no console available _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 12:36:36 2013 From: report at bugs.python.org (anatoly techtonik) Date: Wed, 26 Jun 2013 10:36:36 +0000 Subject: [issue5845] rlcompleter should be enabled automatically In-Reply-To: <1240702039.68.0.55843541961.issue5845@psf.upfronthosting.co.za> Message-ID: <1372242996.27.0.245096673158.issue5845@psf.upfronthosting.co.za> Changes by anatoly techtonik : ---------- nosy: +techtonik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 13:11:41 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jun 2013 11:11:41 +0000 Subject: [issue706263] print in pythonw raises silent exception when no console available Message-ID: <1372245101.11.0.51364068262.issue706263@psf.upfronthosting.co.za> Christian Heimes added the comment: I recommend against changing the code so late in the Python 2.7 release cycle. A change in behavior is too confusing. And it's not a bug but a design decision, too. Over five years ago I implement parts of the IO interaction with the operating system for Python 3.0. I deliberately did NOT port modifications to 2.6. If you want to get Python 3.x style print() behavior in Python 2.7 you can have it already: from __future__ import print_function import sys if sys.executable.endswith("pythonw.exe"): sys.stdout = sys.stdout = None print("can handle sys.stdout = None just fine.") ---------- nosy: +christian.heimes resolution: -> wont fix stage: -> committed/rejected status: open -> pending type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 13:29:37 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jun 2013 11:29:37 +0000 Subject: [issue18306] os.stat gives exception for Windows junctions in v3.3 In-Reply-To: <1372236300.43.0.559187613539.issue18306@psf.upfronthosting.co.za> Message-ID: <1372246177.22.0.380176540696.issue18306@psf.upfronthosting.co.za> Christian Heimes added the comment: Let's have a look ---------- assignee: -> christian.heimes keywords: +3.3regression nosy: +christian.heimes stage: -> test needed versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 14:23:27 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Wed, 26 Jun 2013 12:23:27 +0000 Subject: [issue18305] [patch] Fast sum() for non-numbers In-Reply-To: <1372228439.5.0.789865081817.issue18305@psf.upfronthosting.co.za> Message-ID: <1372249407.52.0.376554411831.issue18305@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 14:38:29 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jun 2013 12:38:29 +0000 Subject: [issue18306] os.stat gives exception for Windows junctions in v3.3 In-Reply-To: <1372236300.43.0.559187613539.issue18306@psf.upfronthosting.co.za> Message-ID: <1372250309.24.0.836415048333.issue18306@psf.upfronthosting.co.za> Christian Heimes added the comment: On my Windows box (Win 7) I'm getting an error with Python 3.2 and 3.3. It looks like I'm not allowed to enter the parent directory (Zugriff verweigert == Permission Denied): >>> os.stat(r'C:\Windows\System32\config') Traceback (most recent call last): File "", line 1, in WindowsError: [Error 5] Zugriff verweigert: 'C:\\Windows\\System32\\config' In order to reproduce your problem anyway I have created a directory, a junction point and a symlink (as admin): > mkdir testdir > mklink /j testjunktion testdir > mklink /d testlinkk testdir Neither os.stat() nor os.lstat() have failed with an exception. There must be something different going on on your system. By the way junction points are soft links but not symbolic links. They are implemented as a different kind of NTFS reparsing points. Python should not treat a junction point as a link but have yet another check for it. >>> os.lstat(r'c:\users\heimes\testdir') nt.stat_result(st_mode=16895, st_ino=58265320179130300, st_dev=3366304641, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1372247959, st_mtime=1372247959, st_ctime=1372247959) >>> os.lstat(r'c:\users\heimes\testjunction') nt.stat_result(st_mode=16895, st_ino=4785074604141776, st_dev=3366304641, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1372247983, st_mtime=1372247983, st_ctime=1372247983) >>> os.lstat(r'c:\users\heimes\testlink') nt.stat_result(st_mode=41471, st_ino=12384898975270541, st_dev=3366304641, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1372249830, st_mtime=1372249830, st_ctime=1372249830) PS: You should use raw strings on Windows or escape the backslashes. ---------- assignee: christian.heimes -> nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 14:55:11 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jun 2013 12:55:11 +0000 Subject: [issue18306] os.stat gives exception for Windows junctions in v3.3 In-Reply-To: <1372236300.43.0.559187613539.issue18306@psf.upfronthosting.co.za> Message-ID: <1372251311.48.0.760450229919.issue18306@psf.upfronthosting.co.za> Christian Heimes added the comment: There is much confusing about junction point on the internet. Some sites like Wikipedia claim that a junction point is a kind of soft link. Other sites refer to junction points as "directory hard links". IMO "directory hard links" is wrong. Contrary to file hard links a junction point doesn't keep the target directory alive when the target is removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 16:06:18 2013 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Wed, 26 Jun 2013 14:06:18 +0000 Subject: [issue18289] python.org Interactive interpreter linked with libedit can segfault on future OS X In-Reply-To: <1372046917.43.0.988841016926.issue18289@psf.upfronthosting.co.za> Message-ID: <1372255578.68.0.516491367953.issue18289@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 16:13:45 2013 From: report at bugs.python.org (John Jefferies) Date: Wed, 26 Jun 2013 14:13:45 +0000 Subject: [issue18306] os.stat gives exception for Windows junctions in v3.3 In-Reply-To: <1372250309.24.0.836415048333.issue18306@psf.upfronthosting.co.za> Message-ID: <51CAF718.9060702@ntlworld.com> John Jefferies added the comment: On 26/06/2013 13:38, Christian Heimes wrote: > Christian Heimes added the comment: > > On my Windows box (Win 7) I'm getting an error with Python 3.2 and 3.3. It looks like I'm not allowed to enter the parent directory (Zugriff verweigert == Permission Denied): Ah. You need to be an administrator to look at the system directories? [I'm also on Win7]. > Neither os.stat() nor os.lstat() have failed with an exception. There > must be something different going on on your system. I didn't look closely enough; only the junctions in system folders are failing for me with an exception. The junctions in my user directory are not. I do hope I haven't wasted too much of your time in not describing the problem correctly. > By the way junction points are soft links but not symbolic links. They > are implemented as a different kind of NTFS reparsing points. Python > should not treat a junction point as a link but have yet another check > for it. I realise there are differences between junctions and symlinks at the ntfs level, but the only things that seem relevant to the application are that junctions are limited to directories on a local volume. So I consider junctions to be a subset of symlinks. Regardless, any reliable indication that a directory is a junction would be useful, and the hack I've been using thus far appeared to work for all the junctions on my system. > PS: You should use raw strings on Windows or escape the backslashes. Yes, I'm ashamed, I did know that but missed it from the example. Many thanks. John ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 16:27:09 2013 From: report at bugs.python.org (Vitaly Murashev) Date: Wed, 26 Jun 2013 14:27:09 +0000 Subject: [issue18307] Relative path in co_filename for zipped modules Message-ID: <1372256829.94.0.0966099631525.issue18307@psf.upfronthosting.co.za> New submission from Vitaly Murashev: Recently I found out that it not possible to debug python code if it is a part of zip-module. Python version being used is 3.3.0 Well known GUI debuggers like Eclipse+PyDev or PyCharm are unable to start debugging and give the following warning: --- pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute) pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints. --- So I started my own investigation of this issue and results are the following. At first I took traditional python debugger 'pdb' to analyze how it behaves during debug of zipped module. 'pdb' showed me some backtaces and filename part for stack entries looks malformed. I expected something like 'full-path-to-zip-dir/my_zipped_module.zip/subdir/test_module.py' but realy it looks like 'full-path-to-current-dir/subdir/test_module.py' Source code in pdb.py and bdb.py (which one are a part of python stdlib) gave me the answer why it happens. The root cause are inside Bdb.format_stack_entry() + Bdb.canonic() Please take a look at the following line inside 'format_stack_entry' method: filename = self.canonic(frame.f_code.co_filename) For zipped module variable 'frame.f_code.co_filename' holds _relative_ file path started from the root of zip archive like 'subdir/test_module.py' And as relult Bdb.canonic() method gives what we have - 'full-path-to-current-dir/subdir/test_module.py' --- Looks like it is a bug in: - in python core subsystem which one is responsible for loading zipped modules - or in pdb debugger ---------- components: Interpreter Core, Library (Lib) messages: 191907 nosy: vmurashev priority: normal severity: normal status: open title: Relative path in co_filename for zipped modules type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 17:37:10 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 26 Jun 2013 15:37:10 +0000 Subject: [issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures) Message-ID: <1372261030.27.0.471709034157.issue18308@psf.upfronthosting.co.za> New submission from David Edelsohn: The recvmsg tests in test_socket.py check that the address returned by recvmsg matches the original address to which the socket was bound. For IPv6, sockaddr includes sin6_scope_id, in addition to the address and port. The test connects to host "::1", which is loopback, but is an under-specified address because the link scope is left ambiguous. The scope_id in the original bind call defaults to "0", which represents an ambiguous scoped address and allows the IPV6 protocol and implementation to choose the interface or site identifier. The recvmsg call returns the actual scope_id. The test incorrectly checks that the full sockaddr matches. sin6_scope_id may not match for IPv6 addresses. This generates bogus failures on AIX. (Microsoft has a good description about scope_id: http://msdn.microsoft.com/en-us/library/windows/desktop/ms739166%28v=vs.85%29.aspx) ---------- components: Tests messages: 191908 nosy: David.Edelsohn priority: normal severity: normal status: open title: checkRecvmsgAddress wrong in test_socket.py (AIX failures) type: behavior versions: Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 18:00:50 2013 From: report at bugs.python.org (=?utf-8?q?Mathias_Fr=C3=B6hlich?=) Date: Wed, 26 Jun 2013 16:00:50 +0000 Subject: [issue18309] Make python slightly more relocatable Message-ID: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> New submission from Mathias Fr?hlich: Hi all, I want to move python a bit closer to be relocatable. One problem to solve is where python finds its modules. The usual lookup mechanism is to compile in a configure time determined prefix that is used as a last resort path if the paths are not set otherwise during application/interpreter startup. The most commonly known way to change the module path at startup time are probably the environment variables PYTHONPATH and PYTHONHOME. The python interpreter itself already tries to interpret argv[0] to get to this point, but it would be nice if an application embedded interpreter also finds its module path without providing this argv[0] directly to the python library. This should even work if being moved or being installed at a different path than the configure time prefix path. The proposal is to add an additional attempt to find the python modules just before we resort to the compiled in prefix by looking at the path to the python27.{so,dll}. Relative to this shared object python library file the python modules are searched in the usual way. If there are no python modules found relative to the python library file, the very last resort compiled in prefix is used as usual. For architectures where we cannot determine the path of the shared library file, nothing changes. I have attached a patch that tries to implement this. It should serve as a base for discussions. This change is tested on linux and behaves like expected. The windows code for this is copied over from an other project where I have this actively running. But this python code variant is not even compile tested on windows. thanks in advance Mathias ---------- components: Installation files: python-relative-path-lookup.diff keywords: patch messages: 191909 nosy: mathias priority: normal severity: normal status: open title: Make python slightly more relocatable versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file30706/python-relative-path-lookup.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 18:06:34 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 26 Jun 2013 16:06:34 +0000 Subject: [issue11454] email.message import time In-Reply-To: <1299701237.24.0.992920521308.issue11454@psf.upfronthosting.co.za> Message-ID: <3bgTd553bnzRSf@mail.python.org> Roundup Robot added the comment: New changeset 520490c4c388 by R David Murray in branch 'default': #11454: Reduce email module load time, improve surrogate check efficiency. http://hg.python.org/cpython/rev/520490c4c388 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 18:09:07 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 26 Jun 2013 16:09:07 +0000 Subject: [issue11454] email.message import time In-Reply-To: <1299701237.24.0.992920521308.issue11454@psf.upfronthosting.co.za> Message-ID: <1372262947.23.0.731460368475.issue11454@psf.upfronthosting.co.za> R. David Murray added the comment: I've checked in the encode version of the method. I'm going to pass on doing the other inlines, given that the improvement isn't that large. I will, however, keep the issue in mind as I make other changes to the code, and there will be a general performance review phase when I get done with the API additions/bug fixing in the email6 project. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 19:38:21 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jun 2013 17:38:21 +0000 Subject: [issue18307] Relative path in co_filename for zipped modules In-Reply-To: <1372256829.94.0.0966099631525.issue18307@psf.upfronthosting.co.za> Message-ID: <1372268301.59.0.735420806514.issue18307@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +brett.cannon, christian.heimes stage: -> test needed versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 20:08:11 2013 From: report at bugs.python.org (py.user) Date: Wed, 26 Jun 2013 18:08:11 +0000 Subject: [issue18310] itertools.tee() can't accept keyword arguments Message-ID: <1372270091.7.0.0269629805126.issue18310@psf.upfronthosting.co.za> New submission from py.user: >>> import itertools >>> itertools.tee('x', n=2) Traceback (most recent call last): File "", line 1, in TypeError: tee() takes no keyword arguments >>> ---------- components: Library (Lib) messages: 191912 nosy: py.user priority: normal severity: normal status: open title: itertools.tee() can't accept keyword arguments type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 20:47:27 2013 From: report at bugs.python.org (mp) Date: Wed, 26 Jun 2013 18:47:27 +0000 Subject: [issue18311] Typo in SSL documentation Message-ID: <1372272447.34.0.872105507579.issue18311@psf.upfronthosting.co.za> New submission from mp: Under http://docs.python.org/3.4/library/ssl.html#ssl.SSLContext.set_npn_protocols "avertise" should be "advertise". This is in documentation for both 3.4 and 3.3 ---------- assignee: docs at python components: Documentation messages: 191913 nosy: docs at python, pfista priority: normal severity: normal status: open title: Typo in SSL documentation versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 20:50:48 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 26 Jun 2013 18:50:48 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning In-Reply-To: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> Message-ID: <1372272648.58.0.00494806547605.issue18242@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- assignee: -> terry.reedy versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 21:11:54 2013 From: report at bugs.python.org (Roundup Robot) Date: Wed, 26 Jun 2013 19:11:54 +0000 Subject: [issue18311] Typo in SSL documentation In-Reply-To: <1372272447.34.0.872105507579.issue18311@psf.upfronthosting.co.za> Message-ID: <3bgYkx2hngz7LjZ@mail.python.org> Roundup Robot added the comment: New changeset d7ae8a84f443 by R David Murray in branch '3.3': #18311: fix typo. http://hg.python.org/cpython/rev/d7ae8a84f443 New changeset 16fe29689f3f by R David Murray in branch 'default': Merge #18311: fix typo. http://hg.python.org/cpython/rev/16fe29689f3f ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 21:12:26 2013 From: report at bugs.python.org (R. David Murray) Date: Wed, 26 Jun 2013 19:12:26 +0000 Subject: [issue18311] Typo in SSL documentation In-Reply-To: <1372272447.34.0.872105507579.issue18311@psf.upfronthosting.co.za> Message-ID: <1372273946.33.0.244517635989.issue18311@psf.upfronthosting.co.za> R. David Murray added the comment: Fixed, thanks. ---------- nosy: +r.david.murray resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 21:26:35 2013 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Jun 2013 19:26:35 +0000 Subject: [issue18310] itertools.tee() can't accept keyword arguments In-Reply-To: <1372270091.7.0.0269629805126.issue18310@psf.upfronthosting.co.za> Message-ID: <1372274795.93.0.794063771942.issue18310@psf.upfronthosting.co.za> Christian Heimes added the comment: A bunch builtin types and functions don't accept keyword args. kwargs make code slightly more complexity and a tiny bit slower. ---------- assignee: -> rhettinger nosy: +christian.heimes, rhettinger priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 21:37:24 2013 From: report at bugs.python.org (TonyP) Date: Wed, 26 Jun 2013 19:37:24 +0000 Subject: [issue7936] sys.argv contains only scriptname In-Reply-To: <1266260840.45.0.891652447218.issue7936@psf.upfronthosting.co.za> Message-ID: <1372275444.22.0.509427085441.issue7936@psf.upfronthosting.co.za> TonyP added the comment: I have v2.7, v3.2, and v3.3 installed on a Win7 64-bit machine and the exact same setup on a Win7 32-bit machine. The 32-bit works OK. The 64-bit machine had this argv problem, too! (I tried installing either Win32/Win64 version, no difference!) Adding %* fixed the argv problem, but I noticed there was one more. The wrong version was called. To sum it up, I had to change only the key HKEY_CLASSES_ROOT/py_auto_file/shell/open/command from: c:\Python32\Python32.exe "%1" %* to: c:\Python33\Python33.exe "%1" %* or to: c:\windows\py.exe "%1" %* (for auto-detection, both worked) ---------- nosy: +tonypdmtr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 21:52:47 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 26 Jun 2013 19:52:47 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1372276367.89.0.714578159276.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I should have changed the Versions sooner, as soon as it became obvious that this was not just a 3.4 issue. The 'temporary' 3.4-only patch breaks forward merging of a better patch. I will back it out just before I commit a 3.3 patch to both eliminate the .formatwarning replacement (#18242) and move the .showwarning replacement (part of Victor's patch). If we ever add tests of PyShell.main and run.main (which we should), the problem of this issue will recur unless we make *sure* that the monkey patch moved inside those functions is reverted. Will try: finally: do that? I will leave this for a second patch. ---------- assignee: -> terry.reedy versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 22:36:39 2013 From: report at bugs.python.org (paul j3) Date: Wed, 26 Jun 2013 20:36:39 +0000 Subject: [issue9625] argparse: Problem with defaults for variable nargs when using choices In-Reply-To: <1282036744.37.0.964764969496.issue9625@psf.upfronthosting.co.za> Message-ID: <1372278999.49.0.35934917561.issue9625@psf.upfronthosting.co.za> Changes by paul j3 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 23:07:46 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jun 2013 21:07:46 +0000 Subject: [issue18306] os.stat gives exception for Windows junctions in v3.3 In-Reply-To: <1372236300.43.0.559187613539.issue18306@psf.upfronthosting.co.za> Message-ID: <1372280866.24.0.203290592999.issue18306@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- components: +Windows nosy: +haypo, tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 23:08:34 2013 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Jun 2013 21:08:34 +0000 Subject: [issue18305] [patch] Fast sum() for non-numbers In-Reply-To: <1372228439.5.0.789865081817.issue18305@psf.upfronthosting.co.za> Message-ID: <1372280914.29.0.126899402553.issue18305@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 26 23:46:11 2013 From: report at bugs.python.org (Jeremy Kloth) Date: Wed, 26 Jun 2013 21:46:11 +0000 Subject: [issue17206] Py_XDECREF() expands its argument multiple times In-Reply-To: <1360858057.09.0.617835061471.issue17206@psf.upfronthosting.co.za> Message-ID: <1372283171.46.0.494021984463.issue17206@psf.upfronthosting.co.za> Jeremy Kloth added the comment: Here is some additional analysis of recursive functions in the 'pythoncore' MSVC project: Ratio Release Debug Filename:Function Name Stack Stack ----------------------------------------------- 1.000 32 32 _sre.asm:_validate_inner 1.159 352 408 ast.asm:set_context 1.167 48 56 compile.asm:stackdepth_walk 1.188 128 152 memoryobject.asm:copy_rec 1.250 160 200 ast.asm:num_stmts 1.308 104 136 firstsets.asm:calcfirstset 1.312 128 168 posixmodule.asm:win32_xstat_impl_w 1.400 40 56 node.asm:freechildren 1.667 72 120 memoryobject.asm:tolist_rec 1.750 32 56 listnode.asm:list1node 1.750 32 56 parsermodule.asm:parser_compare_nodes 1.750 32 56 parsermodule.asm:validate_factor 1.750 32 56 parsermodule.asm:validate_not_test 1.750 32 56 rotatingtree.asm:RotatingTree_Enum 1.750 32 56 typeobject.asm:solid_base 1.786 112 200 bytearrayobject.asm:bytearray_setslice 1.900 80 152 compile.asm:compiler_comprehension_generator 2.143 56 120 pythonrun.asm:print_exception_recursive 2.167 48 104 arraymodule.asm:array_ass_slice 2.250 32 72 ast.asm:validate_slice 2.250 32 72 getargs.asm:skipitem 2.250 32 72 node.asm:sizeofchildren 2.250 32 72 parsermodule.asm:validate_test 2.250 32 72 setobject.asm:set_issuperset 2.278 144 328 listobject.asm:list_ass_slice 2.417 96 232 arraymodule.asm:array_ass_subscr 2.429 56 136 longobject.asm:PyLong_AsLongLong 2.429 56 136 parsermodule.asm:node2tuple 2.429 56 136 typeobject.asm:mro_subclasses 2.500 80 200 bytearrayobject.asm:bytearray_ass_subscript 2.600 40 104 errors.asm:PyErr_GivenExceptionMatches 2.750 32 88 import.asm:update_code_filenames 2.750 32 88 setobject.asm:set_richcompare 2.750 32 88 symtable.asm:symtable_visit_slice 2.750 32 88 typeobject.asm:PyType_Modified 2.766 512 1416 marshal.asm:r_object 3.125 64 200 longobject.asm:long_rshift 3.250 32 104 compile.asm:compiler_with 3.250 32 104 setobject.asm:set_issubset 3.250 32 104 typeobject.asm:assign_version_tag 3.750 32 120 abstract.asm:abstract_issubclass 3.750 32 120 typeobject.asm:PyType_Ready 3.833 48 184 ast.asm:ast_for_expr 4.250 32 136 compile.asm:compiler_visit_expr 4.250 32 136 mathmodule.asm:factorial_partial_product 4.500 80 360 genobject.asm:gen_throw 4.692 312 1464 symtable.asm:symtable_visit_stmt 5.250 32 168 _collectionsmodule.asm:deque_extend 5.250 32 168 _collectionsmodule.asm:deque_extendleft 5.250 32 168 ast.asm:alias_for_import_name 5.750 32 184 typeobject.asm:merge_class_dict 6.250 32 200 abstract.asm:PyObject_IsInstance 6.250 32 200 abstract.asm:PyObject_IsSubclass 6.250 32 200 ast.asm:validate_expr 6.500 48 312 Python-ast.asm:obj2ast_slice 7.182 88 632 parsermodule.asm:build_node_children 7.250 32 232 errors.asm:PyErr_NormalizeException 9.167 48 440 symtable.asm:symtable_visit_expr 10.250 32 328 _json.asm:encoder_listencode_obj 10.344 256 2648 Python-ast.asm:obj2ast_expr 15.955 176 2808 Python-ast.asm:obj2ast_stmt 31.750 32 1016 Python-ast.asm:ast2obj_expr ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 00:18:44 2013 From: report at bugs.python.org (David Edelsohn) Date: Wed, 26 Jun 2013 22:18:44 +0000 Subject: [issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures) In-Reply-To: <1372261030.27.0.471709034157.issue18308@psf.upfronthosting.co.za> Message-ID: <1372285124.04.0.171759538272.issue18308@psf.upfronthosting.co.za> David Edelsohn added the comment: The current arguments to checkRecvmsgAddress() are the sockaddrs, so it does not know the protocol family. One potential patch to infer the family and apply the correct test is: diff -r 035d8fed07ad Lib/test/test_socket.py --- a/Lib/test/test_socket.py Tue Jun 25 22:54:35 2013 +0200 +++ b/Lib/test/test_socket.py Wed Jun 26 15:16:31 2013 -0700 @@ -1809,7 +1809,10 @@ def checkRecvmsgAddress(self, addr1, addr2): # Called to compare the received address with the address of # the peer. - self.assertEqual(addr1, addr2) + if len(addr1) > 3 or len(addr2) > 3: + self.assertEqual(addr1[:-1], addr2[:-1]) + else: + self.assertEqual(addr1, addr2) # Flags that are normally unset in msg_flags msg_flags_common_unset = 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 00:43:28 2013 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 26 Jun 2013 22:43:28 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1372286608.72.0.0116535598461.issue18244@psf.upfronthosting.co.za> Guido van Rossum added the comment: Wow. This is heady stuff. I can't say I totally get every detail, so I'll just pick on some things you wrote. In particular, I'm not sure I agree that there should be a conflict when there are two applicable base classes with a different dispatch if one of them is explicit in the MRO and the other isn't. After all, it both were explicit in the MRO the first one there would be picked, right? And virtual base classes are considered to appear after explicit base classes, right? (Or not?) I do think the new approach is better (the extra code doesn't bother me), and I may be convinced yet that you made the right choice in the above case. I have some trivial review comments on your patch to, will send those via Rietveld. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 00:50:03 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Wed, 26 Jun 2013 22:50:03 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372287003.18.0.733033466619.issue16487@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Here is an updated patch. We now support file-like objects. New helper functions try to turn file arguments into either Py_buffer objects containing the read data, or PyBytesObject argument with the file system encoding of the path. A file-like object is recognized by the successful execution of a read() method call. docs and tests updated. ---------- Added file: http://bugs.python.org/file30707/ssl.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 02:48:02 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 00:48:02 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372294082.65.0.0208382829343.issue16487@psf.upfronthosting.co.za> Christian Heimes added the comment: Thx Kristj?n! My patch maps PyUnicode to PEM encoded cert data and objects with Py_Buffer support to DER encoded cert data. Perhaps you like to you the same concept in your patch to support TextIO and BytesIO read() methods. Feel free to reuse as much of my patch as you like. You don't check ERR_GET_LIB() in some places. Could you please add a comment about extra_chain_cert in PySSL_CTX_use_certificate_chain_mem() and SSL_CTX_get_cert_store() in PySSL_CTX_load_verify_certs_mem()? The difference between the extra chain and the trusted store got me confused more than once. As far as I recall the trusted store is suppose to contain only trusted root CA. The extra chain is uesd to provide intermediate certs for the cert chain between a root CA and the service's cert. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 02:59:19 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 00:59:19 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372294759.58.0.235212594366.issue16487@psf.upfronthosting.co.za> Christian Heimes added the comment: PS: I like to have DER cert support for #17134. I'd rather not convert DER to PEM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 03:04:30 2013 From: report at bugs.python.org (Ethan Furman) Date: Thu, 27 Jun 2013 01:04:30 +0000 Subject: [issue18173] Add MixedTypeKey to reprlib In-Reply-To: <1370786072.61.0.824503392112.issue18173@psf.upfronthosting.co.za> Message-ID: <1372295070.81.0.313857204931.issue18173@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 03:15:31 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jun 2013 01:15:31 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1372295731.58.0.482831196216.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Here is a patch that looks much bigger than it really is. Idle was written before the warnings module, so the warnings system was conditioned on a successful warnings import. The test is no longer needed, and neither Vinay nor Victor repeated the test at the new location for the warnings.showwarning patch, within PyShell.main and run.main. I just deleted the test and dedented the indented blocks, which were, except for three lines, otherwise unchanged. For run.py, I copied warnings.showwarnings and changed it to call idle_formatwarnings_subproc instead of (patched) warnings.formatwarnings. I then put the replacement of warnings.showwarnings in main after the sanity checks. For PyShell.py, I made a similar change in showwarnings and the warnings.showwarnings replacement. I also added AttributeError to the print exception. At least on Windows, warning_stream = sys.__stderr__ is None when Idle is started normally, from an icon. But otherwise changing Idle to stop expecting a writable console is another issue. ---------- stage: needs patch -> commit review Added file: http://bugs.python.org/file30708/issue18081-warn.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 03:15:50 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jun 2013 01:15:50 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning In-Reply-To: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> Message-ID: <1372295749.99.0.855546870422.issue18242@psf.upfronthosting.co.za> Terry J. Reedy added the comment: See #18103 for patch that will fix this also. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 03:23:43 2013 From: report at bugs.python.org (py.user) Date: Thu, 27 Jun 2013 01:23:43 +0000 Subject: [issue18310] itertools.tee() can't accept keyword arguments In-Reply-To: <1372270091.7.0.0269629805126.issue18310@psf.upfronthosting.co.za> Message-ID: <1372296223.39.0.555513085353.issue18310@psf.upfronthosting.co.za> py.user added the comment: tee() docs describe n as a keyword ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 03:27:44 2013 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 27 Jun 2013 01:27:44 +0000 Subject: [issue18312] "make distclean" deletes files under .hg directory Message-ID: <1372296464.66.0.963255474553.issue18312@psf.upfronthosting.co.za> New submission from Eric V. Smith: See: http://mail.python.org/pipermail/python-dev/2013-June/127068.html The find command: find $(srcdir) '(' -name '*.fdc' -o -name '*~' \ -o -name '[@,#]*' -o -name '*.old' \ -o -name '*.orig' -o -name '*.rej' \ -o -name '*.bak' ')' \ -exec rm -f {} ';' will walk into .hg (and other dot directories) and delete files there. The particular problem noted in the email was a filename beginning with '@'. Some suggestions are to change it to: find \( -type d -name .hg -prune \) -o ... or find $(srcdir)/[a-zA-Z]* ... Other suggestions are included in the thread starting at the above link. These include deleting the find command, or using "hg purge". I think that we have enough history of using and suggesting "make distclean" that we should just fix up the find command to do what it does now, but not recurse into any dot directories (.hg, .svn, .git, etc.). ---------- components: Build messages: 191928 nosy: eric.smith priority: normal severity: normal status: open title: "make distclean" deletes files under .hg directory type: behavior versions: Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 04:04:51 2013 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 27 Jun 2013 02:04:51 +0000 Subject: [issue18312] "make distclean" deletes files under .hg directory In-Reply-To: <1372296464.66.0.963255474553.issue18312@psf.upfronthosting.co.za> Message-ID: <1372298691.68.0.656694042831.issue18312@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 04:42:22 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 27 Jun 2013 02:42:22 +0000 Subject: [issue18310] itertools.tee() can't accept keyword arguments In-Reply-To: <1372270091.7.0.0269629805126.issue18310@psf.upfronthosting.co.za> Message-ID: <1372300942.81.0.8119513796.issue18310@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 06:19:47 2013 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 27 Jun 2013 04:19:47 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1372306787.88.0.622854500121.issue18244@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 06:34:44 2013 From: report at bugs.python.org (Eric Snow) Date: Thu, 27 Jun 2013 04:34:44 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1372307684.41.0.360048725102.issue18309@psf.upfronthosting.co.za> Eric Snow added the comment: Hi Mathias. There is a current proposal (http://www.python.org/dev/peps/pep-0432/) for improving interpreter startup. So changes in this area are subject to extra caution. The changes you are talking about are at least indirectly impacted by the proposal, though I expect they are more directly tied to what happens in site.py. As to your proposal, aren't the embedding needs already addressed? See http://docs.python.org/2/c-api/intro.html#embedding-python. Is there some convention for keeping the site files adjacent to the SO/DLL that would warrant your proposed code? p.s. this would be a new feature so it only applies to Python 3.4. ---------- components: +Interpreter Core -Installation nosy: +eric.snow, ncoghlan versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 07:01:01 2013 From: report at bugs.python.org (py.user) Date: Thu, 27 Jun 2013 05:01:01 +0000 Subject: [issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword Message-ID: <1372309261.95.0.7034101172.issue18313@psf.upfronthosting.co.za> New submission from py.user: http://docs.python.org/3/library/itertools.html#itertools-recipes "def repeatfunc(func, times=None, *args):" >>> repeatfunc(lambda x: x, times=None, 1) File "", line 1 SyntaxError: non-keyword arg after keyword arg >>> >>> repeatfunc(lambda x: x, 1, times=None) Traceback (most recent call last): File "", line 1, in TypeError: repeatfunc() got multiple values for argument 'times' >>> ---------- assignee: docs at python components: Documentation messages: 191930 nosy: docs at python, py.user priority: normal severity: normal status: open title: In itertools recipes repeatfunc() defines a non-keyword argument as keyword type: enhancement versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 07:22:02 2013 From: report at bugs.python.org (Eric Snow) Date: Thu, 27 Jun 2013 05:22:02 +0000 Subject: [issue18093] Move main functions to a separate Programs directory In-Reply-To: <1369828290.2.0.750301008205.issue18093@psf.upfronthosting.co.za> Message-ID: <1372310522.87.0.682612787942.issue18093@psf.upfronthosting.co.za> Changes by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 07:56:59 2013 From: report at bugs.python.org (Aaron Gallagher) Date: Thu, 27 Jun 2013 05:56:59 +0000 Subject: [issue16113] Add SHA-3 (Keccak) support In-Reply-To: <1349233804.79.0.00772371618682.issue16113@psf.upfronthosting.co.za> Message-ID: <1372312619.4.0.192186917891.issue16113@psf.upfronthosting.co.za> Aaron Gallagher added the comment: As long as the reference Keccak code is going to live in the python stdlib anyway, I would /greatly/ appreciate it if the Keccak sponge function was directly exposed instead of just the fixed parameters used for SHA-3. A Keccak sponge can have a much wider range of rates/capacities, and after absorption can have any number of bytes squeezed out. The ability to get an unbounded number of bytes out is very useful and I've written some code that uses that behavior. I ended up having to write my own Keccak python library since none of the other SHA-3 libraries exposed this either. ---------- nosy: +habnabit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 08:33:20 2013 From: report at bugs.python.org (paul j3) Date: Thu, 27 Jun 2013 06:33:20 +0000 Subject: [issue9625] argparse: Problem with defaults for variable nargs when using choices In-Reply-To: <1282036744.37.0.964764969496.issue9625@psf.upfronthosting.co.za> Message-ID: <1372314800.89.0.44724263196.issue9625@psf.upfronthosting.co.za> paul j3 added the comment: I've added 2 more tests, one with default='c', which worked before. one with default=['a','b'], which only works with this change. http://bugs.python.org/issue16878 is useful reference, since it documents the differences between nargs="?" and nargs="*", and their handling of their defaults. ---------- Added file: http://bugs.python.org/file30709/issue9625_1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 09:35:56 2013 From: report at bugs.python.org (Ned Deily) Date: Thu, 27 Jun 2013 07:35:56 +0000 Subject: [issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword In-Reply-To: <1372309261.95.0.7034101172.issue18313@psf.upfronthosting.co.za> Message-ID: <1372318556.41.0.237469841274.issue18313@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 09:36:17 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jun 2013 07:36:17 +0000 Subject: [issue18312] "make distclean" deletes files under .hg directory In-Reply-To: <1372296464.66.0.963255474553.issue18312@psf.upfronthosting.co.za> Message-ID: <1372318577.21.0.0072373110646.issue18312@psf.upfronthosting.co.za> STINNER Victor added the comment: Extract of "GNU standards": # make distclean # Delete all files from the current directory that are created by # configuring or building the program. If you have unpacked the # source and built the program without creating any other files, # `make distclean' should leave only the files that were in the # distribution. Python should only remove files generated by the build process: Makefile, pyconfig.h, *.o, etc. But not files generated by Mercurial (.orig, .rej), backup files (.old, .bak), nor any other files which is not generated by the build. These files may be important for the developer (Mercurial keeps modified files after "hg revert --all" for example). If someone wants an hardcore cleaner, the command can be kept, but please, under a different name. I use "make distclean" when I change compiler options (rerun Makefile), when a new C file is added (calling "make" is usually not enough, and I prefer to restart from a "clean" source tree), or more generally when Python doesn't compile for an unknown reason. For example, "make distclean" was need when the new _stat (Modules/_stat.c) module was added. R. David Murray wrote on python-dev: "We also sometimes ask someone reporting an issue to do a make distclean and recompile (...)". Here is a patch simply removing the "find -exec rm {};" command from "make distclean". Remaining commands: -------------- # 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 -------------- ---------- keywords: +patch nosy: +haypo Added file: http://bugs.python.org/file30710/make_distclean.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 09:36:23 2013 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Jun 2013 07:36:23 +0000 Subject: [issue18312] "make distclean" deletes files under .hg directory In-Reply-To: <1372296464.66.0.963255474553.issue18312@psf.upfronthosting.co.za> Message-ID: <1372318583.13.0.864655433827.issue18312@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- versions: +Python 3.3 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 10:45:04 2013 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Thu, 27 Jun 2013 08:45:04 +0000 Subject: [issue18312] "make distclean" deletes files under .hg directory In-Reply-To: <1372318577.21.0.0072373110646.issue18312@psf.upfronthosting.co.za> Message-ID: <51CBFB89.1020708@egenix.com> Marc-Andre Lemburg added the comment: On 27.06.2013 09:36, STINNER Victor wrote: > > STINNER Victor added the comment: > > Extract of "GNU standards": > > # make distclean > # Delete all files from the current directory that are created by > # configuring or building the program. If you have unpacked the > # source and built the program without creating any other files, > # `make distclean' should leave only the files that were in the > # distribution. > > Python should only remove files generated by the build process: Makefile, pyconfig.h, *.o, etc. But not files generated by Mercurial (.orig, .rej), backup files (.old, .bak), nor any other files which is not generated by the build. These files may be important for the developer (Mercurial keeps modified files after "hg revert --all" for example). > > If someone wants an hardcore cleaner, the command can be kept, but please, under a different name. Hmm, but distclean is exactly the kind of cleaner it's meant to be: you use the command to prepare for a source code distribution and you don't want any backup files or failed patch traces in your source code distribution. Perhaps we should introduce a softer version that leaves the files you mention in untouched, so it can be used by developers, e.g. make devclean. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 11:17:32 2013 From: report at bugs.python.org (=?utf-8?q?Mathias_Fr=C3=B6hlich?=) Date: Thu, 27 Jun 2013 09:17:32 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1372324652.21.0.409288110376.issue18309@psf.upfronthosting.co.za> Mathias Fr?hlich added the comment: Hi Eric, Thanks for looking at that ticket so fast! Reassigning this to 3.4 is great. In general, yes I can already do what I need more or less. This is the reason why I can be fine with about every python version. The point I bring up this change that I believe I am doing this at an unappropriate place as I need to know some internals of python when I do so and that I think that other can probably also benefit from this idea/change. What I currently do is to write an application that just uses python*.so as an embedded interpreter and this precompiled application might be relocated to about everywhere - just where it is unpacked. We are currently using the same sort of code to find out where the python*so file is and we use Py_SetPythonHome to set is to the directory where the so file resides. Why are we doing this? So, it takes the idea that is currently in the standard python interpreter. This one tries to be relocatable (means: pack the installation directory and unpack that somewhere else and be still able to run) by looking at argv[0] and dereferencing symbolic links until it arrives at a real file. Now suppose you want to embed python, then you do no longer use the standard python interpreter program. You may also use a different installation layout for basic things like bin and lib. So you end up with an application that is no longer able to find its provided python modules by looking at the applications path. But instead of starting from the path of the interpreter (which is not used in this case) or the application itself you could start from the python library path and look for your python installation relative to that. So as long as you stick with the relative file layout of everything that is python related (and only what is python related, the python.so and the modules) when you pack and unpack your precompiled application this would just work. So, put that in short: Instead of dynamically finding the the python module path relative to .../bin/python try to find the python relative to .../lib/libpython34.so. The benefit of that would be that every application that embeds python and needs to be relocatable will just work in the way that today only the standard python interpreter works. I try to get all of the PEP you pointed me to. As I am seeing this longer document the first time, I am not sure if I missed something there, but in that framework of this my proposal would probably influence the initial setting of sys.prefix (?) if this is not already provided from the embedding application. And yes I am perfectly fine with a different or more general approach. The initially attached patch is something that tried to integrate into the current checked in code as I understood it. Greetings Mathias ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 11:38:29 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 27 Jun 2013 09:38:29 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372325909.76.0.559982976105.issue16487@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Thanks for your comments Christian. "You don't check ERR_GET_LIB() in some places." Do you have a particular place in mind? About DER. As I understand, currently _ssl only supports PEM. If that is the case, then supporting DER should, IMHO, be a separate patch. It will probably involve adding an argument to the functions. Both DER and PEM files are binary formats. the PEM is base64 encoded ascii with some strict ascii headers and footers. As such, the encoding is quite explicit. I am not sure that automatic conversion from unicode to ascii should be undertaken on the C level, particularly if the intention later is to support DER, which is pure binary and where "string" has no place. I'll have a look at your patch as well, haven't gotten round to do that yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 11:54:22 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 09:54:22 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372326862.6.0.410016559941.issue16487@psf.upfronthosting.co.za> Christian Heimes added the comment: I found two places: if (ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE) { if (ERR_GET_REASON(err) == PEM_R_BAD_BASE64_DECODE) AFAIK the _ssl module only supports PEM certs for loading. On the other hands cert data can only be retrieved as dict representation or binary DER data, e.g. getpeercert(binary_form=True) -> DER bytes. It's a bit of a puzzle to me. It feels a bit strange to treat PEM certs as binary data, especially since the SSL module treats PEM as ASCII unicode. For example DER_cert_to_PEM_cert() accepts bytes and returns str, PEM_cert_to_DER_cert() converts str to bytes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 12:00:31 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Jun 2013 10:00:31 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1372326862.6.0.410016559941.issue16487@psf.upfronthosting.co.za> Message-ID: <1998265026.120800880.1372327224579.JavaMail.root@zimbra10-e2.priv.proxad.net> Antoine Pitrou added the comment: > It feels a bit strange to treat PEM certs as binary data, especially > since the SSL module treats PEM as ASCII unicode. For example > DER_cert_to_PEM_cert() accepts bytes and returns str, > PEM_cert_to_DER_cert() converts str to bytes. I agree that PEM is logically text (i.e. unicode). Also, having the unicode == PEM, bytes == DER distinction sounds reasonably practical. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 12:24:20 2013 From: report at bugs.python.org (Roundup Robot) Date: Thu, 27 Jun 2013 10:24:20 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <3bgxzl42Ksz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset 44f455e6163d by Martin v. L?wis in branch 'default': Issue #13483: Use VirtualAlloc in obmalloc on Windows. http://hg.python.org/cpython/rev/44f455e6163d ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 12:24:52 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Thu, 27 Jun 2013 10:24:52 +0000 Subject: [issue13483] Use VirtualAlloc to allocate memory arenas In-Reply-To: <1322313162.87.0.914810161445.issue13483@psf.upfronthosting.co.za> Message-ID: <1372328692.46.0.224023318749.issue13483@psf.upfronthosting.co.za> Changes by Martin v. L?wis : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 12:32:07 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 10:32:07 +0000 Subject: [issue16113] Add SHA-3 (Keccak) support In-Reply-To: <1349233804.79.0.00772371618682.issue16113@psf.upfronthosting.co.za> Message-ID: <1372329127.46.0.0867946447805.issue16113@psf.upfronthosting.co.za> Christian Heimes added the comment: Hi Aaron, it's a tempting idea but I have to decline. The API is deliberately limited to the NIST interface. Once OpenSSL gains SHA-3 support we are going to use it in favor for the reference implementation. I don't expect OpenSSL to provide the full sponge API. I also like to keep all options open so I can switch to a different and perhaps smaller implementation in the future. The reference implementation is huge and the binary is more than 400 KB. For comparison the SHA-2 384 + 512 module's binary is just about 60 KB on a 64bit Linux system. Once a a new API has been introduced it's going to take at least two minor Python release and about four to five years to remove it. But I could add a more flexible interface to Keccak's sponge to my standalone sha3 module https://pypi.python.org/pypi/pysha3 ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 12:43:46 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 27 Jun 2013 10:43:46 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372329826.62.0.210651599357.issue16487@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Ok, thanks. The consistency argument is strong, also Antoine's suggestion to use the return type of read() as a discriminant. also please excuse me because I am not a habitual user of Python 3 and haven't become used to the str/binary dichotomy yet. I didn?t know, for instance, about io.BytesIO until I found to my horror that io.StringIO.read() would output unicode (i.e str). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 12:53:38 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 10:53:38 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372330418.06.0.912969177209.issue16487@psf.upfronthosting.co.za> Christian Heimes added the comment: EVE Online is still using Python 2.7? You gotta hurry up or Guido will beat you with Dropbox's 3.x port. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 13:41:39 2013 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 27 Jun 2013 11:41:39 +0000 Subject: [issue18312] "make distclean" deletes files under .hg directory In-Reply-To: <1372296464.66.0.963255474553.issue18312@psf.upfronthosting.co.za> Message-ID: <1372333299.66.0.666201954085.issue18312@psf.upfronthosting.co.za> Eric V. Smith added the comment: My plan is to just fix this issue, right now, by changing the find command to be: find $(srcdir)/[a-zA-Z]* ... That fixes this bug and keeps the current functionality. If someone wants to open another issue about changing what distclean does, I think that's okay. I suggest discussing it on python-dev first. ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 13:42:00 2013 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 27 Jun 2013 11:42:00 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1372333320.29.0.0110332270705.issue18309@psf.upfronthosting.co.za> Nick Coghlan added the comment: The way we figure out where to find the standard library is crazy, and creating the infrastructure to start making it less crazy is actually one of the prime motivations for PEP 432 :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 14:15:21 2013 From: report at bugs.python.org (=?utf-8?q?Kim_Gr=C3=A4sman?=) Date: Thu, 27 Jun 2013 12:15:21 +0000 Subject: [issue18314] Have os.unlink remove junction points Message-ID: <1372335321.1.0.479247042071.issue18314@psf.upfronthosting.co.za> New submission from Kim Gr?sman: os.unlink currently raises a WindowsError (Access Denied) if I attempt to unlink an NTFS junction point. It looks trivial to allow Py_DeleteFileW [1] to remove junction points as well as proper symbolic links, as far as I can tell. For example, the ntfslink-python library [2] only checks if both FILE_ATTRIBUTE_DIRECTORY and FILE_ATTRIBUTE_REPARSE_POINT are set. RemoveDirectoryW is documented to handle junction points transparently, so it should just be a matter of passing the path on if it's a junction point or a symbolic link. My motivation for this is that I have used external tools to create junction points, and am now switching to symbolic links. When deleting a directory, I need to do: try: os.unlink(link_path) except WindowsError as detail: # BACKWARD COMPATIBILITY HACK if detail.winerror == 5: _delete_junction_point(link_path) else: raise which is a little funky. It seems like os.unlink semantics work just as well for junction points, even if they can't be created with os.symlink. Love it/hate it? [1] http://hg.python.org/cpython/file/44f455e6163d/Modules/posixmodule.c#l4105 [2] https://github.com/Juntalis/ntfslink-python/blob/2f6ff903f9b22942de8aa93a32a3d817124f359e/ntfslink/internals/__init__.py#L32 ---------- components: Windows messages: 191945 nosy: Kim.Gr?sman priority: normal severity: normal status: open title: Have os.unlink remove junction points type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 14:21:52 2013 From: report at bugs.python.org (=?utf-8?q?Kim_Gr=C3=A4sman?=) Date: Thu, 27 Jun 2013 12:21:52 +0000 Subject: [issue18314] Have os.unlink remove junction points In-Reply-To: <1372335321.1.0.479247042071.issue18314@psf.upfronthosting.co.za> Message-ID: <1372335712.86.0.737984440213.issue18314@psf.upfronthosting.co.za> Kim Gr?sman added the comment: Also, I believe the reason os.unlink raises "access denied" is because a junction point does not currently qualify as a directory && link, so its path is passed directly to DeleteFileW, which in turn refuses to delete a directory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 16:21:37 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Jun 2013 14:21:37 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1372342897.77.0.286523575122.issue18244@psf.upfronthosting.co.za> ?ukasz Langa added the comment: The reason why I think it's wrong to special-case ABCs that are explicitly in the MRO is that it's only one of four methods of virtual subclassing: 1. Explicit MRO; 2. Abstract functionality implicitly implemented without any form of registration; 3. abc.register(); 4. One of the above on a base of the type in question. This creates more possibilities for conflicts than just the example described in my last message. For instance, what's the preferred ABC here, Iterable or Sized? >>> class E(Sized): ... def __len__(self): ... return 0 ... def __iter__(self): ... for i in []: ... yield i My answer is: neither. E equally is-a Sized and is-a Iterable. If the dispatcher favors one over the other, you will get people upset about the decision, no matter which one it is. Note that the conflict arises only for multiple ABCs which end up *on the same level* of the MRO. For instance in the example below the dispatch always chooses the Iterable implementation (the functionality appears directly on F, whereas Sized appears on a base): >>> class HasSize(Sized): ... def __len__(self): ... return 0 ... >>> class F(HasSize): ... def __iter__(self): ... for i in []: ... yield i If we wanted to favor the ABCs that are explicitly in the MRO, what should we choose in this case? If we say "Sized", then it breaks the whole idea of arranging the ABCs next to the class that first implements them in the MRO. But it gets better! Suppose you have a generic function with implementations for Sized and Callable. Which implementation should we choose for class G? >>> class G(MutableMapping): ... def __call__(self): ... return None ... # the rest of the MutableMapping implementation Seems like Sized because it is explicitly in the MRO, right? What about H then? >>> class H(dict): ... def __call__(self): ... return None Well, now it's suddenly Callable because Sized is "only" a virtual base class. I don't think we should let that happen. It all comes down to the question whether you consider ABCs to be bases FOR REAL or only sort-of-but-not-really. I believe they're real bases regardless of the method of registration. Implicit implementation and abc.register() doesn't make the base any less real. All in all, the user will ask: "Hey, it's true, I have a tricky type that subclasses both an ABC1 and an ABC2 and singledispatch raises a RuntimeError. How do I make this work?" The answer is simple: just register a more specific implementation on the generic function, even if it simply selects one of the existing ones: generic_func.register(TrickyType, generic_func.dispatch(ABC2)) Explicit is better than implicit. ---------- Added file: http://bugs.python.org/file30711/issue18244.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 17:05:56 2013 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 27 Jun 2013 15:05:56 +0000 Subject: [issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword In-Reply-To: <1372309261.95.0.7034101172.issue18313@psf.upfronthosting.co.za> Message-ID: <1372345556.35.0.295077115838.issue18313@psf.upfronthosting.co.za> Eric V. Smith added the comment: I'm not sure what you're saying. Given the function definition, the way you're calling it is incorrect, and the error messages explain why. Are you saying that these ways to call repeatfunc() are documented somewhere that needs fixing? I couldn't find that on the itertools documentation. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 17:08:20 2013 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 27 Jun 2013 15:08:20 +0000 Subject: [issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword In-Reply-To: <1372309261.95.0.7034101172.issue18313@psf.upfronthosting.co.za> Message-ID: <1372345700.31.0.468648213075.issue18313@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 17:15:49 2013 From: report at bugs.python.org (py.user) Date: Thu, 27 Jun 2013 15:15:49 +0000 Subject: [issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword In-Reply-To: <1372309261.95.0.7034101172.issue18313@psf.upfronthosting.co.za> Message-ID: <1372346149.21.0.514239276119.issue18313@psf.upfronthosting.co.za> py.user added the comment: it should be: "def repeatfunc(func, times, *args):" and None for times described in the docstring ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 17:19:03 2013 From: report at bugs.python.org (py.user) Date: Thu, 27 Jun 2013 15:19:03 +0000 Subject: [issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword In-Reply-To: <1372309261.95.0.7034101172.issue18313@psf.upfronthosting.co.za> Message-ID: <1372346343.92.0.107424761364.issue18313@psf.upfronthosting.co.za> Changes by py.user : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 17:25:44 2013 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 27 Jun 2013 15:25:44 +0000 Subject: [issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword In-Reply-To: <1372309261.95.0.7034101172.issue18313@psf.upfronthosting.co.za> Message-ID: <1372346744.87.0.0687595013439.issue18313@psf.upfronthosting.co.za> Eric V. Smith added the comment: I see. You can't call repeatfunc() and specify times with a named argument because of *args. Interesting. I'll let Raymond weigh in. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 17:53:54 2013 From: report at bugs.python.org (Eric Snow) Date: Thu, 27 Jun 2013 15:53:54 +0000 Subject: [issue16251] pickle special methods are looked up on the instance rather than the type In-Reply-To: <1350411894.01.0.763638555345.issue16251@psf.upfronthosting.co.za> Message-ID: <1372348434.47.0.660756758482.issue16251@psf.upfronthosting.co.za> Eric Snow added the comment: A backward compatible solution would be to do lookup on the class after trying the instance (and that came back None or isn't callable). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 17:59:58 2013 From: report at bugs.python.org (Terrel Shumway) Date: Thu, 27 Jun 2013 15:59:58 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 Message-ID: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> New submission from Terrel Shumway: for line in fileinput.input(files,inplace,backup,"rU"): File "/usr/lib/python2.7/fileinput.py", line 253, in next line = self.readline() File "/usr/lib/python2.7/fileinput.py", line 346, in readline self._buffer = self._file.readlines(self._bufsize) TypeError: an integer is required According to the documentation, my code was correct. But somewhere along the line, someone added a 'bufsize' parameter and didn't update the docstrings. It's an easy fix, but I'll have to investigate when this broke. ---------- assignee: docs at python components: Documentation messages: 191952 nosy: Terrel.Shumway, docs at python priority: normal severity: normal status: open title: bufsize parameter not documented in 2.7.5 type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 18:12:57 2013 From: report at bugs.python.org (Terrel Shumway) Date: Thu, 27 Jun 2013 16:12:57 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372349577.24.0.1954413209.issue18315@psf.upfronthosting.co.za> Terrel Shumway added the comment: http://hg.python.org/cpython/file/4dbbf322a9df/Lib/fileinput.py >In the process, I added an optional bufsize argument to the input() >function and the FileInput class. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 18:19:41 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Jun 2013 16:19:41 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372349981.49.0.298196758866.issue18315@psf.upfronthosting.co.za> R. David Murray added the comment: A quick look at the VCS history indicates bufsize has been in there for a long time. The sphinx docs are wrong as well. This is correctly documented in python3, apparently as part of the conversion from [] notation to keyword notation in d143eb624cf5. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 18:34:47 2013 From: report at bugs.python.org (Terrel Shumway) Date: Thu, 27 Jun 2013 16:34:47 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372350887.93.0.518397630862.issue18315@psf.upfronthosting.co.za> Terrel Shumway added the comment: http://hg.python.org/cpython/file/68c776ba5ea5/Lib/fileinput.py This is where the incorrect docstrings get added. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 18:51:06 2013 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 27 Jun 2013 16:51:06 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1372351866.18.0.109453747257.issue18244@psf.upfronthosting.co.za> Guido van Rossum added the comment: Hm. I interpret "explicit is better than implicit" very differently. I see a strict priority ordering from better to worse, in cases that would otherwise be ambiguous: 1. explicit base class (ABC or otherwise) 2. ABC explicitly registered 3. ABC implicitly inferred from presence of special method I'm all for using all the other heuristics and rules you describe: inferred ABCs occur at the level where they are introduced, for example, and if two different ABCs are both inferred at the same level or both registered at the same level, that should be considered ambiguous. But if one ABC is listed as an explicit base at some level and another is registered or implicit at the same level, the explicit base should just win -- just as if both ABCs were explicitly listed, the one listed first wins. So the rule should be that registered and inferred bases are only considered after explicit bases at the same level. (If you want the registered class to be preferred, you should add it as an explicit base instead -- and if you don't own the code, you should respect the choice of its author, or do something using subclassing.) If it were me, explicitly registered ABCs would also trump inferred ABCs -- after all an inferred ABC is far from obvious to most readers and might even be an accident, and the situation can be rectified by explicit registration. IOW, I disagree with your claim that "Class C is-a Sized just as well as it is-a Iterable." C is a Sized *more* than an Iterable because Size is an explicitly listed base class and Iterable is added through registration. Same if Iterable were inferred. (Just to be clear, this only applies if the ambiguity occurs at a single level. ABCs explicitly listed, registered, or inferred at some base class have explicitly lower priority.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 19:17:14 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 27 Jun 2013 17:17:14 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372353434.52.0.513736353319.issue16487@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: 2.7 is the pinnacle of pythonic achievement. Particularly our branch of it :) One day we'll move, I'm sure, when there is an opportune moment. For example, if we were to start supporting a new game, a new platform. But for now, if it ain't broke, we won't fix it. In fact, today I was asked about python for the ps4... It might be worth taking a look at porting p3k for that and making a clean break :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 19:21:02 2013 From: report at bugs.python.org (Terrel Shumway) Date: Thu, 27 Jun 2013 17:21:02 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372353662.99.0.100391735215.issue18315@psf.upfronthosting.co.za> Terrel Shumway added the comment: Here is a patch against the 2.7 branch. It will probably also apply to 2.6 if anyone cares. ---------- keywords: +patch Added file: http://bugs.python.org/file30712/fileinput-document-bufsize.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 19:25:00 2013 From: report at bugs.python.org (Terrel Shumway) Date: Thu, 27 Jun 2013 17:25:00 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372353900.71.0.768353636567.issue18315@psf.upfronthosting.co.za> Terrel Shumway added the comment: Oops. I messed up, even on such a tiny fix. #:( ---------- Added file: http://bugs.python.org/file30713/fileinput-document-bufsize.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 21:01:27 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jun 2013 19:01:27 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning In-Reply-To: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> Message-ID: <1372359687.79.0.192998007446.issue18242@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- Removed message: http://bugs.python.org/msg191926 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 21:01:56 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jun 2013 19:01:56 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning In-Reply-To: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> Message-ID: <1372359716.78.0.190973219891.issue18242@psf.upfronthosting.co.za> Terry J. Reedy added the comment: See #18101 for patch that will fix this also. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 21:29:43 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 19:29:43 +0000 Subject: [issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments In-Reply-To: <1364651250.44.0.538707073215.issue17580@psf.upfronthosting.co.za> Message-ID: <1372361383.79.0.0833030952803.issue17580@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 22:21:36 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jun 2013 20:21:36 +0000 Subject: [issue18316] Idle 2.7: update to simply cross-version patches Message-ID: <1372364496.41.0.313371812412.issue18316@psf.upfronthosting.co.za> New submission from Terry J. Reedy: In a commiters-list discussion of heuristics for what patches can go into non-Idle 2.7, Nick Coghlan offered "simplifying cross-version maintenance". (He also mentioned "addressing issues that arise due to changes in the underlying platforms", which is another issue I will open.) Because of PEP 434 and the subsequent application of most Idle patches to all current versions, cross-version consistency is even more important for idlelib than the rest of the repository. When backporting patches, both context and changed lines must match. My experience so far is that merge conflicts are normal. So I think the latitude for consistency patches to reduce these should be even wider than for the rest of the repository. On the other hand, the current lack of tests suggests more caution than for the rest of the repository. For this issue, I would like to at least change "except exception, e:" to "except exception as e:". This is about as safe as anything, and grepping 2.7 idlelib for "except .*, *." yields 23 hits where the ',' is not for multiple exceptions. 2.7 has about 80 print statements. While I would not change all in one patch (maybe 4), all in any file should be changed together when the future import is added at the top. Once this is done, forgetting to add parens or convert '>> file' results in a SyntaxError. So this is also pretty safe if the file compiles. Current uses of int() seem to be for str or float conversion, not a/b truncations. That is already done with a//b. There do not seem to be any unicode string literals. Have I forgotten any generic ways to make 2.7 code the same as 3.x? ---------- files: differ23.py messages: 191961 nosy: ncoghlan, roger.serwy, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Idle 2.7: update to simply cross-version patches versions: Python 2.7 Added file: http://bugs.python.org/file30714/differ23.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 22:28:53 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jun 2013 20:28:53 +0000 Subject: [issue18316] Idle 2.7: update to simply cross-version patches In-Reply-To: <1372364496.41.0.313371812412.issue18316@psf.upfronthosting.co.za> Message-ID: <1372364933.85.0.891173753476.issue18316@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I wrote a short script (already uploded) to differ 2.7 and 3.3 versions of an idlelib file. Applied to PyShell, I see unnecessary differences, like 'a,b' changed to 'a, b', or 'not a in b' changed to 'a not in b' only in 3.3 (probably for 3.0 when the necessary changes were made). When working on a particular file, I would be inclined to make the obvious updates to 2.7 first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 22:32:01 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jun 2013 20:32:01 +0000 Subject: [issue18316] Idle 2.7: update to simplify cross-version patches In-Reply-To: <1372364496.41.0.313371812412.issue18316@psf.upfronthosting.co.za> Message-ID: <1372365121.04.0.802060237315.issue18316@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- title: Idle 2.7: update to simply cross-version patches -> Idle 2.7: update to simplify cross-version patches _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 23:27:40 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Thu, 27 Jun 2013 21:27:40 +0000 Subject: [issue11016] Re-implementation of the stat module in C In-Reply-To: <1296039446.69.0.66523737586.issue11016@psf.upfronthosting.co.za> Message-ID: <1372368460.52.0.687909035559.issue11016@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 23:52:48 2013 From: report at bugs.python.org (Jakub Wilk) Date: Thu, 27 Jun 2013 21:52:48 +0000 Subject: [issue18217] Deprecate and remove gettext.install In-Reply-To: <1371242209.86.0.435124148843.issue18217@psf.upfronthosting.co.za> Message-ID: <1372369968.29.0.118731298726.issue18217@psf.upfronthosting.co.za> Changes by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 27 23:54:58 2013 From: report at bugs.python.org (Jakub Wilk) Date: Thu, 27 Jun 2013 21:54:58 +0000 Subject: [issue10529] Write argparse i18n howto In-Reply-To: <1290688089.28.0.749623528369.issue10529@psf.upfronthosting.co.za> Message-ID: <1372370098.98.0.064364700062.issue10529@psf.upfronthosting.co.za> Changes by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 00:01:26 2013 From: report at bugs.python.org (Jakub Wilk) Date: Thu, 27 Jun 2013 22:01:26 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms Message-ID: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> New submission from Jakub Wilk: It is possible to craft a MO file with Plural-Forms taking arbitrary amounts of CPU and memory to evaluate. A test case is attached. I realize that opening unstrusted MO files is a rather unusual use case, but the module already contains some code to protect againt malicious Plural-Forms, so I thought you might want to fix this problem as well. ---------- components: Library (Lib) files: testcase.mo messages: 191963 nosy: jwilk priority: normal severity: normal status: open title: gettext: DoS via crafted Plural-Forms type: security Added file: http://bugs.python.org/file30715/testcase.mo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 00:01:32 2013 From: report at bugs.python.org (Jakub Wilk) Date: Thu, 27 Jun 2013 22:01:32 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372370492.9.0.633387495302.issue18317@psf.upfronthosting.co.za> Changes by Jakub Wilk : Added file: http://bugs.python.org/file30716/testcase.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 00:39:03 2013 From: report at bugs.python.org (Roundup Robot) Date: Thu, 27 Jun 2013 22:39:03 +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: <3bhGHV6NtQz7LjW@mail.python.org> Roundup Robot added the comment: New changeset 1d5856849e64 by R David Murray in branch '3.3': #14360: make encoders.encode_quopri work. http://hg.python.org/cpython/rev/1d5856849e64 New changeset 9046ef201591 by R David Murray in branch 'default': Merge #14360: make encoders.encode_quopri work. http://hg.python.org/cpython/rev/9046ef201591 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 00:41:08 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Jun 2013 22:41:08 +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: <1372372868.54.0.449713139878.issue14360@psf.upfronthosting.co.za> R. David Murray added the comment: This should now be fixed. Calling MIMEApplication with a binary payload and passing it encode_quopri as the encoder will now actually work. ---------- resolution: -> fixed stage: needs patch -> committed/rejected versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 00:41:15 2013 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Jun 2013 22:41: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: <1372372875.68.0.229463704549.issue14360@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 00:43:29 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Jun 2013 22:43:29 +0000 Subject: [issue18318] Idle: stop depending on console output Message-ID: <1372373009.47.0.618602359328.issue18318@psf.upfronthosting.co.za> New submission from Terry J. Reedy: It appears that Idle was originally written to run on *nix after being launched from a command-line console. Messages related to Idle code (warnings and exceptions) are sent back to the console, while messages related to user code go to the shell window. This makes Idle a hybrid text/gui application. Later, Idle was ported to run on Windows with the pythonw.exe no-console binary. When it is started normally for Windows, from anything but a console, there is no console. This has caused problems when Idle tries to write to the non-existent console. (I do not know the situation on modern Mac and *nix.) (Even when a console does exist, it will usually get buried and messages may not be seen.) Example: The warning system, monkey patched in both PyShell.py and run.py and documented in the former. (Edited quote from 3.3.) # Override warnings module to write to warning_stream. # Initialize to send IDLE internal warnings to the console. # ScriptBinding.check_syntax() will temporarily redirect the stream # to the shell window to display warnings when checking user's code. warning_stream = sys.__stderr__ # Typically None, at least on Windows. def idle_showwarning(... ... if file is None: file = warning_stream # Which may itself be None!!! try: file.write(... # AttributeError when file is still None except OSError: pass # if file (probably __stderr__) is invalid, skip warning. The patch for #18081 also catches AttributeError as a bandage. Issue goal: make Idle a true gui app by removing the dependence on a console, which may not exist. Proposed method: re-factor Idle startup to try to import tkinter first, rather than last. If this import fails, inform user with console message and/or the os-specific means to gui apps to tell users 'I cannot start because ...'. I know this exists on Windows because I have seen such messages. I presume same is true on other systems. If this import succeeds, setup traceback and warnings hooks to send internal messages to a gui messagebox rather than (or possibly in addition to) a console that may or may not be present. Or send the messages to the Shell window, but marked somehow as internal. The warnings hook might be used after importing non-Idle modules but before importing Idle modules, so startup is not bogged down on debug builds by DeprecationWarnings from non-Idle modules To be a good citizen for testing, all custom hooks should be undone before the PyShell import finishes and before PyShell.main exits (same for run.py). ---------- messages: 191966 nosy: ned.deily, roger.serwy, terry.reedy priority: normal severity: normal status: open title: Idle: stop depending on console output type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 00:53:23 2013 From: report at bugs.python.org (Jakub Wilk) Date: Thu, 27 Jun 2013 22:53:23 +0000 Subject: [issue18319] gettext() cannot find translations with plural forms Message-ID: <1372373603.42.0.596981858746.issue18319@psf.upfronthosting.co.za> New submission from Jakub Wilk: gettext() cannot find translations for messages that have plural forms. I would expect that gettext(s) is equivalent to ngettext(s, s, 1) for such messages, as it is implemented in GNU gettext. >>> import gettext >>> with open('test.mo', 'rb') as mo: trans = gettext.GNUTranslations(mo) ... >>> trans.ngettext("egg", "eggs", 1) 'Ei' >>> trans.gettext("egg") 'egg' ---------- components: Library (Lib) files: test.mo messages: 191967 nosy: jwilk priority: normal severity: normal status: open title: gettext() cannot find translations with plural forms Added file: http://bugs.python.org/file30717/test.mo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 01:01:28 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 23:01:28 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372374088.09.0.319510708842.issue18317@psf.upfronthosting.co.za> Christian Heimes added the comment: Thanks, can you please provide the PO file, too? Or did you construct the MO file manually? ---------- nosy: +christian.heimes stage: -> test needed versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 01:02:46 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 23:02:46 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372374166.29.0.849670148757.issue18317@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- nosy: +loewis, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 01:10:58 2013 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Jun 2013 23:10:58 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372374658.0.0.0870698662761.issue18317@psf.upfronthosting.co.za> Christian Heimes added the comment: Ah, I see what you are doing. Nice catch! Plural-Forms: nplurals=0; plural=42**42**42; The plural form gets parsed by gettext.c2py() and eventually turned into a lambda that executes int(42**42**42). Perhaps a custom AST visitor could be used to filter out dangerous ops and limit the amount of ops to a sane amount? ---------- nosy: +barry -loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 01:15:29 2013 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 27 Jun 2013 23:15:29 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1372374929.06.0.229576608394.issue16487@psf.upfronthosting.co.za> Kristj?n Valur J?nsson added the comment: Okay, I have updated the patch as suggested. string mode means PEM encoding, binary mode DER encoding. Note that DER encoding is more limited, there is no way to concatentate private keys and certificates into one file (the PEM decoder searches the file until it finds the proper data it is looking for, certificate or private key). Also, the unittests don't test for DER encoded private key, because there is no way to generate them currently. The conversion functions in ssl only cope with certificates. Although adding them, changing them would be trivial. These functions should also probably know how to split a PEM file into sections so that they can be individually converted. ---------- Added file: http://bugs.python.org/file30718/ssl2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 01:41:20 2013 From: report at bugs.python.org (Aaron Gallagher) Date: Thu, 27 Jun 2013 23:41:20 +0000 Subject: [issue16113] Add SHA-3 (Keccak) support In-Reply-To: <1349233804.79.0.00772371618682.issue16113@psf.upfronthosting.co.za> Message-ID: <1372376480.87.0.431051625418.issue16113@psf.upfronthosting.co.za> Aaron Gallagher added the comment: https://pypi.python.org/pypi/cykeccak/ is what I've written to do this, for reference. Honestly I hope that the Keccak sponge is directly exposed in openssl (or any other SHA-3 implementation) because of its utility beyond SHA-3. If the source of some other implementation is going to be bundled with python anyway, it shouldn't be difficult to expose the sponge bits. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 01:52:19 2013 From: report at bugs.python.org (paul j3) Date: Thu, 27 Jun 2013 23:52:19 +0000 Subject: [issue16468] argparse only supports iterable choices In-Reply-To: <1352867539.71.0.970228461518.issue16468@psf.upfronthosting.co.za> Message-ID: <1372377139.94.0.746603042771.issue16468@psf.upfronthosting.co.za> Changes by paul j3 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 02:41:41 2013 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 28 Jun 2013 00:41:41 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372380101.15.0.0763262286277.issue18317@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Why do we have "support" for untrusted MO files? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 03:28:12 2013 From: report at bugs.python.org (Andrew Berg) Date: Fri, 28 Jun 2013 01:28:12 +0000 Subject: [issue9938] Documentation for argparse interactive use In-Reply-To: <1285338690.84.0.283413950067.issue9938@psf.upfronthosting.co.za> Message-ID: <1372382892.91.0.0960670570489.issue9938@psf.upfronthosting.co.za> Andrew Berg added the comment: What is the status of this? If the patch looks good, then will it be pushed into 3.4? ---------- nosy: +aberg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 03:41:47 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Jun 2013 01:41:47 +0000 Subject: [issue9938] Documentation for argparse interactive use In-Reply-To: <1285338690.84.0.283413950067.issue9938@psf.upfronthosting.co.za> Message-ID: <1372383707.7.0.0459281803557.issue9938@psf.upfronthosting.co.za> R. David Murray added the comment: It's great that this patch was provided. Xuanji, can you submit a contributor agreement, please? The patch is missing an update to the documentation. (Really the patch should have been in a separate issue, as requested, since this one is about improving the documentation for the existing released versions. I guess we'll have to open a new issue for updating the docs in the existing versions). ---------- nosy: +r.david.murray stage: -> needs patch versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 06:26:24 2013 From: report at bugs.python.org (Andrew Berg) Date: Fri, 28 Jun 2013 04:26:24 +0000 Subject: [issue9938] Documentation for argparse interactive use In-Reply-To: <1285338690.84.0.283413950067.issue9938@psf.upfronthosting.co.za> Message-ID: <1372393584.91.0.0264729895372.issue9938@psf.upfronthosting.co.za> Andrew Berg added the comment: The patch doesn't work for 3.3 (I think it's just because the line numbers are different), but looking over what the patch does, it looks like parse_known_args will return a value for args if there is an unrecognized argument, which will cause parse_args to call error() (it should raise ArgumentError instead). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 06:31:04 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 04:31:04 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1372393864.22.0.191999880594.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Improved 3.3 patch with tests incorporates Vinay's capture_warnings function to uncapture at end of import and main exit. I plan to apply after checking other versions and close this issue. ---------- Added file: http://bugs.python.org/file30719/issue18081-warn3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 09:28:59 2013 From: report at bugs.python.org (cosmicduck) Date: Fri, 28 Jun 2013 07:28:59 +0000 Subject: [issue18320] idle, pydoc search python on wrong path at make altinstall with different exec- and prefix e.g. $HOME Message-ID: <1372404539.33.0.335439360663.issue18320@psf.upfronthosting.co.za> New submission from cosmicduck: Using Solaris 10 x86 Compiling actual 3.3.2 or 2.7.5 looks like work. Installing as non-root with make altinstall prefix='${HOME}/scripts/tools/python/python-3.3.2' exec-prefix='${HOME}/scripts/tools/python/python-3.3.2' installs looks like correctly to the target. Extends LD_LIBRARYPATH and PATH to ${HOME}/scripts/tools/python/python-3.3.2/lib and ${HOME}/scripts/tools/python/python-3.3.2/bin has been done. Python is started correctly with python3.3. If I start idle3.3 or pydoc3.3 I get error: /usr/local/bin/python3.3: bad interpreter: No such file or directory. So it looks like the she-bang is not correctly set for shell scripts to the path prefix and exec-prefix path. Correcting that by manually setup to ${HOME}/scripts/tools/python/python-3.3.2/bin fix that problem. But I guess it's better to modify the installation process by make to have not future problems. ---------- components: IDLE messages: 191977 nosy: cosmicduck priority: normal severity: normal status: open title: idle, pydoc search python on wrong path at make altinstall with different exec- and prefix e.g. $HOME versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 09:48:00 2013 From: report at bugs.python.org (Ethan Furman) Date: Fri, 28 Jun 2013 07:48:00 +0000 Subject: [issue9938] Documentation for argparse interactive use In-Reply-To: <1285338690.84.0.283413950067.issue9938@psf.upfronthosting.co.za> Message-ID: <1372405680.05.0.758511664241.issue9938@psf.upfronthosting.co.za> Ethan Furman added the comment: It doesn't look like xuanji has signed a CLA. Should we create a new issue, and have someone else create a new patch, and let this issue just be about the docs? ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 10:06:17 2013 From: report at bugs.python.org (Eduardo Robles Elvira) Date: Fri, 28 Jun 2013 08:06:17 +0000 Subject: [issue18321] Multivolume support in tarfile module Message-ID: <1372406777.07.0.523288075904.issue18321@psf.upfronthosting.co.za> New submission from Eduardo Robles Elvira: The patch attached provides implementation for multivolume support for tarfile module. It contains both the changes in the module and a battery of unit tests. It contains support for multivolume for both GNU and PAX formats. The main idea behind this proposal is that for dealing with new volumes, the user will provide a callback function. In this callback function the user typically calls to TarFile.open_volume(filename) with the appropiate filename. This is quite flexible in the sense that the callback function could even ask the user for the filename of the next volume (as tar command does), or do anything they need before returning or before calling to open_volume. Please feel free to comment on how to improve the implementation or the API. Documentation for the new feature will be provided at a later stage of the review process if the patch gets a good review. ---------- components: Library (Lib) files: cpython-tarfile-multivolume.patch keywords: patch messages: 191979 nosy: edulix priority: normal severity: normal status: open title: Multivolume support in tarfile module versions: Python 3.4 Added file: http://bugs.python.org/file30720/cpython-tarfile-multivolume.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 10:10:35 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 28 Jun 2013 08:10:35 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372407035.03.0.654296192959.issue18317@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I would rather ask: why do we eval() MO files? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 10:48:11 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 28 Jun 2013 08:48:11 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372409291.22.0.83245227386.issue18317@psf.upfronthosting.co.za> Christian Heimes added the comment: We don't eval() the whole MO file. It's just the pluralization formula, http://www.gnu.org/software/gettext/manual/gettext.html#index-nplurals_0040r_007b_002c-in-a-PO-file-header_007d-1093 The patch uses ast.NodeVisitor to look for dangerous code. ---------- keywords: +patch Added file: http://bugs.python.org/file30721/18317_gettext.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 10:49:32 2013 From: report at bugs.python.org (Ethan Furman) Date: Fri, 28 Jun 2013 08:49:32 +0000 Subject: [issue18042] Provide enum.unique class decorator In-Reply-To: <1369299378.37.0.789518154232.issue18042@psf.upfronthosting.co.za> Message-ID: <1372409372.29.0.0252451864709.issue18042@psf.upfronthosting.co.za> Ethan Furman added the comment: unique() added to enum.py; tests added; docs updated. If no complaints within a few days I'll push them through. ---------- keywords: +patch Added file: http://bugs.python.org/file30722/unique.stoneleaf.01.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 10:49:57 2013 From: report at bugs.python.org (Ethan Furman) Date: Fri, 28 Jun 2013 08:49:57 +0000 Subject: [issue18042] Provide enum.unique class decorator In-Reply-To: <1369299378.37.0.789518154232.issue18042@psf.upfronthosting.co.za> Message-ID: <1372409397.44.0.791403129072.issue18042@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 11:21:17 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 09:21:17 +0000 Subject: [issue18321] Multivolume support in tarfile module In-Reply-To: <1372406777.07.0.523288075904.issue18321@psf.upfronthosting.co.za> Message-ID: <1372411277.02.0.439282919048.issue18321@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +lars.gustaebel stage: -> patch review type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 11:27:23 2013 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 28 Jun 2013 09:27:23 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372411643.51.0.487303278962.issue18317@psf.upfronthosting.co.za> Jakub Wilk added the comment: Making token filtering more thorough may be simpler that going through AST. I think Python should accept all the operators that GNU gettext accepts: http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/plural.y?id=v0.18.2.1#n132 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 11:32:25 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 28 Jun 2013 09:32:25 +0000 Subject: [issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures) In-Reply-To: <1372261030.27.0.471709034157.issue18308@psf.upfronthosting.co.za> Message-ID: <1372411945.43.0.631838715021.issue18308@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 11:43:11 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 28 Jun 2013 09:43:11 +0000 Subject: [issue16251] pickle special methods are looked up on the instance rather than the type In-Reply-To: <1350411894.01.0.763638555345.issue16251@psf.upfronthosting.co.za> Message-ID: <1372412591.9.0.0742519411243.issue16251@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > At the very least the pickle docs deserve some mention of the > behavior. That way people won't need to spend as much time trying to > figure out why things aren't working the way they expect. I think you are overreacting. The rule you are talking about (special methods are only looked up on the class) is really known by experts, not so much by common Python programmers. I'd argue that pickle doesn't break normal users' expectations here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 11:54:55 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 28 Jun 2013 09:54:55 +0000 Subject: [issue18322] test_stat nits Message-ID: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> New submission from Antoine Pitrou: Patch with small fixes and improvements to test_stat. ---------- assignee: christian.heimes components: Tests files: test_stat.patch keywords: patch messages: 191985 nosy: christian.heimes, pitrou priority: normal severity: normal stage: patch review status: open title: test_stat nits type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file30723/test_stat.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 11:56:50 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 28 Jun 2013 09:56:50 +0000 Subject: [issue18287] PyType_Ready() should sanity-check the tp_name field In-Reply-To: <1372000372.42.0.425313116494.issue18287@psf.upfronthosting.co.za> Message-ID: <1372413410.3.0.914842789833.issue18287@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +amaury.forgeotdarc, benjamin.peterson stage: -> patch review versions: +Python 2.7, Python 3.3, Python 3.4 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 12:05:46 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 28 Jun 2013 10:05:46 +0000 Subject: [issue18287] PyType_Ready() should sanity-check the tp_name field In-Reply-To: <1372000372.42.0.425313116494.issue18287@psf.upfronthosting.co.za> Message-ID: <1372413946.11.0.590893455747.issue18287@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: The patch is not complete: PyType_Ready() returns -1 but no no exception is set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 12:35:51 2013 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 28 Jun 2013 10:35:51 +0000 Subject: [issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows In-Reply-To: <1371306434.01.0.246562250059.issue18224@psf.upfronthosting.co.za> Message-ID: <1372415751.85.0.587268883839.issue18224@psf.upfronthosting.co.za> Vinay Sajip added the comment: On further reflection: the pydoc script adds no value over and above "python -m pydoc ", so I think I will remove it. ---------- assignee: -> vinay.sajip versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 13:24:05 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 28 Jun 2013 11:24:05 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1372418645.59.0.815993454118.issue14455@psf.upfronthosting.co.za> Ronald Oussoren added the comment: I intend to commit my latest version of the patch during the europython sprints, with a minor change: don't include dump(s) and load(s), that change (and the other items on "open issues" in my last post) can be addressed later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 13:26:57 2013 From: report at bugs.python.org (Laurent Gautier) Date: Fri, 28 Jun 2013 11:26:57 +0000 Subject: [issue18323] 'GzipFile' object has no attribute 'extrastart' Message-ID: <1372418817.06.0.791452748439.issue18323@psf.upfronthosting.co.za> New submission from Laurent Gautier: When creating a `gzip.GzipFile` using the named parameter `fileobj` rather than filename, iterating over it is broken: ``` AttributeError: 'GzipFile' object has no attribute 'extrastart' ``` The short example below is demonstrating the problem: ## --- import gzip, tempfile _data = (b'@WXOVW:25:85', b'ATACGCGGCT'+b'GATCGTAGCG', b'+', b'@@))CCCCBB'+b'???ECCEECC') data = gzip.zlib.compress(b'\n'.join(_data)) foo = tempfile.NamedTemporaryFile() foo.write(data) foo.flush() foo.seek(0) gzf = gzip.GzipFile(fileobj=foo) # this will trigger the AttributeError for x in gzf: print(x) ---------- components: Library (Lib) messages: 191989 nosy: Laurent.Gautier priority: normal severity: normal status: open title: 'GzipFile' object has no attribute 'extrastart' type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 13:48:33 2013 From: report at bugs.python.org (Niklas Koep) Date: Fri, 28 Jun 2013 11:48:33 +0000 Subject: [issue18287] PyType_Ready() should sanity-check the tp_name field In-Reply-To: <1372000372.42.0.425313116494.issue18287@psf.upfronthosting.co.za> Message-ID: <1372420113.04.0.346797813685.issue18287@psf.upfronthosting.co.za> Niklas Koep added the comment: Oh, you're right, of course. I completely forgot that any other case which jumps to the error label assumes an appropriate exception has already been set. I attached a new patch which raises a TypeError. Is there a better way to identify the type which is affected by this exception? Since we're complaining about the missing tp_name field we obviously can't supply the name in the exception. ---------- Added file: http://bugs.python.org/file30724/patch.default _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 14:23:47 2013 From: report at bugs.python.org (Amaury Forgeot d'Arc) Date: Fri, 28 Jun 2013 12:23:47 +0000 Subject: [issue18287] PyType_Ready() should sanity-check the tp_name field In-Reply-To: <1372000372.42.0.425313116494.issue18287@psf.upfronthosting.co.za> Message-ID: <1372422227.04.0.984476738419.issue18287@psf.upfronthosting.co.za> Amaury Forgeot d'Arc added the comment: Since this error can occur only during the development of a C extension, I would not worry too much. The traceback will already indicate the imported module, this is much better than a segfault later in pydoc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 14:51:19 2013 From: report at bugs.python.org (Eli Bendersky) Date: Fri, 28 Jun 2013 12:51:19 +0000 Subject: [issue18042] Provide enum.unique class decorator In-Reply-To: <1369299378.37.0.789518154232.issue18042@psf.upfronthosting.co.za> Message-ID: <1372423879.27.0.675496605451.issue18042@psf.upfronthosting.co.za> Eli Bendersky added the comment: Sent some review comments. I'll be on a short vacation this weekend, so please wait at least until next week so I can review the changes. Also, Nick should definitely review this too :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 15:04:55 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 28 Jun 2013 13:04:55 +0000 Subject: [issue18323] 'GzipFile' object has no attribute 'extrastart' In-Reply-To: <1372418817.06.0.791452748439.issue18323@psf.upfronthosting.co.za> Message-ID: <1372424695.97.0.7140553429.issue18323@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +nadeem.vawda _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 15:19:59 2013 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Fri, 28 Jun 2013 13:19:59 +0000 Subject: [issue18321] Multivolume support in tarfile module In-Reply-To: <1372406777.07.0.523288075904.issue18321@psf.upfronthosting.co.za> Message-ID: <1372425599.15.0.361970632133.issue18321@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Eduardo, can you please fill out the contributor form? ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 16:52:47 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 28 Jun 2013 14:52:47 +0000 Subject: [issue18309] Make python slightly more relocatable In-Reply-To: <1372262450.0.0.792872111515.issue18309@psf.upfronthosting.co.za> Message-ID: <1372431167.4.0.786535308915.issue18309@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Note that the OSX port already does this for framework builds. I don't know why we don't use the same code for shared library builds. Issue #15498 contains a patch that switches this code from a deprecated nextstep-era API to dladdr. Two comments on the patch attached to this issue: 1) The name "_PyImport_GetModulePath" is confusing, I'd use _PyImport_GetSharedLibPath to make clear that this is locating the shared library. 2) The code calls dladdr on a static variable that's introduced just for that, it is also possible to call dladdr on an already existing symbol (for example the address of a function in the public API). ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 16:57:52 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 28 Jun 2013 14:57:52 +0000 Subject: [issue18317] gettext: DoS via crafted Plural-Forms In-Reply-To: <1372370486.3.0.302841036863.issue18317@psf.upfronthosting.co.za> Message-ID: <1372431472.65.0.334700769741.issue18317@psf.upfronthosting.co.za> Christian Heimes added the comment: Thanks for the link plural.y! I was looking for a C file, not a YACC file. The AST approach has advantages over tokenizing. The tokenizer returns just symbols but the AST has also context information. It makes it much easier to distinguish between unary - and binary -. Gettext supports substraction but doesn't allow negative numbers. Python's gettext is not as strict as GNU gettext. For 3.4 I like to forbid oct and hex numbers, too. ---------- Added file: http://bugs.python.org/file30725/18317_gettext2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 17:14:48 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 28 Jun 2013 15:14:48 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> Message-ID: <1372432488.51.0.529106615564.issue18322@psf.upfronthosting.co.za> Christian Heimes added the comment: I wish the loader would ignore all test classes with a leading underscore or would gain another way to mark a test class as abstract. The mixin approach looks ugly and prohibits tab completion in my IDE. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 17:19:51 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Jun 2013 15:19:51 +0000 Subject: [issue9938] Documentation for argparse interactive use In-Reply-To: <1285338690.84.0.283413950067.issue9938@psf.upfronthosting.co.za> Message-ID: <1372432791.45.0.716764016092.issue9938@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, I think opening a new issue at this point might be a good idea. The reason is that there are a changes either in place or pending in other issues that involve the parse_know_args code, so a new patch is probably required regardless. I wish I had time to review and commit all the argparse patches, but so far I haven't gotten to them. They are on my todo list somewhere, though :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 17:30:02 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Jun 2013 15:30:02 +0000 Subject: [issue18323] 'GzipFile' object has no attribute 'extrastart' In-Reply-To: <1372418817.06.0.791452748439.issue18323@psf.upfronthosting.co.za> Message-ID: <1372433402.13.0.63831125032.issue18323@psf.upfronthosting.co.za> R. David Murray added the comment: Based on a quick glance at the code, the problem isn't that you are passing fileobj, it is that fileobj has been opened for writing, not reading, and you are attempting to read from it. extrastart (and other attibutes) are only set if mode starts with 'r'. There is certainly a bug here, but it might just be that a clearer error should be generated if you try to read a fileobj open for writing. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 17:30:32 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 15:30:32 +0000 Subject: [issue18321] Multivolume support in tarfile module In-Reply-To: <1372406777.07.0.523288075904.issue18321@psf.upfronthosting.co.za> Message-ID: <1372433432.36.0.760414089754.issue18321@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 17:31:03 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Jun 2013 15:31:03 +0000 Subject: [issue18323] 'GzipFile' object has no attribute 'extrastart' In-Reply-To: <1372418817.06.0.791452748439.issue18323@psf.upfronthosting.co.za> Message-ID: <1372433463.5.0.461459185087.issue18323@psf.upfronthosting.co.za> R. David Murray added the comment: On the other hand, it seems reasonable to be able to read if you've done a seek(0), so a more complicated fix may also be appropriate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 17:38:33 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 15:38:33 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1372433913.3.0.517439391524.issue14455@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Let me review your patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 17:42:55 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 28 Jun 2013 15:42:55 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372432488.51.0.529106615564.issue18322@psf.upfronthosting.co.za> Message-ID: <134681134.125402067.1372434169108.JavaMail.root@zimbra10-e2.priv.proxad.net> Antoine Pitrou added the comment: > I wish the loader would ignore all test classes with a leading > underscore or would gain another way to mark a test class as > abstract. The mixin approach looks ugly and prohibits tab completion > in my IDE. I don't really understand what makes mixins "ugly". I'm sorry about your IDE :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 17:46:10 2013 From: report at bugs.python.org (Sylvain Corlay) Date: Fri, 28 Jun 2013 15:46:10 +0000 Subject: [issue10786] unittest.TextTextRunner does not respect redirected stderr In-Reply-To: <1293519479.07.0.371916485658.issue10786@psf.upfronthosting.co.za> Message-ID: <1372434370.37.0.698770115742.issue10786@psf.upfronthosting.co.za> Sylvain Corlay added the comment: Hello, It would be great if this modification was also done for Python 2.7. A reason is that IPython redirects stderr. When running unit tests in the IPython console without specifying the stream argument, the errors are printed in the shell. See http://python.6.x6.nabble.com/How-to-print-stderr-in-qtconsole-td5021001.html ---------- nosy: +sylvain.corlay versions: +Python 2.7 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 18:32:21 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Jun 2013 16:32:21 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <1372437141.17.0.237838391132.issue18111@psf.upfronthosting.co.za> R. David Murray added the comment: Julian, could you please submit a contributor agreement? (http://www.python.org/psf/contrib) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 18:44:07 2013 From: report at bugs.python.org (Christian Heimes) Date: Fri, 28 Jun 2013 16:44:07 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> Message-ID: <1372437847.01.0.900372090416.issue18322@psf.upfronthosting.co.za> Christian Heimes added the comment: Ask your Java buddies about mixins. :) Go ahead and submit the patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 19:26:30 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 28 Jun 2013 17:26:30 +0000 Subject: [issue17914] add os.cpu_count() In-Reply-To: <1367838407.82.0.153634220851.issue17914@psf.upfronthosting.co.za> Message-ID: <3bhlJP28lYzSR8@mail.python.org> Roundup Robot added the comment: New changeset 6a0437adafbd by Charles-Fran?ois Natali in branch 'default': Issue #17914: Use os.cpu_count() instead of multiprocessing.cpu_count() where http://hg.python.org/cpython/rev/6a0437adafbd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 19:31:31 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 28 Jun 2013 17:31:31 +0000 Subject: [issue18111] Add a default argument to min & max In-Reply-To: <1370042466.03.0.969655883225.issue18111@psf.upfronthosting.co.za> Message-ID: <3bhlQB5b0gzSJf@mail.python.org> Roundup Robot added the comment: New changeset 34ff27b431d0 by R David Murray in branch 'default': #18111: Add What's New entry for max/min default. http://hg.python.org/cpython/rev/34ff27b431d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 20:13:18 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 18:13:18 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1372443198.28.0.422366265072.issue18135@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Re-close? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 20:17:13 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 18:17:13 +0000 Subject: [issue18280] Documentation is too personalized In-Reply-To: <1371889714.5.0.753258621658.issue18280@psf.upfronthosting.co.za> Message-ID: <1372443433.92.0.569404411607.issue18280@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I find some anonymous I references (Guido? 20 years ago?) off-putting when reading the doc as formal reference. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 20:19:24 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 18:19:24 +0000 Subject: [issue18292] IDLE Improvements: Unit test for AutoExpand.py In-Reply-To: <1372098554.92.0.798687151295.issue18292@psf.upfronthosting.co.za> Message-ID: <1372443564.61.0.497125599801.issue18292@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 20:21:53 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 28 Jun 2013 18:21:53 +0000 Subject: [issue17914] add os.cpu_count() In-Reply-To: <1367838407.82.0.153634220851.issue17914@psf.upfronthosting.co.za> Message-ID: <1372443713.14.0.354966733372.issue17914@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 Fri Jun 28 20:34:02 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jun 2013 18:34:02 +0000 Subject: [issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes) In-Reply-To: <1370381679.09.0.63930940174.issue18135@psf.upfronthosting.co.za> Message-ID: <1372444442.02.0.177833152842.issue18135@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 20:53:53 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 18:53:53 +0000 Subject: [issue18301] In itertools.chain.from_iterable() there is no cls argument In-Reply-To: <1372186723.21.0.67533324157.issue18301@psf.upfronthosting.co.za> Message-ID: <1372445633.7.0.24115891989.issue18301@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The 2.7 doc says 'Roughly equivalent to' rather than 'Equivalent to'. The undecorated Python version of from_iterable actually works as an attribute of the Python version of chain: chain.from_iterable = from_iterable. I would just remove the decorator. The entire itertools doc exploits that fact that generator functions are analogous to classes, but it does not work to mix the two in the way that the 3.x chain entry does. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:05:06 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Jun 2013 19:05:06 +0000 Subject: [issue4768] email.generator.Generator object bytes/str crash - b64encode() bug? In-Reply-To: <1230571301.08.0.30132908931.issue4768@psf.upfronthosting.co.za> Message-ID: <1372446306.53.0.127800530267.issue4768@psf.upfronthosting.co.za> R. David Murray added the comment: For the record, encode_quopri was fixed in #14360. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:10:04 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 28 Jun 2013 19:10:04 +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: <3bhnbv6tYkzNxG@mail.python.org> Roundup Robot added the comment: New changeset 7c807bc15fa8 by R David Murray in branch '3.3': #14360: Add news item. http://hg.python.org/cpython/rev/7c807bc15fa8 New changeset 36cc8b0446b3 by R David Murray in branch 'default': Merge #14360: Add news item. http://hg.python.org/cpython/rev/36cc8b0446b3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:16:22 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Jun 2013 19:16:22 +0000 Subject: [issue18324] set_payload does not handle binary payloads correctly Message-ID: <1372446982.29.0.852040030503.issue18324@psf.upfronthosting.co.za> New submission from R. David Murray: In order to maintain model consistency without exposing the need for 'surrogateescape' to library users, it should be possible to pass binary data to set_payload and have it do the correct conversion to the expected storage format for the model. Currently, this does not work. The attached patch provides one example test out of a class of tests that should be written and made to pass. ---------- components: email files: set_qp_payload_test.patch keywords: easy, patch messages: 192012 nosy: barry, r.david.murray priority: normal severity: normal stage: test needed status: open title: set_payload does not handle binary payloads correctly type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30726/set_qp_payload_test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:28:14 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 19:28:14 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> Message-ID: <1372447694.13.0.381129925977.issue18322@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:30:00 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 19:30:00 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> Message-ID: <1372447800.46.0.971139345294.issue18322@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:33:00 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 19:33:00 +0000 Subject: [issue18305] [patch] Fast sum() for non-numbers In-Reply-To: <1372228439.5.0.789865081817.issue18305@psf.upfronthosting.co.za> Message-ID: <1372447980.14.0.769605833246.issue18305@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Performance enhancements do not normally go in bugfix releases. The issue of quadratic performance of sum(sequences, null_seq) is known, which is why the doc says that sum() is for numbers and recommends .join for strings and itertools.chain for other sequences. sum([[1,2,3]]*n, []) == [1,2,3]*n == list(chain.from_iterable([[1,2,3]]*n)) For n = 1000000, the second takes a blink of an eye and the third under a second. So there is no issue for properly written code. More generally, sum(listlist, []) == list(chain.from_iterable(listlist)) The latter should be comparable in speed to your patch and has the advantage of not turning the iterator into a concrete list unless and until one actually needs a concrete list. There are two disadvantages to doing the equivalent within sum: 1. People *will* move code that depends on the internal optimization to pythons that do not have it. And they *will* complain about their program 'freezing'. This already happened when the equivalent of str.join was built into sum. It is better to use 'proper' code that will work well enough on all CPython versions and other implementations. 2. It discourages people from carefully thinking about whether they actually need a concrete list or merely the iterator for a virtual list. The latter work for sequences that are too long to fit in memory. So my inclination is to reject the change. ---------- nosy: +terry.reedy versions: +Python 3.4 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:47:05 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 19:47:05 +0000 Subject: [issue18305] [patch] Fast sum() for non-numbers In-Reply-To: <1372228439.5.0.789865081817.issue18305@psf.upfronthosting.co.za> Message-ID: <1372448825.17.0.257367429732.issue18305@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I agree with Terry. CPython deliberately disallow use sum() with lists of strings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:52:06 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 19:52:06 +0000 Subject: [issue18301] In itertools.chain.from_iterable() there is no cls argument In-Reply-To: <1372186723.21.0.67533324157.issue18301@psf.upfronthosting.co.za> Message-ID: <1372449126.04.0.769743817039.issue18301@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Perhaps it should be staticmethod, not classmethod. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:56:28 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 19:56:28 +0000 Subject: [issue18266] Fix test discovery for test_largefile.py In-Reply-To: <1371675654.81.0.262540951411.issue18266@psf.upfronthosting.co.za> Message-ID: <1372449388.97.0.868485549467.issue18266@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 21:56:47 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Jun 2013 19:56:47 +0000 Subject: [issue17767] Fix test discovery for test_locale.py In-Reply-To: <1366141872.94.0.252098297991.issue17767@psf.upfronthosting.co.za> Message-ID: <1372449407.46.0.370225572471.issue17767@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 22:00:30 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 20:00:30 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> Message-ID: <1372449630.69.0.505907671819.issue18322@psf.upfronthosting.co.za> Terry J. Reedy added the comment: While you are at it, should you just replace test_main with unittest.main? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 22:15:49 2013 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Jun 2013 20:15:49 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> Message-ID: <1372450549.88.0.0908713173993.issue18322@psf.upfronthosting.co.za> STINNER Victor added the comment: > The mixin approach looks ugly and prohibits tab completion in my IDE. It is a common practice in Python, especially in tests. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 22:50:16 2013 From: report at bugs.python.org (Federico Schwindt) Date: Fri, 28 Jun 2013 20:50:16 +0000 Subject: [issue18325] test_kqueue fails in OpenBSD Message-ID: <1372452616.96.0.640334462237.issue18325@psf.upfronthosting.co.za> New submission from Federico Schwindt: test_kqueue fails in OpenBSD/amd64 -current: Traceback (most recent call last): File "/usr/obj/pobj/Python-3.3.2/Python-3.3.2/Lib/test/test_kqueue.py", line 79, in test_create_event ev = select.kevent(bignum, 1, 2, 3, sys.maxsize, bignum) OverflowError: signed integer is greater than maximum In OpenBSD, ident is an unsigned integer data is a signed integer. See http://bugs.python.org/issue12181 for details. ---------- components: Tests messages: 192018 nosy: Federico.Schwindt, neologix priority: normal severity: normal status: open title: test_kqueue fails in OpenBSD versions: Python 2.7, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 22:50:44 2013 From: report at bugs.python.org (Federico Schwindt) Date: Fri, 28 Jun 2013 20:50:44 +0000 Subject: [issue18325] test_kqueue fails in OpenBSD In-Reply-To: <1372452616.96.0.640334462237.issue18325@psf.upfronthosting.co.za> Message-ID: <1372452644.39.0.449862718128.issue18325@psf.upfronthosting.co.za> Changes by Federico Schwindt : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 23:20:36 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 21:20:36 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372454436.58.0.653525305948.issue18315@psf.upfronthosting.co.za> Terry J. Reedy added the comment: If you think you will ever contribute another patch (and we hope you do), and you have not yet submitted a contributor agreement, please do. http://www.python.org/psf/contrib/contrib-form/ http://www.python.org/psf/contrib/ Once processed, a * will appear after your name. In the meanwhile, I will fix this. (2.6 is security patches only.) Your patch missed the doc, as opposed to the docstrings, but your report with tracker research was unusually complete. Thanks. ---------- assignee: docs at python -> terry.reedy nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 23:27:19 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 21:27:19 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372454839.44.0.71323219604.issue18315@psf.upfronthosting.co.za> Terry J. Reedy added the comment: David, with the addition, this line """class FileInput([files[, inplace[, backup[, bufsize[, mode[, openhook]]]]]]) ends at position 83 instead of 80. It should stay on one line. I could reduce that by removing blanks after ,s. Is it better to be a bit too long or a bit too compressed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 23:34:17 2013 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Jun 2013 21:34:17 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372455257.35.0.983340914795.issue18315@psf.upfronthosting.co.za> R. David Murray added the comment: At 83 it is a judgement call whether to leave it long or wrap it. I wouldn't compress it. (Wrapping is done by putting a '\' at the end of the line you want to wrap, if you don't already know that). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 23:35:41 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 21:35:41 +0000 Subject: [issue18315] bufsize parameter not documented in 2.7.5 In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372455341.79.0.0882596014961.issue18315@psf.upfronthosting.co.za> Changes by Terry J. Reedy : Added file: http://bugs.python.org/file30727/18315-fileinput-27.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 28 23:50:47 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 21:50:47 +0000 Subject: [issue18315] Fix fileinput doc and docstrings (add 'buffer' in 2.7) In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372456247.96.0.989763967138.issue18315@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I just remembered: the first list of a .py file docstring should be a one line summary of what the callable does. It should not give the signature because (unlike C function currently) help does that for us from the callable itself (using the inspect module). Putting it in the docstring just repeats it. On 3.3.2: >>> help(fileinput.input) Help on function input in module fileinput: input(files=None, inplace=False, backup='', bufsize=0, mode='r', openhook=None) input(files=None, inplace=False, backup="", bufsize=0, mode="r", openhook=None) ... So the 3.x files need correcting also. For .doc, the signature does need to be present and correct. ---------- title: bufsize parameter not documented in 2.7.5 -> Fix fileinput doc and docstrings (add 'buffer' in 2.7) versions: +Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 01:00:19 2013 From: report at bugs.python.org (Roundup Robot) Date: Fri, 28 Jun 2013 23:00:19 +0000 Subject: [issue18315] Fix fileinput doc and docstrings (add 'buffer' in 2.7) In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <3bhtjZ2YMZzRrF@mail.python.org> Roundup Robot added the comment: New changeset 80b1c5b25ff0 by Terry Jan Reedy in branch '2.7': Issue #18315: Improve fileinput docs by adding 'bufsize' where missing and http://hg.python.org/cpython/rev/80b1c5b25ff0 New changeset 0760b58526ba by Terry Jan Reedy in branch '3.3': Issue #18315: Improve fileinput docs by adding 'bufsize' where missing and http://hg.python.org/cpython/rev/0760b58526ba ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 01:01:29 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Jun 2013 23:01:29 +0000 Subject: [issue18315] Fix fileinput doc and docstrings (add 'buffer' in 2.7) In-Reply-To: <1372348798.45.0.272594255655.issue18315@psf.upfronthosting.co.za> Message-ID: <1372460489.18.0.119245747204.issue18315@psf.upfronthosting.co.za> Terry J. Reedy added the comment: There was one missing 'bufsize' in 3.x also. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 01:52:21 2013 From: report at bugs.python.org (Sergey) Date: Fri, 28 Jun 2013 23:52:21 +0000 Subject: [issue18305] [patch] Fast sum() for non-numbers In-Reply-To: <1372228439.5.0.789865081817.issue18305@psf.upfronthosting.co.za> Message-ID: <1372463541.02.0.559209336606.issue18305@psf.upfronthosting.co.za> Sergey added the comment: > The issue of quadratic performance of sum(sequences, null_seq) is known I hope it's never too late to fix some bugs... :) > sum([[1,2,3]]*n, []) == [1,2,3]*n == list(chain.from_iterable([[1,2,3]]*n)) But if you already have a list of lists, and you need to join the lists together you have only two of those: 1. sum(list_of_lists, []) 2. list(chain.from_iterable(list_of_lists)) And using sum is much more obvious than using itertools, that most people may not (and don't have to) even know about. When someone, not a python-guru, just thinks about that, she would think "so, I'll just add lists together, let's write a for-loop... Oh, wait, that's what sum() does, it adds things, and python is dynamic-type, sum() should work for everything". That's how I was thinking, that's how most people would think, I guess... I was very surprised to find out about that bug. > 1. People *will* move code that depends on the internal optimization to pythons that do not have it. Looks like this bug is CPython-specific, others (Jython, IronPython...) don't have it, so people will move code that depends on the internal optimization to other pythons that DO have it. :) > 2. It discourages people from carefully thinking about whether they actually need a concrete list or merely the iterator for a virtual list. Hm... Currently people can also use iterator for sum() or list for itertools. Nothing changed... > I agree with Terry. CPython deliberately disallow use sum() with lists of strings. Isn't it exactly because of this bug? I mean, if this bug gets fixed, sum would be as fast as join, or maybe even faster, right? So the string restriction can be dropped later. But that would be a separate bugreport. Anyway, the bug is there not just for strings, it also happens for lists, or for any other non-numeric objects that can be added. PS: I was ready that my patch may not get accepted, and I'm actually thinking on another way of doing that (just don't know how to get a copy of arbitrary PyObject in C yet). But I thought that the idea itself is great: finally making sum() fast without any trade-offs, what could be better? Patch works at least for 2.7, 3.3, hg-tip and can be easily ported to any other version. I have not expected to get such a cold shoulder. :( ---------- versions: +Python 2.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 02:01:15 2013 From: report at bugs.python.org (Berker Peksag) Date: Sat, 29 Jun 2013 00:01:15 +0000 Subject: [issue17940] extra code in argparse.py In-Reply-To: <1368052350.83.0.843381398629.issue17940@psf.upfronthosting.co.za> Message-ID: <1372464075.05.0.354028819793.issue17940@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- stage: needs patch -> patch review versions: +Python 3.4 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 05:48:04 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jun 2013 03:48:04 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <3bj15b0mF3zSq9@mail.python.org> Roundup Robot added the comment: New changeset 2176c1867b34 by Terry Jan Reedy in branch 'default': Issue #18081: Back out temporary changeset, 2a9e1eb3719c, to merge new patch. http://hg.python.org/cpython/rev/2176c1867b34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 05:53:42 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jun 2013 03:53:42 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning In-Reply-To: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> Message-ID: <3bj1D55fg2z7LjN@mail.python.org> Roundup Robot added the comment: New changeset c15d0baac3d6 by Terry Jan Reedy in branch '3.3': Issue *18081, #18242: Change Idle warnings capture in PyShell and run to stop http://hg.python.org/cpython/rev/c15d0baac3d6 New changeset 89e0d33cb978 by Terry Jan Reedy in branch '2.7': Issue *18081, #18242: Change Idle warnings capture in PyShell and run to stop http://hg.python.org/cpython/rev/89e0d33cb978 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 05:55:16 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Jun 2013 03:55:16 +0000 Subject: [issue18242] IDLE should not be replacing warnings.formatwarning In-Reply-To: <1371481160.56.0.0975578809817.issue18242@psf.upfronthosting.co.za> Message-ID: <1372478116.68.0.895423995448.issue18242@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 06:05:43 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Jun 2013 04:05:43 +0000 Subject: [issue18081] test_logging failure in WarningsTest on buildbots In-Reply-To: <1369754727.16.0.996234462502.issue18081@psf.upfronthosting.co.za> Message-ID: <1372478743.76.0.0166207486845.issue18081@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This was sent to #18242 but not here. I expected here also. New changeset c15d0baac3d6 by Terry Jan Reedy in branch '3.3': Issue *18081, #18242: Change Idle warnings capture in PyShell and run http://hg.python.org/cpython/rev/c15d0baac3d6 New changeset 89e0d33cb978 by Terry Jan Reedy in branch '2.7': Issue *18081, #18242: Change Idle warnings capture in PyShell and run http://hg.python.org/cpython/rev/89e0d33cb978 Brett's test case works on my machine, all 3 versions. python_d -m test[.regrtest] test_idle test_logging ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 06:59:55 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jun 2013 04:59:55 +0000 Subject: [issue18316] Idle 2.7: update to simplify cross-version patches In-Reply-To: <1372364496.41.0.313371812412.issue18316@psf.upfronthosting.co.za> Message-ID: <3bj2hW11Rpz7Lk5@mail.python.org> Roundup Robot added the comment: New changeset aa1350c7d196 by Terry Jan Reedy in branch '2.7': Issue #18316: Update idlelib 2.7 except clauses to ease backports. http://hg.python.org/cpython/rev/aa1350c7d196 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 06:59:59 2013 From: report at bugs.python.org (Zachary Ware) Date: Sat, 29 Jun 2013 04:59:59 +0000 Subject: [issue16000] test_curses should use unittest In-Reply-To: <1348263086.74.0.172285441847.issue16000@psf.upfronthosting.co.za> Message-ID: <1372481999.02.0.246124468992.issue16000@psf.upfronthosting.co.za> Zachary Ware added the comment: I had a chance to look at this today and took a stab at writing a patch (attached). Since moving all of the test functions into a TestCase subclass necessarily means indenting everything another level, the patch is a huge ugly mix of - and + lines that don't really have any relation to each other. As such, I'll also be attaching another patch which is for review purposes only: it differs from the real patch by only indenting the def statements by 2 spaces instead of the usual 4, allowing the bodies of the methods to not be indented, which makes the changes MUCH easier to keep track of. As Chris mentioned previously, running the test in verbose mode (under regrtest) causes rendering problems. I worked around this by adding a "print('')" to the setUp method; it doesn't make things perfect, but it makes it a bit easier to read. I'm not terribly attached to this hack, though, so I'd be fine with removing it if anyone has a preference. Also as Chris mentioned, there is an open question of how to do setup, whether to do things in TestCase.setUp, TestCase,setUpClass, or setUpModule. This patch does initial curses.setupterm() in setUpModule, then initscr and savetty in setUp (with resetty and endwin in tearDown). However, this is not how the module has been testing; it has been doing initscr/savetty and resetty/endwin only once throughout execution. I've considered creating a subclass of the TestCurses test class which would do initscr/savetty in setUpClass, to do all the tests again on the same screen (as has been up to now), but I'd like others' opinions on that before I write it. Also, this patch is against default; I'll make sure it works for 3.3 after a round or two of review. ---------- Added file: http://bugs.python.org/file30728/issue16000.v1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 07:00:45 2013 From: report at bugs.python.org (Zachary Ware) Date: Sat, 29 Jun 2013 05:00:45 +0000 Subject: [issue16000] test_curses should use unittest In-Reply-To: <1348263086.74.0.172285441847.issue16000@psf.upfronthosting.co.za> Message-ID: <1372482045.22.0.780981594759.issue16000@psf.upfronthosting.co.za> Changes by Zachary Ware : Added file: http://bugs.python.org/file30729/issue16000.v1-cmp.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 09:20:47 2013 From: report at bugs.python.org (paul j3) Date: Sat, 29 Jun 2013 07:20:47 +0000 Subject: [issue16418] argparse with many choices can generate absurdly long usage message In-Reply-To: <1352157111.52.0.432994430995.issue16418@psf.upfronthosting.co.za> Message-ID: <1372490447.05.0.283661813083.issue16418@psf.upfronthosting.co.za> Changes by paul j3 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 12:59:05 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jun 2013 10:59:05 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> Message-ID: <3bjBfw4pJxzPPY@mail.python.org> Roundup Robot added the comment: New changeset f3f38c84aebc by Antoine Pitrou in branch 'default': Issue #18322: fix some test_stat nits. http://hg.python.org/cpython/rev/f3f38c84aebc ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 12:59:28 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 29 Jun 2013 10:59:28 +0000 Subject: [issue18322] test_stat nits In-Reply-To: <1372413295.3.0.80971149549.issue18322@psf.upfronthosting.co.za> Message-ID: <1372503568.0.0.0771428887112.issue18322@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Committed with unittest.main(). Thanks for the comments. ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 13:51:26 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Jun 2013 11:51:26 +0000 Subject: [issue18266] Fix test discovery for test_largefile.py In-Reply-To: <1371675654.81.0.262540951411.issue18266@psf.upfronthosting.co.za> Message-ID: <1372506686.39.0.942709321015.issue18266@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is other problem with test_largefile. It not allows running only selected tests. I.e. ./python -m test.regrtest -v -m test_lseek test_largefile Looks as test_largefile was suboptimal converted to unittest. ---------- nosy: +facundobatista, giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 15:05:36 2013 From: report at bugs.python.org (icedream91) Date: Sat, 29 Jun 2013 13:05:36 +0000 Subject: [issue18326] Not Clear Docs Message-ID: <1372511136.61.0.278425078947.issue18326@psf.upfronthosting.co.za> New submission from icedream91: I think the documents talking about list.sort() in page http://docs.python.org/3/library/stdtypes.html#list.sort is not clear enough. What asterisk means in "sort(*, key=None, reverse=None)", may be cmp argument from Python 2, or anything else? Or it is a typo? I think document should explain what this asterisk means. Thanks. ---------- assignee: docs at python components: Documentation messages: 192034 nosy: docs at python, icedream91 priority: normal severity: normal status: open title: Not Clear Docs versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 15:27:03 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 29 Jun 2013 13:27:03 +0000 Subject: [issue18326] Not Clear Docs In-Reply-To: <1372511136.61.0.278425078947.issue18326@psf.upfronthosting.co.za> Message-ID: <1372512423.8.0.145150226683.issue18326@psf.upfronthosting.co.za> R. David Murray added the comment: It means they are keyword-only arguments. This could be mentioned in the text, with the term 'keyword-only arguments' linked to an appropriate glossary entry (which appears to need to be added). ---------- keywords: +easy nosy: +r.david.murray stage: -> needs patch versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 15:57:49 2013 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 29 Jun 2013 13:57:49 +0000 Subject: [issue18280] Documentation is too personalized In-Reply-To: <1371889714.5.0.753258621658.issue18280@psf.upfronthosting.co.za> Message-ID: <1372514269.87.0.537952307552.issue18280@psf.upfronthosting.co.za> Antoine Pitrou added the comment: The sockets tutorial deserves a good overhaul :-) ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 19:03:45 2013 From: report at bugs.python.org (Ronald Oussoren) Date: Sat, 29 Jun 2013 17:03:45 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1372525425.22.0.451989266669.issue14455@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Any review would be greatly appreciated. One thing I'm not too happy about is the use of magic numbers in the binary plist support code, but I think that using constants or a dispatch table would not make the code any clearer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 19:16:43 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jun 2013 17:16:43 +0000 Subject: [issue18237] unittest.assertRaisesRegex(p) example is wrong in docs In-Reply-To: <1371432897.82.0.367432880569.issue18237@psf.upfronthosting.co.za> Message-ID: <3bjM2f2rBgz7Ljj@mail.python.org> Roundup Robot added the comment: New changeset 4a714fea95ef by Terry Jan Reedy in branch '2.7': Issue #18237: Fix assertRaisesRegexp error caought by Jeff Tratner. http://hg.python.org/cpython/rev/4a714fea95ef New changeset b3d19f0494e7 by Terry Jan Reedy in branch '3.3': Issue #18237: Fix assertRaisesRegexp error caought by Jeff Tratner. http://hg.python.org/cpython/rev/b3d19f0494e7 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 19:21:52 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Jun 2013 17:21:52 +0000 Subject: [issue18237] unittest.assertRaisesRegex(p) example is wrong in docs In-Reply-To: <1371432897.82.0.367432880569.issue18237@psf.upfronthosting.co.za> Message-ID: <1372526512.47.0.384655526442.issue18237@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I went with adding ' after changing '...' to "...". If you think you might ever submit a more substantial patch, and we hope you do, please submit a Contributor Agreement (now optionally electronic). http://www.python.org/psf/contrib/ When processed (a week?), an * will appear after your name. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 19:24:37 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 29 Jun 2013 17:24:37 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1372526677.94.0.12961643988.issue18244@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Looks like the priority ordering you mention is not yet documented anywhere. It definitely makes sense but I'd like to take a step back for a moment to consider the following questions: 1. What additional functionality do our users get with this ordering? In other words, what purpose does this new ordering have? Apart from solving the conflict we're discussing, I can't see any. 2. What disadvantages does this ordering bring to the table? I think that simplicity is a feature. This ordering creates additional complexity in the language. Firstly, there is currently no obvious way for users to distinguish between implicit subclassing (via implementation) or subclassing by `abc.register()`. This creates the dangerous situation where backwards incompatibility introduced by switching between those ABC registration mechanism is nearly impossible to debug. Consider an example: version A of a library has a type which only implicitly subclasses an ABC. User code with singledispatch is created that works with the current state of things. Version B of the same library uses `ABC.register(Type)` and suddenly the dispatch changes without any way for the user to see what's going on. A similar example with explicit subclassing and a different form of registration is easier to debug, but not much, really. Secondly, it creates this awkward situation where dispatch for any custom `MutableMapping` can be different from the dispatch for `dict`. Although the latter is a `MutableMapping` "only" by means of `MutableMapping.register(dict)`, in reality the whole definition of what a mutable mapping is comes from the behaviour found in `dict`. Following your point of view, dict is less of a mutable mapping than a custom type subclassing the ABC explicitly. You're saying the user should "respect the choice of its author" but it's clearly suboptimal here. I strongly believe I should be able to swap a mutable mapping implementation with any other and get consistent dispatch. Thirdly, while I can't support this with any concrete examples, I have a gut feeling that considering all three ABC subclassing mechanisms to be equally binding will end up as a toolkit with better composability. The priority ordering on the other hand designs `abc.register()` and implicit subclassing as inferior MRO wannabes. Last but not least, the priority ordering will further complicate the implementation of `functools._compose_mro()` and friends. While the complexity of this code is not the reason of my stance on the matter, I think it nicely shows how much the user has to keep in her head to really know what's going on. Especially that we only consider this ordering to be decisive on a single interitance level. 3. Why is the ordering MRO -> register -> implicit? The reason I'm asking is that the whole existence of `abc.register()` seems to come from the following: * we want types that predate the creation of an ABC to be considered its subclasses; * we can't use implicit subclassing because either the existence of methods in question is not enough (e.g. Mapping versus Sequence); or the methods are added at runtime and don't appear in __dict__. Considering the above, one might argue that the following order is just as well justified: MRO -> implicit -> register. I'm aware that the decision to put register first is because if the user is unhappy with the dispatch, she can override the ordering by registering types which were implicit before. But, while I can register third-party types, I can't unregister any. In other words, I find this ordering arbitrary. I hope you don't perceive my position as stubborn, I just care enough to insist on this piece of machinery to be clearly defined and as simple as possible (but not simpler, sure). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 20:23:42 2013 From: report at bugs.python.org (Ethan Furman) Date: Sat, 29 Jun 2013 18:23:42 +0000 Subject: [issue18042] Provide enum.unique class decorator In-Reply-To: <1369299378.37.0.789518154232.issue18042@psf.upfronthosting.co.za> Message-ID: <1372530222.86.0.763817437798.issue18042@psf.upfronthosting.co.za> Ethan Furman added the comment: Integrated comments. ---------- Added file: http://bugs.python.org/file30730/unique.stoneleaf.02.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 21:08:45 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 29 Jun 2013 19:08:45 +0000 Subject: [issue18327] swapped arguments in compatible_for_assignment()? Message-ID: <1372532925.38.0.271653772611.issue18327@psf.upfronthosting.co.za> New submission from Christian Heimes: Coverity has found something fishy in our code base: CID 983564 (#1 of 1): Arguments in wrong order (SWAPPED_ARGUMENTS)swapped_arguments: The positions of arguments newto and oldto are inconsistent with the positions of the corresponding parameters for "compatible_for_assignment(PyTypeObject *, PyTypeObject *, char *)". Object/typeobject.c:3326 if (compatible_for_assignment(newto, oldto, "__class__")) { Objects/typeobject.c.3265 static int compatible_for_assignment(PyTypeObject* oldto, PyTypeObject* newto, char* attr) ---------- components: Interpreter Core messages: 192042 nosy: christian.heimes priority: normal severity: normal stage: test needed status: open title: swapped arguments in compatible_for_assignment()? type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 21:22:50 2013 From: report at bugs.python.org (Demian Brecht) Date: Sat, 29 Jun 2013 19:22:50 +0000 Subject: [issue18206] license url in site.py should always use X.Y.Z form of version number In-Reply-To: <1371162560.09.0.685782864566.issue18206@psf.upfronthosting.co.za> Message-ID: <1372533770.96.0.151934967024.issue18206@psf.upfronthosting.co.za> Changes by Demian Brecht : ---------- nosy: +dbrecht _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 21:27:01 2013 From: report at bugs.python.org (Phil Webster) Date: Sat, 29 Jun 2013 19:27:01 +0000 Subject: [issue18292] IDLE Improvements: Unit test for AutoExpand.py In-Reply-To: <1372098554.92.0.798687151295.issue18292@psf.upfronthosting.co.za> Message-ID: <1372534021.52.0.321808723116.issue18292@psf.upfronthosting.co.za> Changes by Phil Webster : ---------- nosy: +philwebster _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 21:27:32 2013 From: report at bugs.python.org (Demian Brecht) Date: Sat, 29 Jun 2013 19:27:32 +0000 Subject: [issue17908] Unittest runner needs an option to call gc.collect() after each test In-Reply-To: <1367720444.87.0.21268529715.issue17908@psf.upfronthosting.co.za> Message-ID: <1372534052.48.0.525831409796.issue17908@psf.upfronthosting.co.za> Changes by Demian Brecht : ---------- nosy: +dbrecht _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 21:29:19 2013 From: report at bugs.python.org (Demian Brecht) Date: Sat, 29 Jun 2013 19:29:19 +0000 Subject: [issue17845] Clarify successful build message In-Reply-To: <1366911874.8.0.692153365711.issue17845@psf.upfronthosting.co.za> Message-ID: <1372534159.32.0.176696684905.issue17845@psf.upfronthosting.co.za> Changes by Demian Brecht : ---------- nosy: +dbrecht _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 21:53:37 2013 From: report at bugs.python.org (Christian Heimes) Date: Sat, 29 Jun 2013 19:53:37 +0000 Subject: [issue18328] Use after free in pystate.c Message-ID: <1372535617.95.0.680763936377.issue18328@psf.upfronthosting.co.za> New submission from Christian Heimes: Coverity doesn't like the code in and I think it's right. Can somebody look into the matter and check Python 3.3, too? http://hg.python.org/cpython/file/ac7bc6700ac3/Python/pystate.c#l376 http://hg.python.org/cpython/file/ac7bc6700ac3/Python/pystate.c#l394 10. freed_arg: "tstate_delete_common(PyThreadState *)" frees "tstate". 395 tstate_delete_common(tstate); 11. Condition "autoInterpreterState", taking true branch CID 1019639 (#1 of 1): Use after free (USE_AFTER_FREE)12. use_after_free: Using freed pointer "tstate". 396 if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate) 397 PyThread_delete_key_value(autoTLSkey); ---------- components: Interpreter Core messages: 192043 nosy: christian.heimes priority: normal severity: normal stage: test needed status: open title: Use after free in pystate.c type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 23:25:58 2013 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sat, 29 Jun 2013 21:25:58 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation Message-ID: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> New submission from ???? ?????????: Results or running attached program: $ python2.7 qwe.py TCP mode, makefile method. 198807.2 lines per second (189.6 MB/s). Delay is 5.03 seconds TCP mode, fdopen method. 1041666.7 lines per second (993.4 MB/s). Delay is 0.96 seconds UNIX mode, makefile method. 2040816.3 lines per second (1946.3 MB/s). Delay is 0.49 seconds UNIX mode, fdopen method. 1923076.9 lines per second (1834.0 MB/s). Delay is 0.52 seconds $ python3.2 qwe.py TCP mode, makefile method. 275482.1 lines per second (262.7 MB/s). Delay is 3.63 seconds TCP mode, fdopen method. 909090.9 lines per second (867.0 MB/s). Delay is 1.10 seconds UNIX mode, makefile method. 323624.6 lines per second (308.6 MB/s). Delay is 3.09 seconds UNIX mode, fdopen method. 1694915.3 lines per second (1616.4 MB/s). Delay is 0.59 seconds ---------------------------------------------- 1. in every case, socket.makefile() is MUCH slower than os.fdopen() when used as "for line in fileobject" 2. compare speeds between python 2.7 and python 3.2 in same operation. Especially, socketpair+makefile 3. Why not to return os.fdopen() for sockets when socket.makefile() called on unix systems? ---------- components: IO, Library (Lib) files: qwe.py messages: 192044 nosy: mmarkk priority: normal severity: normal status: open title: for line in socket.makefile() speed degradation type: performance versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file30731/qwe.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 23:26:09 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Jun 2013 21:26:09 +0000 Subject: [issue14455] plistlib unable to read json and binary plist files In-Reply-To: <1333144578.81.0.343123708942.issue14455@psf.upfronthosting.co.za> Message-ID: <1372541169.04.0.49558480913.issue14455@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I have added comments on Rietveld. I have to apologize for unwitting misleading of d9pouces. Functional version of the patch is enough Pythonic and it looks more clear to me than object-oriented one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 23:36:16 2013 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sat, 29 Jun 2013 21:36:16 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation In-Reply-To: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> Message-ID: <1372541776.82.0.246578996273.issue18329@psf.upfronthosting.co.za> ???? ????????? added the comment: Yes, results are repeatable, and for python 2.7 I have roughly same timings for UNIX socket. Also, I have straced all variants and see that in all 4 cases (and for both python versions) IO is done using 8192 blocks in size, so buffering is not cause of problems. I have linux 3.5.0, Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 23:43:26 2013 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sat, 29 Jun 2013 21:43:26 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation In-Reply-To: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> Message-ID: <1372542206.91.0.4990516767.issue18329@psf.upfronthosting.co.za> ???? ????????? added the comment: Well, python 3.3 is slightly faster: $ python3.3 qwe.py TCP mode, makefile method. 380228.1 lines per second (362.6 MB/s). Delay is 2.63 seconds TCP mode, fdopen method. 877193.0 lines per second (836.6 MB/s). Delay is 1.14 seconds UNIX mode, makefile method. 469483.6 lines per second (447.7 MB/s). Delay is 2.13 seconds UNIX mode, fdopen method. 1562500.0 lines per second (1490.1 MB/s). Delay is 0.64 seconds But problem still exists ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 23:44:17 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 29 Jun 2013 21:44:17 +0000 Subject: [issue12716] Reorganize os docs for files/dirs/fds In-Reply-To: <1312900904.97.0.581848486096.issue12716@psf.upfronthosting.co.za> Message-ID: <1372542257.15.0.498235995415.issue12716@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Closing this issue after a week. Mike Hoy: thanks for your patch. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 23:49:40 2013 From: report at bugs.python.org (A.M. Kuchling) Date: Sat, 29 Jun 2013 21:49:40 +0000 Subject: [issue4199] add shorthand global and nonlocal statements In-Reply-To: <1224887535.03.0.272495603252.issue4199@psf.upfronthosting.co.za> Message-ID: <1372542580.24.0.502720540573.issue4199@psf.upfronthosting.co.za> A.M. Kuchling added the comment: Bumping version to 3.4. I'll send a note to python-dev about this issue. ---------- versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 23:53:37 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Jun 2013 21:53:37 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation In-Reply-To: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> Message-ID: <1372542817.8.0.645119535075.issue18329@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Try to wrap socket.makefile() with io.BufferedReader(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 29 23:59:24 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sat, 29 Jun 2013 21:59:24 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation In-Reply-To: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> Message-ID: <1372543164.95.0.156218427681.issue18329@psf.upfronthosting.co.za> Richard Oudkerk added the comment: I think in Python 3 makefile() returns a TextIOWrapper object by default. To force the use of binary you need to specfiy the mode: fileobj = ss.makefile(mode='rb') ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 00:09:07 2013 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sat, 29 Jun 2013 22:09:07 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation In-Reply-To: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> Message-ID: <1372543747.93.0.923820211642.issue18329@psf.upfronthosting.co.za> ???? ????????? added the comment: Eliminate unicode conversion for python3, but results still the same $ python2.7 qwe.py TCP mode, makefile method. 211416.5 lines per second (201.6 MB/s). Delay is 4.73 seconds TCP mode, fdopen method. 1041666.7 lines per second (993.4 MB/s). Delay is 0.96 seconds UNIX mode, makefile method. 2040816.3 lines per second (1946.3 MB/s). Delay is 0.49 seconds UNIX mode, fdopen method. 1886792.5 lines per second (1799.4 MB/s). Delay is 0.53 seconds $ python3.2 qwe.py TCP mode, makefile method. 487804.9 lines per second (465.2 MB/s). Delay is 2.05 seconds TCP mode, fdopen method. 900900.9 lines per second (859.2 MB/s). Delay is 1.11 seconds UNIX mode, makefile method. 625000.0 lines per second (596.0 MB/s). Delay is 1.60 seconds UNIX mode, fdopen method. 1492537.3 lines per second (1423.4 MB/s). Delay is 0.67 seconds $ python3.3 qwe.py TCP mode, makefile method. 512820.5 lines per second (489.1 MB/s). Delay is 1.95 seconds TCP mode, fdopen method. 884955.8 lines per second (844.0 MB/s). Delay is 1.13 seconds UNIX mode, makefile method. 680272.1 lines per second (648.8 MB/s). Delay is 1.47 seconds UNIX mode, fdopen method. 1587301.6 lines per second (1513.8 MB/s). Delay is 0.63 seconds Also, io.BufferedReader() is not my case. I understand that intermediate buffer will increase performance. Problem in implementation of socket.makefile(). That is I want to be fixed. ---------- Added file: http://bugs.python.org/file30732/qwe.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 00:09:24 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Jun 2013 22:09:24 +0000 Subject: [issue18330] Fix idlelib.PyShell.build_subprocess_arglist use of __import__ Message-ID: <1372543764.27.0.834894616208.issue18330@psf.upfronthosting.co.za> New submission from Terry J. Reedy: The purpose of the function is to create a command line for the user subprocess. Most of its body: ''' # Maybe IDLE is installed and is being accessed via sys.path, # or maybe it's not installed and the idle.py script is being # run from the IDLE source directory. del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc', default=False, type='bool') if __name__ == 'idlelib.PyShell': command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,) else: command = "__import__('run').main(%r)" % (del_exitf,) return [sys.executable] + w + ["-c", command, str(self.port)] ''' Question: is it really important to avoid binding the run module to 'run' in the user process? If so, maybe we should use importlib.import_module, as 'direct use of __import__ is entirely discouraged". The first command looks 'funny' because of the repetition of 'run'. The reason is that __import__('idlelib.run') returns idlelib, not idlelib.run. Perhaps it would work to delete .run in the import, or to use importlib.import_module. The second command incorrectly assumes that if __name__ == '__main__' (the alternative to 'idlelib.PyShell'), then the directory containing PyShell and run is the current working directory. This is true if PyShell is run from that directory, but F:\Python\dev\py33\PCbuild>python_d -m idlelib.PyShell F:\Python\dev\py33\PCbuild>python_d ../Lib/idlelib/PyShell.py both report "ImportError: No module named 'run'" and open a shell window and error message box a few seconds later. The shell closes when the messagebox is dismissed. It seems to me that the 'else' caters to a non-existent or impossible use case. PyShell has several 'from idlelib.X import Y' statements. If those work, then "from idlelib import run' must work, and so too must the function equivalent. ---------- messages: 192053 nosy: roger.serwy, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Fix idlelib.PyShell.build_subprocess_arglist use of __import__ type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 00:09:36 2013 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sat, 29 Jun 2013 22:09:36 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation In-Reply-To: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> Message-ID: <1372543776.14.0.526023452179.issue18329@psf.upfronthosting.co.za> Changes by ???? ????????? : Removed file: http://bugs.python.org/file30731/qwe.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 00:14:34 2013 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sat, 29 Jun 2013 22:14:34 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation In-Reply-To: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> Message-ID: <1372544074.14.0.717416104457.issue18329@psf.upfronthosting.co.za> ???? ????????? added the comment: Can anyone test in python 3.4 ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 00:30:45 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jun 2013 22:30:45 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <3bjV1042Mhz7Ljm@mail.python.org> Roundup Robot added the comment: New changeset c818c215f1a4 by Terry Jan Reedy in branch '3.3': Issue #18103: Update README.txt and test_idle to describe and run gui tests. http://hg.python.org/cpython/rev/c818c215f1a4 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 00:41:17 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jun 2013 22:41:17 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <3bjVF92Ch3z7Ljm@mail.python.org> Roundup Robot added the comment: New changeset 0767363a0393 by Terry Jan Reedy in branch '2.7': Issue #18103: Update README.txt and test_idle to describe and run gui tests. http://hg.python.org/cpython/rev/0767363a0393 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 00:44:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Jun 2013 22:44:10 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <3bjVJT64t5z7Ljm@mail.python.org> Roundup Robot added the comment: New changeset 68ff68f9a0d5 by R David Murray in branch '3.3': #18155: Regex-escape delimiter, in case it is a regex special char. http://hg.python.org/cpython/rev/68ff68f9a0d5 New changeset acaf73e3d882 by R David Murray in branch 'default': Merge #18155: Regex-escape delimiter, in case it is a regex special char. http://hg.python.org/cpython/rev/acaf73e3d882 New changeset 0e1d538d36dc by R David Murray in branch '2.7': #18155: Regex-escape delimiter, in case it is a regex special char. http://hg.python.org/cpython/rev/0e1d538d36dc ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 00:45:47 2013 From: report at bugs.python.org (R. David Murray) Date: Sat, 29 Jun 2013 22:45:47 +0000 Subject: [issue18155] csv.Sniffer.has_header doesn't escape characters used in regex In-Reply-To: <1370603359.06.0.18660649496.issue18155@psf.upfronthosting.co.za> Message-ID: <1372545947.94.0.154155766119.issue18155@psf.upfronthosting.co.za> R. David Murray added the comment: Committed, with slight modifications to the tests. Thanks Vajrasky. ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 02:09:26 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 00:09:26 +0000 Subject: [issue18103] Create a GUI test framework for Idle In-Reply-To: <1369948017.01.0.493052648792.issue18103@psf.upfronthosting.co.za> Message-ID: <1372550966.71.0.605113778095.issue18103@psf.upfronthosting.co.za> Terry J. Reedy added the comment: While I have not committed any gui tests, the patch is based on experiments with a couple of temporary files. ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 02:12:19 2013 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 30 Jun 2013 00:12:19 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1372526677.94.0.12961643988.issue18244@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: > Looks like the priority ordering you mention is not yet documented > anywhere. Because up till now it has not been needed -- all you can do with ABCs is use isinstance/issubclass. > It definitely makes sense but I'd like to take a step back for > a moment to consider the following questions: > > 1. What additional functionality do our users get with this ordering? In > other words, what purpose does this new ordering have? > > Apart from solving the conflict we're discussing, I can't see any. There doesn't have to be any other functionality. We're just trying to address how ABCs should be ordered relative to classes explicitly in the MRO for the purpose of @singledispatch. > 2. What disadvantages does this ordering bring to the table? > > I think that simplicity is a feature. This ordering creates > additional complexity in the language. But so does not ordering. The underlying question is how to dispatch when two or more classes in an object's class hierarchy have a different dispatch rule. This is fundamentally a question of ordering. For regular method dispatch, the ordering used is the MRO, and there is always a unique answer: the class that comes first in the MRO wins. (Ambiguities and inconsistencies in the MRO are rejected at class definition time.) This is very convenient because the issue of coming up with a total ordering of base classes is solved once and for all, and because of the total ordering we never have to reject a request to dispatch (of regular methods or attribute lookup) as ambiguous. (Note: I call it a total ordering, but the total ordering is only within a specific class's MRO. Any class's explicit bases are totally ordered in that class's MRO -- but the order of two classes may be different in a different class's MRO. This is actually relevant for the definition of C3, and we'll see this below.) For @singledispatch, we are choosing to support ABCs (because it makes sense), and so we have to think about how handle ABCs that are relevant (isinstance/issubclass returns True) but not in the MRO. Let's introduce terminology so we can talk about different cases easily. Relevant: isinstance/issubclass returns True Explicit: it's in the MRO Implicit: relevant but not explicit Registered: Implicit due to a register() call Inferred: Implicit due to a special method These categories are not always exclusive, e.g. an ABC may be registered for one class in the MRO but inferred for a different one. The registration mechanism tries?to avoid outright cycles but otherwise is not as strict about rejecting ambiguities as C3 is for the MRO calculation, and this I believe is the reason we're still debating the order. A simple example of something rejected by C3: - suppose we have classes B and C derived directly from object - class X(B, C) has MRO [X, B, C, object] - class Y(C, B) has MRO [Y, C, B, object] - class Z(X, Y) is *rejected* because there is no consistent ordering for B and C in the MRO for Z However, if we construct a similar situation using implicit ABCs, e.g. by removing B and C from the list of explicit bases of X and Y, and instead registering X and Y as their virtual subclasses -- then Z(X, Y) is valid and Z is a virtual subclass of both B and C. But there is no ordering preference in this case, so I think it's good if @singledispatch refuses the temptation to guess here, in the case where there are registered dispatches for B and C but none for X, Y or Z. I believe the rest of the discussion is purely about what to do if B was explicitly listed as a base but C wasn't (or vice versa). There are still a few different cases; the simplest is this: class X(B) -- MRO is [X, B, object] class Y(B) -- MRO is [Y, B, object] C.register(X) C.register(Y) class Z(X, Y) -- MRO is [Z, X, Y, B, object] IIUC you want @singledispatch to still reject a call for a Z instance if the only relevant registered dispatches are for B and C -- because you claim that X, Y and Z are "just as much" subclasses of B as they are of C. (It doesn't actually matter whether we use X, Y or Z as an example here -- all of them have the same problem.) But I disagree. First, in the all-explicit example, we can equally say that X is "just as much" a subclass of B as it is of C. And yet, because both appear in the explicit MRO, B wins when dispatching for X -- and C wins when dispatching for Y, because the explicit base classes are ordered differently there. So the property of being "just as much" a base class isn't used -- but the order in the explicit MRO is. It is the nature and intent of ABC registration that it does not have to occur in the same file as the class definition. In particular, it is possible that the class definitions of B, C, X, Y and Z all occur together, but the C.register() calls occur in a different, unrelated module, which is imported only on the whim of the top-level application, or as a side effect of some unrelated import made by the top-level app. This, to me, is enough to consider registered ABC inheritance as a second-class citizen compared to explicit inclusion in the list of bases. Consider this: dispatch(Z) would consider only Z, X, Y, B, object if the C.register() calls were *not* made, and then it would choose B; but under your rules, if the app changed to cause the C.register() calls to be added, dispatch(Z) would complain. This sounds fragile to me, and it is the main reason why I want explicit ABCs to prevail over "merely" registered ABCs, rather than to be treated equal and possibly cause complaints based on what happened elsewhere in the program. Now let's move on to inferred ABCs. Let's assume C is actually Sized, and both X and Y implicitly subclass Sized because they implement __len__(). On the one hand, this doesn't have the problem with register() calls that may or may not be loaded -- the __len__() definitions are always there. On the other hand, to me this feels even less explicit than using register() -- while presumably everyone who uses register() knows at some basic level about ABCs, I do not make the same assumption about people who write classes that have a __len__() method. Because of Python's long history of duck typing, many __len__() methods in code that is still in use (even if it has evolved in other ways) were probably written before ABCs (or even MROs) were introduced! Now assume X's explicit base class B is actually Iterable, and X implements both __iter__() and __len__(). X's author *could* easily have made X a subclass of both Iterable and Sized, and thereby avoided the ambiguity. But instead, they explicitly inherited only Iterable, and left Sized implicit. (I guess their understanding of ABCs was limited. :-) I really do think that in this case there is a discernible difference between the author's attitude towards Iterable and Sized -- they cared enough about Iterable to inherit from it. So I think we should assume that *if* we asked them to add Sized as a base class, they would add it second, thereby resolving the ambiguity in favor of Iterable. And that's why I think that if they left Sized out, we are doing them more of a favor by preferring Iterable than by complaining. Now on to your other examples. > Firstly, [Off-topic English-major nit: it's better to write "first" instead of "firstly". English is not a very consistent language. :-) See http://www.randomhouse.com/wotd/index.pperl?date=20010629 for a nuanced view that still ends up preferring "first".] > there is currently no obvious way for users to distinguish > between implicit (which I called "inferred" above) > subclassing (via implementation) or subclassing by > `abc.register()`. What do you mean by "no obvious way to distinguish"? That you can't tell by merely looking at the MRO and calling isinstance/issubclass? But you could look in the _abc_registry. Or you could scan the source for register() calls. TBH I would be fine if these received exactly the same status -- but explicit inclusion in the MRO still ought to prevail. > This creates the dangerous situation where > backwards incompatibility introduced by switching between those ABC > registration mechanism is nearly impossible to debug. Consider an > example: version A of a library has a type which only implicitly > subclasses an ABC. User code with singledispatch is created that > works with the current state of things. Version B of the same library > uses `ABC.register(Type)` and suddenly the dispatch changes without > any way for the user to see what's going on. A similar example with > explicit subclassing and a different form of registration is easier > to debug, but not much, really. So there are an infinite number of ways to break subtle code like this by subtle changes in inheritance. I see that mostly as a fact of life, not something we must contain at all cost. I suppose even with explicit base classes it's not inconceivable that one developer's "innocent" fix of a class hierarchy breaks another developer's code. (See also http://xkcd.com/1172/ :-) So could "innocently" adding or moving a __len__() method. > Secondly, it creates this awkward situation where dispatch for any > custom `MutableMapping` can be different from the dispatch for > `dict`. Although the latter is a `MutableMapping` "only" by means of > `MutableMapping.register(dict)`, in reality the whole definition of > what a mutable mapping is comes from the behaviour found in `dict`. > Following your point of view, dict is less of a mutable mapping than > a custom type subclassing the ABC explicitly. You're saying the user > should "respect the choice of its author" but it's clearly suboptimal > here. I strongly believe I should be able to swap a mutable mapping > implementation with any other and get consistent dispatch. Hmm... I need to make this situation explicit to think about it. I think you are still looking at a case where there are exactly two possible dispatches, one for Sized and one for Iterable, right? And the issue is that if the user defines class Foo(MutableMapping), Sized and Iterable appear explicitly in Foo's MRO, in that order (because MM explicitly subclasses them in this order), so Sized wins. But, hm, because there's a call to MutableMapping.register(dict) in collections/abc.py, the way I see it, if the only dispatches possible were on Sized and Iterable, Sized should still win, because it comes first in MM's MRO. Now, if that MM.register(dict) call was absent, you might be right. But it's there (and you mention it) so I'm not sure what?is going on here -- are you talking about a slightly different example, or about a different rule than I am proposing? > Thirdly, while I can't support this with any concrete examples, > I have a gut feeling that considering all three ABC subclassing > mechanisms to be equally binding will end up as a toolkit with better > composability. The priority ordering on the other hand designs > `abc.register()` and implicit subclassing as inferior MRO wannabes. Ok, when we're talking gut feelings, you're going to have a hard time convincing others that your gut is more finely tuned to digesting Python subtleties than mine. :-) Clearly my gut tells me that explicit inclusion of an ABC in the list of bases is a stronger signal than implicit subclassing; at least part of the reason why my gut feels this way is that the C3 analysis is more strict about rejecting ambiguous orderings outright than registered or inferred ABCs. (But my gut agrees with yours that there's not much to break a tie between a registered and an inferred ABC.) > Last but not least, the priority ordering will further complicate the > implementation of `functools._compose_mro()` and friends. While the > complexity of this code is not the reason of my stance on the matter, > I think it nicely shows how much the user has to keep in her head to > really know what's going on. Especially that we only consider this > ordering to be decisive on a single inheritance level. The implementation of C3 is also complex, and understanding all its rules is hard -- harder than what I had before. But it is a better rule, and that's why we use it. > 3. Why is the ordering MRO -> register -> implicit? (Note: I already relented on the latter arrow.) > The reason I'm asking is that the whole existence of `abc.register()` > seems to come from the following: > > * we want types that predate the creation of an ABC to be considered > its subclasses; We certainly want it enough for isinstance/issubclass to work and for an unambiguous dispatch to work. But we're not sure about the relative ordering in all cases, because there's no order in the registry nor for inferred ABCs, and that may affect when dispatch is considered dispatch. > * we can't use implicit subclassing because either the existence of > methods in question is not enough (e.g. Mapping versus Sequence); > or the methods are added at runtime and don't appear in __dict__. > > Considering the above, one might argue that the following order is > just as well justified: MRO -> implicit -> register. I'm aware that > the decision to put register first is because if the user is unhappy > with the dispatch, she can override the ordering by registering types > which were implicit before. But, while I can register third-party > types, I can't unregister any. In other words, I find this ordering > arbitrary. So, if you can handle "MRO is stronger than registered or inferred" we don't actually disagree on this. :-) > I hope you don't perceive my position as stubborn, I just care enough to > insist on this piece of machinery to be clearly defined and as simple as > possible (but not simpler, sure). Not at al. You may notice I enjoy the debate. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 07:34:25 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 05:34:25 +0000 Subject: [issue10060] python.exe crashes or hangs on help() modules when bad modules found In-Reply-To: <1286676227.2.0.62342583611.issue10060@psf.upfronthosting.co.za> Message-ID: <1372570465.56.0.422831481352.issue10060@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This issue still seems to be about bad extension modules crashing CPython and we cannot fix that. ---------- resolution: -> wont fix stage: -> committed/rejected status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 07:44:17 2013 From: report at bugs.python.org (Mike Gilbert) Date: Sun, 30 Jun 2013 05:44:17 +0000 Subject: [issue16809] Tk 8.6.0 introduces TypeError. (Tk 8.5.13 works) In-Reply-To: <1356763107.47.0.647000150457.issue16809@psf.upfronthosting.co.za> Message-ID: <1372571057.43.0.372136283729.issue16809@psf.upfronthosting.co.za> Changes by Mike Gilbert : ---------- nosy: +floppymaster _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 07:53:11 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 05:53:11 +0000 Subject: [issue10794] Infinite recursion while garbage collecting loops indefinitely In-Reply-To: <1293670287.34.0.585233901325.issue10794@psf.upfronthosting.co.za> Message-ID: <1372571591.66.0.718899346958.issue10794@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: -terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 07:57:36 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 05:57:36 +0000 Subject: [issue11126] Wave.py does not always write proper length in header In-Reply-To: <1296864048.5.0.627671615909.issue11126@psf.upfronthosting.co.za> Message-ID: <1372571856.36.0.856607859884.issue11126@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 07:57:54 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 05:57:54 +0000 Subject: [issue11205] Evaluation order of dictionary display is different from reference manual. In-Reply-To: <1297589953.69.0.371220549392.issue11205@psf.upfronthosting.co.za> Message-ID: <1372571874.23.0.583692074722.issue11205@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 07:58:25 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 05:58:25 +0000 Subject: [issue11343] Make errors due to full parser stack identifiable In-Reply-To: <1298759991.59.0.16834388397.issue11343@psf.upfronthosting.co.za> Message-ID: <1372571905.13.0.496695824416.issue11343@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 08:00:45 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 06:00:45 +0000 Subject: [issue11945] Adopt and document consistent semantics for handling NaN values in containers In-Reply-To: <1303962145.0.0.00759154980454.issue11945@psf.upfronthosting.co.za> Message-ID: <1372572045.79.0.67447910995.issue11945@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 08:01:59 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 06:01:59 +0000 Subject: [issue12075] python3.2 memory leak when reloading class with attributes In-Reply-To: <1305357392.12.0.709817768407.issue12075@psf.upfronthosting.co.za> Message-ID: <1372572119.49.0.887824513546.issue12075@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 08:02:28 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 06:02:28 +0000 Subject: [issue12211] Better document math.copysign behavior. In-Reply-To: <1306710150.53.0.509116993934.issue12211@psf.upfronthosting.co.za> Message-ID: <1372572148.47.0.801284941339.issue12211@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 08:03:48 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 06:03:48 +0000 Subject: [issue14507] Segfault with deeply nested starmap calls In-Reply-To: <1333628918.06.0.633986455545.issue14507@psf.upfronthosting.co.za> Message-ID: <1372572228.74.0.933456926999.issue14507@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.4 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 08:37:14 2013 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 30 Jun 2013 06:37:14 +0000 Subject: [issue16809] Tk 8.6.0 introduces TypeError. (Tk 8.5.13 works) In-Reply-To: <1356763107.47.0.647000150457.issue16809@psf.upfronthosting.co.za> Message-ID: <1372574234.58.0.611777709156.issue16809@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: Please commit the full patch in all active branches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 10:09:42 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Jun 2013 08:09:42 +0000 Subject: [issue18329] for line in socket.makefile() speed degradation In-Reply-To: <1372541158.63.0.507892499267.issue18329@psf.upfronthosting.co.za> Message-ID: <1372579782.82.0.0103862526416.issue18329@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: 3.4 have same performance as 3.3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 10:12:57 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 30 Jun 2013 08:12:57 +0000 Subject: [issue18328] Use after free in pystate.c In-Reply-To: <1372535617.95.0.680763936377.issue18328@psf.upfronthosting.co.za> Message-ID: <1372579977.19.0.870995490439.issue18328@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: Well, tstate is freed, but is not used afterwards, it's just comparing the pointer against the TLS. ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 10:15:32 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Jun 2013 08:15:32 +0000 Subject: [issue11126] Wave.py does not always write proper length in header In-Reply-To: <1296864048.5.0.627671615909.issue11126@psf.upfronthosting.co.za> Message-ID: <1372580132.25.0.130858778335.issue11126@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 10:22:57 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Jun 2013 08:22:57 +0000 Subject: [issue14507] Segfault with deeply nested starmap calls In-Reply-To: <1333628918.06.0.633986455545.issue14507@psf.upfronthosting.co.za> Message-ID: <1372580577.48.0.0159781867253.issue14507@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This looks as a duplicate of issue14010. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 13:30:10 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Jun 2013 11:30:10 +0000 Subject: [issue11126] Wave.py does not always write proper length in header In-Reply-To: <1296864048.5.0.627671615909.issue11126@psf.upfronthosting.co.za> Message-ID: <1372591810.26.0.505144756159.issue11126@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't see anything wrong in current code. In first alternation data is an array of sampwidth-sized items and the number of written bytes is len(data) * self._sampwidth. In second alternation data is raw bytes object and the number of written bytes is just len(data). Could you please provide a sample script which exposes the wrong behavior? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 13:40:15 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Jun 2013 11:40:15 +0000 Subject: [issue18328] Use after free in pystate.c In-Reply-To: <1372535617.95.0.680763936377.issue18328@psf.upfronthosting.co.za> Message-ID: <1372592415.23.0.914586335167.issue18328@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Seems it is not possible to write a test for this. ---------- nosy: +serhiy.storchaka stage: test needed -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 15:22:47 2013 From: report at bugs.python.org (koobs) Date: Sun, 30 Jun 2013 13:22:47 +0000 Subject: [issue18178] Redefinition of malloc(3) family of functions at build time In-Reply-To: <1370851878.25.0.593003779218.issue18178@psf.upfronthosting.co.za> Message-ID: <1372598567.6.0.978122042344.issue18178@psf.upfronthosting.co.za> koobs added the comment: I've added a new FreeBSD 10.0-CURRENT buildbot to the pool (thanks antoine) that reproduces the issue and should provide sufficient coverage for testing the proposed patch: http://buildbot.python.org/all/buildslaves/koobs-freebsd10 I'll upgrade the FreeBSD 9-STABLE buildbot once this is resolved ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 15:39:52 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 30 Jun 2013 13:39:52 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1372599592.03.0.551921614456.issue18244@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Having all information in place, I think it's acceptable for both of us to implement preference for explicit registration, leaving both ways of implicit registration as equally binding. The latter is future proof in the sense that if we change our minds later, it's going to be easier to lift the dispatch conflict than to introduce conflicts where there weren't any before. The point you're making about `Abc.register(Cls)` being external to the definition of Cls and thus somewhat dependant on import order and other machinery is what convinced me in the end. I also like the proposed terminology and think it should appear in the documentation. I created a modified patch. This wasn't as tricky as I feared but required me to formulate an explicit rule: all implicit ABCs are inserted in the MRO of a given class directly after the last explicit ABC in the MRO of said class. One open question is what to do with the algorithm described in PEP 443 which no longer describes the state of things exactly. Although the said PEP is final, some parts of the discussion on this issue just beg to be included in the "Abstract base classes" section. What do you think we should do? Answering your questions, neither scanning the source code nor using a private attribute on ABCMeta can be considered an *obvious* way to distinguish between registered and inferred ABCs. The former is static analysis which might involve opening (and understanding) a number of black boxes, the latter is fragile by definition and breaks the abstraction (again, opening a black box). This is why we introduced a public API to get the current cache token [1]_. As for dispatch differences between MutableMapping and dict, it's in my previous message (191947) on the issue, classes G and H. On an unrelated note, thank you for correcting my English. It seems that after achieving a level of fluency that is bearable to native speakers, nobody corrects my mistakes anymore. This in turn places me in an unfortunate plateau. And yes, I'm well aware that my gut would win no popularity contest, especially when the BDFL's one is a contender :-) I just hope this doesn't automatically make the feelings of my own gut invalid. .. [1] http://bugs.python.org/issue16832 ---------- Added file: http://bugs.python.org/file30733/issue18244.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 16:12:37 2013 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 30 Jun 2013 14:12:37 +0000 Subject: [issue4199] add shorthand global and nonlocal statements In-Reply-To: <1224887535.03.0.272495603252.issue4199@psf.upfronthosting.co.za> Message-ID: <1372601556.99.0.900604098166.issue4199@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Closing and rejecting based on said discussion. http://mail.python.org/pipermail/python-dev/2013-June/127143.html ---------- nosy: +gregory.p.smith resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 16:21:56 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Jun 2013 14:21:56 +0000 Subject: [issue18305] [patch] Fast sum() for non-numbers In-Reply-To: <1372228439.5.0.789865081817.issue18305@psf.upfronthosting.co.za> Message-ID: <1372602116.47.0.17321965434.issue18305@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > Looks like this bug is CPython-specific, others (Jython, IronPython...) don't have it, so people will move code that depends on the internal optimization to other pythons that DO have it. :) I don't know about IronPython, but Jython and PyPy have same behavior as CPython. Even if the proposed implementation returns same result for common types, it may have different behavior for user types. Such changes should not do in bugfix releases, this is a new feature. I think that it is worthwhile to discuss the idea at first in the Python-Ideas mailing list [1]. But I suspect that most core developers will agree with Terry. [1] http://mail.python.org/mailman/listinfo/python-ideas ---------- nosy: +aleax versions: +Python 3.4 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 16:33:02 2013 From: report at bugs.python.org (Drekin) Date: Sun, 30 Jun 2013 14:33:02 +0000 Subject: [issue18331] runpy.run_path gives functions with corrupted .__globals__ Message-ID: <1372602782.77.0.618152195123.issue18331@psf.upfronthosting.co.za> New submission from Drekin: Let's have a simple script test.py: def f(): return x x = 2 print(f()) Now if we try to run it via runpy.run_path, we get the following: >>> import runpy >>> g = runpy.run_path("test.py") 2 >>> g["f"]() is None True >>> g["x"] is 2 True >>> g["f"].__globals__["x"] is None True Is the behaviour of f.__globals__ after return from run_path intended and why? ---------- components: Library (Lib) messages: 192072 nosy: Drekin priority: normal severity: normal status: open title: runpy.run_path gives functions with corrupted .__globals__ type: behavior versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 17:01:10 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 30 Jun 2013 15:01:10 +0000 Subject: [issue18328] Use after free in pystate.c In-Reply-To: <1372535617.95.0.680763936377.issue18328@psf.upfronthosting.co.za> Message-ID: <1372604470.25.0.249522670782.issue18328@psf.upfronthosting.co.za> Christian Heimes added the comment: I think it's unsafe. The address of a pointer should not be used once the pointer has been freed. How about we reverse the order? At first we remove the key from TLS and then free the tstate. ---------- keywords: +patch Added file: http://bugs.python.org/file30734/tstate.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 17:12:45 2013 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Jun 2013 15:12:45 +0000 Subject: [issue18328] Use after free in pystate.c In-Reply-To: <1372535617.95.0.680763936377.issue18328@psf.upfronthosting.co.za> Message-ID: <1372605165.96.0.197637476835.issue18328@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: LGTM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 17:27:14 2013 From: report at bugs.python.org (R. David Murray) Date: Sun, 30 Jun 2013 15:27:14 +0000 Subject: [issue18331] runpy.run_path gives functions with corrupted .__globals__ In-Reply-To: <1372602782.77.0.618152195123.issue18331@psf.upfronthosting.co.za> Message-ID: <1372606034.46.0.471154165764.issue18331@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 17:51:09 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 30 Jun 2013 15:51:09 +0000 Subject: [issue18038] Unhelpful error message on invalid encoding specification In-Reply-To: <1369262596.73.0.912726466313.issue18038@psf.upfronthosting.co.za> Message-ID: <3bjx5T1BQcz7Lk5@mail.python.org> Roundup Robot added the comment: New changeset 19bc00996e74 by R David Murray in branch '3.3': #18038: Use non-deprecated assert names in tests. http://hg.python.org/cpython/rev/19bc00996e74 New changeset 29e7f6a2dc0d by R David Murray in branch 'default': Null merge #18038: Use non-deprecated assert names in tests. http://hg.python.org/cpython/rev/29e7f6a2dc0d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 18:40:57 2013 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 30 Jun 2013 16:40:57 +0000 Subject: [issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering In-Reply-To: <1371490468.22.0.590624884808.issue18244@psf.upfronthosting.co.za> Message-ID: <1372610457.81.0.494706431666.issue18244@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Here's an improved patch which doesn't copy data between lists in `_c3_mro()` so much. ---------- Added file: http://bugs.python.org/file30735/issue18244.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 18:47:57 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 30 Jun 2013 16:47:57 +0000 Subject: [issue18332] _posix_listdir may leak FD Message-ID: <1372610877.27.0.117914198257.issue18332@psf.upfronthosting.co.za> New submission from Christian Heimes: Under rare circumstances listdir() could leak a FD: - HAVE_FDOPENDIR is defined - dup(fd) succeeds - fdopendir() fails and sets dirp to NULL - if (dirp == NULL) goto exit - the dupped fd isn't closed because exit just handles dirp != NULL. Proposed fix: if (dirp != NULL) { ... } else if (fd != -1) { close(fd); } CID 992693 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_handle: Handle variable "fd" going out of scope leaks the handle ---------- components: Extension Modules messages: 192077 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: _posix_listdir may leak FD type: resource usage versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 18:58:58 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 30 Jun 2013 16:58:58 +0000 Subject: [issue18331] runpy.run_path gives functions with corrupted .__globals__ In-Reply-To: <1372602782.77.0.618152195123.issue18331@psf.upfronthosting.co.za> Message-ID: <1372611538.59.0.427369334182.issue18331@psf.upfronthosting.co.za> Richard Oudkerk added the comment: When modules are garbage collected the associated globals dict is purged -- see #18214. This means that all values (except __builtins__) are replaced by None. To work around this run_path() apparently returns a *copy* of the globals dict which was created before purging. ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 19:00:56 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 30 Jun 2013 17:00:56 +0000 Subject: [issue18333] Memory leak in _pickle.c:Unpickler_set_memo() Message-ID: <1372611656.54.0.917364518453.issue18333@psf.upfronthosting.co.za> New submission from Christian Heimes: Unpickler_set_memo() has a memory leak when it is called with an empty dictionariy as argument - PyDict_Check(obj) is true - PyDict_Size(obj) returns 0 - _Unpickler_NewMemo(new_memo_size) calls PyMem_MALLOC(0) - PyMem_MALLOC(0) returns a valid pointer although 0 bytes have been requested - later on an error occurs: goto exit - because new_memo_size == 0, PyMem_FREE(new_memo) is never executed CID 983308 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable "new_memo" going out of scope leaks the storage it points to. ---------- components: Extension Modules messages: 192079 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: Memory leak in _pickle.c:Unpickler_set_memo() type: resource usage versions: Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 19:26:50 2013 From: report at bugs.python.org (Richard Oudkerk) Date: Sun, 30 Jun 2013 17:26:50 +0000 Subject: [issue18332] _posix_listdir may leak FD In-Reply-To: <1372610877.27.0.117914198257.issue18332@psf.upfronthosting.co.za> Message-ID: <1372613210.61.0.848900341305.issue18332@psf.upfronthosting.co.za> Richard Oudkerk added the comment: I think this is a duplicate of #17899. ---------- nosy: +sbt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 19:34:14 2013 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 30 Jun 2013 17:34:14 +0000 Subject: [issue18328] Use after free in pystate.c In-Reply-To: <1372604470.25.0.249522670782.issue18328@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: > I think it's unsafe. The address of a pointer should not be used once the pointer has been freed. Dereferencing a freed pointer is unsafe. A pointer is just an address, there's nothing inherently unsafe with comparing a pointer with a value. The only thing that could go wrong is if the same address was reused in between which could end up screwing your code logic, but since here the TLS can only be set by the current thread, I think it's perfectly safe. > How about we reverse the order? At first we remove the key from TLS and then free the tstate. Looks good to me! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 19:43:23 2013 From: report at bugs.python.org (Christian Heimes) Date: Sun, 30 Jun 2013 17:43:23 +0000 Subject: [issue18332] _posix_listdir may leak FD In-Reply-To: <1372610877.27.0.117914198257.issue18332@psf.upfronthosting.co.za> Message-ID: <1372614203.84.0.0847210566539.issue18332@psf.upfronthosting.co.za> Christian Heimes added the comment: You are right. ---------- resolution: -> duplicate status: open -> closed superseder: -> os.listdir() leaks FDs if invoked on FD pointing to a non-directory _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 22:51:23 2013 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Jun 2013 20:51:23 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <1372625483.23.0.0797534692247.issue18189@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The test_delegator patches were useful for working out and testing the use of the gui resource. However, they are not appropriate for testing the Delegator class. It is a standalone class that has nothing to do with tkinter; in fact, the file has no imports. The test should be a normal text-only test. The only import needed is unittest. Delegator has two unused methods. We can delete them, leaving just 4 methods to test. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 22:53:04 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 30 Jun 2013 20:53:04 +0000 Subject: [issue18189] IDLE Improvements: Unit test for Delegator.py In-Reply-To: <1370950219.82.0.574615156859.issue18189@psf.upfronthosting.co.za> Message-ID: <3bk3nq2wf3z7Llb@mail.python.org> Roundup Robot added the comment: New changeset a568a5426a16 by Terry Jan Reedy in branch '2.7': Issue 18189: remove unused methods in idlelib.Delegator.Delegator. http://hg.python.org/cpython/rev/a568a5426a16 New changeset 9d65716367c1 by Terry Jan Reedy in branch '3.3': Issue 18189: remove unused methods in idlelib.Delegator.Delegator. http://hg.python.org/cpython/rev/9d65716367c1 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 23:12:10 2013 From: report at bugs.python.org (Roundup Robot) Date: Sun, 30 Jun 2013 21:12:10 +0000 Subject: [issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows In-Reply-To: <1371306434.01.0.246562250059.issue18224@psf.upfronthosting.co.za> Message-ID: <3bk4Cs1cdXz7LmM@mail.python.org> Roundup Robot added the comment: New changeset af837bf390d0 by Vinay Sajip in branch '3.3': Issue #18224: Removed pydoc script from created venv, as it causes problems on Windows and adds no value over and above python -m pydoc ... http://hg.python.org/cpython/rev/af837bf390d0 New changeset de73e7ffabb3 by Vinay Sajip in branch 'default': Closes #18224: Removed pydoc script from created venv, as it causes problems on Windows and adds no value over and above python -m pydoc ... http://hg.python.org/cpython/rev/de73e7ffabb3 New changeset c17fa2cbad43 by Vinay Sajip in branch '3.3': Issue #18224: Updated test. http://hg.python.org/cpython/rev/c17fa2cbad43 New changeset ae69436eb7c2 by Vinay Sajip in branch 'default': Issue #18224: Updated test. http://hg.python.org/cpython/rev/ae69436eb7c2 ---------- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 30 23:24:03 2013 From: report at bugs.python.org (Roger Serwy) Date: Sun, 30 Jun 2013 21:24:03 +0000 Subject: [issue18288] Idle 2.7: Run Module does not set __file__ In-Reply-To: <1372014649.46.0.451507262065.issue18288@psf.upfronthosting.co.za> Message-ID: <1372627443.87.0.777216284629.issue18288@psf.upfronthosting.co.za> Roger Serwy added the comment: See issue8515. The patch was not applied to 2.7. ---------- _______________________________________ Python tracker _______________________________________