From report at bugs.python.org Fri Aug 1 00:35:53 2014 From: report at bugs.python.org (Roundup Robot) Date: Thu, 31 Jul 2014 22:35:53 +0000 Subject: [issue22111] Improve imaplib testsuite. In-Reply-To: <1406767358.21.0.322738125164.issue22111@psf.upfronthosting.co.za> Message-ID: <3hPRKh3B9jz7LjT@mail.python.org> Roundup Robot added the comment: New changeset 6b2cafab7a9f by Antoine Pitrou in branch 'default': Issue #22111: Assorted cleanups in test_imaplib. Patch by Milan Oberkirch. http://hg.python.org/cpython/rev/6b2cafab7a9f ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 00:38:18 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 31 Jul 2014 22:38:18 +0000 Subject: [issue22111] Improve imaplib testsuite. In-Reply-To: <1406767358.21.0.322738125164.issue22111@psf.upfronthosting.co.za> Message-ID: <1406846298.02.0.415410663469.issue22111@psf.upfronthosting.co.za> Antoine Pitrou added the comment: This is now pushed. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 00:47:11 2014 From: report at bugs.python.org (Roundup Robot) Date: Thu, 31 Jul 2014 22:47:11 +0000 Subject: [issue20540] Python 3.3/3.4 regression in multiprocessing manager ? In-Reply-To: <1391774788.17.0.649419287978.issue20540@psf.upfronthosting.co.za> Message-ID: <3hPRZl1NjZz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset 20fd13242a45 by Antoine Pitrou in branch 'default': Simplify code in multiprocessing.Connection.send_bytes(). http://hg.python.org/cpython/rev/20fd13242a45 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:01:51 2014 From: report at bugs.python.org (Dan O'Reilly) Date: Thu, 31 Jul 2014 23:01:51 +0000 Subject: [issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks In-Reply-To: <1298300689.71.0.822605356721.issue11271@psf.upfronthosting.co.za> Message-ID: <1406847711.15.0.0209034492275.issue11271@psf.upfronthosting.co.za> Dan O'Reilly added the comment: I've attached an updated patch based on your review comments; there's now a unit test with a non-default chunksize, the chunking algorithm is more readable, and the same code path is used no matter what chunksize is provided. I've also updated the test script to match the implementation changes. ---------- Added file: http://bugs.python.org/file36184/map_chunksize_with_test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:02:18 2014 From: report at bugs.python.org (Dan O'Reilly) Date: Thu, 31 Jul 2014 23:02:18 +0000 Subject: [issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks In-Reply-To: <1298300689.71.0.822605356721.issue11271@psf.upfronthosting.co.za> Message-ID: <1406847738.01.0.752386219434.issue11271@psf.upfronthosting.co.za> Changes by Dan O'Reilly : Removed file: http://bugs.python.org/file36065/test_mult.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:04:02 2014 From: report at bugs.python.org (Dan O'Reilly) Date: Thu, 31 Jul 2014 23:04:02 +0000 Subject: [issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks In-Reply-To: <1298300689.71.0.822605356721.issue11271@psf.upfronthosting.co.za> Message-ID: <1406847841.99.0.0459633338952.issue11271@psf.upfronthosting.co.za> Changes by Dan O'Reilly : Added file: http://bugs.python.org/file36185/test_mult.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:08:14 2014 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Jul 2014 23:08:14 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds Message-ID: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> New submission from STINNER Victor: To prepare Python to add support of monotonic clock in pytime.h, I propose to rewrite pytime.h to use a new _PyTimeSpec structure which has a resolution of 1 nanosecond on only work on integers. Currently, pytime.h uses a _PyTime_timeval structure which has a solution of 1 microsecond and works internally on floating point numbers. Computing the difference between two timestamps may loose precision. The tv_nsec field of _PyTimeSpec must be in the range [0; 999999999], even for negative numbers. For example, -1 ns is stored as (-1, 999999999). This property makes the code more complex, especially to round correctly. The new API is based on the idea that all timestamps must be stored as _PyTimeSpec. Convert a value into a _PyTimeSpec: - _PyTimeSpec_from_double(): C double - _PyTimeSpec_from_object(): Python int or float object - you can also fill directly the tv_sec and tv_nsec fields Convert a _PyTimeSpec timestamp into a value: - _PyTimeSpec_to_time_t(): C time_t - _PyTimeSpec_to_timeval(): C timeval (tv_sec, tv_usec), but ot directly the structure because the exact structure is different depending on the OS and OS version - _PyTimeSpec_ms(): C long, number of milliseconds Operations on _PyTimeSpec: - _PyTimeSpec_add(): a+b - _PyTimeSpec_sub(): a-b I removed high-level functions like _PyTime_ObjectToTimeval(): you should now combine _PyTimeSpec_from_object() with _PyTimeSpec_to_timeval(). I did this to not multiply the number of functions, because I want to test all functions in unit tests and have a short API. I tried to enhance detecton of overflow. I didn't review carefuly my patch yet. I'm not sure that all calls check for error and handle exceptions correctly. Only the following functions raise an exception on error: - _PyTimeSpec_from_object() - _PyTimeSpec_to_time_t() - _PyTimeSpec_to_timeval() Other functions sets the minimum/maximum value in case of underflow/overflow. So even if you don't check for errors, the behaviour on overflow should be acceptable. The new _PyTimeSpec_Init() function checks that the system clock works, so _PyTimeSpec_get_time() and _PyTimeSpec_get_time_info() don't need to check for error. In fact, these functions call Py_FatalError() on error, but it should never happen. This idea was proposed in the issue #22043 to check if the monotonic clock is working. Maybe we can avoid checking the system clock in _PyTimeSpec_Init() and only check the monotonic clock. I hope that all platforms have a working system clock! The oppoosite would be a huge issue. The patch removes function which are exposed in the stable ABI. Since the functions are private, name starting with ("_Py"), I consider that it's ok to remove them. The functions are replaced with new functions which a have a new name. I excluded pytime.h from the stable ABI. I don't know why private functions were part of the stable ABI :-/ The patch comes with unit tests for each function. I didn't implement handling of overflow and underflow in _PyTimeSpec_add() and _PyTimeSpec_sub() yet. But I implemented detection for overflow for the simple case. See also: - Issue #22043: "Use a monotonic clock to compute timeouts". - PEP 410: "Use decimal.Decimal type for timestamps" (rejected) ---------- files: timespec.patch keywords: patch messages: 224452 nosy: haypo priority: normal severity: normal status: open title: Rewrite pytime.h to work on nanoseconds versions: Python 3.4 Added file: http://bugs.python.org/file36186/timespec.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:09:30 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 31 Jul 2014 23:09:30 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> Message-ID: <1406848170.58.0.539510305184.issue22117@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- type: -> enhancement versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:11:42 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 31 Jul 2014 23:11:42 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> Message-ID: <1406848302.81.0.960434694271.issue22117@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +belopolsky, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:14:01 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 31 Jul 2014 23:14:01 +0000 Subject: [issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh In-Reply-To: <1350421202.49.0.905467284446.issue16255@psf.upfronthosting.co.za> Message-ID: <1406848441.36.0.109931356492.issue16255@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Why not simply use $SHELL? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:19:56 2014 From: report at bugs.python.org (Mark Lawrence) Date: Thu, 31 Jul 2014 23:19:56 +0000 Subject: [issue18651] test failures on KFreeBSD In-Reply-To: <1375610825.98.0.456814475805.issue18651@psf.upfronthosting.co.za> Message-ID: <1406848796.67.0.585650399027.issue18651@psf.upfronthosting.co.za> Mark Lawrence added the comment: A different patch is still needed for 3.4. ---------- nosy: +BreamoreBoy type: -> behavior versions: +Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:29:36 2014 From: report at bugs.python.org (Martin Panter) Date: Thu, 31 Jul 2014 23:29:36 +0000 Subject: [issue11429] ctypes is highly eclectic in its raw-memory support In-Reply-To: <1299484141.33.0.394671210882.issue11429@psf.upfronthosting.co.za> Message-ID: <1406849376.17.0.425797108277.issue11429@psf.upfronthosting.co.za> Martin Panter added the comment: Interesting that ?cast? accepts a byte string. If this is intended behaviour, it would be good to document that. Currently it says it takes ?an object that can be interpreted as a pointer?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:39:27 2014 From: report at bugs.python.org (STINNER Victor) Date: Thu, 31 Jul 2014 23:39:27 +0000 Subject: [issue22043] Use a monotonic clock to compute timeouts In-Reply-To: <1406081401.66.0.461602325424.issue22043@psf.upfronthosting.co.za> Message-ID: <1406849967.15.0.636285712935.issue22043@psf.upfronthosting.co.za> STINNER Victor added the comment: pytimespec.patch become too large, I splitted this patch into a new issue: issue #22117. If this issue is rejected, I will rewrite pymonotonic-2.patch to use the _PyTime_timeval structure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:44:21 2014 From: report at bugs.python.org (Mark Lawrence) Date: Thu, 31 Jul 2014 23:44:21 +0000 Subject: [issue7897] Support parametrized tests in unittest In-Reply-To: <1265768482.24.0.694001982317.issue7897@psf.upfronthosting.co.za> Message-ID: <1406850261.8.0.920986602843.issue7897@psf.upfronthosting.co.za> Mark Lawrence added the comment: Is there any possibility of getting this into 3.5? If it helps I've always got time on my hands so if nothing else I could do testing on Windows 8.1. ---------- nosy: +BreamoreBoy, zach.ware versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 01:53:20 2014 From: report at bugs.python.org (Mark Lawrence) Date: Thu, 31 Jul 2014 23:53:20 +0000 Subject: [issue7944] Use the 'with' statement in conjunction with 'open' throughout test modules In-Reply-To: <1266342231.42.0.692171370087.issue7944@psf.upfronthosting.co.za> Message-ID: <1406850800.57.0.00298521301761.issue7944@psf.upfronthosting.co.za> Mark Lawrence added the comment: Following on from msg185817 I'd suggest this is closed. ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 02:23:33 2014 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 01 Aug 2014 00:23:33 +0000 Subject: [issue20056] Got deprecation warning when running test_shutil.py on Windows NT 6 In-Reply-To: <1387810364.09.0.723584968408.issue20056@psf.upfronthosting.co.za> Message-ID: <1406852613.98.0.117615903027.issue20056@psf.upfronthosting.co.za> Mark Lawrence added the comment: The deprecation warnings are coming from the various os calls so are nothing to do with test_shutil. I think this can be closed as "not a bug". ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 02:23:58 2014 From: report at bugs.python.org (Brian Curtin) Date: Fri, 01 Aug 2014 00:23:58 +0000 Subject: [issue7944] Use the 'with' statement in conjunction with 'open' throughout test modules In-Reply-To: <1266342231.42.0.692171370087.issue7944@psf.upfronthosting.co.za> Message-ID: <1406852638.9.0.826031349313.issue7944@psf.upfronthosting.co.za> Changes by Brian Curtin : ---------- nosy: -brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 02:24:19 2014 From: report at bugs.python.org (Brian Curtin) Date: Fri, 01 Aug 2014 00:24:19 +0000 Subject: [issue7897] Support parametrized tests in unittest In-Reply-To: <1265768482.24.0.694001982317.issue7897@psf.upfronthosting.co.za> Message-ID: <1406852659.85.0.468893341849.issue7897@psf.upfronthosting.co.za> Changes by Brian Curtin : ---------- nosy: -brian.curtin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 02:44:08 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 00:44:08 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> Message-ID: <1406853848.47.0.334618797252.issue22117@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I forgot to mention that the patch of the issue #22043 also changes _PyTimeSpec_get_time() to use clock_gettime(CLOCK_REALTIME) which has a resolution of 1 nanosecond. _PyTimeSpec_get_time() already uses GetSystemTimeAsFileTime() which has a resolution of 100 nanosecond. See also the issue #19007 "precise time.time() under Windows 8: use GetSystemTimePreciseAsFileTime". I'm talking about the resolution of the C structure. The effive resolution can be much worse than that. For example, the resolution measured in Python of clock_gettime(CLOCK_REALTIME) is closer to 160 nanoseconds (on my laptop) than 1 nanoescond. See the "Python Resolution" column the second table of: http://legacy.python.org/dev/peps/pep-0418/#system-time ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 02:44:53 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 00:44:53 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> Message-ID: <1406853893.6.0.585817813208.issue22117@psf.upfronthosting.co.za> STINNER Victor added the comment: The effective* resolution ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 02:46:57 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 00:46:57 +0000 Subject: [issue22108] python c api wchar_t*/char* passing contradiction In-Reply-To: <1406740242.49.0.577134590981.issue22108@psf.upfronthosting.co.za> Message-ID: <1406854017.58.0.794148989719.issue22108@psf.upfronthosting.co.za> STINNER Victor added the comment: > What I'd really like to see in CPython is that the internal storage (and the way it's exposed in the C-API) is just raw bytes (=> char*). Python is portable, we care of Windows. On Windows, wchar_t* is the native type for strings (ex: command line, environment variables). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 02:55:35 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 01 Aug 2014 00:55:35 +0000 Subject: [issue20341] Argument Clinic: add "nullable ints" In-Reply-To: <1390360681.97.0.808723930218.issue20341@psf.upfronthosting.co.za> Message-ID: <1406854535.94.0.542003658657.issue20341@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, I agree with Antoine that Nullable Int is a misnomer. Also, I don't buy into this mission to change signatures for optional ints into int-or-none. In particular, itertools.repeat() is fine as-is. Optional int APIs have been around for a long time, they work fine, and they really don't need to be changed. AFAICT, there is no real issue here that warrants changes to existing APIs. >>> s = [10, 20, 30] >>> s.pop(None) Traceback (most recent call last): File "", line 1, in s.pop(None) TypeError: 'NoneType' object cannot be interpreted as an integer >>> int('42', None) Traceback (most recent call last): File "", line 1, in int('42', None) TypeError: 'NoneType' object cannot be interpreted as an integer ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 03:19:48 2014 From: report at bugs.python.org (Larry Hastings) Date: Fri, 01 Aug 2014 01:19:48 +0000 Subject: [issue20341] Argument Clinic: add "nullable ints" In-Reply-To: <1390360681.97.0.808723930218.issue20341@psf.upfronthosting.co.za> Message-ID: <1406855988.67.0.0359615918701.issue20341@psf.upfronthosting.co.za> Larry Hastings added the comment: FWIW, Martin agreed with me at EuroPython that "nullable int" is the proper name. So does Wikipedia: http://en.wikipedia.org/wiki/Nullable_type As for "repeat_new": like I said, I don't intend to check in this change when checking in nullable ints. (I really just used it because I was doing the work on a plane and just didn't feel like finding a different example.) I'm simply not interested in picking a fight about it. However, this is using the general approach endorsed by Guido: https://mail.python.org/pipermail/python-dev/2014-January/131673.html And indeed, see thread for further specific discussion of repeat_new. I feel the position of "these have been in Python for years, they're fine" misses the point. Builtins never had signatures before. Now that they can have signatures, the design decision of writing builtins with non-Pythonic signatures has come home to roost. How can the signature for itertools.repeat() convey that "times" is an optional parameter without it having a default value? I view giving all builtins in Python valid signatures as a worthwhile goal unto itself. So ISTM that allowing "times" to accept None to mean "repeat forever" is reasonable: it makes the function more Pythonic, and it means it can have a meaningful signature. But if this goal doesn't interest you, I can see why you'd think this was a waste of time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 03:23:06 2014 From: report at bugs.python.org (paul j3) Date: Fri, 01 Aug 2014 01:23:06 +0000 Subject: [issue22029] argparse - CSS white-space: like control for individual text blocks In-Reply-To: <1406004413.12.0.04362068929.issue22029@psf.upfronthosting.co.za> Message-ID: <1406856186.61.0.190448292562.issue22029@psf.upfronthosting.co.za> Changes by paul j3 : Added file: http://bugs.python.org/file36187/issue22029_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 03:23:53 2014 From: report at bugs.python.org (paul j3) Date: Fri, 01 Aug 2014 01:23:53 +0000 Subject: [issue22029] argparse - CSS white-space: like control for individual text blocks In-Reply-To: <1406004413.12.0.04362068929.issue22029@psf.upfronthosting.co.za> Message-ID: <1406856233.41.0.234872709266.issue22029@psf.upfronthosting.co.za> Changes by paul j3 : Removed file: http://bugs.python.org/file36160/issue22029_2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 04:05:52 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 01 Aug 2014 02:05:52 +0000 Subject: [issue20341] Argument Clinic: add "nullable ints" In-Reply-To: <1390360681.97.0.808723930218.issue20341@psf.upfronthosting.co.za> Message-ID: <1406858752.37.0.736567045391.issue20341@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Larry, ISTM that you are bulldozing your way through something that isn't an actual problem to be solved. > I can see why you'd think this was a waste of time. I don't think it is just a waste of time; I think it is a bad idea. You have a very strong notion of how function signatures should look (i.e. the number of arguments being irrelevant) and you want to impose your ideas on existing, stable APIs for zero benefit. > I view giving all builtins in Python valid signatures > as a worthwhile goal unto itself. I can already model the behavior of repeat() using *args and **kwds, just like I can for int(), list.pop(), range(), and slice(). You don't seem to get that those tools already work, that people understand them, that they've been stable for a long time, and that they don't need to change for any reason other than that you've worked yourself into a snit about it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 06:13:07 2014 From: report at bugs.python.org (eryksun) Date: Fri, 01 Aug 2014 04:13:07 +0000 Subject: [issue11429] ctypes is highly eclectic in its raw-memory support In-Reply-To: <1299484141.33.0.394671210882.issue11429@psf.upfronthosting.co.za> Message-ID: <1406866387.35.0.859372897774.issue11429@psf.upfronthosting.co.za> eryksun added the comment: > Interesting that ?cast? accepts a byte string. If this is > intended behaviour, it would be good to document that. > Currently it says it takes ?an object that can be > interpreted as a pointer?. cast makes an FFI call: _cast = PYFUNCTYPE(py_object, c_void_p, py_object, py_object)(_cast_addr) def cast(obj, typ): return _cast(obj, obj, typ) The first arg is passed as c_void_p, i.e. a void pointer. c_void_p.from_param accepts common objects that can be interpreted as a pointer: None (NULL), integers, bytes, and str. It also accepts c_void_p ('P'), c_char_p ('z'), c_wchar_p ('Z'), Array, _Pointer, _CFuncPtr, and CArgObject (byref). If none of the latter apply, c_void_p.from_param checks for the _as_parameter_ hook. For example: from ctypes import * from ctypes.util import find_library libc = CDLL(find_library('c')) libc.atoi.argtypes = [c_void_p] class X: _as_parameter_ = b'123' >>> libc.atoi(X()) 123 There's also code in place to support bytearray, but it's incomplete. It uses the z_set setfunc (defined in cfield.c), which doesn't support bytearray yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 06:49:03 2014 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Aug 2014 04:49:03 +0000 Subject: [issue21907] Update Windows build batch scripts In-Reply-To: <1404328602.32.0.540869349126.issue21907@psf.upfronthosting.co.za> Message-ID: <3hPbcG2wcMz7LjW@mail.python.org> Roundup Robot added the comment: New changeset 60c61ea64021 by Zachary Ware in branch 'default': Issue #21907: Further improvments to build_pgo.bat. Patch by Ingolf Becker. http://hg.python.org/cpython/rev/60c61ea64021 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 06:51:49 2014 From: report at bugs.python.org (Martin Panter) Date: Fri, 01 Aug 2014 04:51:49 +0000 Subject: [issue6259] ctypes pointer arithmetic In-Reply-To: <1244662680.17.0.41540856406.issue6259@psf.upfronthosting.co.za> Message-ID: <1406868709.24.0.683927397001.issue6259@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 06:59:54 2014 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Aug 2014 04:59:54 +0000 Subject: [issue21907] Update Windows build batch scripts In-Reply-To: <1404328602.32.0.540869349126.issue21907@psf.upfronthosting.co.za> Message-ID: <3hPbrn4Mzdz7Ljd@mail.python.org> Roundup Robot added the comment: New changeset 4c1d543135ef by Zachary Ware in branch 'default': Issue #21907: Avoid using double quotes to check argument values. http://hg.python.org/cpython/rev/4c1d543135ef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 07:15:01 2014 From: report at bugs.python.org (Martin Panter) Date: Fri, 01 Aug 2014 05:15:01 +0000 Subject: [issue10803] ctypes: better support of bytearray objects In-Reply-To: <1293951546.17.0.00856255345379.issue10803@psf.upfronthosting.co.za> Message-ID: <1406870101.21.0.7343593856.issue10803@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 07:54:24 2014 From: report at bugs.python.org (Martin Panter) Date: Fri, 01 Aug 2014 05:54:24 +0000 Subject: [issue19023] ctypes docs: Unimplemented and undocumented features In-Reply-To: <1379246270.23.0.998338553474.issue19023@psf.upfronthosting.co.za> Message-ID: <1406872464.85.0.0492962386087.issue19023@psf.upfronthosting.co.za> Martin Panter added the comment: Here is the patch stripped of all the noise and the structure and union stuff, so you can see just the changes related to arrays and pointers. However I have not attempted to apply the patch, nor addressed Georg?s comment about the ?contents? attribute. ---------- nosy: +vadmium Added file: http://bugs.python.org/file36188/arrays-pointers.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 08:30:38 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 06:30:38 +0000 Subject: [issue22046] ZipFile.read() should mention that it might throw NotImplementedError In-Reply-To: <1406118023.79.0.0716895014277.issue22046@psf.upfronthosting.co.za> Message-ID: <1406874638.99.0.292218551429.issue22046@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> needs patch versions: +Python 3.4, Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 08:36:26 2014 From: report at bugs.python.org (Larry Hastings) Date: Fri, 01 Aug 2014 06:36:26 +0000 Subject: [issue9232] Allow trailing comma in any function argument list. In-Reply-To: <1278945017.29.0.842296068848.issue9232@psf.upfronthosting.co.za> Message-ID: <1406874986.61.0.730992087114.issue9232@psf.upfronthosting.co.za> Larry Hastings added the comment: Moratorium's long over. Will this patch rise from the dead? ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 09:37:57 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 07:37:57 +0000 Subject: [issue5411] Add xz support to shutil In-Reply-To: <1236081386.1.0.884971889723.issue5411@psf.upfronthosting.co.za> Message-ID: <1406878677.69.0.804107388134.issue5411@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Now 3.4 is released, but shutil still doesn't support the xz compression. I think we should hurry on to be in time for 3.5. ---------- versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 09:41:10 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 07:41:10 +0000 Subject: [issue16314] Support xz compression in distutils In-Reply-To: <1351114378.64.0.718374634123.issue16314@psf.upfronthosting.co.za> Message-ID: <1406878870.54.0.442717499591.issue16314@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What about the patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 10:30:28 2014 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 01 Aug 2014 08:30:28 +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: <1406881828.78.0.0255119323499.issue11698@psf.upfronthosting.co.za> Mark Lawrence added the comment: Could somebody pick this up please as it fixes #5907. ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 10:33:32 2014 From: report at bugs.python.org (Geert Jansen) Date: Fri, 01 Aug 2014 08:33:32 +0000 Subject: [issue21965] Add support for Memory BIO to _ssl In-Reply-To: <1405156134.57.0.513965198344.issue21965@psf.upfronthosting.co.za> Message-ID: <1406882012.68.0.737341475185.issue21965@psf.upfronthosting.co.za> Changes by Geert Jansen : Added file: http://bugs.python.org/file36189/ssl-memory-bio-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 10:50:40 2014 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 01 Aug 2014 08:50:40 +0000 Subject: [issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh In-Reply-To: <1406848441.36.0.109931356492.issue16255@psf.upfronthosting.co.za> Message-ID: Gregory P. Smith added the comment: $SHELL is up to the user and not guaranteed to be anything remotely /bin/sh compatible. On Jul 31, 2014 4:14 PM, "Antoine Pitrou" wrote: > > Antoine Pitrou added the comment: > > Why not simply use $SHELL? > > ---------- > nosy: +pitrou > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:02:07 2014 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 01 Aug 2014 09:02:07 +0000 Subject: [issue19613] test_nntplib: sporadic failures, test_article_head_body() In-Reply-To: <1384536645.9.0.862907413915.issue19613@psf.upfronthosting.co.za> Message-ID: <1406883727.55.0.693229878024.issue19613@psf.upfronthosting.co.za> Mark Lawrence added the comment: The last five builds have been successful so can this be closed as "out of date"? ---------- nosy: +BreamoreBoy type: -> behavior versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:13:04 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 09:13:04 +0000 Subject: [issue19613] test_nntplib: sporadic failures, test_article_head_body() In-Reply-To: <1384536645.9.0.862907413915.issue19613@psf.upfronthosting.co.za> Message-ID: <1406884384.6.0.738424957359.issue19613@psf.upfronthosting.co.za> STINNER Victor added the comment: > The last five builds have been successful so can this be closed as "out of date"? Really? I saw a lot of test_nntplib failures this week, on Windows buildbots for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:31:16 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 09:31:16 +0000 Subject: [issue16353] add function to os module for getting path to default shell In-Reply-To: <1351473560.4.0.147895276383.issue16353@psf.upfronthosting.co.za> Message-ID: <1406885476.38.0.77572952799.issue16353@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Should it be function? Why not use just a variable initialized at import time? The path to the default shell shouldn't change during the time of program execution. if sys.platform == 'win32': default_shell = 'cmd.exe' else: default_shell = '/bin/sh' ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:34:42 2014 From: report at bugs.python.org (Geert Jansen) Date: Fri, 01 Aug 2014 09:34:42 +0000 Subject: [issue21965] Add support for Memory BIO to _ssl In-Reply-To: <1405156134.57.0.513965198344.issue21965@psf.upfronthosting.co.za> Message-ID: <1406885682.78.0.0923129853333.issue21965@psf.upfronthosting.co.za> Geert Jansen added the comment: I added a new patch that addresses the comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:35:22 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 09:35:22 +0000 Subject: [issue19380] Optimize parsing of regular expressions In-Reply-To: <1382645659.73.0.868235602026.issue19380@psf.upfronthosting.co.za> Message-ID: <1406885722.71.0.599988369356.issue19380@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- keywords: +needs review versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:38:36 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 09:38:36 +0000 Subject: [issue19055] Regular expressions: * does not match as many repetitions as possible. In-Reply-To: <1379629723.54.0.556911663587.issue19055@psf.upfronthosting.co.za> Message-ID: <1406885916.97.0.871406170589.issue19055@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think this issue can be closed. Behavior and documentation are correct and match one other. Nothing to do with it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:39:39 2014 From: report at bugs.python.org (Geert Jansen) Date: Fri, 01 Aug 2014 09:39:39 +0000 Subject: [issue21965] Add support for Memory BIO to _ssl In-Reply-To: <1405156134.57.0.513965198344.issue21965@psf.upfronthosting.co.za> Message-ID: <1406885979.92.0.675782448885.issue21965@psf.upfronthosting.co.za> Geert Jansen added the comment: I've explored a few options for the Python-level API in the attachment "bio_python_options.py". Me personally I prefer the more light weight option #3. This is both out of selfish interest (less work for me), but also I believe that memory BIOs are an API that will be used almost exclusively by framework authors, not by end users like SSLSocket itself. So a more lower-level (but perfectly valid IMHO) API would be appropriate. ---------- Added file: http://bugs.python.org/file36190/bio_python_options.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:42:31 2014 From: report at bugs.python.org (Geert Jansen) Date: Fri, 01 Aug 2014 09:42:31 +0000 Subject: [issue21965] Add support for Memory BIO to _ssl In-Reply-To: <1405156134.57.0.513965198344.issue21965@psf.upfronthosting.co.za> Message-ID: <1406886151.15.0.6248725184.issue21965@psf.upfronthosting.co.za> Changes by Geert Jansen : Removed file: http://bugs.python.org/file36190/bio_python_options.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 11:43:04 2014 From: report at bugs.python.org (Geert Jansen) Date: Fri, 01 Aug 2014 09:43:04 +0000 Subject: [issue21965] Add support for Memory BIO to _ssl In-Reply-To: <1405156134.57.0.513965198344.issue21965@psf.upfronthosting.co.za> Message-ID: <1406886184.16.0.455709036142.issue21965@psf.upfronthosting.co.za> Changes by Geert Jansen : Added file: http://bugs.python.org/file36191/bio_python_options.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 12:34:29 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 10:34:29 +0000 Subject: [issue19613] test_nntplib: sporadic failures, test_article_head_body() In-Reply-To: <1384536645.9.0.862907413915.issue19613@psf.upfronthosting.co.za> Message-ID: <1406889269.04.0.529685442897.issue19613@psf.upfronthosting.co.za> STINNER Victor added the comment: Well, it's not exactly the same error, but it's still "sporadic failure" of test_nntp. Example: http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/8578/steps/test/logs/stdio ====================================================================== ERROR: test_zlogin (test.test_nntplib.NetworkedNNTPTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_nntplib.py", line 251, in wrapped meth(self) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_nntplib.py", line 229, in test_zlogin user=baduser, password=badpw, usenetrc=False) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", line 704, in assertRaises return context.handle('assertRaises', callableObj, args, kwargs) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", line 162, in handle callable_obj(*args, **kwargs) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\nntplib.py", line 963, in login resp = self._shortcmd('authinfo user ' + user) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\nntplib.py", line 512, in _shortcmd return self._getresp() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\nntplib.py", line 450, in _getresp resp = self._getline() File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\nntplib.py", line 433, in _getline line = self.file.readline(_MAXLINE +1) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\socket.py", line 514, in readinto raise OSError("cannot read from timed out object") OSError: cannot read from timed out object ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 12:34:47 2014 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Aug 2014 10:34:47 +0000 Subject: [issue22108] python c api wchar_t*/char* passing contradiction In-Reply-To: <1406740242.49.0.577134590981.issue22108@psf.upfronthosting.co.za> Message-ID: <3hPlHB1Vk0z7LjQ@mail.python.org> Roundup Robot added the comment: New changeset 94d0e842b9ea by Victor Stinner in branch 'default': Issue #18395, #22108: Update embedded Python examples to decode correctly http://hg.python.org/cpython/rev/94d0e842b9ea ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 12:34:47 2014 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Aug 2014 10:34:47 +0000 Subject: [issue18395] Make _Py_char2wchar() and _Py_wchar2char() public In-Reply-To: <1373205636.55.0.562779126658.issue18395@psf.upfronthosting.co.za> Message-ID: <3hPlHB6q5sz7LjQ@mail.python.org> Roundup Robot added the comment: New changeset 93a798c7f270 by Victor Stinner in branch 'default': Issue #18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`, rename http://hg.python.org/cpython/rev/93a798c7f270 New changeset 94d0e842b9ea by Victor Stinner in branch 'default': Issue #18395, #22108: Update embedded Python examples to decode correctly http://hg.python.org/cpython/rev/94d0e842b9ea ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 12:35:39 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 10:35:39 +0000 Subject: [issue19884] Importing readline produces erroneous output In-Reply-To: <1386158776.45.0.265770743985.issue19884@psf.upfronthosting.co.za> Message-ID: <1406889339.84.0.275051590405.issue19884@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, the test also fails on the new Red Hat 6 buildbot: http://buildbot.python.org/all/builders/x86%20RHEL%206%203.x/builds/4358/steps/test/logs/stdio ====================================================================== FAIL: test_init (test.test_readline.TestReadline) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_readline.py", line 53, in test_init self.assertEqual(stdout, b'') AssertionError: b'\x1b[?1034h' != b'' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 12:36:33 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 10:36:33 +0000 Subject: [issue18395] Make _Py_char2wchar() and _Py_wchar2char() public In-Reply-To: <1373205636.55.0.562779126658.issue18395@psf.upfronthosting.co.za> Message-ID: <1406889393.67.0.700633338309.issue18395@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 12:37:21 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 10:37:21 +0000 Subject: [issue22108] python c api wchar_t*/char* passing contradiction In-Reply-To: <1406740242.49.0.577134590981.issue22108@psf.upfronthosting.co.za> Message-ID: <1406889441.12.0.0601364724203.issue22108@psf.upfronthosting.co.za> STINNER Victor added the comment: I updated the embedding and extending examples but I didn't try them. @Jonas: Can you please try the updated examples? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 12:46:28 2014 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Aug 2014 10:46:28 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1406889988.86.0.699025728078.issue22116@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 13:21:24 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 11:21:24 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1406892084.49.0.229264153825.issue9529@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think MizardX means that match object should be iterable. This will allow sequence unpacking. >>> import re >>> m = re.match(r'(\w+):(\w+)', 'qwerty:asdfgh') >>> k, v = m >>> k 'qwerty' >>> v 'asdfgh' This idea looks reasonable to me. Here is simple preliminary patch which implements it. ---------- keywords: +patch nosy: +serhiy.storchaka stage: needs patch -> patch review title: Converge re.findall and re.finditer -> Make re match object iterable type: behavior -> enhancement versions: +Python 3.5 -Python 3.2 Added file: http://bugs.python.org/file36192/re_matchobj_iterable.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 13:38:46 2014 From: report at bugs.python.org (Matthew Barnett) Date: Fri, 01 Aug 2014 11:38:46 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1406893126.44.0.289883148651.issue9529@psf.upfronthosting.co.za> Matthew Barnett added the comment: Match objects have a .groups method: >>> import re >>> m = re.match(r'(\w+):(\w+)', 'qwerty:asdfgh') >>> m.groups() ('qwerty', 'asdfgh') >>> k, v = m.groups() >>> k 'qwerty' >>> v 'asdfgh' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 13:43:28 2014 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 01 Aug 2014 11:43:28 +0000 Subject: [issue9232] Allow trailing comma in any function argument list. In-Reply-To: <1278945017.29.0.842296068848.issue9232@psf.upfronthosting.co.za> Message-ID: <1406893408.0.0.145593364769.issue9232@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Will this patch rise from the dead? It's really down to getting consensus that it's a good idea. That might require another python-dev discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 14:02:14 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 12:02:14 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1406893126.44.0.289883148651.issue9529@psf.upfronthosting.co.za> Message-ID: <11925142.c1akzAufYZ@raxxla> Serhiy Storchaka added the comment: Yes, but the purpose of this feature is to simplify the use of finditer() in the "for" loop. >>> import re >>> for k, v in re.finditer(r"(\w+):?(\w+)?", "ab:cd\nef\n"): ... print(k, v) ... ab cd ef None Currently you should either unpack manually: for m in re.finditer(...): k, v = m.groups() ... This way doesn't work well with comprehensions. Or use the operator module: import operator for k, v in map(operator.methodcaller('groups'), re.finditer(...)): ... This way is too verbose and unclear. Sorry, previous version of the patch had reference leak. ---------- Added file: http://bugs.python.org/file36193/re_matchobj_iterable.patch _______________________________________ Python tracker _______________________________________ -------------- next part -------------- diff -r 4c1d543135ef Doc/library/re.rst --- a/Doc/library/re.rst Thu Jul 31 23:58:27 2014 -0500 +++ b/Doc/library/re.rst Fri Aug 01 14:57:03 2014 +0300 @@ -873,6 +873,15 @@ if match: process(match) +Match objects are iterable and can be unpacked. ``iter(match)`` is equivalent +to ``iter(match.groups())``. For example: + + >>> [(k, v) for k, v in re.finditer(r"(\w+):?(\w+)?", "ab:cd, ef")] + [('ab', 'cd'), ('ef', None)] + +.. versionadded:: 3.5 + Match objects are now iterable. + Match objects support the following methods and attributes: diff -r 4c1d543135ef Lib/test/test_re.py --- a/Lib/test/test_re.py Thu Jul 31 23:58:27 2014 -0500 +++ b/Lib/test/test_re.py Fri Aug 01 14:57:03 2014 +0300 @@ -349,6 +349,18 @@ (None, 'b', None)) self.assertEqual(pat.match('ac').group(1, 'b2', 3), ('a', None, 'c')) + def test_re_match_iter(self): + pat = re.compile(r'(\w+):(\w+)?:(\w+)') + m = pat.match('ab::cd=') + it = iter(m) + self.assertEqual(next(it), 'ab') + self.assertEqual(next(it), None) + self.assertEqual(next(it), 'cd') + self.assertRaises(StopIteration, next, it) + self.assertEqual(list(m), ['ab', None, 'cd']) + x, y, z = m + self.assertEqual((x, y, z), ('ab', None, 'cd')) + def test_re_fullmatch(self): # Issue 16203: Proposal: add re.fullmatch() method. self.assertEqual(re.fullmatch(r"a", "a").span(), (0, 1)) @@ -896,6 +908,10 @@ self.assertEqual([item.group(0) for item in iter], ["::", "::"]) + iter = re.finditer(r"(\w+):?(\w+)?", "ab:cd\nef\n") + self.assertEqual([(k, v) for k, v in iter], + [('ab', 'cd'), ('ef', None)]) + def test_bug_926075(self): self.assertTrue(re.compile('bug_926075') is not re.compile(b'bug_926075')) diff -r 4c1d543135ef Modules/_sre.c --- a/Modules/_sre.c Thu Jul 31 23:58:27 2014 -0500 +++ b/Modules/_sre.c Fri Aug 01 14:57:03 2014 +0300 @@ -2080,6 +2080,31 @@ } static PyObject* +match_iter(MatchObject* self) +{ + PyObject *result, *iter; + Py_ssize_t index; + + result = PyTuple_New(self->groups-1); + if (!result) + return NULL; + + for (index = 1; index < self->groups; index++) { + PyObject* item; + item = match_getslice_by_index(self, index, Py_None); + if (!item) { + Py_DECREF(result); + return NULL; + } + PyTuple_SET_ITEM(result, index-1, item); + } + + iter = PyObject_GetIter(result); + Py_DECREF(result); + return iter; +} + +static PyObject* match_groups(MatchObject* self, PyObject* args, PyObject* kw) { PyObject* result; @@ -2478,7 +2503,7 @@ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ + (getiterfunc)match_iter, /* tp_iter */ 0, /* tp_iternext */ match_methods, /* tp_methods */ match_members, /* tp_members */ From report at bugs.python.org Fri Aug 1 14:20:38 2014 From: report at bugs.python.org (Jonas Jelten) Date: Fri, 01 Aug 2014 12:20:38 +0000 Subject: [issue22108] python c api wchar_t*/char* passing contradiction In-Reply-To: <1406740242.49.0.577134590981.issue22108@psf.upfronthosting.co.za> Message-ID: <1406895638.38.0.448307473748.issue22108@psf.upfronthosting.co.za> Jonas Jelten added the comment: Indeed, that should do it, thanks. I still pledge for Python 4? always using char* internally to make this conversion obsolete ;) (except for windows) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 14:21:45 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 12:21:45 +0000 Subject: [issue22108] python c api wchar_t*/char* passing contradiction In-Reply-To: <1406740242.49.0.577134590981.issue22108@psf.upfronthosting.co.za> Message-ID: <1406895705.09.0.427937353687.issue22108@psf.upfronthosting.co.za> STINNER Victor added the comment: > I still pledge for Python 4? always using char* internally to make this conversion obsolete ;) (except for windows) I don't understand your proposition. We try to have duplicating functions for char* and wchar*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 14:27:04 2014 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 01 Aug 2014 12:27:04 +0000 Subject: [issue7897] Support parametrized tests in unittest In-Reply-To: <1406850261.8.0.920986602843.issue7897@psf.upfronthosting.co.za> Message-ID: Nick Coghlan added the comment: I don't believe the "how to request specific parameters" aspect has been clearly addressed so far, and the subTest() API in Python 3.4 already allows subtests that aren't individually addressable. Any new API (if any) should likely also be based on the subtest feature, and I don't think the community has enough experience with that yet to be confident in how best to integrate it with parameterised testing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 14:50:57 2014 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Fri, 01 Aug 2014 12:50:57 +0000 Subject: [issue20341] Argument Clinic: add "nullable ints" In-Reply-To: <1390360681.97.0.808723930218.issue20341@psf.upfronthosting.co.za> Message-ID: <1406897457.07.0.0349946783174.issue20341@psf.upfronthosting.co.za> Martin v. L?wis added the comment: If this feature is contentious, then a PEP is need to decide on it. As it turns out, PEP 436 already discusses the nullable feature. But, as it also turns out, PEP 436 hasn't been accepted yet (at least I could not find any records on that having happened, and the PEP says that it is in draft state). So what I think needs to happen next is: - opposition to the PEP or certain features should be recorded in the PEP - a BDFL delegate needs to be nominated, or Guido needs to declare that he wants to rule on the PEP himself - a decision on the PEP needs to be made. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 14:51:00 2014 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Aug 2014 12:51:00 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1406897460.14.0.659410636273.issue9529@psf.upfronthosting.co.za> Ezio Melotti added the comment: See also #19536. I still think that if we do something about these issues, we should try to be compatible with the regex module. If we are going to add support for both iterability and __getitem__, they should be consistent, so that list(m) == [m[0], m[1], m[N]]. This means that m[0] should be equal to m.group(0), rather than m.group(1). Currently the Match object of the regex module supports __getitem__ (with m[0] == m.group[0]) but is not iterable: >>> m = regex.match('([^:]+): (.*)', 'foo: bar') >>> m[0], m[1], m[2] ('foo: bar', 'foo', 'bar') >>> len(m) 3 >>> list(m) TypeError: '_regex.Match' object is not iterable I can see different possible solutions: 1) do what regex does, have m[X] == m.group(X) and live with m[0] == m.group(0) (this means that unpacking will be "_, key, value = m"); 2) have m[0] == m.group(1), which makes unpacking easier, but is inconsistent with both m.group() and with what regex does; * 3) disregard regex compatibility and implement what we think is best; * since regex already has a few incompatibilities with re, a global flag/function could be added to regex to make it behave like the re module (where possible). If necessary, the re module could also include and ignore a similar flag/function. This would make interoperability between the two easier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:02:53 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 13:02:53 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1406898173.12.0.627041355889.issue9529@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think that if the regex module will be adopted in the stdlib, not all it's feature should be included. Regex is too complicated. In particular indexing looks confusing (due to ambiguity of starting index and redundant first item in unpacking). If we will not add support for indexing, there will no incompatibility. There is yet one solution: 0) Reject both iterating and indexing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:05:08 2014 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Fri, 01 Aug 2014 13:05:08 +0000 Subject: [issue22108] python c api wchar_t*/char* passing contradiction In-Reply-To: <1406740242.49.0.577134590981.issue22108@psf.upfronthosting.co.za> Message-ID: <1406898308.01.0.0400742070326.issue22108@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Jonas: Python's string type is a Unicode character type, unlike C's (which is wishy-washy when it comes to characters outside of the "basic execution character set"). So just declaring that all APIs take UTF-8 will *not* allow for easy integration with other C code; instead, it will be the source of moji-bake. In any case, this issue appears to be resolved now; thanks for the patch. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:05:27 2014 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Aug 2014 13:05:27 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1406898327.7.0.191207496283.issue9529@psf.upfronthosting.co.za> Ezio Melotti added the comment: That's indeed another valid solution, even though having indexing and iterability would be convenient (assuming we can figure out a reasonable way to implement them). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:06:05 2014 From: report at bugs.python.org (Zachary Ware) Date: Fri, 01 Aug 2014 13:06:05 +0000 Subject: [issue20466] Example in Doc/extending/embedding.rst fails to compile cleanly In-Reply-To: <1391206449.61.0.838795178148.issue20466@psf.upfronthosting.co.za> Message-ID: <1406898365.57.0.417096854069.issue20466@psf.upfronthosting.co.za> Zachary Ware added the comment: Thanks for your efforts, Saimadhav. The issue has been fixed in another way, though. ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Make _Py_char2wchar() and _Py_wchar2char() public _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:07:10 2014 From: report at bugs.python.org (Zachary Ware) Date: Fri, 01 Aug 2014 13:07:10 +0000 Subject: [issue22108] python c api wchar_t*/char* passing contradiction In-Reply-To: <1406740242.49.0.577134590981.issue22108@psf.upfronthosting.co.za> Message-ID: <1406898430.04.0.802403820492.issue22108@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- stage: -> resolved versions: -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:38:32 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 13:38:32 +0000 Subject: [issue9134] sre bug: lastmark_save/restore In-Reply-To: <1277932738.21.0.537266945796.issue9134@psf.upfronthosting.co.za> Message-ID: <1406900312.35.0.481406572119.issue9134@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It looks as the nature of this bug is clear to you, Armin. Do you want to write a patch? ---------- nosy: +serhiy.storchaka stage: test needed -> needs patch versions: +Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:38:49 2014 From: report at bugs.python.org (Mike Lissner) Date: Fri, 01 Aug 2014 13:38:49 +0000 Subject: [issue22118] urljoin fails with messy relative URLs Message-ID: <1406900329.8.0.528379735401.issue22118@psf.upfronthosting.co.za> New submission from Mike Lissner: Not sure if this is desired behavior, but it's making my code break, so I figured I'd get it filed. I'm trying to crawl this website: https://www.appeals2.az.gov/ODSPlus/recentDecisions2.cfm Unfortunately, most of the URLs in the HTML are relative, taking the form: '../../some/path/to/some/pdf.pdf' I'm using lxml's make_links_absolute() function, which calls urljoin creating invalid urls like: https://www.appeals2.az.gov/../Decisions/CR20130096OPN.pdf If you put that into Firefox or wget or whatever, it works, despite being invalid and making no sense. **It works because those clients fix the problem,** joining the invalid path and the URL into: https://www.appeals2.az.gov/Decisions/CR20130096OPN.pdf I know this will mean making urljoin have a workaround to fix bad HTML, but this seems to be what wget, Chrome, Firefox, etc. all do. I've never filed a Python bugs before, but is this something we could consider? ---------- components: Library (Lib) messages: 224500 nosy: Mike.Lissner priority: normal severity: normal status: open title: urljoin fails with messy relative URLs type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:56:45 2014 From: report at bugs.python.org (Michael Foord) Date: Fri, 01 Aug 2014 13:56:45 +0000 Subject: [issue7897] Support parametrized tests in unittest In-Reply-To: <1265768482.24.0.694001982317.issue7897@psf.upfronthosting.co.za> Message-ID: <1406901405.17.0.637438748383.issue7897@psf.upfronthosting.co.za> Michael Foord added the comment: I agree with Nick. There is a potential use case for parameterized tests as well as sub tests, but it's not something we're going to rush into. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:57:25 2014 From: report at bugs.python.org (Armin Rigo) Date: Fri, 01 Aug 2014 13:57:25 +0000 Subject: [issue9134] sre bug: lastmark_save/restore In-Reply-To: <1277932738.21.0.537266945796.issue9134@psf.upfronthosting.co.za> Message-ID: <1406901445.96.0.619202929254.issue9134@psf.upfronthosting.co.za> Armin Rigo added the comment: It was clear to me four years ago. Now I'd have to dig again as much as you do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 15:59:11 2014 From: report at bugs.python.org (Mike Lissner) Date: Fri, 01 Aug 2014 13:59:11 +0000 Subject: [issue22118] urljoin fails with messy relative URLs In-Reply-To: <1406900329.8.0.528379735401.issue22118@psf.upfronthosting.co.za> Message-ID: <1406901551.54.0.292530484807.issue22118@psf.upfronthosting.co.za> Mike Lissner added the comment: FWIW, the workaround that I've just created for this problem is this: u = 'https://www.appeals2.az.gov/../Decisions/CR20130096OPN.pdf' # Split the url and rejoin it, nuking any '/..' patterns at the # beginning of the path. s = urlsplit(u) urlunsplit(s[:2] + (re.sub('^(/\.\.)+', '', s.path),) + s[3:]) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 16:11:49 2014 From: report at bugs.python.org (Saimadhav Heblikar) Date: Fri, 01 Aug 2014 14:11:49 +0000 Subject: [issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default. In-Reply-To: <1364102013.73.0.373085073641.issue17535@psf.upfronthosting.co.za> Message-ID: <1406902309.41.0.582630869415.issue17535@psf.upfronthosting.co.za> Saimadhav Heblikar added the comment: Attached is Text widget based implementation to add linenumbering to IDLE. NS: The purpose of comment block in update_sidebar_text_font The reason why it is there is to allow tk to "catch up" with changes(esp on large files) after a font change. While it *IS* not required for me, it *WAS* in the past. I don't know what has changed, but as it stands it is not required, IDK if it has been caused by a hardware change on my end. Anyways, while reviewing, please open a large file, and change the font size from minimum to maximum to minimum many times. Post here if the Linenumbering goes out of sync with and without uncommenting the comment block. ---------- Added file: http://bugs.python.org/file36194/linenumber-text-widget-v1.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 16:25:28 2014 From: report at bugs.python.org (Zachary Ware) Date: Fri, 01 Aug 2014 14:25:28 +0000 Subject: [issue22096] Argument Clinic: add ability to specify an existing impl function In-Reply-To: <1406581736.61.0.192085386043.issue22096@psf.upfronthosting.co.za> Message-ID: <1406903128.35.0.35664567531.issue22096@psf.upfronthosting.co.za> Zachary Ware added the comment: Fair enough. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 16:36:10 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 14:36:10 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1406903770.93.0.124232701682.issue9529@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file36192/re_matchobj_iterable.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 16:43:47 2014 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 01 Aug 2014 14:43:47 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1406904227.74.0.179064926821.issue9529@psf.upfronthosting.co.za> Mark Lawrence added the comment: Why worry about the "new" regex module? It doesn't appear to be any closer to getting into the stdlib than it was when #2636 was first opened on 15th April 2008, so maybe Python 4.0? ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 16:48:47 2014 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Aug 2014 14:48:47 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1406904527.48.0.656825118298.issue9529@psf.upfronthosting.co.za> Ezio Melotti added the comment: Even if it doesn't get included in the stdlib, some people might decide to switch from re to regex (or possibly vice versa) for their projects, so the closer they are the easier this will be. Another reason is that afaik the authors of the regex module made a conscious effort to maintain compatibility with re, so returning the favor is the least we can do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 17:57:07 2014 From: report at bugs.python.org (eryksun) Date: Fri, 01 Aug 2014 15:57:07 +0000 Subject: [issue16353] add function to os module for getting path to default shell In-Reply-To: <1351473560.4.0.147895276383.issue16353@psf.upfronthosting.co.za> Message-ID: <1406908627.97.0.49168854247.issue16353@psf.upfronthosting.co.za> eryksun added the comment: > The path to the default shell shouldn't change during the time > of program execution. On Windows the ComSpec environment variable could change during program execution. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 18:47:49 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 16:47:49 +0000 Subject: [issue16353] add function to os module for getting path to default shell In-Reply-To: <1406908627.97.0.49168854247.issue16353@psf.upfronthosting.co.za> Message-ID: <1843748.YAkf1jqr4n@raxxla> Serhiy Storchaka added the comment: Taking into consideration msg174586 we can ignore the ComSpec environment variable and hardcode "cmd.exe" on Windows, as we ignore the SHELL environment variable on Posix systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 19:01:13 2014 From: report at bugs.python.org (Zachary Ware) Date: Fri, 01 Aug 2014 17:01:13 +0000 Subject: [issue20170] Derby #1: Convert 137 sites to Argument Clinic in Modules/posixmodule.c In-Reply-To: <1389138185.8.0.104398826507.issue20170@psf.upfronthosting.co.za> Message-ID: <1406912473.5.0.188499392856.issue20170@psf.upfronthosting.co.za> Zachary Ware added the comment: Another nit to pick: long lines in docstrings. There are several lines about 75-78 characters long in several different docstrings, which look absolutely terrible when you try "import os;help(os)" on an 80-character-wide terminal due to an 8 character indent. Blame can be spread pretty far and wide on this, but I wonder if Clinic should enforce a 72 character limit on docstring lines to try to mitigate this? Other than that (and the fix to utime mentioned earlier), I don't see anything obviously wrong with the patch, though I admit to not having read through the whole thing (it's huge!). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 19:42:14 2014 From: report at bugs.python.org (Guillaume Matte) Date: Fri, 01 Aug 2014 17:42:14 +0000 Subject: [issue17703] Trashcan mechanism segfault during interpreter finalization in Python 2.7.4 In-Reply-To: <1365774192.26.0.770170442284.issue17703@psf.upfronthosting.co.za> Message-ID: <1406914934.67.0.143061692186.issue17703@psf.upfronthosting.co.za> Guillaume Matte added the comment: It does still cause a Fatal Error in debug build as PyThreadState_GET() error out if _PyThreadState_Current is NULL ---------- nosy: +flex.plexico _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 19:51:34 2014 From: report at bugs.python.org (eryksun) Date: Fri, 01 Aug 2014 17:51:34 +0000 Subject: [issue16353] add function to os module for getting path to default shell In-Reply-To: <1351473560.4.0.147895276383.issue16353@psf.upfronthosting.co.za> Message-ID: <1406915494.57.0.661057749301.issue16353@psf.upfronthosting.co.za> eryksun added the comment: Defaulting to just "cmd.exe" can execute an arbitrary program named "cmd.exe" in the application directory or current directory. When CreateProcess needs to find the shell to execute a batch file (.bat or .cmd), it doesn't search for "cmd.exe" -- at least not in NT 6. If ComSpec isn't set, it defaults to "%SystemRoot%\system32\cmd.exe". If both ComSpec and SystemRoot are unset, executing a batch file via CreateProcess fails with ERROR_DIRECTORY. I think Python should use the same default path if it's ignoring ComSpec: default_shell = path.join(environ["SystemRoot"], "system32", "cmd.exe") A KeyError shouldn't be a problem here. CPython won't even run if SystemRoot isn't set to the correct path: C:\>set SystemRoot= C:\>py -3 Fatal Python error: Failed to initialize Windows random API (CryptoGen) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 20:18:46 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Aug 2014 18:18:46 +0000 Subject: [issue22077] Improve the error message for various sequences In-Reply-To: <1406364730.89.0.733726269195.issue22077@psf.upfronthosting.co.za> Message-ID: <1406917126.03.0.27144450832.issue22077@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- assignee: -> terry.reedy nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 20:55:31 2014 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 01 Aug 2014 18:55:31 +0000 Subject: [issue1327594] Static Windows Build fails to locate existing installation Message-ID: <1406919331.56.0.901870439174.issue1327594@psf.upfronthosting.co.za> Mark Lawrence added the comment: Opinions from our Windows experts please. ---------- nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 21:11:54 2014 From: report at bugs.python.org (Akira Li) Date: Fri, 01 Aug 2014 19:11:54 +0000 Subject: [issue16353] add function to os module for getting path to default shell In-Reply-To: <1351473560.4.0.147895276383.issue16353@psf.upfronthosting.co.za> Message-ID: <1406920314.29.0.837965155557.issue16353@psf.upfronthosting.co.za> Akira Li added the comment: > Should it be function? Why not use just a variable initialized at > import time? The path to the default shell shouldn't change during > the time of program execution. > if sys.platform == 'win32': > default_shell = 'cmd.exe' > else: > default_shell = '/bin/sh' Andriod uses /system/bin/sh (and /sbin/sh if we believe some adb source on the internet). See issue16255: "subrocess.Popen needs /bin/sh but Android only has /system/bin/sh" POSIX recommends [1] `getconf PATH` (os.confstr('CS_PATH')): Applications should note that the standard PATH to the shell cannot be assumed to be either /bin/sh or /usr/bin/sh, and should be determined by interrogation of the PATH returned by getconf PATH, ensuring that the returned pathname is an absolute pathname and not a shell built-in. For example, to determine the location of the standard sh utility: $ command -v sh i.e. shell executable is shutil.which('sh', os.defpath) on POSIX. os.defpath could be tweaked on Android. To avoid dependency on shutil something like msg174628 could be adopted: if sys.platform == "win32": # use sys.platform to accommodate java def get_shell_executable(): """Return path to the command processor specified by %ComSpec%. Default: %SystemRoot%\system32\cmd.exe """ return (environ.get('ComSpec') or path.join(environ.get('SystemRoot', r'C:\Windows'), r'system32\cmd.exe')) else: # POSIX def get_shell_executable(): """Return path to the standard system shell executable. Default: '/bin/sh' """ for dirpath in defpath.split(pathsep): sh = dirpath + sep + 'sh' #NOTE: interpret '' as '/' if access(sh, F_OK | X_OK) and path.isfile(sh): #NOTE: allow symlinks e.g., /bin/sh on Ubuntu may be dash return sh return '/bin/sh' #XXX either OS or python are broken if we got here Windows part is based on msg224512. If r'C:\Windows' or '/bin/sh' code is reached then it means that either OS or python are broken/misconfigured. system(), popen() are described on POSIX as [2]: # fork() execl(shell path, "sh", "-c", command, (char *)0); subprocess module that replaces system, popen, spawn*p* calls may use os.get_shell_executable() to implement shell=True. os.defpath is [3]: The default search path used by exec*p* and spawn*p* if the environment doesn?t have a 'PATH' key. Also available via os.path. In the absense of os.confstr('CS_PATH') on Android (msg175006), os.defpath seems appropriate than os.environ['PATH'] to expand 'sh' basename to the full path to be used by subprocess later. os.get_shell() name might imply that a shell object is returned that can run commands like for example os.popen() returns a file-like object that is not true (the intent is to return a path -- a simple string). os.get_shell_executable() is similar to sys.executable that returns path to python executable. os.get_shell_executable() is not necessary for every python run therefore it is better to keep it a function to avoid unnecessary stat calls on startup. Though the result should not change during the program run. > On Windows the ComSpec environment variable could change during > program execution. Does it? The docs for os.environ say [4]: This mapping is captured the first time the os module is imported, typically during Python startup as part of processing site.py. Changes to the environment made after this time are not reflected in os.environ, except for changes made by modifying os.environ directly. I've uploaded a patch with the described implementation (plus docs, tests). [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html [2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/popen.html [3] https://docs.python.org/3.4/library/os.html#os.defpath [4] https://docs.python.org/3.4/library/os.html#os.environ ---------- nosy: +akira Added file: http://bugs.python.org/file36195/os.get_shell_executable.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 21:22:06 2014 From: report at bugs.python.org (Akira Li) Date: Fri, 01 Aug 2014 19:22:06 +0000 Subject: [issue16353] add function to os module for getting path to default shell In-Reply-To: <1351473560.4.0.147895276383.issue16353@psf.upfronthosting.co.za> Message-ID: <1406920926.33.0.0148192279978.issue16353@psf.upfronthosting.co.za> Changes by Akira Li <4kir4.1i at gmail.com>: ---------- versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 21:24:04 2014 From: report at bugs.python.org (Akira Li) Date: Fri, 01 Aug 2014 19:24:04 +0000 Subject: [issue16353] add function to os module for getting path to default shell In-Reply-To: <1351473560.4.0.147895276383.issue16353@psf.upfronthosting.co.za> Message-ID: <1406921044.42.0.858006482674.issue16353@psf.upfronthosting.co.za> Changes by Akira Li <4kir4.1i at gmail.com>: Removed file: http://bugs.python.org/file36195/os.get_shell_executable.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 21:24:31 2014 From: report at bugs.python.org (Akira Li) Date: Fri, 01 Aug 2014 19:24:31 +0000 Subject: [issue16353] add function to os module for getting path to default shell In-Reply-To: <1351473560.4.0.147895276383.issue16353@psf.upfronthosting.co.za> Message-ID: <1406921071.34.0.81228478376.issue16353@psf.upfronthosting.co.za> Changes by Akira Li <4kir4.1i at gmail.com>: Added file: http://bugs.python.org/file36196/os.get_shell_executable.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 21:28:04 2014 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 01 Aug 2014 19:28:04 +0000 Subject: [issue1654408] Installer should split tcl/tk and tkinter install options. Message-ID: <1406921284.9.0.00200038028197.issue1654408@psf.upfronthosting.co.za> Mark Lawrence added the comment: Quoting from msg55008 "I know this isn't a common occurrence and not a problem with python directly" I believe this should be closed as "won't fix", what do the rest of you think? ---------- components: +Windows nosy: +BreamoreBoy, steve.dower, terry.reedy, tim.golden, zach.ware versions: +Python 3.5 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 21:55:31 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 19:55:31 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1406922931.12.0.296278221792.issue21448@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Therefore the bug is that email parser is dramatically slow for abnormal long lines. It has quadratic complexity from line size. Minimal example: import email.parser import time data = 'From: example at example.com\n\n' + 'x' * 10000000 start = time.time() email.parser.Parser().parsestr(data) print(time.time() - start) ---------- nosy: +serhiy.storchaka versions: +Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 22:21:19 2014 From: report at bugs.python.org (Anselm Kruis) Date: Fri, 01 Aug 2014 20:21:19 +0000 Subject: [issue18004] test_list.test_overflow crashes Win64 In-Reply-To: <1368834409.49.0.790067586607.issue18004@psf.upfronthosting.co.za> Message-ID: <1406924479.82.0.00126935473249.issue18004@psf.upfronthosting.co.za> Anselm Kruis added the comment: Currently, if you run the test suite of a 64bit Windows python installation it consumes all your memory and - depending on your RAM and swap space - you system becomes unusable. That's a behaviour nobody expects. I didn't look into the implementation of the test case test_list. Therefore I can't make a proposal what to change. Obviously there are at least two options: - skip the test - replace "sys.maxint" with "sys.maxsize" in test_overflow ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 22:44:52 2014 From: report at bugs.python.org (John Fisher) Date: Fri, 01 Aug 2014 20:44:52 +0000 Subject: [issue22119] Some input chars (i.e. '++') break re.match Message-ID: <1406925892.62.0.916485678842.issue22119@psf.upfronthosting.co.za> New submission from John Fisher: Some characters repeated in the pattern break re.match: Linux python 2.7.6 ################################### # test.py import re #diffitem = "libstdc+" succeeds #diffitem = "libstdc++" fails #diffitem = "libstdc**" fails #diffitem = "libstdc.." succeeds diffitem = "libstdc+\+" succeeds line = "time 1.7-23build1" result = re.match(diffitem, line) print result ################################### $ python test.py Traceback (most recent call last): File "test.py", line 9, in result = re.match(diffitem, line) File "/usr/lib/python2.7/re.py", line 137, in match return _compile(pattern, flags).match(string) File "/usr/lib/python2.7/re.py", line 244, in _compile raise error, v # invalid expression sre_constants.error: multiple repeat ---------- components: Regular Expressions messages: 224518 nosy: ezio.melotti, jpfisher, mrabarnett priority: normal severity: normal status: open title: Some input chars (i.e. '++') break re.match type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 22:55:47 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 20:55:47 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> Message-ID: <1406926547.66.0.460437993132.issue22117@psf.upfronthosting.co.za> Changes by STINNER Victor : Added file: http://bugs.python.org/file36197/timespec-2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 22:58:24 2014 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Aug 2014 20:58:24 +0000 Subject: [issue22110] enable extra compilation warnings In-Reply-To: <1406757101.06.0.990367547704.issue22110@psf.upfronthosting.co.za> Message-ID: <3hQ16l6kxmz7LjM@mail.python.org> Roundup Robot added the comment: New changeset 2c70897e5f98 by Charles-Fran?ois Natali in branch 'default': Issue #22110: Enable extra compilation warnings. http://hg.python.org/cpython/rev/2c70897e5f98 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 23:06:42 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 21:06:42 +0000 Subject: [issue18004] test_list.test_overflow crashes Win64 In-Reply-To: <1368834409.49.0.790067586607.issue18004@psf.upfronthosting.co.za> Message-ID: <1406927202.52.0.0910361039916.issue18004@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Definitely this test should be decorated as bigmemtest. Here are patches. ---------- keywords: +patch nosy: +serhiy.storchaka stage: -> patch review versions: +Python 3.4, Python 3.5 Added file: http://bugs.python.org/file36198/test_list_overflow-3.4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 23:08:31 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 01 Aug 2014 21:08:31 +0000 Subject: [issue18004] test_list.test_overflow crashes Win64 In-Reply-To: <1368834409.49.0.790067586607.issue18004@psf.upfronthosting.co.za> Message-ID: <1406927311.8.0.95143597155.issue18004@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file36199/test_list_overflow-2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 23:19:27 2014 From: report at bugs.python.org (Matthew Barnett) Date: Fri, 01 Aug 2014 21:19:27 +0000 Subject: [issue22119] Some input chars (i.e. '++') break re.match In-Reply-To: <1406925892.62.0.916485678842.issue22119@psf.upfronthosting.co.za> Message-ID: <1406927967.71.0.329496082291.issue22119@psf.upfronthosting.co.za> Matthew Barnett added the comment: In a regex, '+' is a metacharacter meaning "repeated one or more times". "libstdc+" will match "libstd" followed by "c" repeated one or more times. "libstdc++" will match "libstd" followed by "c" repeated one or more times, but then there's another "+", which it takes to mean that you want the repeat to be repeated, hence the exception. '*' is also a metacharacter, this one meaning "repeated zero or more times". In summary, not a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 23:22:41 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Aug 2014 21:22:41 +0000 Subject: [issue1654408] Installer should split tcl/tk and tkinter install options. Message-ID: <1406928161.84.0.00498702390181.issue1654408@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I am not sure whether separately installing tcl/tk is generally feasible, without special care. tkinter depends on _tkinter, which is compiled against a particular tk version compiled with the same MS C compiler. It was also not clear from the linked report why the BLT.dll would not work with the co-installed tcl/tk but would work with a separately installed tcl/tk. Zack recently changed some of the tcl/tk compile options. Perhaps they make a difference. I think being able to add tcl/tk extentions on Windows would be nice -- I can imagine wanting to do so myself. But I think the request should be 'compile and install tcl/tk so that user can add tcl/tk extensions' (without deleting and reinstalling). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 23:27:18 2014 From: report at bugs.python.org (Ezio Melotti) Date: Fri, 01 Aug 2014 21:27:18 +0000 Subject: [issue22119] Some input chars (i.e. '++') break re.match In-Reply-To: <1406925892.62.0.916485678842.issue22119@psf.upfronthosting.co.za> Message-ID: <1406928438.65.0.0125578613074.issue22119@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 1 23:37:10 2014 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 01 Aug 2014 21:37:10 +0000 Subject: [issue22110] enable extra compilation warnings In-Reply-To: <1406757101.06.0.990367547704.issue22110@psf.upfronthosting.co.za> Message-ID: <1406929030.77.0.8228774621.issue22110@psf.upfronthosting.co.za> Charles-Fran?ois Natali added the comment: Committed. Sorry for the extra ~70 warnings :-) ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 00:38:10 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Aug 2014 22:38:10 +0000 Subject: [issue22086] Tab indent no longer works in interpreter In-Reply-To: <1406396060.4.0.777513387491.issue22086@psf.upfronthosting.co.za> Message-ID: <1406932690.45.0.194070853172.issue22086@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This is a *nix issue only, as tab completion is not active on Windows (except with Idle). ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 00:46:00 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Aug 2014 22:46:00 +0000 Subject: [issue22088] base64 module still ignores non-alphabet characters In-Reply-To: <1406414649.83.0.15731376973.issue22088@psf.upfronthosting.co.za> Message-ID: <1406933160.1.0.186037727988.issue22088@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Update the doc. I believe Davis intentionally only applied the 3.2 patch, treating the change as a bit of an enhancement. Can you propose a new wording? ---------- components: -Library (Lib) nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 00:51:22 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Aug 2014 22:51:22 +0000 Subject: [issue22092] Executing some tests inside Lib/unittest/test individually throws Error In-Reply-To: <1406472645.11.0.803987239444.issue22092@psf.upfronthosting.co.za> Message-ID: <1406933482.58.0.440720744663.issue22092@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 00:57:10 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Aug 2014 22:57:10 +0000 Subject: [issue22105] Idle: Hang during File "Save As" In-Reply-To: <1406689445.5.0.172130301576.issue22105@psf.upfronthosting.co.za> Message-ID: <1406933830.51.0.833918552857.issue22105@psf.upfronthosting.co.za> Terry J. Reedy added the comment: What file were you trying to save to? Be very exact. Reading/Saving to 'Library' files is known to have problems and there is another issue for this. Were you trying to save the Shell window, displaying output from your program. What is the minimum # of lines required to have a problem. 400000 lines is probably "won't fix" because the problem is likely with tk and Windows, not Idle. Your program should print directly to a file. ---------- nosy: +terry.reedy title: Hang during File "Save As" -> Idle: Hang during File "Save As" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 00:58:37 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Aug 2014 22:58:37 +0000 Subject: [issue22107] tempfile module misinterprets access denied error on Windows In-Reply-To: <1406724041.52.0.0365391579019.issue22107@psf.upfronthosting.co.za> Message-ID: <1406933917.45.0.951924388029.issue22107@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +georg.brandl, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 01:00:44 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 01 Aug 2014 23:00:44 +0000 Subject: [issue22115] Add new methods to trace Tkinter variables In-Reply-To: <1406818071.8.0.276271200629.issue22115@psf.upfronthosting.co.za> Message-ID: <1406934044.26.0.892694367719.issue22115@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 01:01:43 2014 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Aug 2014 23:01:43 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> Message-ID: <1406934103.61.0.767415162703.issue22117@psf.upfronthosting.co.za> STINNER Victor added the comment: Here is a more complete patch (version 3). It uses _PyTimeSpec in more functions. I tested the patch on Linux, Windows, FreeBSD, OpenBSD. I was surprised to find bugs. For example, Windows has a time_t larger than long, whereas OpenBSD 5.4 (on 64 bit) has a time_t smaller than long. ---------- Added file: http://bugs.python.org/file36200/timespec-3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 02:14:08 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 00:14:08 +0000 Subject: [issue22120] Fix compiler warnings Message-ID: <1406938448.57.0.457733140419.issue22120@psf.upfronthosting.co.za> New submission from STINNER Victor: The issue #22110 enabled more compiler warnings. Attached patch tries to fix most of them on Linux. ---------- messages: 224528 nosy: haypo priority: normal severity: normal status: open title: Fix compiler warnings _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 02:15:00 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 00:15:00 +0000 Subject: [issue22120] Fix compiler warnings In-Reply-To: <1406938448.57.0.457733140419.issue22120@psf.upfronthosting.co.za> Message-ID: <1406938500.85.0.316719977604.issue22120@psf.upfronthosting.co.za> STINNER Victor added the comment: clinic.patch: modify clinic.py to generate "return_value == (type)-1" instead of "return_value == -1" to avoid a warning if return_value is unsigned. ---------- keywords: +patch nosy: +larry, neologix Added file: http://bugs.python.org/file36201/clinic.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 02:18:15 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 00:18:15 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> Message-ID: <1406938695.77.0.58463536443.issue22117@psf.upfronthosting.co.za> STINNER Victor added the comment: timespec-3.patch is quite large: Include/pyport.h | 14 + Include/pytime.h | 159 +++++++---- Lib/test/test_time.py | 340 +++++++++++++++++++------ Modules/_datetimemodule.c | 40 ++ Modules/_ssl.c | 31 +- Modules/_testcapimodule.c | 238 ++++++++++++++++- Modules/_threadmodule.c | 196 +++++++------- Modules/gcmodule.c | 15 - Modules/posixmodule.c | 24 - Modules/selectmodule.c | 36 -- Modules/signalmodule.c | 12 Modules/socketmodule.c | 206 +++++++++------ Modules/socketmodule.h | 6 Modules/timemodule.c | 22 - Python/pythonrun.c | 3 Python/pytime.c | 616 +++++++++++++++++++++++++++++++++------------- 16 files changed, 1371 insertions(+), 587 deletions(-) Tell me if you prefer to review shorter patches. I can try to only add new functions, then use new functions, and finally remove new functions. I wanted to keep changes in a single patch at least one to show how the new API is used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 02:24:27 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 00:24:27 +0000 Subject: [issue22114] You cannot call communicate() safely after receiving an exception (EINTR or EAGAIN) In-Reply-To: <1406807939.82.0.812223355091.issue22114@psf.upfronthosting.co.za> Message-ID: <1406939067.8.0.285637823463.issue22114@psf.upfronthosting.co.za> STINNER Victor added the comment: > By the definition of the (blocking) communicate API, communicate can only be called once (it feeds in all the input, and reads all the output). Since Python 3.3, communicate() can now fail with TimeoutExpired. On UNIX, it looks like it's possible to call again communicate() in this case. On Windows, the implementation is different: stdin.write() doesn't use the timeout, so the write can hang longer than the timeout :-( Use asyncio is you want reliable and efficient communicate() on all platforms ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 03:14:09 2014 From: report at bugs.python.org (Josh Rosenberg) Date: Sat, 02 Aug 2014 01:14:09 +0000 Subject: [issue11271] concurrent.futures.ProcessPoolExecutor.map() doesn't batch function arguments by chunks In-Reply-To: <1298300689.71.0.822605356721.issue11271@psf.upfronthosting.co.za> Message-ID: <1406942049.59.0.215815448244.issue11271@psf.upfronthosting.co.za> Changes by Josh Rosenberg : ---------- nosy: +josh.rosenberg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 05:14:27 2014 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Aug 2014 03:14:27 +0000 Subject: [issue2771] Test issue In-Reply-To: <1210005645.74.0.283923986194.issue2771@psf.upfronthosting.co.za> Message-ID: <1406949267.4.0.137479977625.issue2771@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 06:30:50 2014 From: report at bugs.python.org (Ned Deily) Date: Sat, 02 Aug 2014 04:30:50 +0000 Subject: [issue12312] is ok In-Reply-To: Message-ID: <1406953850.6.0.93514132038.issue12312@psf.upfronthosting.co.za> Changes by Ned Deily : ---------- Removed message: http://bugs.python.org/msg224391 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 06:45:09 2014 From: report at bugs.python.org (Ned Deily) Date: Sat, 02 Aug 2014 04:45:09 +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: <1406954709.18.0.30603720733.issue18142@psf.upfronthosting.co.za> Ned Deily added the comment: As the cited Mageia bug has been closed, there seems to be no reason to keep this issue open. ---------- nosy: +ned.deily resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 06:45:31 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 04:45:31 +0000 Subject: [issue18004] test_list.test_overflow crashes Win64 In-Reply-To: <1368834409.49.0.790067586607.issue18004@psf.upfronthosting.co.za> Message-ID: <1406954731.19.0.476474930575.issue18004@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file36198/test_list_overflow-3.4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 06:46:15 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 04:46:15 +0000 Subject: [issue18004] test_list.test_overflow crashes Win64 In-Reply-To: <1368834409.49.0.790067586607.issue18004@psf.upfronthosting.co.za> Message-ID: <1406954775.79.0.455834500161.issue18004@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file36199/test_list_overflow-2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 06:51:43 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 04:51:43 +0000 Subject: [issue18004] test_list.test_overflow crashes Win64 In-Reply-To: <1368834409.49.0.790067586607.issue18004@psf.upfronthosting.co.za> Message-ID: <1406955103.24.0.24026684955.issue18004@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I was wrong. Here should be just sys.maxsize. With sys.maxint the test should consume about 32 GB of memory and then fail on assertion (imul requires even 40 GB, but the test fails earlier). ---------- stage: patch review -> needs patch versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 06:58:58 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 04:58:58 +0000 Subject: [issue22120] Fix compiler warnings In-Reply-To: <1406938448.57.0.457733140419.issue22120@psf.upfronthosting.co.za> Message-ID: <1406955538.19.0.330888299349.issue22120@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think this should be done only for unsigned integer types. Otherwise it just dirty sources and can hide actual bugs. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 07:31:03 2014 From: report at bugs.python.org (Roundup Robot) Date: Sat, 02 Aug 2014 05:31:03 +0000 Subject: [issue22077] Improve the error message for various sequences In-Reply-To: <1406364730.89.0.733726269195.issue22077@psf.upfronthosting.co.za> Message-ID: <3hQDVH0fXRz7Ljg@mail.python.org> Roundup Robot added the comment: New changeset 02d6d3a7a181 by Terry Jan Reedy in branch 'default': Issue #22077: Improve index error messages for bytearrays, bytes, lists, and http://hg.python.org/cpython/rev/02d6d3a7a181 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 07:32:25 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 02 Aug 2014 05:32:25 +0000 Subject: [issue22077] Improve the error message for various sequences In-Reply-To: <1406364730.89.0.733726269195.issue22077@psf.upfronthosting.co.za> Message-ID: <1406957545.9.0.511241548181.issue22077@psf.upfronthosting.co.za> Terry J. Reedy added the comment: while at it, I changed bytearray messages to include bad type as other do. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 09:29:41 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 07:29:41 +0000 Subject: [issue22107] tempfile module misinterprets access denied error on Windows In-Reply-To: <1406724041.52.0.0365391579019.issue22107@psf.upfronthosting.co.za> Message-ID: <1406964581.31.0.0316010323631.issue22107@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- type: -> behavior versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 09:53:52 2014 From: report at bugs.python.org (Mark Summerfield) Date: Sat, 02 Aug 2014 07:53:52 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory Message-ID: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> New submission from Mark Summerfield: On Windows IDLE's working directory is Python's install directory, e.g., C:\Python34. ISTM that this is the wrong directory for 99% of general users and for 100% of beginners since this is _not_ the directory where people should save their own .py files (unless they are experts, in which case they know better and won't anyway). I think that IDLE should start out in the user's home directory (ideally on all platforms). ---------- components: IDLE messages: 224537 nosy: mark priority: normal severity: normal status: open title: IDLE should start with HOME as the initial working directory type: enhancement versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 09:57:51 2014 From: report at bugs.python.org (Mark Summerfield) Date: Sat, 02 Aug 2014 07:57:51 +0000 Subject: [issue22122] turtle module examples should all begin "from turtle import *" Message-ID: <1406966271.25.0.28039955033.issue22122@psf.upfronthosting.co.za> New submission from Mark Summerfield: The turtle module is aimed primarily at young beginners to Python. Making them type turtle.this and turtle.that all over the place is tedious and unhelpful. At the start of the turtle docs there's a nice example that begins from turtle import * and the following code is all the better for it. But none of the other examples do this. I realise that this would make the module's docs inconsistent, but given the target audience and given that we surely want to lower the barrier to entry, it would be a reasonable concession to make? ---------- assignee: docs at python components: Documentation messages: 224538 nosy: docs at python, mark priority: normal severity: normal status: open title: turtle module examples should all begin "from turtle import *" type: enhancement versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 10:01:04 2014 From: report at bugs.python.org (Anthony Kong) Date: Sat, 02 Aug 2014 08:01:04 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1406966464.9.0.386630289084.issue22116@psf.upfronthosting.co.za> Changes by Anthony Kong : ---------- nosy: +Anthony.Kong _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 10:02:28 2014 From: report at bugs.python.org (Mark Summerfield) Date: Sat, 02 Aug 2014 08:02:28 +0000 Subject: [issue22123] Make object() behave exactly like types.SimpleNamespace() if given kwargs Message-ID: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> New submission from Mark Summerfield: Right now object() does not accept any args and returns the lightest possible featureless object (i.e., without even a __dict__). This is great. However, it is really useful sometimes to be able to create an object to hold some editable state (so not a namedtuple). Right now this can be done with types.SimpleNamespace(). I think it would be a useful enhancement to have object() work as it does now, but to allow it to accept kwargs in which case it would provide identical functionality to types.SimpleNamespace(). This arises from an email I wrote to the python mailinglist: https://groups.google.com/d/msg/comp.lang.python/9pY7hLp8lDg/voYF8nMO6x8J But I also think it would be useful more generally. ---------- components: Interpreter Core messages: 224539 nosy: mark priority: normal severity: normal status: open title: Make object() behave exactly like types.SimpleNamespace() if given kwargs type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 10:04:26 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 08:04:26 +0000 Subject: [issue22120] Fix compiler warnings In-Reply-To: <1406955538.19.0.330888299349.issue22120@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: It would be better to only modify clinic for unsigned types, but how do you check if a type is signed or not? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 10:37:42 2014 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 02 Aug 2014 08:37:42 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1406968662.14.0.876379936042.issue22116@psf.upfronthosting.co.za> Stefan Behnel added the comment: FWIW, functions in Cython (which C-level-inherit from PyCFunction) support weak references just fine. Adding that as a general feature to PyCFunction sounds like the right thing to do. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 10:54:22 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sat, 02 Aug 2014 08:54:22 +0000 Subject: [issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars In-Reply-To: <1405482059.28.0.321220843423.issue21987@psf.upfronthosting.co.za> Message-ID: <1406969662.46.0.123104776756.issue21987@psf.upfronthosting.co.za> Daniel Eriksson added the comment: Added Matt Behrens test to Lars Gust?bel 2.7 version. ---------- nosy: +daniel at starstable.com Added file: http://bugs.python.org/file36202/issue21987_py2.7_with_test.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 10:56:54 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 08:56:54 +0000 Subject: [issue22120] Fix compiler warnings In-Reply-To: Message-ID: <1491125.g2G3mocfN3@raxxla> Serhiy Storchaka added the comment: Either override render() for unsigned type converters, or add new converter attribute (in additional to "type", "cast", "conversion_fn", etc). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 11:12:30 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sat, 02 Aug 2014 09:12:30 +0000 Subject: [issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace In-Reply-To: <1403455487.85.0.474137406062.issue21827@psf.upfronthosting.co.za> Message-ID: <1406970750.0.0.328365114764.issue21827@psf.upfronthosting.co.za> Daniel Eriksson added the comment: Tested and it works fine on CentOS 6.4 in 2.7, 3.4 and 3.5 ---------- nosy: +daniel at starstable.com, ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 11:27:20 2014 From: report at bugs.python.org (Jason Robinson) Date: Sat, 02 Aug 2014 09:27:20 +0000 Subject: [issue19996] httplib infinite read on invalid header In-Reply-To: <1387194945.4.0.440069571587.issue19996@psf.upfronthosting.co.za> Message-ID: <1406971640.18.0.971474655556.issue19996@psf.upfronthosting.co.za> Jason Robinson added the comment: I took the patches and verified that; * running the new tests without the changed code in Lib/email/feedparser.py (head) and Lib/httplib.py, Lib/rfc822.py (2.7) fails both the new tests. * running the new tests with the changed code passes the tests (on both head and 2.7). Sainsburys Bank site seems to have been fixed thus verification in the first comment does not work - but the test I think emulates that well enough. ---------- nosy: +ezio.melotti, jaywink versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 12:44:37 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sat, 02 Aug 2014 10:44:37 +0000 Subject: [issue21697] shutil.copytree() handles symbolic directory incorrectly In-Reply-To: <1402319959.34.0.00412025295877.issue21697@psf.upfronthosting.co.za> Message-ID: <1406976277.59.0.406555036958.issue21697@psf.upfronthosting.co.za> Daniel Eriksson added the comment: I have tested both patches on CentOS 6.4 and Eduardo Seabra:s patch works correctly with symlinks=True ---------- nosy: +daniel at starstable.com _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 12:45:12 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Aug 2014 10:45:12 +0000 Subject: [issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace In-Reply-To: <1403455487.85.0.474137406062.issue21827@psf.upfronthosting.co.za> Message-ID: <1406976312.25.0.702356111473.issue21827@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I've got it from here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 12:53:54 2014 From: report at bugs.python.org (Jason Robinson) Date: Sat, 02 Aug 2014 10:53:54 +0000 Subject: [issue17762] platform.linux_distribution() should honor /etc/os-release In-Reply-To: <1366124468.64.0.40642643299.issue17762@psf.upfronthosting.co.za> Message-ID: <1406976834.01.0.270412140924.issue17762@psf.upfronthosting.co.za> Jason Robinson added the comment: platform.linux_distribution is being deprecated in 3.5 and removed in 3.6 as stated in comment http://bugs.python.org/issue1322#msg207427 in issue #1322 I'm guessing this issue should be closed when that patch is merged in? ---------- nosy: +jaywink _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 12:57:26 2014 From: report at bugs.python.org (Jason Robinson) Date: Sat, 02 Aug 2014 10:57:26 +0000 Subject: [issue9514] platform.linux_distribution() under Ubuntu returns ('debian', 'squeeze/sid', '') In-Reply-To: <1280944069.64.0.760525549047.issue9514@psf.upfronthosting.co.za> Message-ID: <1406977046.42.0.472276935681.issue9514@psf.upfronthosting.co.za> Jason Robinson added the comment: platform.linux_distribution is being deprecated in 3.5 and removed in 3.6 as stated in comment http://bugs.python.org/issue1322#msg207427 in issue #1322 I'm guessing this issue should be closed when that patch is merged in? ---------- nosy: +ezio.melotti, jaywink _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 13:04:24 2014 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 02 Aug 2014 11:04:24 +0000 Subject: [issue22120] Fix compiler warnings In-Reply-To: <1406955538.19.0.330888299349.issue22120@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: This patch should probably be moved to its own issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 13:10:49 2014 From: report at bugs.python.org (Roundup Robot) Date: Sat, 02 Aug 2014 11:10:49 +0000 Subject: [issue15114] Deprecate strict mode of HTMLParser In-Reply-To: <1340185371.41.0.609283463083.issue15114@psf.upfronthosting.co.za> Message-ID: <3hQN2J550Jz7LjR@mail.python.org> Roundup Robot added the comment: New changeset 0e2e47c1f205 by Ezio Melotti in branch 'default': #15114: the strict mode and argument of HTMLParser, HTMLParser.error, and the HTMLParserError exception have been removed. http://hg.python.org/cpython/rev/0e2e47c1f205 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 13:13:19 2014 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Aug 2014 11:13:19 +0000 Subject: [issue15114] Deprecate strict mode of HTMLParser In-Reply-To: <1340185371.41.0.609283463083.issue15114@psf.upfronthosting.co.za> Message-ID: <1406977999.0.0.133173454005.issue15114@psf.upfronthosting.co.za> Ezio Melotti added the comment: 3.5 is done. Closing. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 13:19:44 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 11:19:44 +0000 Subject: [issue22112] '_UnixSelectorEventLoop' object has no attribute 'create_task' In-Reply-To: <1406774418.2.0.505776361437.issue22112@psf.upfronthosting.co.za> Message-ID: <1406978384.42.0.66436631837.issue22112@psf.upfronthosting.co.za> STINNER Victor added the comment: Here is a a patch which replaces loop.create_task(coro) with asyncio.async(coro), mention that asyncio.async() can be used to scheduler a coroutine, and make it clear that create_task() is only available in Python 3.4.2 and later. Does it look better? If it's possible, I would prefer to have exactly the same documentation in Python 3.4 and 3.5. ---------- keywords: +patch Added file: http://bugs.python.org/file36203/doc_create_task.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 13:22:26 2014 From: report at bugs.python.org (Alexander Grigorievskiy) Date: Sat, 02 Aug 2014 11:22:26 +0000 Subject: [issue20402] List comprehensions should be noted in for loop documentation In-Reply-To: <1390793056.66.0.0906291243976.issue20402@psf.upfronthosting.co.za> Message-ID: <1406978546.41.0.612222547245.issue20402@psf.upfronthosting.co.za> Alexander Grigorievskiy added the comment: I have added some clarification following Westley Mart?nez recommendation. I provided references to the list comprehensions and generator expressions. I tried to make the description short. ---------- keywords: +patch nosy: +AlexGrig Added file: http://bugs.python.org/file36204/issue20402.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 13:46:27 2014 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 02 Aug 2014 11:46:27 +0000 Subject: [issue22120] Fix compiler warnings In-Reply-To: <1406938448.57.0.457733140419.issue22120@psf.upfronthosting.co.za> Message-ID: <1406979987.06.0.233707288019.issue22120@psf.upfronthosting.co.za> Changes by Charles-Fran?ois Natali : ---------- Removed message: http://bugs.python.org/msg224550 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 14:10:03 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 12:10:03 +0000 Subject: [issue22120] Fix compiler warnings In-Reply-To: <1406938448.57.0.457733140419.issue22120@psf.upfronthosting.co.za> Message-ID: <1406981403.36.0.926545210606.issue22120@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, I forgot the attach the most important patch: fix_warnings.patch. ---------- Added file: http://bugs.python.org/file36205/fix_warnings.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 14:12:41 2014 From: report at bugs.python.org (Tuikku Anttila) Date: Sat, 02 Aug 2014 12:12:41 +0000 Subject: [issue22046] ZipFile.read() should mention that it might throw NotImplementedError In-Reply-To: <1406118023.79.0.0716895014277.issue22046@psf.upfronthosting.co.za> Message-ID: <1406981561.14.0.805767326679.issue22046@psf.upfronthosting.co.za> Tuikku Anttila added the comment: Added to the documentation of zipfile.ZipFile.read() that the method will throw a NotImplementedError when the compression scheme of the ZipFile is something else than ZIP_STORED, ZIP_DEFLATED, ZIP_BZIP2 or ZIP_LZMA. ---------- keywords: +patch nosy: +Tuikku.Anttila Added file: http://bugs.python.org/file36206/issue22046.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 14:27:52 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sat, 02 Aug 2014 12:27:52 +0000 Subject: [issue14910] argparse: disable abbreviation In-Reply-To: <1337943742.57.0.897347214609.issue14910@psf.upfronthosting.co.za> Message-ID: <1406982472.88.0.347300241591.issue14910@psf.upfronthosting.co.za> Daniel Eriksson added the comment: Update the patch - issue_14910_3.diff argparse.rst - merging conflicts ---------- nosy: +daniel at starstable.com Added file: http://bugs.python.org/file36207/issue_14910_3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 14:49:37 2014 From: report at bugs.python.org (Wei Wu) Date: Sat, 02 Aug 2014 12:49:37 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1406983777.18.0.826407037916.issue22116@psf.upfronthosting.co.za> Wei Wu added the comment: I have made a patch related to this issue, please take a look at it. Thanks :) ---------- nosy: +kilowu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 14:51:14 2014 From: report at bugs.python.org (Wei Wu) Date: Sat, 02 Aug 2014 12:51:14 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1406983874.93.0.517207404765.issue22116@psf.upfronthosting.co.za> Changes by Wei Wu : ---------- keywords: +patch Added file: http://bugs.python.org/file36208/22116.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:04:56 2014 From: report at bugs.python.org (Sowmya) Date: Sat, 02 Aug 2014 13:04:56 +0000 Subject: [issue18859] README.valgrind should mention --with-valgrind In-Reply-To: <1377649189.0.0.381916551624.issue18859@psf.upfronthosting.co.za> Message-ID: <1406984696.6.0.11203269441.issue18859@psf.upfronthosting.co.za> Sowmya added the comment: Hi, I have created a patch for this bug. The Misc/README.valgrind now mentions the --with-valgrind configure options. ---------- keywords: +patch nosy: +sowmya-ravidas type: enhancement -> Added file: http://bugs.python.org/file36209/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:16:18 2014 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sat, 02 Aug 2014 13:16:18 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406848093.52.0.5184372094.issue22117@psf.upfronthosting.co.za> Message-ID: <1406985378.06.0.29775897272.issue22117@psf.upfronthosting.co.za> Martin v. L?wis added the comment: What problem does this solve? ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:19:48 2014 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 02 Aug 2014 13:19:48 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1406985588.97.0.383299454365.issue22116@psf.upfronthosting.co.za> Stefan Behnel added the comment: Patch looks ok. Not sure about the test dependency from test_weakref.py to _testcapi, though. Is that module allowed to be used everywhere? Wouldn't it be enough to test that one of the builtin functions is now weak referencible? "len" seems to be used in other places, for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:26:55 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 13:26:55 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1406986015.56.0.523010824829.issue21448@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Parser reads from input file small chunks (8192 churacters) and feed FeedParser which pushes data into BufferedSubFile. In BufferedSubFile.push() chunks of incomplete data are accumulated in a buffer and repeatedly scanned for newlines. Every push() has linear complexity from the size of accumulated buffer, and total complexity is quadratic. Here is a patch which fixes problem with parsing long lines. Feel free to add comments if they are needed (there is an abundance of comments in the module). ---------- keywords: +patch Added file: http://bugs.python.org/file36210/email_parser_long_lines.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:27:41 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 13:27:41 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1406986061.51.0.48246582921.issue21448@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:29:36 2014 From: report at bugs.python.org (Jason Robinson) Date: Sat, 02 Aug 2014 13:29:36 +0000 Subject: [issue15907] move doctest test-data files into a subdirectory of Lib/test In-Reply-To: <1347296459.35.0.660655246065.issue15907@psf.upfronthosting.co.za> Message-ID: <1406986176.62.0.590594166082.issue15907@psf.upfronthosting.co.za> Jason Robinson added the comment: Here is a patch that hopefully does what was intended. All the tests passed locally, hopefully the tests we're adapted correctly to the new location of the files. My first patch :) I added a new "data" file 'doctest_DocFileSuite_test.txt' to Lib/test to keep the test that tests that doctest.DocFileSuite loads files from calling module path. All the old files I moved to Lib/test/doctest and adapted tests to use them from there. ---------- keywords: +patch nosy: +ezio.melotti, jaywink Added file: http://bugs.python.org/file36211/issue15907.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:36:43 2014 From: report at bugs.python.org (Evans Mungai) Date: Sat, 02 Aug 2014 13:36:43 +0000 Subject: [issue7944] Use the 'with' statement in conjunction with 'open' throughout test modules In-Reply-To: <1266342231.42.0.692171370087.issue7944@psf.upfronthosting.co.za> Message-ID: <1406986603.09.0.544980335247.issue7944@psf.upfronthosting.co.za> Evans Mungai added the comment: Backport for test_tarfile.py ---------- nosy: +evans.mungai versions: +Python 2.7 -Python 3.3, Python 3.4 Added file: http://bugs.python.org/file36212/issue7944_tarfile_2_7.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:39:16 2014 From: report at bugs.python.org (Vivek Balakrishnan) Date: Sat, 02 Aug 2014 13:39:16 +0000 Subject: [issue22024] Add to shutil the ability to wait until files are definitely deleted In-Reply-To: <1405972808.55.0.924744488039.issue22024@psf.upfronthosting.co.za> Message-ID: <1406986755.99.0.711935023876.issue22024@psf.upfronthosting.co.za> Vivek Balakrishnan added the comment: Patch that adds wait parameter to shutil.rmtree. ---------- keywords: +patch nosy: +Vivek.Balakrishnan Added file: http://bugs.python.org/file36213/shutil_wait.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:46:17 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 13:46:17 +0000 Subject: [issue22024] Add to shutil the ability to wait until files are definitely deleted In-Reply-To: <1405972808.55.0.924744488039.issue22024@psf.upfronthosting.co.za> Message-ID: <1406987177.4.0.100865927966.issue22024@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What if other program will create a file with same name in short time after deletion? Then rmtree() will hang in infinity loop. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:47:34 2014 From: report at bugs.python.org (Eli Bendersky) Date: Sat, 02 Aug 2014 13:47:34 +0000 Subject: [issue14910] argparse: disable abbreviation In-Reply-To: <1337943742.57.0.897347214609.issue14910@psf.upfronthosting.co.za> Message-ID: <1406987254.59.0.938280410711.issue14910@psf.upfronthosting.co.za> Eli Bendersky added the comment: Daniel, I left some comments in Rietveld. Also it doesn't seem that you addressed the previously left comments when you fixed up the patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 15:52:53 2014 From: report at bugs.python.org (Ezio Melotti) Date: Sat, 02 Aug 2014 13:52:53 +0000 Subject: [issue22024] Add to shutil the ability to wait until files are definitely deleted In-Reply-To: <1405972808.55.0.924744488039.issue22024@psf.upfronthosting.co.za> Message-ID: <1406987573.23.0.505010681313.issue22024@psf.upfronthosting.co.za> Changes by Ezio Melotti : ---------- nosy: +ezio.melotti, loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 16:00:41 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sat, 02 Aug 2014 14:00:41 +0000 Subject: [issue16037] httplib: header parsing is unlimited In-Reply-To: <1348568722.91.0.654032066819.issue16037@psf.upfronthosting.co.za> Message-ID: <1406988041.35.0.762184430596.issue16037@psf.upfronthosting.co.za> Daniel Eriksson added the comment: Updated the patch for 2.7 to raise HTTPException instead of a new Exception. ---------- nosy: +clearminds Added file: http://bugs.python.org/file36214/issue_16037_py27_v3.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 16:11:35 2014 From: report at bugs.python.org (Vivek Balakrishnan) Date: Sat, 02 Aug 2014 14:11:35 +0000 Subject: [issue22024] Add to shutil the ability to wait until files are definitely deleted In-Reply-To: <1405972808.55.0.924744488039.issue22024@psf.upfronthosting.co.za> Message-ID: <1406988695.59.0.916846385509.issue22024@psf.upfronthosting.co.za> Vivek Balakrishnan added the comment: With respect to msg224566, is a default timeout a good solution? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 16:16:39 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 14:16:39 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406985378.06.0.29775897272.issue22117@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: >Tell me if you prefer to review shorter patches. I can try to only add new functions, then use new functions, and finally remove new functions. Oh, i should read what i wrote before pushing the submit button. The last part is"remove the old functions"... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 16:35:27 2014 From: report at bugs.python.org (STINNER Victor) Date: Sat, 02 Aug 2014 14:35:27 +0000 Subject: [issue22117] Rewrite pytime.h to work on nanoseconds In-Reply-To: <1406985378.06.0.29775897272.issue22117@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Le samedi 2 ao?t 2014, Martin v. L?wis a ?crit : > > > What problem does this solve? > My patch detects overflows which are not detected yet. Currently i guess that the behaviour on overflow is undefined. I should test each function. I also want a nanosecond resolution. It's the same motivation than the PEP 410, except that the patch doesn't touch the Python API, I only care of the C code which has fewer constraints (we don't need a "full" API). I expect that C code is more concerned by the resolution because C code is faster. You need to recompute timeout on EINTR (see the PEP 475 which is still a draft). I don't want to loose precision and I want to round correctly. My main usecase is to compute a timeout from two timestamps of a monotonic clock. IMO it's better to use PyTimeSpec structure everywhere to reuse the code which is now well tested (by unit tests) and make the code more consistent. For example, the datetime module rounds currently using the "down" method, whereas it needs to round "floor" in fact. I saw this issue when I changed the code to use PyTimeSpec in all functions. I agree that my patch is large, especially the new code in pytime.c. I would like to hide the complexity in functions, the API should be simple. Do you think that changes in modules like time, socket or select make the code more complex? I don't know if it's worth it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 16:44:49 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 14:44:49 +0000 Subject: [issue22024] Add to shutil the ability to wait until files are definitely deleted In-Reply-To: <1406988695.59.0.916846385509.issue22024@psf.upfronthosting.co.za> Message-ID: <1759121.ac6nNtRYeB@raxxla> Serhiy Storchaka added the comment: On Linux and some other systems there is an API which allow you to subscribe on notifications about file system events (in particular on deleting specified file). There are modules which provides Python interface to it (e.g. python- inotify, inotifyx, pyinotify). May be there is similar API on Windows? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 16:47:35 2014 From: report at bugs.python.org (Stefan Krah) Date: Sat, 02 Aug 2014 14:47:35 +0000 Subject: [issue18859] README.valgrind should mention --with-valgrind In-Reply-To: <1377649189.0.0.381916551624.issue18859@psf.upfronthosting.co.za> Message-ID: <1406990855.48.0.936230314782.issue18859@psf.upfronthosting.co.za> Stefan Krah added the comment: Hi Sowmya. Currently we have the option to use --with-valgrind or the old method --without-pymalloc. Both methods work. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 17:36:34 2014 From: report at bugs.python.org (Roundup Robot) Date: Sat, 02 Aug 2014 15:36:34 +0000 Subject: [issue21047] html.parser.HTMLParser: convert_charrefs should become True by default In-Reply-To: <1395638238.78.0.969546304297.issue21047@psf.upfronthosting.co.za> Message-ID: <3hQTwy0TMNz7Lkt@mail.python.org> Roundup Robot added the comment: New changeset 4425024f2e01 by Ezio Melotti in branch 'default': #21047: set the default value for the *convert_charrefs* argument of HTMLParser to True. Patch by Berker Peksag. http://hg.python.org/cpython/rev/4425024f2e01 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 17:54:53 2014 From: report at bugs.python.org (Roundup Robot) Date: Sat, 02 Aug 2014 15:54:53 +0000 Subject: [issue15114] Deprecate strict mode of HTMLParser In-Reply-To: <1340185371.41.0.609283463083.issue15114@psf.upfronthosting.co.za> Message-ID: <3hQVL472Frz7Ll6@mail.python.org> Roundup Robot added the comment: New changeset 5b95f3fdcc0b by Ezio Melotti in branch 'default': #15114, #21047: update whatsnew in Python 3.5. http://hg.python.org/cpython/rev/5b95f3fdcc0b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 17:54:54 2014 From: report at bugs.python.org (Roundup Robot) Date: Sat, 02 Aug 2014 15:54:54 +0000 Subject: [issue21047] html.parser.HTMLParser: convert_charrefs should become True by default In-Reply-To: <1395638238.78.0.969546304297.issue21047@psf.upfronthosting.co.za> Message-ID: <3hQVL55Flkz7Ll6@mail.python.org> Roundup Robot added the comment: New changeset 5b95f3fdcc0b by Ezio Melotti in branch 'default': #15114, #21047: update whatsnew in Python 3.5. http://hg.python.org/cpython/rev/5b95f3fdcc0b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 18:08:32 2014 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 02 Aug 2014 16:08:32 +0000 Subject: [issue22123] Make object() behave exactly like types.SimpleNamespace() if given kwargs In-Reply-To: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> Message-ID: <1406995712.88.0.961599563883.issue22123@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 18:53:33 2014 From: report at bugs.python.org (Ethan Furman) Date: Sat, 02 Aug 2014 16:53:33 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1406998413.65.0.92010113343.issue22121@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 18:54:11 2014 From: report at bugs.python.org (Ethan Furman) Date: Sat, 02 Aug 2014 16:54:11 +0000 Subject: [issue22122] turtle module examples should all begin "from turtle import *" In-Reply-To: <1406966271.25.0.28039955033.issue22122@psf.upfronthosting.co.za> Message-ID: <1406998451.75.0.854348632829.issue22122@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 18:55:15 2014 From: report at bugs.python.org (Ethan Furman) Date: Sat, 02 Aug 2014 16:55:15 +0000 Subject: [issue22123] Make object() behave exactly like types.SimpleNamespace() if given kwargs In-Reply-To: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> Message-ID: <1406998515.09.0.174820032108.issue22123@psf.upfronthosting.co.za> Changes by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 19:12:03 2014 From: report at bugs.python.org (Berker Peksag) Date: Sat, 02 Aug 2014 17:12:03 +0000 Subject: [issue21047] html.parser.HTMLParser: convert_charrefs should become True by default In-Reply-To: <1395638238.78.0.969546304297.issue21047@psf.upfronthosting.co.za> Message-ID: <1406999523.84.0.478966555262.issue21047@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 19:46:25 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Aug 2014 17:46:25 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407001585.92.0.0287057622472.issue21448@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'm looking at the patch today. ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 20:39:02 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 18:39:02 +0000 Subject: [issue22123] Make object() behave exactly like types.SimpleNamespace() if given kwargs In-Reply-To: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> Message-ID: <1407004742.88.0.854945663648.issue22123@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This will be fragile because the behavior will be depend from the number of keyword argument. Hypothetic example: >>> kwargs = {'a': 1} >>> obj = object(**kwargs) >>> obj.b = 2 # success >>> kwargs = {} # empty >>> obj = object(**kwargs) >>> obj.b = 2 Traceback (most recent call last): File "", line 1, in AttributeError: 'object' object has no attribute 'b' For now you need only one or two line of code to declare new class. >>> class Object: pass ... >>> obj = Object() >>> obj.a = 1 >>> obj.b = 2 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 20:44:18 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 18:44:18 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1407005058.12.0.841749452948.issue22121@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: When I start IDLE ("python -m idle") from my project directory I expect that it doesn't change current directory and I can access files in this directory by short relative name. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 20:48:49 2014 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 02 Aug 2014 18:48:49 +0000 Subject: [issue22112] '_UnixSelectorEventLoop' object has no attribute 'create_task' In-Reply-To: <1406978384.42.0.66436631837.issue22112@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Looks good! On Sat, Aug 2, 2014 at 4:19 AM, STINNER Victor wrote: > > STINNER Victor added the comment: > > Here is a a patch which replaces loop.create_task(coro) with > asyncio.async(coro), mention that asyncio.async() can be used to scheduler > a coroutine, and make it clear that create_task() is only available in > Python 3.4.2 and later. > > Does it look better? > > If it's possible, I would prefer to have exactly the same documentation in > Python 3.4 and 3.5. > > ---------- > keywords: +patch > Added file: http://bugs.python.org/file36203/doc_create_task.patch > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 20:50:44 2014 From: report at bugs.python.org (Ethan Furman) Date: Sat, 02 Aug 2014 18:50:44 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1407005444.75.0.206432611101.issue22121@psf.upfronthosting.co.za> Ethan Furman added the comment: We should be able to add enough smarts to handle both cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 21:06:02 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sat, 02 Aug 2014 19:06:02 +0000 Subject: [issue22123] Make object() behave exactly like types.SimpleNamespace() if given kwargs In-Reply-To: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> Message-ID: <1407006362.15.0.0171407927953.issue22123@psf.upfronthosting.co.za> Mark Lawrence added the comment: As a work around for the originator how about >>> pyobject = object # keep reference to built-in. >>> from types import SimpleNamespace as object >>> help(object) Help on class SimpleNamespace in module types: ... ??? ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 21:23:12 2014 From: report at bugs.python.org (Ned Deily) Date: Sat, 02 Aug 2014 19:23:12 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1407007392.06.0.670933958288.issue22121@psf.upfronthosting.co.za> Ned Deily added the comment: FWIW, on OS X when IDLE is launched from the Finder, for example by double-clicking on an IDLE icon, IDLE defaults to using the user's Documents folder as its working directory. When IDLE is launched from a command line shell, it uses the current working directory. Perhaps something similar can be done for Windows. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 21:41:47 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 19:41:47 +0000 Subject: [issue15826] Increased test coverage of test_glob.py In-Reply-To: <1346381534.69.0.636623200483.issue15826@psf.upfronthosting.co.za> Message-ID: <1407008507.88.0.170962524725.issue15826@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: GlobTests.glob() tests that glob() for bytes returns the same (encoded) result as glob() for string. Therefore this patch is not needed, it doesn't increase test coverage. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 21:52:01 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 02 Aug 2014 19:52:01 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1407009121.91.0.916698777098.issue22121@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The same is on Linux. Therefore this is Windows only issue. ---------- components: +Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 22:35:33 2014 From: report at bugs.python.org (Sai Krishna G) Date: Sat, 02 Aug 2014 20:35:33 +0000 Subject: [issue22124] Rotating items of list to left Message-ID: <1407011733.93.0.772896051293.issue22124@psf.upfronthosting.co.za> New submission from Sai Krishna G: Hi, I am trying to rotate list of 3 to left for this I am trying to define this function def rotate_left3(nums) #argument nums is list for example rotate_left3([1, 2, 3]) I am expecting value [2,3,1] in return. I have written the following code a = nums a[0]=nums[1] a[1]=nums[2] a[2]=nums[0] return a #this is returning [2,3,2] instead of [2,3,1] however if I assign a = [0,0,0] #or any other value other than directly assigning nums the code works perfectly ---------- components: Windows files: rotate_left3.py messages: 224586 nosy: Sai.Krishna.G priority: normal severity: normal status: open title: Rotating items of list to left type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file36215/rotate_left3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 22:48:05 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 02 Aug 2014 20:48:05 +0000 Subject: [issue22121] IDLE should start with HOME as the initial working directory In-Reply-To: <1406966032.01.0.548285467026.issue22121@psf.upfronthosting.co.za> Message-ID: <1407012485.52.0.693705578976.issue22121@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Mark's opening statement is incomplete. The actual situation is more complex, and probably not documented anywhere except in the code -- and the system-specific behavior not even there. Let 'working directory' mean the initial directory of an Open or Save As dialog opened from a particular window. By experiment, each window has its own working directory. For Editor windows with a named file, the working directory is the directory of the file. Note that recently edited file can be opened from File / Recent Files, bypassing the Open dialog. (Side issue: the number of recent files kept should be expanded.) I sometimes open a file to get to its directory. Untitled Editor widows inherit the working directory from the active window where File / New File or control-N was invoked. Output windows inherit the Shell working directory. Currently, the Shell working directory is the current working directory of the python(w) process it is running in. If python is started from a command line*, it inherits the console cwd. If python is started from a python or idle icon, its current directory is that of the python executable -- but apparently only on Windows. When Python is installed, the executable is in the install directory that also contains /lib. In a Windows repository build, the executable in /pcbuild, next to /lib. (Another side issue: this is a nuisance and currently disables File / Load Module Alt-m.) * with, for instance, "python -m idlelib" This issue should only be about changing the Shell working directory when it would otherwise be the executable directory (from an icon start, the last case in the previous paragraph). This can be tested by looking for 'python.exe'. We could add a new config option to the Startup Preferences block of the General tab of the config dialog. Subissue: perhaps this option, unlike most, should have a command line option. A binary option would be sufficient to switch to the user's home directory. But especially for beginners, and especially for children (Mark's presented use case on python-list), this is not the right place. Splattering .py files in ~HOME is not tremendously better than doing the same in the executable directory. So I think there should be an entry box where someone could enter, for instance, '~/Python'. Starting in a particular directory, rather than having to switch to a Python-files directory, would not be Windows-specific. The current Windows behavior of starting in the version-specific python tree is very handy when working on python itself. But I guess using Pathbrowser would be a substitute for that. ---------- nosy: +terry.reedy stage: -> needs patch versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 23:24:18 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 02 Aug 2014 21:24:18 +0000 Subject: [issue22122] turtle module examples should all begin "from turtle import *" In-Reply-To: <1406966271.25.0.28039955033.issue22122@psf.upfronthosting.co.za> Message-ID: <1407014658.78.0.149149384652.issue22122@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I think your suggestion is wrong as is and that this issue should be revised or closed. The simple initial example is a complete program. PEP8 discourages 'import *' but it is acceptable in this context. The snippets you refer to follow "24.1.3. Methods of RawTurtle/Turtle and corresponding functions Most of the examples in this section refer to a Turtle instance called turtle." Methods are always documented as method calls, and they should be here too. The function interface can only be used for 1 turtle, while drawings often require more than 1. See turtledemo for examples such as 'forest', which uses 3 Turtle instances. Nothing says that users have to name an instance 'turtle'. In practice one might use 't1', 't2', etc, or other short names. Within a subclass of Turtle, with added methods, the prefix would be 'self.'. The quote above could be, and perhaps should be augmented with a reminder that "If one uses the function interface for one turtle or the first of many turtles, 'turtle.' should be omitted." As a further concession to beginners, this could even be follows by "If one uses the object interface, replace 'turtle' with the actual name of a particular turtle." ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 23:28:40 2014 From: report at bugs.python.org (Donald Stufft) Date: Sat, 02 Aug 2014 21:28:40 +0000 Subject: [issue21308] PEP 466: backport ssl changes In-Reply-To: <9f606957-c0fc-42fe-b0e1-52ea1cb44333@email.android.com> Message-ID: <1407014920.2.0.638629911125.issue21308@psf.upfronthosting.co.za> Donald Stufft added the comment: I think we probably want to revert that particular change. Afaik it wasn't added to 3.4 because of the danger of breaking things so we probably shouldn't add it to 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 23:34:29 2014 From: report at bugs.python.org (Zachary Ware) Date: Sat, 02 Aug 2014 21:34:29 +0000 Subject: [issue22124] Rotating items of list to left In-Reply-To: <1407011733.93.0.772896051293.issue22124@psf.upfronthosting.co.za> Message-ID: <1407015269.87.0.996462401324.issue22124@psf.upfronthosting.co.za> Zachary Ware added the comment: This is not a bug. The assignment "a = nums" doesn't create a copy of "nums", it just assigns the name "a" to the same object that "nums" refers to. Since lists are mutable, changes made to "a" are visible through the name "nums". By the time you do "a[2] = nums[0]", "nums[0]" has been reassigned. Have a look at this article: http://nedbatchelder.com/text/names.html Also, you may want to look at collections.deque and its rotate method. ---------- nosy: +zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 2 23:56:55 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Aug 2014 21:56:55 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407016615.17.0.828827392393.issue21448@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I think the push() code can be a little cleaner. Attaching a revised patch that simplifies push() a bit. ---------- assignee: rhettinger -> serhiy.storchaka Added file: http://bugs.python.org/file36216/fix_email_parse.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 00:01:28 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Aug 2014 22:01:28 +0000 Subject: [issue22024] Add to shutil the ability to wait until files are definitely deleted In-Reply-To: <1405972808.55.0.924744488039.issue22024@psf.upfronthosting.co.za> Message-ID: <1407016888.61.0.247961682298.issue22024@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Windows has FindFirstChangeNotification and FileSystemWatcher: * http://msdn.microsoft.com/en-us/library/aa364417%28VS.85%29.aspx * http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 00:11:52 2014 From: report at bugs.python.org (David Wilson) Date: Sat, 02 Aug 2014 22:11:52 +0000 Subject: [issue22125] Cure signedness warnings introduced by #22003 Message-ID: <1407017512.42.0.779686467966.issue22125@psf.upfronthosting.co.za> New submission from David Wilson: The attached patch (hopefully) silences the signedness warnings generated by Visual Studio and reported on python-dev in . This was sloppiness on my part, I even noted the problem in the original ticket and never fixed it. :) I don't have a local dev environment setup for MSVC and Python, but at least the attached patch cures the signedness errors on Clang. They don't seem to occur at all with GCC on my Mac. The added casts ensure comparisons uniformly compare in the unsigned domain. It seems "size_t buf_size" is pretty redundant in the original struct, it just introduces lots of casting when it only appears to be required during write_bytes() to avoid signed overflow (undefined behaviour) ---------- components: Library (Lib) files: cow-sign.patch keywords: patch messages: 224593 nosy: dw, pitrou, zach.ware priority: normal severity: normal status: open title: Cure signedness warnings introduced by #22003 type: compile error versions: Python 3.5 Added file: http://bugs.python.org/file36217/cow-sign.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 00:33:01 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 02 Aug 2014 22:33:01 +0000 Subject: [issue20402] List comprehensions should be noted in for loop documentation In-Reply-To: <1390793056.66.0.0906291243976.issue20402@psf.upfronthosting.co.za> Message-ID: <1407018781.63.0.246151626976.issue20402@psf.upfronthosting.co.za> Raymond Hettinger added the comment: We do have prominent entries in the glossary and tutorial: https://docs.python.org/2.7/glossary.html#term-list-comprehension https://docs.python.org/2.7/tutorial/datastructures.html#list-comprehensions Moving it earlier in the tutorial is likely to do more harm than help. In teaching Python, you need some gap between learning for-loops and learning list comprehensions (the former is a prerequisite for the latter). ---------- assignee: docs at python -> rhettinger nosy: +rhettinger versions: -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 00:54:24 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 02 Aug 2014 22:54:24 +0000 Subject: [issue22123] Make object() behave exactly like types.SimpleNamespace() if given kwargs In-Reply-To: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> Message-ID: <1407020064.07.0.677514386821.issue22123@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Making types.SimpleNamespace more easily available might be a good idea. Screwing around with our fundamental base class to do so is not. Neither is rebinding the builtin name 'object'. Find a different way to accomplish the goal. SimpleNamespace *could* have been added to builtins, but was not. Instead, it was added to types, which is the catchall for types not used enough to be in builtins. Someone might check the issue or list discussion as to why. At one time object had the bug of silently ignoring arguments. Years ago, Guido insisted that this be fixed and wrote patches himself. See #1683368. For one thing, raising the exception catches bugs with cooperative multiple inheritance and super calls. I believe having object() return a subclass of object that in not a superclass of other classes would be worse than the previous bug. I think this idea should have been left on python-list or moved to python-ideas for further development. I am sure that the proposal as stated should be rejected. ---------- nosy: +terry.reedy stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 01:52:07 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sat, 02 Aug 2014 23:52:07 +0000 Subject: [issue1602] windows console doesn't print or input Unicode In-Reply-To: <1197453390.87.0.813702844893.issue1602@psf.upfronthosting.co.za> Message-ID: <1407023527.19.0.72900967549.issue1602@psf.upfronthosting.co.za> Mark Lawrence added the comment: To ensure that we're all talking about the same thing, is everybody using the /u unicode output option or /a ansi (which I'm assuming is the default) when running cmd? ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:01:20 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 00:01:20 +0000 Subject: [issue20323] Argument Clinic: docstring_prototype output causes build failure on Windows In-Reply-To: <1390284343.93.0.69163024688.issue20323@psf.upfronthosting.co.za> Message-ID: <1407024080.31.0.233645552256.issue20323@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:06:28 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 00:06:28 +0000 Subject: [issue10071] Should not release GIL while running RegEnumValue In-Reply-To: <1286884651.82.0.158483399845.issue10071@psf.upfronthosting.co.za> Message-ID: <1407024388.85.0.0993656380634.issue10071@psf.upfronthosting.co.za> Mark Lawrence added the comment: Apart from the request for a comment made in msg192649 it looks as if this can be commited. ---------- nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware -brian.curtin versions: +Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:12:26 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 00:12:26 +0000 Subject: [issue19955] When adding .PY and .PYW to PATHEXT, it replaced string instead of appending In-Reply-To: <1386803247.34.0.411424382912.issue19955@psf.upfronthosting.co.za> Message-ID: <1407024746.78.0.583231531966.issue19955@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: +steve.dower, tim.golden, zach.ware versions: +Python 3.4, Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:15:39 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 00:15:39 +0000 Subject: [issue18611] Mac: Some Python Launcher issues In-Reply-To: <1375350644.84.0.910420929307.issue18611@psf.upfronthosting.co.za> Message-ID: <1407024939.25.0.373257054596.issue18611@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:17:23 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 00:17:23 +0000 Subject: [issue18645] Add a configure option for performance guided optimization In-Reply-To: <1375562503.45.0.752070512413.issue18645@psf.upfronthosting.co.za> Message-ID: <1407025043.69.0.217757473351.issue18645@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- type: behavior -> enhancement versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:20:26 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 00:20:26 +0000 Subject: [issue18423] Document limitations on -m In-Reply-To: <1373461112.24.0.280779659137.issue18423@psf.upfronthosting.co.za> Message-ID: <1407025226.77.0.2732938272.issue18423@psf.upfronthosting.co.za> Mark Lawrence added the comment: @Andrew could you put up a patch for this? ---------- nosy: +BreamoreBoy versions: +Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:32:26 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 00:32:26 +0000 Subject: [issue18691] sqlite3.Cursor.execute expects sequence as second argument. In-Reply-To: <1376000572.11.0.481266307811.issue18691@psf.upfronthosting.co.za> Message-ID: <1407025946.76.0.998593743323.issue18691@psf.upfronthosting.co.za> Mark Lawrence added the comment: @Andrew your words describe the Cursor execute method but your examples show the Connection execute method, can you clarify please. ---------- nosy: +BreamoreBoy, ghaering _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:34:57 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 00:34:57 +0000 Subject: [issue18697] Unify arguments names in Unicode object C API documentation In-Reply-To: <1376074126.58.0.40251146149.issue18697@psf.upfronthosting.co.za> Message-ID: <1407026097.14.0.742659200624.issue18697@psf.upfronthosting.co.za> Mark Lawrence added the comment: @Serhiy will you be proposing a patch for this? ---------- nosy: +BreamoreBoy versions: +Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:42:12 2014 From: report at bugs.python.org (Meador Inge) Date: Sun, 03 Aug 2014 00:42:12 +0000 Subject: [issue22125] Cure signedness warnings introduced by #22003 In-Reply-To: <1407017512.42.0.779686467966.issue22125@psf.upfronthosting.co.za> Message-ID: <1407026532.93.0.893885715978.issue22125@psf.upfronthosting.co.za> Meador Inge added the comment: Hmmmm, maybe I am missing some context, but why not avoid the casting and do? diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -47,7 +47,7 @@ typedef struct { * exception and returns -1 on failure. Existing state is preserved on failure. */ static int -unshare(bytesio *self, size_t preferred_size, int truncate) +unshare(bytesio *self, Py_ssize_t preferred_size, int truncate) { if (self->initvalue) { Py_ssize_t copy_size; ---------- nosy: +meador.inge stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 02:50:30 2014 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 03 Aug 2014 00:50:30 +0000 Subject: [issue22110] enable extra compilation warnings In-Reply-To: <1406757101.06.0.990367547704.issue22110@psf.upfronthosting.co.za> Message-ID: <1407027030.24.0.570380593106.issue22110@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: GCC >=4.5.0 (released on 2010-04-14) silently accepts and ignores -Wunreachable-code option. I think that build system of Python should not pass unused options to compiler. ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 03:21:37 2014 From: report at bugs.python.org (Amrith Kumar) Date: Sun, 03 Aug 2014 01:21:37 +0000 Subject: [issue22114] You cannot call communicate() safely after receiving an exception (EINTR or EAGAIN) In-Reply-To: <1406807939.82.0.812223355091.issue22114@psf.upfronthosting.co.za> Message-ID: <1407028897.55.0.276700940036.issue22114@psf.upfronthosting.co.za> Amrith Kumar added the comment: After some debugging and reading code in python's subprocess.py (v2.7), here's what I'm seeing. (a) the error has nothing to do with eventlet and monkey-patching. (b) the code in _communicate_with_select() and potentially _communicate_with_poll() are the problem. What's the problem? ------------------- The code in _communicate_with_select() correctly sets up to handle the read and write calls without blocking on any of them. It does this by establishing the two (read and write) lists of descriptors and calls select without no timeout specified. When select returns, and indicates that a socket is in (for example) the read list, what that means is that an attempt to read() will not block. However, it is possible on some systems (Linux for sure) that (a) a socket is non-blocking, and (b) a call to select indicates that the socket is ready to read, and (c) a call to read the socket returns an error EAGAIN (aka EWOULDBLOCK). Callers of read() and write() on non-blocking sockets should be prepared to handle this situation. The python code in _communicate_with_select() is not. It assumes that if select() returns that a read fd is ready for read, that a call to read it will produce 0 or more bytes. The calls to read() for stdout and stderr are not guarded with exception handlers. However, if a socket is setup as non-blocking, any call can produce EWOULDBLOCK, EAGAIN, ... Adding some debugging code it was possible to recreate the problem and show that the backtrace was (in this case it happened with python 2.6) Traceback (most recent call last): [...] File "trove/openstack/common/processutils.py", line 186, in execute result = obj.communicate() File "/usr/lib64/python2.6/subprocess.py", line 732, in communicate stdout, stderr = self._communicate(input, endtime) File "/usr/lib64/python2.6/subprocess.py", line 1318, in _communicate stdout, stderr = self._communicate_with_select(input, endtime) File "/usr/lib64/python2.6/subprocess.py", line 1483, in _communicate_with_select data = os.read(self.stdout.fileno(), 1024) OSError: [Errno 11] Resource temporarily unavailable The correct fix for this is to make _communicate_with_select() and maybe _communicate_with_poll() properly handle the read() and write() calls and be better prepared to handle a thrown condition of EAGAIN from os.read or os.write. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 03:33:56 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 01:33:56 +0000 Subject: [issue18645] Add a configure option for performance guided optimization In-Reply-To: <1375562503.45.0.752070512413.issue18645@psf.upfronthosting.co.za> Message-ID: <1407029636.63.0.174432728803.issue18645@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Martin is this reasonable, doable, and worthwhile? ---------- assignee: -> loewis nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 04:20:55 2014 From: report at bugs.python.org (Glenn Linderman) Date: Sun, 03 Aug 2014 02:20:55 +0000 Subject: [issue1602] windows console doesn't print or input Unicode In-Reply-To: <1197453390.87.0.813702844893.issue1602@psf.upfronthosting.co.za> Message-ID: <1407032455.35.0.779621309842.issue1602@psf.upfronthosting.co.za> Glenn Linderman added the comment: Mark, the /U and /A switches to CMD only affect (as the help messages say) the output of internal CMD commands. So they would only affect interoperability between internal command output piped to a Python program. The biggest issue in this bug, however, is the output of Python programs not being properly displayed by the console window (often thought of or described as the CMD shell window). While my biggest concerns have been with output, I suppose input can be an issue also, and running the output of echo, or other internal commands, into Python could be an issue as well. I have pasted a variety of data into Python programs beyond ASCII, but I'm not sure I've gone beyond ANSI or beyond Unicode BMP. Obviously, once output is working properly, input should also be tested and fixed, although I think output is more critical. With the impetus of your question... I just took some text supplied in another context that has a bunch of characters from different repertoires, including non-BMP, and tried to paste it into the console window. Here is the text: ??????? - fine on Linux, all boxes on Windows (all boxes in Chrome on Linux too) ?????? ??????! - fine on Linux and Windows ?????, ??! - fine on Linux, just boxes and punctuation on Windows (likewise in Chrome) ??????, ???! - fine on Linux and Windows ???? ????? ??? ?????? - fine on both, but Google Translate has a problem with this! It returned "Hello, world!" as the Greek for "Hello, world!"... so I tried again with "This is a test". ?????, ?????! - not actually a language, but this is astral In the console window, which I have configured using the Consolas font, the glyphs for the non-ASCII characters in the first two and last lines were boxes... likely Consolas doesn't support those characters. I had written a Python equivalent of "echo", including some workarounds originally posted in this issue, and got exactly the same output as input, with no errors produced. So it is a bit difficult to test characters outside the repertoire of whatever font is configured for the console window. Perhaps someone that has Chinese or Korean fonts configured for their console window could report on further testing of the above or similar strings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 05:36:05 2014 From: report at bugs.python.org (eryksun) Date: Sun, 03 Aug 2014 03:36:05 +0000 Subject: [issue11395] print(s) fails on Windows with long strings In-Reply-To: <1299217663.52.0.355409591746.issue11395@psf.upfronthosting.co.za> Message-ID: <1407036965.07.0.90624245079.issue11395@psf.upfronthosting.co.za> eryksun added the comment: The buffer size only needs to be capped if WINVER < 0x602. This issue doesn't apply to Windows 8 since it uses the ConDrv device driver instead of LPC. Prior to Windows 8, WriteFile redirects to WriteConsoleA when passed a console handle. This makes an LPC call to conhost.exe (csrss.exe before Windows 7), which copies the buffer to a shared heap. But a Windows 8 console process instead has actual File handles provided by the ConDrv device: stdin \Device\ConDrv\Input stdout \Device\ConDrv\Output stderr \Device\ConDrv\Output For File handles, ReadFile and WriteFile simply call the NT system functions NtReadFile and NtWriteFile. The buffer size is only limited by available memory. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 05:42:28 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 03:42:28 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407037347.99.0.611326989489.issue21448@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- Removed message: http://bugs.python.org/msg224577 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 07:17:32 2014 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 03 Aug 2014 05:17:32 +0000 Subject: [issue18645] Add a configure option for performance guided optimization In-Reply-To: <1375562503.45.0.752070512413.issue18645@psf.upfronthosting.co.za> Message-ID: <1407043052.15.0.330176482594.issue18645@psf.upfronthosting.co.za> Stefan Behnel added the comment: Looks like a duplicate of issue 17781. Ubuntu already does this for their builds and gets substantially better performance, so I can't see a reason why CPython shouldn't just follow. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:07:00 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:07:00 +0000 Subject: [issue18654] modernize mingw&cygwin compiler classes In-Reply-To: <1375621500.14.0.511859388859.issue18654@psf.upfronthosting.co.za> Message-ID: <1407046020.04.0.40689664788.issue18654@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36218/0011-MINGW-compiler-customize-mingw-cygwin-compilers.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:09:56 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:09:56 +0000 Subject: [issue17148] mingw: nt thread model detection In-Reply-To: <1360190170.63.0.398498965196.issue17148@psf.upfronthosting.co.za> Message-ID: <1407046196.62.0.920852130338.issue17148@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36219/0001-MINGW-issue17148-nt-thread-model-detection.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:11:29 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:11:29 +0000 Subject: [issue17596] mingw: add wincrypt.h in Python/random.c In-Reply-To: <1364759550.1.0.784816138904.issue17596@psf.upfronthosting.co.za> Message-ID: <1407046289.92.0.335869470471.issue17596@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36220/0006-MINGW-add-wincrypt.h-in-Python-random.c.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:12:34 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:12:34 +0000 Subject: [issue17597] mingw: add $srcdir/PC to CPPFLAGS In-Reply-To: <1364759799.81.0.998386094022.issue17597@psf.upfronthosting.co.za> Message-ID: <1407046354.47.0.110712588907.issue17597@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36221/0007-MINGW-add-srcdir-PC-to-CPPFLAGS.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:13:17 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:13:17 +0000 Subject: [issue17599] mingw: detect REPARSE_DATA_BUFFER In-Reply-To: <1364759977.57.0.233975454494.issue17599@psf.upfronthosting.co.za> Message-ID: <1407046397.4.0.525186857336.issue17599@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36222/0009-MINGW-detect-REPARSE_DATA_BUFFER.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:14:20 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:14:20 +0000 Subject: [issue17602] mingw: default sys.path calculations for windows platforms In-Reply-To: <1364760613.75.0.604084743865.issue17602@psf.upfronthosting.co.za> Message-ID: <1407046460.38.0.490255402327.issue17602@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36223/0012-MINGW-default-sys.path-calculations-for-windows-plat.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:14:56 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:14:56 +0000 Subject: [issue17604] mingw: use main() to start execution In-Reply-To: <1364760973.75.0.319025813954.issue17604@psf.upfronthosting.co.za> Message-ID: <1407046496.05.0.984669904626.issue17604@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36224/0014-MINGW-use-main-to-start-execution.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:17:57 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:17:57 +0000 Subject: [issue18495] mingw: ignore main program for frozen scripts In-Reply-To: <1374178220.38.0.0504340051034.issue18495@psf.upfronthosting.co.za> Message-ID: <1407046677.24.0.982908533618.issue18495@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36225/0007-MINGW-ignore-main-program-for-frozen-scripts.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:18:10 2014 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Aug 2014 06:18:10 +0000 Subject: [issue11395] print(s) fails on Windows with long strings In-Reply-To: <1407036965.07.0.90624245079.issue11395@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: This issue is closed. You should reopen it or open a new one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:18:28 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Aug 2014 06:18:28 +0000 Subject: [issue18697] Unify arguments names in Unicode object C API documentation In-Reply-To: <1407026097.14.0.742659200624.issue18697@psf.upfronthosting.co.za> Message-ID: <1663401.1lpINmn1WR@raxxla> Serhiy Storchaka added the comment: > @Serhiy will you be proposing a patch for this? No, I am not. I have no opinion what name is better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:18:57 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 06:18:57 +0000 Subject: [issue18631] mingw: setup msvcrt and _winapi modules In-Reply-To: <1375467097.24.0.168691156888.issue18631@psf.upfronthosting.co.za> Message-ID: <1407046737.05.0.220089206713.issue18631@psf.upfronthosting.co.za> Changes by Roumen Petrov : Added file: http://bugs.python.org/file36226/0014-MINGW-setup-msvcrt-and-_winapi-modules.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:31:03 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Aug 2014 06:31:03 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407047463.79.0.813018360318.issue21448@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: fix_email_parse.diff is not work when one chunk ends with '\r' and next chunk doesn't start with '\n'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 08:55:09 2014 From: report at bugs.python.org (Mark Summerfield) Date: Sun, 03 Aug 2014 06:55:09 +0000 Subject: [issue22122] turtle module examples should all begin "from turtle import *" In-Reply-To: <1406966271.25.0.28039955033.issue22122@psf.upfronthosting.co.za> Message-ID: <1407048909.91.0.287175914817.issue22122@psf.upfronthosting.co.za> Mark Summerfield added the comment: Ah, we're slightly at cross purposes. I showed them purely in terms of the procedural API. However, I can see now that I could have begun with: import turtle ... jane = turtle.Turtle() jane.fd(100) So, to "teach" their turtle how to go in a square, I guess they'd do: def square(who, size=100): for n in range(4): who.fd(100) who.rt(90) square(jane) That seems reasonable, but then why isn't the first (and only complete) example done in this OO-ish style? Anyway, I've marked this closed and will switch to this approach in future. Thanks. ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 09:02:31 2014 From: report at bugs.python.org (Mark Summerfield) Date: Sun, 03 Aug 2014 07:02:31 +0000 Subject: [issue22123] Provide a direct function for types.SimpleNamespace() In-Reply-To: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> Message-ID: <1407049351.58.0.772650713921.issue22123@psf.upfronthosting.co.za> Mark Summerfield added the comment: I changed my suggestion but did so on the mailing list instead of here: This (importing & using types.SimpleNamespace()) is too much for children (& beginners). But perhaps what I should be asking for is for a new built-in that does what types.SimpleNamespace() does, so that without any import you can write, say, foo = namespace(a=1, b=2) # or bar = namespace() bar.a = 1 where under the hood namespace has the same behavior as types.SimpleNamespace(). Naturally, I understand that adding a new name is a big deal and may be too much to ask for beginners. I've renamed the issue to reflect this (although I don't know if that will work). Alternatively, I (or someone) could just close the issue as "won't fix"; it was just an idea. ---------- title: Make object() behave exactly like types.SimpleNamespace() if given kwargs -> Provide a direct function for types.SimpleNamespace() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 09:12:42 2014 From: report at bugs.python.org (ivank) Date: Sun, 03 Aug 2014 07:12:42 +0000 Subject: [issue22126] mc68881 fpcr inline asm breaks clang -flto build Message-ID: <1407049962.24.0.593960566551.issue22126@psf.upfronthosting.co.za> New submission from ivank: Build cpython master with clang -flto results in: [...] ar rc libpython3.5m.a Modules/_threadmodule.o Modules/signalmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/_stat.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/zipimport.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/hashtable.o Modules/symtablemodule.o Modules/xxsubtype.o ranlib libpython3.5m.a clang -pthread -flto -B/usr/lib/gold-ld -flto -B/usr/lib/gold-ld -Xlinker -export-dynamic -o python Programs/python.o libpython3.5m.a -lpthread -ldl -lutil -lm clang -pthread -flto -B/usr/lib/gold-ld -flto -B/usr/lib/gold-ld -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.5m.a -lpthread -ldl -lutil -lm :1:10: error: invalid register name fmove.l %fpcr,36(%rsp) ^~~~~ LLVM ERROR: Error parsing inline asm clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [python] Error 1 make: *** Waiting for unfinished jobs.... :1:10: error: invalid register name fmove.l %fpcr,36(%rsp) ^~~~~ LLVM ERROR: Error parsing inline asm clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Programs/_testembed] Error 1 My build script was: #!/bin/bash # Get clang 3.5 from # deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main # deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty main set -e sudo ln -sf /usr/lib/llvm-3.5/lib/LLVMgold.so /usr/lib/LLVMgold.so sudo mkdir -p /usr/lib/bfd-plugins sudo ln -sf /usr/lib/llvm-3.5/lib/LLVMgold.so /usr/lib/bfd-plugins/LLVMgold.so grep -Fxq /usr/lib/llvm-3.5/lib /etc/ld.so.conf || (echo "/usr/lib/llvm-3.5/lib should be in /etc/ld.so.conf" && false) sudo ldconfig export CC=clang export CXX=clang++ export CFLAGS="-O3 -flto -B/usr/lib/gold-ld -fomit-frame-pointer" export CXXFLAGS="-O3 -flto -B/usr/lib/gold-ld -fomit-frame-pointer" export LDFLAGS="-flto -B/usr/lib/gold-ld" make clean || echo "Can't make clean" ./configure --prefix=/opt/leakless make -j17 It works fine without the -flto/gold-ld options. ---------- components: Interpreter Core messages: 224613 nosy: ivank priority: normal severity: normal status: open title: mc68881 fpcr inline asm breaks clang -flto build type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 09:22:24 2014 From: report at bugs.python.org (Wouter van Heyst) Date: Sun, 03 Aug 2014 07:22:24 +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: <1407050544.46.0.150494491771.issue18034@psf.upfronthosting.co.za> Wouter van Heyst added the comment: The attached patch changes the body of the __import__ faq entry to suggest using `importlib.import_module` instead. ---------- keywords: +patch nosy: +larstiq Added file: http://bugs.python.org/file36227/faq-import_module.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 09:26:02 2014 From: report at bugs.python.org (=?utf-8?q?Martin_v=2E_L=C3=B6wis?=) Date: Sun, 03 Aug 2014 07:26:02 +0000 Subject: [issue18631] mingw: setup msvcrt and _winapi modules In-Reply-To: <1375467097.24.0.168691156888.issue18631@psf.upfronthosting.co.za> Message-ID: <1407050762.09.0.16273830402.issue18631@psf.upfronthosting.co.za> Martin v. L?wis added the comment: Roumen, can you please fill out the contributor form? ---------- nosy: +loewis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 10:01:36 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sun, 03 Aug 2014 08:01:36 +0000 Subject: [issue14910] argparse: disable abbreviation In-Reply-To: <1337943742.57.0.897347214609.issue14910@psf.upfronthosting.co.za> Message-ID: <1407052896.6.0.281063705138.issue14910@psf.upfronthosting.co.za> Daniel Eriksson added the comment: Oh, completely missed comments there too! I hope I got them all in a good way! ---------- Added file: http://bugs.python.org/file36228/issue14910_4.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 10:06:00 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sun, 03 Aug 2014 08:06:00 +0000 Subject: [issue14910] argparse: disable abbreviation In-Reply-To: <1337943742.57.0.897347214609.issue14910@psf.upfronthosting.co.za> Message-ID: <1407053160.8.0.0627517514332.issue14910@psf.upfronthosting.co.za> Daniel Eriksson added the comment: Sorry for a new patch this close, but just tripple checked the documentation and noticed a word to much. Made it more clear hopefully ---------- Added file: http://bugs.python.org/file36229/issue14910_5.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 10:17:29 2014 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Aug 2014 08:17:29 +0000 Subject: [issue22127] performance regression in socket.getsockaddr() Message-ID: <1407053849.06.0.738160055146.issue22127@psf.upfronthosting.co.za> New submission from Charles-Fran?ois Natali: I noticed that socket.sendto() got noticably slower since 3.4 (at least), compared to 2.7: 2.7: $ ./python -m timeit -s "import socket; s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); DATA = b'hello'; TARGET=('127.0.0.1', 4242)" "s.sendto(DATA, TARGET)" 100000 loops, best of 3: 15.8 usec per loop 3.4: $ ./python -m timeit -s "import socket; s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); DATA = b'hello'; TARGET=('127.0.0.1', 4242)" "s.sendto(DATA, TARGET)" 10000 loops, best of 3: 25.9 usec per loop A profile reveals this: 2.7: 100065 function calls in 2.268 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.361 0.361 2.268 2.268 test_send.py:1() 100000 1.895 0.000 1.895 0.000 {method 'sendto' of '_socket.socket' objects} 3.4: 906015 function calls (905975 primitive calls) in 6.132 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 5/1 0.000 0.000 6.132 6.132 {built-in method exec} 1 0.334 0.334 6.132 6.132 test_send.py:1() 100000 2.347 0.000 5.769 0.000 {method 'sendto' of '_socket.socket' objects} 100000 1.991 0.000 3.411 0.000 idna.py:147(encode) 500086 0.894 0.000 0.894 0.000 {built-in method len} 100000 0.269 0.000 0.269 0.000 {method 'encode' of 'str' objects} 100000 0.257 0.000 0.257 0.000 {method 'split' of 'bytes' objects} As can be seen, it's the IDNA encoding which takes a long time, and doesn't appear in the 2.7 profile. The parsing code (including idna codec) is present in both versions though: """ static int getsockaddrarg(PySocketSockObject *s, PyObject *args, struct sockaddr *addr_ret, int *len_ret) [...] if (!PyArg_ParseTuple(args, "eti:getsockaddrarg", "idna", &host, &port)) return 0; """ I'm currently bisecting the commit, but I'm not familiar with encoding stuff. Is it expected that the IDNA encoding be called when passed an ascii string? ---------- components: Library (Lib) messages: 224618 nosy: haypo, loewis, neologix, pitrou priority: normal severity: normal status: open title: performance regression in socket.getsockaddr() type: performance versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 10:18:10 2014 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Aug 2014 08:18:10 +0000 Subject: [issue22127] performance regression in socket getsockaddrarg() In-Reply-To: <1407053849.06.0.738160055146.issue22127@psf.upfronthosting.co.za> Message-ID: <1407053890.04.0.605267031498.issue22127@psf.upfronthosting.co.za> Changes by Charles-Fran?ois Natali : ---------- title: performance regression in socket.getsockaddr() -> performance regression in socket getsockaddrarg() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 10:31:05 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 08:31:05 +0000 Subject: [issue8548] Building on CygWin 1.7: PATH_MAX redefined In-Reply-To: <1272386591.01.0.834578637911.issue8548@psf.upfronthosting.co.za> Message-ID: <1407054665.25.0.379196336147.issue8548@psf.upfronthosting.co.za> Roumen Petrov added the comment: Hi Mark, #else before is not solution. See unified diff below as post by Scott Rostrup lack definition Some additional information: a) move outside #ifdef HAVE_FCNTL_H : definition PATH_MAX is not related to control functions on open files (fcntl.h) b) HAVE_FCNTL_H is defined for MSC build as well. so no impact on other build --- a/Modules/main.c +++ b/Modules/main.c @@ -9,6 +9,8 @@ #include #ifdef HAVE_FCNTL_H #include +#endif +#ifndef PATH_MAX #define PATH_MAX MAXPATHLEN #endif #endif -- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 10:55:39 2014 From: report at bugs.python.org (Roumen Petrov) Date: Sun, 03 Aug 2014 08:55:39 +0000 Subject: [issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io In-Reply-To: <1282599121.2.0.918330648156.issue9665@psf.upfronthosting.co.za> Message-ID: <1407056139.14.0.224646527726.issue9665@psf.upfronthosting.co.za> Roumen Petrov added the comment: PATH_MAX in duplicate with issue8548 Instead to modify BASECFLAGS user could configure with CPPFLAGS set if symbolic links are missing . In addition 5.9 package creates links so work around is not required . Please close as invalid. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 11:24:46 2014 From: report at bugs.python.org (Wouter van Heyst) Date: Sun, 03 Aug 2014 09:24:46 +0000 Subject: [issue21278] Running the test suite with -v makes the test_ctypes and the test_zipimport erroneously reported as failed In-Reply-To: <1397689360.76.0.544034222842.issue21278@psf.upfronthosting.co.za> Message-ID: <1407057886.56.0.701909619575.issue21278@psf.upfronthosting.co.za> Wouter van Heyst added the comment: Even running `EXTRATESTOPTS='-x test_gdb -uall -v' make testall` I can not reproduce this. I'll dig some more in the code for anything suspicious. ---------- nosy: +larstiq _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 11:36:44 2014 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Aug 2014 09:36:44 +0000 Subject: [issue11763] assertEqual memory issues with large text inputs In-Reply-To: <1301948164.44.0.0206798295308.issue11763@psf.upfronthosting.co.za> Message-ID: <1407058604.4.0.0861939591562.issue11763@psf.upfronthosting.co.za> Ezio Melotti added the comment: The second problem I mentioned in msg134530 got fixed in #18996, making the patches on this issue obsolete. Since the other problem is now tracked in #19217, I'm going to close this. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 11:48:59 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 09:48:59 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407059339.23.0.122391921412.issue21448@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Attaching revised patch. I forgot to reapply splitlines. ---------- Added file: http://bugs.python.org/file36230/fix_email_parse2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 12:20:59 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 10:20:59 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407061259.89.0.503271303598.issue21448@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Attaching a more extensive test ---------- Added file: http://bugs.python.org/file36231/test_parser.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 12:33:18 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 10:33:18 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407061998.83.0.272152732425.issue21448@psf.upfronthosting.co.za> Changes by Raymond Hettinger : Added file: http://bugs.python.org/file36232/fix_prepending.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 12:40:06 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 10:40:06 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407062406.42.0.317412889375.issue21448@psf.upfronthosting.co.za> Changes by Raymond Hettinger : Added file: http://bugs.python.org/file36233/fix_prepending2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 12:40:17 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 10:40:17 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407062417.57.0.711261592929.issue21448@psf.upfronthosting.co.za> Changes by Raymond Hettinger : Removed file: http://bugs.python.org/file36232/fix_prepending.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 13:19:12 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sun, 03 Aug 2014 11:19:12 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407064752.62.0.100580258444.issue19838@psf.upfronthosting.co.za> Daniel Eriksson added the comment: @Antoine: We have investigated a bit here and it seems that ZFS just keeps a timestamp in seconds in the memory. See function uberblock_update in uberblock.c ( http://people.freebsd.org/~gibbs/zfs_doxygenation/html/d3/d65/uberblock_8c_source.html - Row 57) ub->ub_timestamp = gethrestime_sec(); ---------- nosy: +clearminds _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 13:21:00 2014 From: report at bugs.python.org (Wouter van Heyst) Date: Sun, 03 Aug 2014 11:21:00 +0000 Subject: [issue21278] Running the test suite with -v makes the test_ctypes and the test_zipimport erroneously reported as failed In-Reply-To: <1397689360.76.0.544034222842.issue21278@psf.upfronthosting.co.za> Message-ID: <1407064860.59.0.428609032547.issue21278@psf.upfronthosting.co.za> Wouter van Heyst added the comment: Ezio also couldn't reproduce this, so unless someone else (ddvento?), can reproduce it, I would advocate closing this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 14:11:44 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sun, 03 Aug 2014 12:11:44 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407067904.17.0.272600720253.issue19838@psf.upfronthosting.co.za> Daniel Eriksson added the comment: After thinking and looking a bit on it, this patch isn't the best to put into the code what I can see. If any of these things really break, because of something completely different - we won't notice it. A more accurate solution is to maybe look on a different way to compare the timestamps that works on systems that just support seconds too? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 14:27:50 2014 From: report at bugs.python.org (Claudiu Popa) Date: Sun, 03 Aug 2014 12:27:50 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407068870.58.0.168797959131.issue19838@psf.upfronthosting.co.za> Claudiu Popa added the comment: I agree. The patch was merely a temporary solution to the real problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 14:46:52 2014 From: report at bugs.python.org (Eli Bendersky) Date: Sun, 03 Aug 2014 12:46:52 +0000 Subject: [issue14910] argparse: disable abbreviation In-Reply-To: <1337943742.57.0.897347214609.issue14910@psf.upfronthosting.co.za> Message-ID: <1407070012.27.0.737177787994.issue14910@psf.upfronthosting.co.za> Eli Bendersky added the comment: No worries, Daniel. You should have received an email when comments were posted to the review, did you? If you you may want to check your settings in the bug tracker. I left a couple of additional comments on the documentation file, but other than that this LGTM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 14:49:52 2014 From: report at bugs.python.org (Stefan Krah) Date: Sun, 03 Aug 2014 12:49:52 +0000 Subject: [issue22126] mc68881 fpcr inline asm breaks clang -flto build In-Reply-To: <1407049962.24.0.593960566551.issue22126@psf.upfronthosting.co.za> Message-ID: <1407070192.56.0.827968389866.issue22126@psf.upfronthosting.co.za> Stefan Krah added the comment: If it works without -flto, isn't that a toolchain rather than a Python issue? ---------- nosy: +schwab, skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 14:56:30 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Aug 2014 12:56:30 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407070590.7.0.898342025139.issue21448@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: fix_email_parse2.diff slightly changes behavior. See my comments on Rietveld. As for fix_prepending2.diff, could you please provide any benchmark results? And there is yet one bug in current code. str.splitlines() splits a string not only breaking it at '\r', '\n' or '\r\n', but at any Unicode line break character (e.g. '\x85', '\u2028', etc). And when a chunk ends with such line break character, it will not break a line. Definitely something should fixed: either lines should be broken only at '\r', '\n' or '\r\n', or other line break characters should be handled correctly when they happen at the end of the chunk. What would you say about this, David? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:17:18 2014 From: report at bugs.python.org (Frank van Dijk) Date: Sun, 03 Aug 2014 13:17:18 +0000 Subject: [issue22128] patch: steer people away from codecs.open Message-ID: <1407071838.74.0.684483503953.issue22128@psf.upfronthosting.co.za> New submission from Frank van Dijk: stackoverflow.com has a zillion answers recommending the use of codecs.open() as a unicode capable drop in replacement for open(). This probably means that there is still a lot of code being written that uses codecs.open(). That's bad thing because of codecs.open()'s lack of newline conversion. A lot of that code will - have compatibility issues when it is moved between unix and windows - silently break text files on windows, leading to issues further downstream (confusing other tools, messing up revision control histories) The problem has been fixed with io.open() in 2.x and open() in 3.x. Unfortunately the 2.7 unicode HOWTO still recommends the use of codecs.open(). The 2.7 and the 3.x documentation of codecs.open() doesn't refer the reader to better alternatives. The attached patches fix that. The only downside I see is that newly written code that uses the better alternatives would be incompatible with 2.5 and older. However croaking on a small minority of systems is better than silently disrupting workflows, causing platform incompatibilities, and inviting flaky workarounds. The 2.7 patch makes the unicode HOWTO recommend io.open() instead of codecs.open(). Both patches change the codecs.open() documentation to refer to io.open() or (on 3.x) open(). Additionally I removed the "data loss" explanation from codecs.open()'s note about its lack of newline conversion. It is not particularly helpful information and it is not entirely correct (data loss could also have been avoided by doing newline conversion before encoding and after decoding) ---------- assignee: docs at python components: Documentation files: codecsopen2.patch keywords: patch messages: 224632 nosy: Frank.van.Dijk, docs at python priority: normal severity: normal status: open title: patch: steer people away from codecs.open type: behavior versions: Python 2.7, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file36234/codecsopen2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:17:58 2014 From: report at bugs.python.org (Frank van Dijk) Date: Sun, 03 Aug 2014 13:17:58 +0000 Subject: [issue22128] patch: steer people away from codecs.open In-Reply-To: <1407071838.74.0.684483503953.issue22128@psf.upfronthosting.co.za> Message-ID: <1407071878.87.0.126582435925.issue22128@psf.upfronthosting.co.za> Changes by Frank van Dijk : Added file: http://bugs.python.org/file36235/codecsopen3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:18:36 2014 From: report at bugs.python.org (Tobias Leupold) Date: Sun, 03 Aug 2014 13:18:36 +0000 Subject: [issue22129] Please add an equivalent to QString::simplified() to Python strings Message-ID: <1407071916.54.0.415237885761.issue22129@psf.upfronthosting.co.za> New submission from Tobias Leupold: It would be nice if a function equivalent to Qt's QString::simplified() would be added to Python's strings (cf. http://qt-project.org/doc/qt-4.8/qstring.html#simplified ). I'm not sure if my approach is good or fast, but I added this function to my code like so: http://nasauber.de/blog/T/143/QString_simplified_in_Python ---------- components: Interpreter Core messages: 224633 nosy: l3u priority: normal severity: normal status: open title: Please add an equivalent to QString::simplified() to Python strings type: enhancement versions: Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:20:16 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Aug 2014 13:20:16 +0000 Subject: [issue22128] patch: steer people away from codecs.open In-Reply-To: <1407071838.74.0.684483503953.issue22128@psf.upfronthosting.co.za> Message-ID: <1407072016.4.0.847627382548.issue22128@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +doerwalter, haypo, lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:22:36 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 03 Aug 2014 13:22:36 +0000 Subject: [issue22127] performance regression in socket getsockaddrarg() In-Reply-To: <1407053849.06.0.738160055146.issue22127@psf.upfronthosting.co.za> Message-ID: <1407072156.54.0.642061349123.issue22127@psf.upfronthosting.co.za> Antoine Pitrou added the comment: IDNA encoding is quite slow (see 6e1071ed4c66). I'm surprised we accept general hosnames in sendto(), though (rather than plain IP addresses). 25 ?s per call is a lot for such a function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:23:49 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 13:23:49 +0000 Subject: [issue15428] add "Name Collision" section to argparse docs In-Reply-To: <1343001632.52.0.429837248023.issue15428@psf.upfronthosting.co.za> Message-ID: <1407072229.11.0.22963822393.issue15428@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- type: -> enhancement versions: +Python 3.5 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:26:20 2014 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Aug 2014 13:26:20 +0000 Subject: [issue20135] FAQ need list mutation answers In-Reply-To: <1388979444.45.0.0357103143169.issue20135@psf.upfronthosting.co.za> Message-ID: <1407072380.83.0.721734351862.issue20135@psf.upfronthosting.co.za> Ezio Melotti added the comment: Here is a new patch that includes an additional paragraph about mutation and non-mutation operations. ---------- Added file: http://bugs.python.org/file36236/issue20135-2.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:29:08 2014 From: report at bugs.python.org (Andreas Schwab) Date: Sun, 03 Aug 2014 13:29:08 +0000 Subject: [issue22126] mc68881 fpcr inline asm breaks clang -flto build In-Reply-To: <1407049962.24.0.593960566551.issue22126@psf.upfronthosting.co.za> Message-ID: <1407072548.96.0.309423466755.issue22126@psf.upfronthosting.co.za> Andreas Schwab added the comment: Why does the configure test succeed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:38:41 2014 From: report at bugs.python.org (Ezio Melotti) Date: Sun, 03 Aug 2014 13:38:41 +0000 Subject: [issue22092] Executing some tests inside Lib/unittest/test individually throws Error In-Reply-To: <1406472645.11.0.803987239444.issue22092@psf.upfronthosting.co.za> Message-ID: <1407073121.68.0.262057769654.issue22092@psf.upfronthosting.co.za> Ezio Melotti added the comment: I left a comment on rietveld. Michael, do you think changing the imports is OK, or will this cause you some troubles with the external unittest package you maintain? ---------- assignee: -> michael.foord stage: -> patch review type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 15:39:09 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Aug 2014 13:39:09 +0000 Subject: [issue22129] Please add an equivalent to QString::simplified() to Python strings In-Reply-To: <1407071916.54.0.415237885761.issue22129@psf.upfronthosting.co.za> Message-ID: <1407073149.91.0.108691225919.issue22129@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is too specialized function to be included in the stdlib ar added as a method to base class. There are simpler and faster implementations of this function: def simplify(s): return ' '.join(s.strip().split()) or def simplify(s): return re.sub(r'\s+', ' ', s.strip()) Due to they simplicity there is no need to add them in Python. ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 16:50:31 2014 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 03 Aug 2014 14:50:31 +0000 Subject: [issue22123] Provide a direct function for types.SimpleNamespace() In-Reply-To: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> Message-ID: <1407077431.82.0.569821134725.issue22123@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I'm not in favor of changing object() but exposing types.SimpleNamespace as built-in namespace() doesn't seem like such a bad idea, especially given Tim's penultimate Zen aphorism. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 16:57:27 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sun, 03 Aug 2014 14:57:27 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407077847.0.0.701165802658.issue19838@psf.upfronthosting.co.za> Daniel Eriksson added the comment: #15745 is probably related to this issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 16:57:44 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 03 Aug 2014 14:57:44 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1407077864.22.0.942562217472.issue22116@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Wouldn't it be enough to test that one of the builtin functions is now weak referencible? It's better to check that the weakref gets cleared when the object dies, and for that you need an object you can dispose of. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 17:17:40 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sun, 03 Aug 2014 15:17:40 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407079060.42.0.409824550243.issue19838@psf.upfronthosting.co.za> Daniel Eriksson added the comment: So me and @larstiq have been sitting with this during the sprint here and we have figured out some things but haven't had the time to put together a patch. If you put two p.touch() before starting the testing, it will not fail on BSD. What we have found out so far is that during file creation the resolution of the timestamp is higher then at the touch attempt when a file exists. The main issue as we see it is that os.stat can return a timestamp with more granularity than os.utime can set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 17:26:37 2014 From: report at bugs.python.org (Vajrasky Kok) Date: Sun, 03 Aug 2014 15:26:37 +0000 Subject: [issue22092] Executing some tests inside Lib/unittest/test individually throws Error In-Reply-To: <1406472645.11.0.803987239444.issue22092@psf.upfronthosting.co.za> Message-ID: <1407079597.74.0.0420363744113.issue22092@psf.upfronthosting.co.za> Vajrasky Kok added the comment: Here is the patch based on Ezio's review. Thanks! ---------- Added file: http://bugs.python.org/file36237/fix_test_inside_unittest_v2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 17:30:10 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 15:30:10 +0000 Subject: [issue18766] IDLE: Autocomplete in editor doesn't work for un-imported modules In-Reply-To: <1376703586.47.0.0617094548794.issue18766@psf.upfronthosting.co.za> Message-ID: <1407079810.28.0.216584180311.issue18766@psf.upfronthosting.co.za> Mark Lawrence added the comment: The patch is simple but I don't know enough about IDLE to comment technically, what do you think Terry? ---------- nosy: +BreamoreBoy versions: +Python 3.4, Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 18:31:43 2014 From: report at bugs.python.org (Francis MB) Date: Sun, 03 Aug 2014 16:31:43 +0000 Subject: [issue20135] FAQ need list mutation answers In-Reply-To: <1388979444.45.0.0357103143169.issue20135@psf.upfronthosting.co.za> Message-ID: <1407083503.64.0.87693611118.issue20135@psf.upfronthosting.co.za> Francis MB added the comment: A) On the example: +Also note that some operations (e.g. ``y.append(10)``/``y += [10]`` or +``y.sort()``) mutate are you saying: 1) "y.append(10)" divided by "y += [10]" or 2) "y.append(10)" and "y += [10]" I don't want to split hairs but reading it fast confused me a bit B) The paragraph: + etc.), we can use some specific operations to mutate it and all the variables + that refer to it will see + the change; Couldn't be (one newline less): + etc.), we can use some specific operations to mutate it and all the variables + that refer to it will see the change; ---------- nosy: +francismb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 18:37:33 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 16:37:33 +0000 Subject: [issue13822] is(upper/lower/title) are not exactly correct In-Reply-To: <1326946975.13.0.733756833132.issue13822@psf.upfronthosting.co.za> Message-ID: <1407083853.75.0.261791645377.issue13822@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 18:41:35 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 16:41:35 +0000 Subject: [issue18769] argparse remove subparser In-Reply-To: <1376757040.66.0.700111900917.issue18769@psf.upfronthosting.co.za> Message-ID: <1407084095.15.0.406071478646.issue18769@psf.upfronthosting.co.za> Mark Lawrence added the comment: @Paul it's a simple enough patch, what do you think? ---------- nosy: +BreamoreBoy versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 19:08:30 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 17:08:30 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407085710.63.0.303381901015.issue21448@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > As for fix_prepending2.diff, could you please provide > any benchmark results> No. Inserting at the beginning of a list is always O(n) and inserting at the beginning of a deque is always O(1). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 19:16:57 2014 From: report at bugs.python.org (Brendan Meeder) Date: Sun, 03 Aug 2014 17:16:57 +0000 Subject: [issue22130] Logging fileConfig behavior does not match documentation Message-ID: <1407086217.44.0.852593986521.issue22130@psf.upfronthosting.co.za> New submission from Brendan Meeder: The 2.7.8 documentation for fileConfig says that for disable_existing_loggers: "If specified as False, loggers which exist when this call is made are left alone." This is actually not the case- they are enabled after the call to fileConfig. In particular, the loggers that would be disabled if disable_existing_loggers=True are enabled after the call, regardless of whether they were previously enabled/disabled. ---------- components: Library (Lib) messages: 224648 nosy: Brendan.Meeder priority: normal severity: normal status: open title: Logging fileConfig behavior does not match documentation type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 20:28:13 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Aug 2014 18:28:13 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407090493.35.0.0869819073585.issue21448@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, but if n is limited, O(n) becomes O(1). In our case n is the number of fed but not read lines. I suppose the worst case is a number of empty lines, in this case n=8192. I tried following microbenchmark and did not noticed significant difference. $ ./python -m timeit -s "from email.parser import Parser; d = 'From: example at example.com\n\n' + '\n' * 100000" -- "Parser().parsestr(d)" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 20:38:11 2014 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 03 Aug 2014 18:38:11 +0000 Subject: [issue13540] Document the Action API in argparse In-Reply-To: <1323183395.55.0.489132691311.issue13540@psf.upfronthosting.co.za> Message-ID: <1407091091.53.0.293838442095.issue13540@psf.upfronthosting.co.za> Jason R. Coombs added the comment: @paul.j3, It wasn't from a different project, it's just that the bug tracker when it does a diff always uses the tip of each branch instead of the most recent common ancestor, so it effectively calculated the the diff of the changes plus the inverse of every change since the effort initiated. But yes, it makes sense to remove it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 20:38:31 2014 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 03 Aug 2014 18:38:31 +0000 Subject: [issue13540] Document the Action API in argparse In-Reply-To: <1323183395.55.0.489132691311.issue13540@psf.upfronthosting.co.za> Message-ID: <1407091111.57.0.509742832421.issue13540@psf.upfronthosting.co.za> Changes by Jason R. Coombs : Removed file: http://bugs.python.org/file36001/9ac347a7f375.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 21:02:07 2014 From: report at bugs.python.org (Jessica McKellar) Date: Sun, 03 Aug 2014 19:02:07 +0000 Subject: [issue16428] turtle with compound shape doesn't get clicks In-Reply-To: <1352299609.35.0.759398778926.issue16428@psf.upfronthosting.co.za> Message-ID: <1407092527.28.0.129920064522.issue16428@psf.upfronthosting.co.za> Changes by Jessica McKellar : ---------- keywords: +needs review stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 21:19:09 2014 From: report at bugs.python.org (Jessica McKellar) Date: Sun, 03 Aug 2014 19:19:09 +0000 Subject: [issue18624] Add alias for iso-8859-8-i which is the same as iso-8859-8 In-Reply-To: <1375398269.06.0.0330535739148.issue18624@psf.upfronthosting.co.za> Message-ID: <1407093549.89.0.175651425834.issue18624@psf.upfronthosting.co.za> Changes by Jessica McKellar : ---------- keywords: +needs review stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 21:30:55 2014 From: report at bugs.python.org (Roundup Robot) Date: Sun, 03 Aug 2014 19:30:55 +0000 Subject: [issue13540] Document the Action API in argparse In-Reply-To: <1323183395.55.0.489132691311.issue13540@psf.upfronthosting.co.za> Message-ID: <3hRC4t2LDmz7LjS@mail.python.org> Roundup Robot added the comment: New changeset 956c6d33a57d by Jason R. Coombs in branch '2.7': Issue #13540: Expanded argparse documents to clarify the action API http://hg.python.org/cpython/rev/956c6d33a57d New changeset 008a5473f300 by Jason R. Coombs in branch '2.7': Issue #13540: Removed redundant documentation about Action instance attributes. Updated example and documentation per recommendations by Steven Bethard in msg149524. http://hg.python.org/cpython/rev/008a5473f300 New changeset 7a627bc9d40e by Jason R. Coombs in branch '2.7': Issue #13540: Update references to Action class to match syntax used for other classes in this file. http://hg.python.org/cpython/rev/7a627bc9d40e New changeset b232e937e668 by Jason R. Coombs in branch '2.7': Issue #13540: Merge commits http://hg.python.org/cpython/rev/b232e937e668 ---------- nosy: +python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 21:31:48 2014 From: report at bugs.python.org (Roundup Robot) Date: Sun, 03 Aug 2014 19:31:48 +0000 Subject: [issue13540] Document the Action API in argparse In-Reply-To: <1323183395.55.0.489132691311.issue13540@psf.upfronthosting.co.za> Message-ID: <3hRC5v2j2nz7LjS@mail.python.org> Roundup Robot added the comment: New changeset e2c9e0a3ef02 by Jason R. Coombs in branch '3.2': Issue #13540: Expanded argparse documents to clarify the action API http://hg.python.org/cpython/rev/e2c9e0a3ef02 New changeset c10a6ca9cb32 by Jason R. Coombs in branch '3.2': Issue #13540: Removed redundant documentation about Action instance attributes. Updated example and documentation per recommendations by Steven Bethard in msg149524. http://hg.python.org/cpython/rev/c10a6ca9cb32 New changeset 634f3fe8cbde by Jason R. Coombs in branch '3.2': Issue #13540: Update references to Action class to match syntax used for other classes in this file. http://hg.python.org/cpython/rev/634f3fe8cbde New changeset a36d469f31c1 by Jason R. Coombs in branch '3.3': Issue #13540: Merge changes from 3.2 http://hg.python.org/cpython/rev/a36d469f31c1 New changeset c689156580ca by Jason R. Coombs in branch '3.4': Issue #13540: Merge changes from 3.3 http://hg.python.org/cpython/rev/c689156580ca New changeset a2d01ed713cb by Jason R. Coombs in branch 'default': Issue #13540: Merge changes from 3.4 http://hg.python.org/cpython/rev/a2d01ed713cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 21:34:22 2014 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 03 Aug 2014 19:34:22 +0000 Subject: [issue13540] Document the Action API in argparse In-Reply-To: <1323183395.55.0.489132691311.issue13540@psf.upfronthosting.co.za> Message-ID: <1407094462.93.0.503743724476.issue13540@psf.upfronthosting.co.za> Jason R. Coombs added the comment: Commits applied to Python 2.7 and 3.2-3.5. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:12:24 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Sun, 03 Aug 2014 20:12:24 +0000 Subject: [issue14910] argparse: disable abbreviation In-Reply-To: <1337943742.57.0.897347214609.issue14910@psf.upfronthosting.co.za> Message-ID: <1407096744.06.0.677154542626.issue14910@psf.upfronthosting.co.za> Daniel Eriksson added the comment: Eli, will look into those tomorrow morning, so a final patch will come during tomorrow. Checked my spam folder - and there they where, fixed the settings now so I get it faster. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:27:57 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 20:27:57 +0000 Subject: [issue17603] AC_LIBOBJ replacement of fileblocks In-Reply-To: <1364760819.41.0.900154328327.issue17603@psf.upfronthosting.co.za> Message-ID: <1407097677.31.0.793062151763.issue17603@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:31:50 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 20:31:50 +0000 Subject: [issue17769] python-config --ldflags gives broken output when statically linking Python with --as-needed In-Reply-To: <1366143734.86.0.154931116413.issue17769@psf.upfronthosting.co.za> Message-ID: <1407097910.59.0.244151543554.issue17769@psf.upfronthosting.co.za> Mark Lawrence added the comment: @Max sorry about the delay in giving you a response. Can somebody please pick this up, I can't find on the experts list who to put on the nosy list for build issues. ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:34:14 2014 From: report at bugs.python.org (Larry Hastings) Date: Sun, 03 Aug 2014 20:34:14 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407098054.56.0.985399335457.issue19838@psf.upfronthosting.co.za> Larry Hastings added the comment: os.stat can return something more precise than nanosecond resolution? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:35:52 2014 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Aug 2014 20:35:52 +0000 Subject: [issue22128] patch: steer people away from codecs.open In-Reply-To: <1407072016.44.0.291385355074.issue22128@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: See also my PEP 400: http://legacy.python.org/dev/peps/pep-0400/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:37:30 2014 From: report at bugs.python.org (STINNER Victor) Date: Sun, 03 Aug 2014 20:37:30 +0000 Subject: [issue22127] performance regression in socket getsockaddrarg() In-Reply-To: <1407072156.54.0.642061349123.issue22127@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: For Python, the encoder is only used when you pass a Unicode string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:38:59 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 20:38:59 +0000 Subject: [issue17774] unable to disable -r in run_tests.py In-Reply-To: <1366203781.64.0.116345501767.issue17774@psf.upfronthosting.co.za> Message-ID: <1407098339.24.0.697211509374.issue17774@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- versions: +Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:41:40 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 20:41:40 +0000 Subject: [issue15992] Strict aliasing violations in Objects/unicodeobject.c In-Reply-To: <1348172219.51.0.84674051024.issue15992@psf.upfronthosting.co.za> Message-ID: <1407098500.44.0.487553470097.issue15992@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- versions: +Python 3.4, Python 3.5 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:44:51 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 20:44:51 +0000 Subject: [issue16429] Emit SyntaxWarning for code that risks UnboundLocalError In-Reply-To: <1352300366.42.0.384864300614.issue16429@psf.upfronthosting.co.za> Message-ID: <1407098691.31.0.807991954376.issue16429@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- type: -> enhancement versions: +Python 3.5 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:45:50 2014 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sun, 03 Aug 2014 20:45:50 +0000 Subject: [issue22128] patch: steer people away from codecs.open In-Reply-To: <1407071838.74.0.684483503953.issue22128@psf.upfronthosting.co.za> Message-ID: <1407098750.65.0.384582388806.issue22128@psf.upfronthosting.co.za> Marc-Andre Lemburg added the comment: Pointing people to io.open() as alternative to codecs.open() is a good idea, but that doesn't make codecs.open() less useful. The reason why codecs.open() uses binary mode is to avoid issues with automatic newline conversion getting in the way of the file's encoding. Think of e.g. UTF-16 encoded files that use newlines. Note that codecs allow handling newlines on a line-by-line bases via the .readline() keepends parameter, so issues with Windows vs. Unix can be worked around explicitly. Since default is to keep line ends, no data loss occurs and application code can deal with line ends as it sees fit. As it stands, I'm -1 on this patch, but would be +1 on mentioning io.open() as alternative to codecs.open() with a slightly different approach to line ends. I don't think it's useful to tell people: * use codecs.open() on Python 2.4, 2.5, 2.6 * use io.open() on Python 2.7 (io is too slow on 2.6 to be a real alternative to codecs.open()) * use open() on Python 3.4+ codecs.open() works the same across all these Python versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:50:00 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 20:50:00 +0000 Subject: [issue15018] Incomplete Python LDFLAGS and CPPFLAGS used for extension modules on posix In-Reply-To: <1338987103.32.0.200789346526.issue15018@psf.upfronthosting.co.za> Message-ID: <1407099000.57.0.151820596801.issue15018@psf.upfronthosting.co.za> Mark Lawrence added the comment: Who is best placed to comment on build issues? ---------- nosy: +BreamoreBoy versions: +Python 3.4, Python 3.5 -Python 2.6, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:56:15 2014 From: report at bugs.python.org (Michael Foord) Date: Sun, 03 Aug 2014 20:56:15 +0000 Subject: [issue22092] Executing some tests inside Lib/unittest/test individually throws Error In-Reply-To: <1406472645.11.0.803987239444.issue22092@psf.upfronthosting.co.za> Message-ID: <1407099375.81.0.12716384488.issue22092@psf.upfronthosting.co.za> Michael Foord added the comment: Patch looks fine, easy enough to change for unittest2 (if I ever have the time for a new release!) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 22:58:22 2014 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 03 Aug 2014 20:58:22 +0000 Subject: [issue18841] math.isfinite fails with Decimal sNAN In-Reply-To: <1377531520.63.0.106544243675.issue18841@psf.upfronthosting.co.za> Message-ID: <1407099502.93.0.0612488326248.issue18841@psf.upfronthosting.co.za> Mark Lawrence added the comment: Steven, can you propose a patch for this? ---------- nosy: +BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 23:16:33 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 03 Aug 2014 21:16:33 +0000 Subject: [issue18766] IDLE: Autocomplete in editor doesn't work for un-imported modules In-Reply-To: <1376703586.47.0.0617094548794.issue18766@psf.upfronthosting.co.za> Message-ID: <1407100593.68.0.852479737619.issue18766@psf.upfronthosting.co.za> Terry J. Reedy added the comment: A least a manual (human) test is needed: a description of steps that do not work now and do work with a patch. Currently, get_entity() is only called in one place in fetch_completions; it is not used anywhere else in idlelib. (Call_tips defines another get_entity().) Its body should be moved inline at the call site. A variation that differs in the second line namespace = __main__.__dict__.copy() namespace.update(__main__.__builtins__.__dict__) is already in-lined in the if-branch above. We are trying to eliminate bare excepts: in idlelib -- #15313 -- not expand them or their use. Try blocks should only include the statement or statements that could raise the exception or exceptions caught. So the import, once inlined, should be inside try: except ImportError: return... . I do not know what the existing try: except: is meant to catch, but it includes too much, as does the one that follows. That, however, should be a separate patch. + namespace = sys.modules.copy() + namespace.update(__main__.__dict__) seems unnecessary. I think the following should work. namespace[name] = sys.modules[name] A testcase would make sure either way. ---------- stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 3 23:43:08 2014 From: report at bugs.python.org (Francis MB) Date: Sun, 03 Aug 2014 21:43:08 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407102188.06.0.462491293744.issue19838@psf.upfronthosting.co.za> Francis MB added the comment: > What we have found out so far is that during file creation the > resolution of the timestamp is higher then at the touch attempt > when a file exists. Could it help to create 2 files (file 1, wait a bit, file 2) and then do the checks only with file 1? ---------- nosy: +francismb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 00:11:19 2014 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Aug 2014 22:11:19 +0000 Subject: [issue22127] performance regression in socket getsockaddrarg() In-Reply-To: Message-ID: Charles-Fran?ois Natali added the comment: > For Python, the encoder is only used when you pass a Unicode string. Hm... I'm passing ('127.0.0.1', 4242)as destination, and you can see in the above profile that the idna encode function is called. This doesn't occur with 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 00:22:19 2014 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sun, 03 Aug 2014 22:22:19 +0000 Subject: [issue22127] performance regression in socket getsockaddrarg() In-Reply-To: Message-ID: Charles-Fran?ois Natali added the comment: OK, I think I see what you mean: $ ./python -m timeit -s "import socket; s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)" "s.sendto(b'hello', ('127.0.0.1', 4242))"10000 loops, best of 3: 44.7 usec per loop $ ./python -m timeit -s "import socket; s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)" "s.sendto(b'hello', (b'127.0.0.1', 4242))" 10000 loops, best of 3: 23.7 usec per loop That's really surprising, especially since gethostbyname() and getaddrinfo() seem to return strings: $ ./python -m timeit -s "import socket; s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); addr=socket.gethostbyname('127.0.0.1')" "s.sendto(b'hello', (addr, 4242))" $ ./python -c "import socket; print(type(socket.gethostbyname('127.0.0.1')))" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 01:03:32 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 03 Aug 2014 23:03:32 +0000 Subject: [issue21448] Email Parser use 100% CPU In-Reply-To: <1399404013.42.0.0957567548326.issue21448@psf.upfronthosting.co.za> Message-ID: <1407107012.44.0.57152003558.issue21448@psf.upfronthosting.co.za> Raymond Hettinger added the comment: A deque is typically the right data structure when you need to append, pop, and extend on both the left and right side. It is designed specifically for that task. Also, it nicely cleans-up the code by removing the backwards line list and the list reversal prior to insertion on the left (that's what we had to do to achieve decent performance before the introduction of deques in Python 2.4, now you hardly ever see code like "self._lines[:0] = lines[::-1]"). I think fix_prepending2 would be a nice improvement for Py3.5. For the main patches that directly address the OP's performance issue, feel free to apply either my or yours. They both work. Either way, please add test_parser.diff since the original test didn't cover all the cases and because it didn't make clear the relationship between push() and splitlines(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 01:52:17 2014 From: report at bugs.python.org (Steven Barker) Date: Sun, 03 Aug 2014 23:52:17 +0000 Subject: [issue1234674] filecmp.cmp's "shallow" option Message-ID: <1407109937.11.0.881891838879.issue1234674@psf.upfronthosting.co.za> Steven Barker added the comment: I've worked on this filecmp issue some more, and I have some new patches. First up is a patch that only modifies the tests. It has one test that fails without the behavior patch. The test patch also modifies some other tests so that they will work after the behavior patch is applied. Notably, test_keyword had a some tests that would fail due to false negatives on shallow comparisons. The second patch is the behavior and documentation changes required to actually fix this issue. This should be very simple to understand (the behavior change is only two lines of code, quoted in the discussion above). If you apply only this patch, you'll get several test failures, all due to false negative shallow comparisons (where two files have the same contents, but their stat signatures differ). With these new patches, I think this issue is ready for a review, and eventually to be committed. The behavior change is simple and I think, obviously correct (assuming we want to risk breaking backwards compatibility). Perhaps my test code can be improved, but I don't think it's too bad. So, the main question is "will too much outside code break if we make this behavior change?" I don't think filecmp is used very widely, but as was demonstrated by the standard library's only use of filecmp (in Lib/test/test_keyword.py), it's likely that a lot of users perform shallow comparisons (by default) where they really don't want to get false-negatives. If we decide that the changed behavior is too big of a break of backwards compatibility, we just need to document the current behavior better (at a minimum, the docstring for filecmp.cmp must be corrected). ---------- Added file: http://bugs.python.org/file36238/filecmp_test_patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 01:52:31 2014 From: report at bugs.python.org (Steven Barker) Date: Sun, 03 Aug 2014 23:52:31 +0000 Subject: [issue1234674] filecmp.cmp's "shallow" option Message-ID: <1407109951.51.0.0862151558392.issue1234674@psf.upfronthosting.co.za> Changes by Steven Barker : Added file: http://bugs.python.org/file36239/filecmp_behavior_and_doc_fix.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 03:28:23 2014 From: report at bugs.python.org (Berker Peksag) Date: Mon, 04 Aug 2014 01:28:23 +0000 Subject: [issue14910] argparse: disable abbreviation In-Reply-To: <1337943742.57.0.897347214609.issue14910@psf.upfronthosting.co.za> Message-ID: <1407115703.43.0.0652724017932.issue14910@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- components: +Library (Lib) -None stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 03:31:45 2014 From: report at bugs.python.org (Martin Panter) Date: Mon, 04 Aug 2014 01:31:45 +0000 Subject: [issue22123] Provide a direct function for types.SimpleNamespace() In-Reply-To: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za> Message-ID: <1407115905.3.0.0497360046293.issue22123@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 03:37:21 2014 From: report at bugs.python.org (Larry Hastings) Date: Mon, 04 Aug 2014 01:37:21 +0000 Subject: [issue20170] Derby #1: Convert 137 sites to Argument Clinic in Modules/posixmodule.c In-Reply-To: <1389138185.8.0.104398826507.issue20170@psf.upfronthosting.co.za> Message-ID: <1407116241.96.0.265421722242.issue20170@psf.upfronthosting.co.za> Larry Hastings added the comment: Diff tweaked to undo the ill-concieved Py_RETURN_NONE change. Thanks, Zachary! Does it now compile and pass tests on Windows? ---------- Added file: http://bugs.python.org/file36240/larry.clinicize.posixmodule.7.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 03:50:38 2014 From: report at bugs.python.org (Martin Panter) Date: Mon, 04 Aug 2014 01:50:38 +0000 Subject: [issue1186900] nntplib shouldn't raise generic EOFError Message-ID: <1407117038.26.0.321196019641.issue1186900@psf.upfronthosting.co.za> Martin Panter added the comment: I could be wrong, but isn?t this error raised when expecting a response from any command, not just during ?connection establishment?? Perhaps change the docstring to say something like ?Connection closed unexpectedly? instead. ---------- nosy: +vadmium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 04:05:56 2014 From: report at bugs.python.org (Kevin London) Date: Mon, 04 Aug 2014 02:05:56 +0000 Subject: [issue22131] uuid.bytes optimization Message-ID: <1407117956.69.0.92579582172.issue22131@psf.upfronthosting.co.za> New submission from Kevin London: Generating the byte representation of a UUID object can be a little faster by using binascii's unhexlify on the hex value of the UUID object. In my testing, I saw about a 5.5x speed increase with the attached changes. Here are a set of benchmarks that I ran, which are inspired by Wang Chun's benchmarks on http://bugs.python.org/issue5885: https://gist.github.com/kevinlondon/d3bb32d5a784f78731fa My times: kevin$ python uuid_benchmark.py 100000 Original Average: 8.049 microseconds Updated Average: 1.447 microseconds I re-ran all of the tests with the patched uuid module and they passed. Here's my patchcheck output as well: kevin$ make patchcheck ./python.exe ./Tools/scripts/patchcheck.py Getting the list of files that have been added/changed ... 1 file Fixing whitespace ... 0 files Fixing C file whitespace ... 0 files Fixing docs whitespace ... 0 files Docs modified ... NO Misc/ACKS updated ... NO Misc/NEWS updated ... NO configure regenerated ... not needed pyconfig.h.in regenerated ... not needed Thanks! ---------- assignee: ronaldoussoren components: Benchmarks, Library (Lib), Macintosh files: uuid_bytes_update.patch keywords: patch messages: 224671 nosy: kevinlondon, ronaldoussoren priority: normal severity: normal status: open title: uuid.bytes optimization type: performance versions: Python 2.7 Added file: http://bugs.python.org/file36241/uuid_bytes_update.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 04:10:00 2014 From: report at bugs.python.org (Alex Gaynor) Date: Mon, 04 Aug 2014 02:10:00 +0000 Subject: [issue22131] uuid.bytes optimization In-Reply-To: <1407117956.69.0.92579582172.issue22131@psf.upfronthosting.co.za> Message-ID: <1407118200.39.0.668542627664.issue22131@psf.upfronthosting.co.za> Alex Gaynor added the comment: `self.int.to_bytes(16, byteorder='big')` looks to be even faster (about 3x on my machine) ---------- nosy: +alex _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 04:10:58 2014 From: report at bugs.python.org (Alex Gaynor) Date: Mon, 04 Aug 2014 02:10:58 +0000 Subject: [issue22131] uuid.bytes optimization In-Reply-To: <1407117956.69.0.92579582172.issue22131@psf.upfronthosting.co.za> Message-ID: <1407118258.12.0.0818852927664.issue22131@psf.upfronthosting.co.za> Alex Gaynor added the comment: What I said only applies to the Python3 version of this patch. Thanks for submitting this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 04:11:03 2014 From: report at bugs.python.org (Alex Gaynor) Date: Mon, 04 Aug 2014 02:11:03 +0000 Subject: [issue22131] uuid.bytes optimization In-Reply-To: <1407117956.69.0.92579582172.issue22131@psf.upfronthosting.co.za> Message-ID: <1407118263.24.0.728682791069.issue22131@psf.upfronthosting.co.za> Changes by Alex Gaynor : ---------- versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 04:31:47 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 04 Aug 2014 02:31:47 +0000 Subject: [issue22127] performance regression in socket getsockaddrarg() In-Reply-To: <1407053849.06.0.738160055146.issue22127@psf.upfronthosting.co.za> Message-ID: <1407119507.65.0.241251064448.issue22127@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Note that even the bytes version is still quite slow. UDP is used for light-weight protocols where you may send thousands or more messages per second. I'd be curious what the sendto() performance is in raw C. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 04:35:17 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 04 Aug 2014 02:35:17 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1407119717.94.0.490672792688.issue22116@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 04:41:55 2014 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 04 Aug 2014 02:41:55 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1407120115.39.0.505475237777.issue22116@psf.upfronthosting.co.za> Antoine Pitrou added the comment: @kilowu, your patch looks good to me. As a necessary step to include your contribution, could you please sign the contributor's agreement? See https://www.python.org/psf/contrib/contrib-form/ Thank you very much! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 05:26:45 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 04 Aug 2014 03:26:45 +0000 Subject: [issue22131] uuid.bytes optimization In-Reply-To: <1407117956.69.0.92579582172.issue22131@psf.upfronthosting.co.za> Message-ID: <1407122805.49.0.599407927282.issue22131@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I also like the way the patch cleans-up the code. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 05:36:12 2014 From: report at bugs.python.org (koobs) Date: Mon, 04 Aug 2014 03:36:12 +0000 Subject: [issue11445] python.exe on OS X shared-llbrary build erroneously linked to MacPorts python library In-Reply-To: <19830.44206.997189.286834@montanaro.dyndns.org> Message-ID: <1407123372.18.0.260460101957.issue11445@psf.upfronthosting.co.za> Changes by koobs : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 05:57:44 2014 From: report at bugs.python.org (Rob Lanphier) Date: Mon, 04 Aug 2014 03:57:44 +0000 Subject: [issue20402] List comprehensions should be noted in for loop documentation In-Reply-To: <1390793056.66.0.0906291243976.issue20402@psf.upfronthosting.co.za> Message-ID: <1407124664.55.0.95560924828.issue20402@psf.upfronthosting.co.za> Rob Lanphier added the comment: > Moving it earlier in the tutorial is likely to do more harm than help. > In teaching Python, you need some gap between learning for-loops and > learning list comprehensions (the former is a prerequisite for the > latter). The problem here is that many people get list comprehensions foisted on them by reading code that has them in it. Since list comprehensions aren't called "list comprehensions" in the code, but rather, they look like funny for loops, many people will turn to the for loop documentation, and as of this writing, they won't find anything. There doesn't necessarily need to be the full example as in Alex's patch (though Alex's version seems fine to me), I think there should at least be some link to the list comprehension documentation, e.g. "It is also possible to prepend a function onto a 'for' loop. This is a :ref:`list comprehensions `, and is explained further in the next chapter." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 06:10:06 2014 From: report at bugs.python.org (Joe Gaspard) Date: Mon, 04 Aug 2014 04:10:06 +0000 Subject: [issue22105] Idle: Hang during File "Save As" In-Reply-To: <1406933830.51.0.833918552857.issue22105@psf.upfronthosting .co.za> Message-ID: <201408040410.s7449p3i030475@mail237c25.carrierzone.com> Joe Gaspard added the comment: Thanks Terry. As best I can recall was trying to save a ".py" while IDLE and the "'.py" file were both open, but definitely not a 'Library' file. I did try to save the IDLE window display once, and it may have been this time. My programs have been much smaller than 400000 lines (53 KB max), but I have saved a 500 billion byte file on the same 2TB hard drive without a problem. Attached is a WordPad doc describing two additional problems that happened a little while ago. Python is new to me. Would I have fewer problems if I used an earlier version? Thanks again for the help .... Joe Gaspard At 03:57 PM 8/1/2014, you wrote: >Terry J. Reedy added the comment: > >What file were you trying to save to? Be very exact. Reading/Saving >to 'Library' files is known to have problems and there is another >issue for this. > >Were you trying to save the Shell window, displaying output from >your program. > >What is the minimum # of lines required to have a problem. 400000 >lines is probably "won't fix" because the problem is likely with tk >and Windows, not Idle. Your program should print directly to a file. > >---------- >nosy: +terry.reedy >title: Hang during File "Save As" -> Idle: Hang during File "Save As" > >_______________________________________ >Python tracker > >_______________________________________ ---------- Added file: http://bugs.python.org/file36242/PythonHang201408011146.txt _______________________________________ Python tracker _______________________________________ -------------- next part -------------- APP HANG 8/1/2014 11:46-47 AM WHILE IN IDLE: Selected Edit>Find> x. Program did not respond. Program was manually interrupted by "CTRL.C" (while in Python 3.4.1 shell) prior to attempting a search for a variable "x", probably (but not exactly) similar to pervious "Hang" problem submitted to Python. Moving the cursor to the ">>>_" position on the display relieved the Problem. Fortunately the operating program was saved before the problem occurred. The operating program was lost last time this happened. "I am not going to do that anymore." Hope this info helps. ... Joe Gaspard See Microsoft report below for more details. Description: A problem caused this program to stop interacting with Windows. Problem signature: Problem Event Name: AppHangB1 Application Name: pythonw.exe Application Version: 0.0.0.0 Application Timestamp: 5378731e Hang Signature: 1910 Hang Type: 0 OS Version: 6.1.7601.2.1.0.768.3 Locale ID: 1033 Additional Hang Signature 1: 191017f5c54030d20a7f882b139dfba9 Additional Hang Signature 2: 184f Additional Hang Signature 3: 184f1a21fed89659658cbe7167f7508c Additional Hang Signature 4: 1910 Additional Hang Signature 5: 191017f5c54030d20a7f882b139dfba9 Additional Hang Signature 6: 184f Additional Hang Signature 7: 184f1a21fed89659658cbe7167f7508c Read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409 If the online privacy statement is not available, please read our privacy statement offline: C:\Windows\system32\en-US\erofflps.txt 8/3/2014 7:30 PM - Uninitiated program stop: "Your computer is low on memory" "The ecception breakpoint has been reached" (0X80000003 occured in the application at location 0x74c54164) Click OK to terminate the program I first cleared the (!) Low Memory pop-up, then the (X)Exception breakpoint pop-up. Normal activity Ok afterwards. From report at bugs.python.org Mon Aug 4 07:07:07 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Mon, 04 Aug 2014 05:07:07 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407128827.27.0.808954360826.issue19838@psf.upfronthosting.co.za> Daniel Eriksson added the comment: @Larry The issue is the following: In the test after the first p.touch (Pdb) old_mtime 1407128672.4133856 (Pdb) old_mtime_ns 1407128672413385711 After second p.touch (Pdb) st.st_mtime_ns 1407128689000000000 (Pdb) st.st_mtime 1407128689.0 So the issue is that when utime is used it can't set the time with nanosecond, but just with second resolution. @Francis - A quick fix that would work, but it is a bit dirty but it will work correctly is to just add two p.touch() before doing anything. Not really the best solution but could work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 07:14:40 2014 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 04 Aug 2014 05:14:40 +0000 Subject: [issue22105] Idle: Hang during File "Save As" In-Reply-To: <1406689445.5.0.172130301576.issue22105@psf.upfronthosting.co.za> Message-ID: <1407129280.1.0.239761292711.issue22105@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The latest version is best. We are gradually fixing crashes, closes, hangs, and other bugs. When you replay by email, please delete the quoted message, as it is redundant with the message already displayed and just noise. I am closing this issue for now because there is insufficient data to do anything. We can only work on semi-repeatable problems that occur on more than just one user's machine. Windows, at least, is prone to unrepeatable and sometimes system-specific glitches. ---------- resolution: -> later stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 07:17:38 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 04 Aug 2014 05:17:38 +0000 Subject: [issue20402] List comprehensions should be noted in for loop documentation In-Reply-To: <1390793056.66.0.0906291243976.issue20402@psf.upfronthosting.co.za> Message-ID: <1407129458.5.0.685646707459.issue20402@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Sorry, I'm going to close this one because I believe it would make the documentation worse. I don't believe that making a forward reference from section 4.2 to section 5.6 helps anyone. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 07:20:15 2014 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 04 Aug 2014 05:20:15 +0000 Subject: [issue22097] Linked list API for ordereddict In-Reply-To: <1406583029.35.0.857255601544.issue22097@psf.upfronthosting.co.za> Message-ID: <1407129615.83.0.536125228468.issue22097@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Antoine, can I close this one? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 07:40:52 2014 From: report at bugs.python.org (Larry Hastings) Date: Mon, 04 Aug 2014 05:40:52 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407130852.02.0.0618142987606.issue19838@psf.upfronthosting.co.za> Larry Hastings added the comment: So why can't you use the "ns" parameter for os.utime()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 07:43:11 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Mon, 04 Aug 2014 05:43:11 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407130991.92.0.13543467589.issue19838@psf.upfronthosting.co.za> Daniel Eriksson added the comment: @Larry - the problem arrives after the second touch, which does os.utime(FILE, None) if the file exists. The os.utime that is in the test-code doesn't really break anything, what breaks the test is the second touch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 07:50:44 2014 From: report at bugs.python.org (Larry Hastings) Date: Mon, 04 Aug 2014 05:50:44 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407131444.0.0.75853032101.issue19838@psf.upfronthosting.co.za> Larry Hastings added the comment: A cursory read of the source code suggests everybody is doing the right thing. Can you run this with a debug build of CPython, put a breakpoint in posix_utime, and check that when it's called for the second p.touch that it's correctly calling the underlying function to say "set the time of this file to the current time"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 07:57:09 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Mon, 04 Aug 2014 05:57:09 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407131829.56.0.151600335188.issue19838@psf.upfronthosting.co.za> Daniel Eriksson added the comment: @Larry - we did that yesterday and on the FreeBSD-machine the regular utimes was used and not utimensat. utimensat is not available on FreeBSD 10 so it fall backs to regular utimes to be used in os.utime. But when a file is created it is the file system that sets the utime, so it will have nanoseconds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 07:59:30 2014 From: report at bugs.python.org (Larry Hastings) Date: Mon, 04 Aug 2014 05:59:30 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407131970.94.0.243012899078.issue19838@psf.upfronthosting.co.za> Larry Hastings added the comment: And was the "time" argument passed in to utimes() set to NULL? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 08:35:54 2014 From: report at bugs.python.org (Joseph Godbehere) Date: Mon, 04 Aug 2014 06:35:54 +0000 Subject: [issue21091] EmailMessage.is_attachment should be a method In-Reply-To: <1396056379.22.0.363709068017.issue21091@psf.upfronthosting.co.za> Message-ID: <1407134154.88.0.0623355237946.issue21091@psf.upfronthosting.co.za> Joseph Godbehere added the comment: Patch to change message.is_attachment from a property to a normal method. I've updated the doc and all calls to is_attachment. ---------- keywords: +patch nosy: +joegod Added file: http://bugs.python.org/file36243/attach_not_property.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 08:40:02 2014 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 04 Aug 2014 06:40:02 +0000 Subject: [issue21091] EmailMessage.is_attachment should be a method In-Reply-To: <1396056379.22.0.363709068017.issue21091@psf.upfronthosting.co.za> Message-ID: <1407134402.08.0.601906019246.issue21091@psf.upfronthosting.co.za> Nick Coghlan added the comment: This is your call David - I agree consistency is highly desirable, and having a chance to find and fix this kind of discrepancy is a large part of why we introduced provisional APIs. ---------- assignee: -> r.david.murray nosy: +ncoghlan stage: -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 08:43:50 2014 From: report at bugs.python.org (Drekin) Date: Mon, 04 Aug 2014 06:43:50 +0000 Subject: [issue1602] windows console doesn't print or input Unicode In-Reply-To: <1197453390.87.0.813702844893.issue1602@psf.upfronthosting.co.za> Message-ID: <1407134630.89.0.167605422127.issue1602@psf.upfronthosting.co.za> Drekin added the comment: I think that boxes are ok, it's just missing font. Without active workaroud there is just UnicodeEncodeError (with cp852 for me). There is problem with astral characters ? I'm getting each box twice. It is possible that Windows console doesn't handle astral characters at all ? it doesn't interpret surrogate pairs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 09:15:34 2014 From: report at bugs.python.org (Csaba Makara) Date: Mon, 04 Aug 2014 07:15:34 +0000 Subject: [issue22132] Cannot copy the same directory structure to the same destination more than once Message-ID: <1407136534.84.0.777001072361.issue22132@psf.upfronthosting.co.za> New submission from Csaba Makara: If I use the distutils.dir_util.copy_tree to copy the same directory structure multiple times to the same place (even from multiple sources) but I remove and recreate the target_directory before each copy, the following exception accurs: g:\_Programming>py example.py Traceback (most recent call last): File "E:\Python34\lib\distutils\file_util.py", line 41, in _copy_file_contents fdst = open(dst, 'wb') FileNotFoundError: [Errno 2] No such file or directory: 'c:\\bin\\folder_inside\ \file_inside.txt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "example.py", line 13, in dir_util.copy_tree(source_folder2, target_folder) File "E:\Python34\lib\distutils\dir_util.py", line 160, in copy_tree verbose=verbose, dry_run=dry_run)) File "E:\Python34\lib\distutils\dir_util.py", line 164, in copy_tree dry_run=dry_run) File "E:\Python34\lib\distutils\file_util.py", line 143, in copy_file _copy_file_contents(src, dst) File "E:\Python34\lib\distutils\file_util.py", line 44, in _copy_file_contents "could not create '%s': %s" % (dst, e.strerror)) distutils.errors.DistutilsFileError: could not create 'c:\bin\folder_inside\file _inside.txt': No such file or directory _______________________________________________________________ If the target_folder is not deleted, the problem won't appear. The problem seems to be the handling of the inner directories. In the second attempt the inner folders are thought to be existing, but they are not. See the attached script. ---------- components: Distutils files: example.py messages: 224691 nosy: Csaba.Makara, dstufft, eric.araujo priority: normal severity: normal status: open title: Cannot copy the same directory structure to the same destination more than once type: crash versions: Python 3.4 Added file: http://bugs.python.org/file36244/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 09:20:58 2014 From: report at bugs.python.org (Wei Wu) Date: Mon, 04 Aug 2014 07:20:58 +0000 Subject: [issue22116] Weak reference support for C function objects In-Reply-To: <1406829091.92.0.589773315049.issue22116@psf.upfronthosting.co.za> Message-ID: <1407136858.47.0.24072807559.issue22116@psf.upfronthosting.co.za> Wei Wu added the comment: @pitrou, thank you for the review. I have signed the contributor agreement form after submitting this patch. Please let me know if there is a further step to help you to verify the signed contributor agreement. I'm really glad to have the chance to contribute back to the community. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 09:21:46 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Aug 2014 07:21:46 +0000 Subject: [issue21091] EmailMessage.is_attachment should be a method In-Reply-To: <1396056379.22.0.363709068017.issue21091@psf.upfronthosting.co.za> Message-ID: <1407136906.4.0.89862802921.issue21091@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Unfortunately this will silently break existing code because msg.is_attachment will be always true. But it is possible to make EmailMessage.is_attachment a property which returns special callable with the __bool__() method which will emit deprecation warning and call the __call__() method. After some intermediate period (one or two releases) it can be replaced by regular method. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 09:22:49 2014 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Aug 2014 07:22:49 +0000 Subject: [issue22127] performance regression in socket getsockaddrarg() In-Reply-To: Message-ID: STINNER Victor added the comment: "Abc" is a bytes string in Python 2 and an Unicode string in Python 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 09:24:48 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Aug 2014 07:24:48 +0000 Subject: [issue21091] EmailMessage.is_attachment should be a method In-Reply-To: <1396056379.22.0.363709068017.issue21091@psf.upfronthosting.co.za> Message-ID: <1407137088.42.0.865789788289.issue21091@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The alternative is to make EmailMessage.is_multipart a property. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 09:50:33 2014 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Mon, 04 Aug 2014 07:50:33 +0000 Subject: [issue22127] performance regression in socket getsockaddrarg() In-Reply-To: <1407119507.65.0.241251064448.issue22127@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: > Note that even the bytes version is still quite slow. UDP is used for light-weight protocols where you may send thousands or more messages per second. I'd be curious what the sendto() performance is in raw C. Ah, I wouldn't rely on the absolyte values, my computer is *slow*. On a more recent machine, I get this: 100000 loops, best of 3: 8.82 usec per loop Whereas a C loop gives a 4usec per loop. > "Abc" is a bytes string in Python 2 and an Unicode string in Python 3. Sure, but why do getaddrinfo() and gethostbyname() return strings then? This means that someone using: addr = getaddrinfo(...) sendto(DATA, addr) Will pay the idna encoding upon every call to sendto(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 10:09:00 2014 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 04 Aug 2014 08:09:00 +0000 Subject: [issue22131] uuid.bytes optimization In-Reply-To: <1407117956.69.0.92579582172.issue22131@psf.upfronthosting.co.za> Message-ID: <1407139740.79.0.55419761126.issue22131@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If such changes are acceptable, here is a part of my large patch fo modernizing stdlib sources. Some microbenchmarks: $ ./python -m timeit -s "from uuid import NAMESPACE_DNS as u" -- "u.bytes" $ ./python -m timeit -s "from uuid import NAMESPACE_DNS as u" -- "u.bytes_le" $ ./python -m timeit -s "from uuid import UUID" -- "UUID(bytes_le=b'abcdefghijklmnop')" Before patch: 10000 loops, best of 3: 66.9 usec per loop 10000 loops, best of 3: 102 usec per loop 10000 loops, best of 3: 65.2 usec per loop After patch: 100000 loops, best of 3: 3.98 usec per loop 100000 loops, best of 3: 10.8 usec per loop 10000 loops, best of 3: 32.1 usec per loop ---------- nosy: +serhiy.storchaka Added file: http://bugs.python.org/file36245/modernize_uuid.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 4 10:13:20 2014 From: report at bugs.python.org (Daniel Eriksson) Date: Mon, 04 Aug 2014 08:13:20 +0000 Subject: [issue19838] test.test_pathlib.PosixPathTest.test_touch_common fails on FreeBSD with ZFS In-Reply-To: <1385801049.84.0.483097954762.issue19838@psf.upfronthosting.co.za> Message-ID: <1407140000.33.0.017889451276.issue19838@psf.upfronthosting.co.za> Daniel Eriksson added the comment: I'm no expert at all at GDB, but I will give it a go and if this is wrong I can try a lot more. Breakpoint 1, posix_utime (self=0xf00918ed8, args=0xf014459f8, kwargs=0x0) at ./Modules/posixmodule.c:4838 4838 PyObject *times = NULL; Current language: auto; currently minimal 4839 PyObject *ns = NULL; 4840 int dir_fd = DEFAULT_DIR_FD; 4841 int follow_symlinks = 1; 4843 "follow_symlinks", NULL}; 4856 memset(&path, 0, sizeof(path)); 4857 path.function_name = "utime"; 4858 memset(&utime, 0, sizeof(utime_t)); 4860 path.allow_fd = 1; 4862 if (!PyArg_ParseTupleAndKeywords(args, kwargs, 4875 if (times && (times != Py_None) && ns) { 4903 else if (ns) { 4919 utime.now = 1; 4927 if (path_and_dir_fd_invalid("utime", &path, dir_fd) || 963 if (!path->narrow && !path->wide && (dir_fd != DEFAULT_DIR_FD)) { 4928 dir_fd_and_fd_invalid("utime", dir_fd, path.fd) || 974 if ((dir_fd != DEFAULT_DIR_FD) && (fd != -1)) { 4929 fd_and_follow_symlinks_invalid("utime", path.fd, follow_symlinks)) 986 if ((fd > 0) && (!follow_symlinks)) { 4933 if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) { 4974 Py_BEGIN_ALLOW_THREADS 4977 if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD)) 4989 if (path.fd != -1) 4994 result = utime_default(&utime, path.narrow); 4800 UTIME_TO_TIMEVAL; 4801 return utimes(path, time); (gdb) print time $1 = {} 0xf01191d20