From report at bugs.python.org Sat Apr 1 00:00:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Apr 2017 04:00:20 +0000 Subject: [issue29955] logging decimal point should come from locale In-Reply-To: <1490980687.61.0.0711345645767.issue29955@psf.upfronthosting.co.za> Message-ID: <1491019220.77.0.56548608989.issue29955@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 for changing this to a period. Every time I see the comma, it seems odd to me. It also is harder to parse back into a regular float. In addition, it is hazard when people use commas and delimiters between the fields in a log file. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 00:37:19 2017 From: report at bugs.python.org (Michael Selik) Date: Sat, 01 Apr 2017 04:37:19 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher Message-ID: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> New submission from Michael Selik: Minor, but it looks like someone decided to use a defaultdict but forgot to remove the checks for whether a key exists. Creating a defaultdict(list): https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/lib2to3/btm_matcher.py#L100 Checking for the key, then initializing an empty list: https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/lib2to3/btm_matcher.py#L120 Again: https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/lib2to3/btm_matcher.py#L137 Because the ``results`` is getting returned, perhaps it'd be better to use a regular dict and dict.setdefault instead of a defaultdict. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 290955 nosy: selik priority: normal severity: normal status: open title: unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 00:42:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Apr 2017 04:42:20 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491021740.18.0.618132555704.issue29957@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Nice catch. You've got sharp eyes. Do you want to submit a pull request or have another dev work on it? ---------- nosy: +Mariatta, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 00:43:25 2017 From: report at bugs.python.org (Michael Selik) Date: Sat, 01 Apr 2017 04:43:25 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491021805.08.0.295065380493.issue29957@psf.upfronthosting.co.za> Michael Selik added the comment: I'll submit a pull request momentarily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 00:59:28 2017 From: report at bugs.python.org (Mandeep Singh) Date: Sat, 01 Apr 2017 04:59:28 +0000 Subject: [issue23033] Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard handling. In-Reply-To: <1418331823.45.0.0499057066046.issue23033@psf.upfronthosting.co.za> Message-ID: <1491022768.81.0.337824485122.issue23033@psf.upfronthosting.co.za> Changes by Mandeep Singh : ---------- pull_requests: +1120 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 00:59:45 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 01 Apr 2017 04:59:45 +0000 Subject: [issue29955] logging decimal point should come from locale In-Reply-To: <1490980687.61.0.0711345645767.issue29955@psf.upfronthosting.co.za> Message-ID: <1491022785.03.0.409551636656.issue29955@psf.upfronthosting.co.za> Xiang Zhang added the comment: Although I prefer period but such a change could break backwards compatibility so I don't know it's worth or not. Codes like `datetime.strptime('1993-04-21 08:03:00,123', '%Y-%m-%d %H:%M:%S,%f')` (usually for such a simple parse goal I like to use the builtin datetime library) would break with this change and IIUC, the datetime format could be customized for logging. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:04:09 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 01 Apr 2017 05:04:09 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491023049.33.0.309381679653.issue29957@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1121 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:11:32 2017 From: report at bugs.python.org (Michael Selik) Date: Sat, 01 Apr 2017 05:11:32 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491023492.18.0.453709147929.issue29957@psf.upfronthosting.co.za> Michael Selik added the comment: PR submitted. I also signed the contributor agreement, but the bot doesn't seem to have noticed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:18:25 2017 From: report at bugs.python.org (Zachary Ware) Date: Sat, 01 Apr 2017 05:18:25 +0000 Subject: [issue29763] test_site failing on AppVeyor In-Reply-To: <1489009179.7.0.320606146583.issue29763@psf.upfronthosting.co.za> Message-ID: <1491023905.33.0.628737267898.issue29763@psf.upfronthosting.co.za> Zachary Ware added the comment: New changeset b94d7fd4efa877d649cea9c8125c8869ffe0c32d by Zachary Ware in branch 'master': bpo-29763: Use unittest cleanup in test_site (GH-841) https://github.com/python/cpython/commit/b94d7fd4efa877d649cea9c8125c8869ffe0c32d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:19:07 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 01 Apr 2017 05:19:07 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491023947.05.0.780044381081.issue29957@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Thanks for the PR Michael :) It may take one US business day for the CLA to be received. Then a core dev has to manually update the label in GitHub. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:20:21 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 01 Apr 2017 05:20:21 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491024021.21.0.86807808467.issue29957@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: -> patch review versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:20:40 2017 From: report at bugs.python.org (Zachary Ware) Date: Sat, 01 Apr 2017 05:20:40 +0000 Subject: [issue29763] test_site failing on AppVeyor In-Reply-To: <1489009179.7.0.320606146583.issue29763@psf.upfronthosting.co.za> Message-ID: <1491024040.23.0.860540772869.issue29763@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- pull_requests: +1123 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:40:18 2017 From: report at bugs.python.org (Dominic Mayers) Date: Sat, 01 Apr 2017 05:40:18 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491025218.83.0.59957529419.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: I am a bit ashamed that I missed that. Still, the intent in the current code, the name of the parameter, the examples, etc. is that we pass the handler class. This is more than its __init__ function and less than a generic factory method. An important difference, which could become important, is that with a factory the handler type could depend on the request. As pointed out by Eric, passing the class was perhaps the intent in the early days. Now, perhaps many use it differently and pass a factory method, not a class, but it still appears as a hack that does not respect the intent. One could legitimately worry that this hack will not be supported in future versions, because it is not documented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:43:10 2017 From: report at bugs.python.org (Zachary Ware) Date: Sat, 01 Apr 2017 05:43:10 +0000 Subject: [issue29763] test_site failing on AppVeyor In-Reply-To: <1489009179.7.0.320606146583.issue29763@psf.upfronthosting.co.za> Message-ID: <1491025390.15.0.758844305831.issue29763@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- pull_requests: +1124 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:47:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:47:06 +0000 Subject: [issue20211] setup.py: do not add system header locations when cross compiling In-Reply-To: <1389308528.92.0.403642458985.issue20211@psf.upfronthosting.co.za> Message-ID: <1491025626.18.0.807567776462.issue20211@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -867 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:47:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:47:24 +0000 Subject: [issue23262] webbrowser module broken with Firefox 36+ In-Reply-To: <1421554616.48.0.911036047072.issue23262@psf.upfronthosting.co.za> Message-ID: <1491025644.11.0.688542673861.issue23262@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -903 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:47:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:47:34 +0000 Subject: [issue29335] subprocess module does not check WIFSTOPPED on SIGCHLD In-Reply-To: <1484945288.47.0.935636853008.issue29335@psf.upfronthosting.co.za> Message-ID: <1491025654.95.0.0811877184134.issue29335@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -916 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:47:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:47:44 +0000 Subject: [issue27172] Undeprecate inspect.getfullargspec() In-Reply-To: <1464767888.9.0.788649321892.issue27172@psf.upfronthosting.co.za> Message-ID: <1491025664.51.0.727371203117.issue27172@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -923 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:47:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:47:54 +0000 Subject: [issue27906] Socket accept exhaustion during high TCP traffic In-Reply-To: <1472608644.33.0.983787454696.issue27906@psf.upfronthosting.co.za> Message-ID: <1491025674.14.0.527283043258.issue27906@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:48:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:48:04 +0000 Subject: [issue26906] Special method lookup fails on uninitialized types In-Reply-To: <1462194444.45.0.679859267338.issue26906@psf.upfronthosting.co.za> Message-ID: <1491025684.77.0.0609092692784.issue26906@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -967 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:48:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:48:19 +0000 Subject: [issue27593] Deprecate sys._mercurial and create sys._git In-Reply-To: <1469223805.51.0.614192375682.issue27593@psf.upfronthosting.co.za> Message-ID: <1491025699.42.0.832166463333.issue27593@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:48:30 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:48:30 +0000 Subject: [issue29416] Path.mkdir can get into a recursive error loop In-Reply-To: <1485989192.98.0.740495069051.issue29416@psf.upfronthosting.co.za> Message-ID: <1491025710.82.0.945039772942.issue29416@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:48:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:48:41 +0000 Subject: [issue28087] macOS 12 poll syscall returns prematurely In-Reply-To: <1473637008.93.0.918549766701.issue28087@psf.upfronthosting.co.za> Message-ID: <1491025721.26.0.300119546095.issue28087@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1036 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:48:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:48:51 +0000 Subject: [issue28556] typing.py upgrades In-Reply-To: <1477756009.46.0.442279756181.issue28556@psf.upfronthosting.co.za> Message-ID: <1491025731.15.0.129749756036.issue28556@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:49:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:49:01 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491025741.3.0.470584873607.issue27867@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1038 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:49:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:49:10 +0000 Subject: [issue29572] Upgrade installers to OpenSSL 1.0.2k In-Reply-To: <1487181972.09.0.437715679754.issue29572@psf.upfronthosting.co.za> Message-ID: <1491025750.39.0.140882755923.issue29572@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:49:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:49:19 +0000 Subject: [issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error In-Reply-To: <1464060517.76.0.559675330412.issue27100@psf.upfronthosting.co.za> Message-ID: <1491025759.07.0.979881550982.issue27100@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1060 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:49:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:49:27 +0000 Subject: [issue19569] Use __attribute__((deprecated)) to warn usage of deprecated functions and macros In-Reply-To: <1384348276.8.0.185765824651.issue19569@psf.upfronthosting.co.za> Message-ID: <1491025767.33.0.902535610674.issue19569@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1085 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:49:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:49:38 +0000 Subject: [issue23903] Generate PC/python3.def by scraping headers In-Reply-To: <1428637761.13.0.348463350169.issue23903@psf.upfronthosting.co.za> Message-ID: <1491025778.59.0.469798564354.issue23903@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:49:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:49:51 +0000 Subject: [issue29571] test_re is failing when local is set for `en_IN` In-Reply-To: <1487179751.17.0.601093046575.issue29571@psf.upfronthosting.co.za> Message-ID: <1491025791.27.0.768470743749.issue29571@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:50:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:50:01 +0000 Subject: [issue28115] Use argparse for the zipfile module In-Reply-To: <1473750423.74.0.95052105427.issue28115@psf.upfronthosting.co.za> Message-ID: <1491025801.53.0.955106696344.issue28115@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 01:56:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 05:56:24 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491026184.96.0.458116565512.issue29957@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:09:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 06:09:55 +0000 Subject: [issue29931] ipaddress.ip_interface __lt__ check seems to be broken In-Reply-To: <1490697440.73.0.104969617886.issue29931@psf.upfronthosting.co.za> Message-ID: <1491026995.88.0.891654869822.issue29931@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7bd8d3e794782582a4ad1c9749424fff86802c3e by Serhiy Storchaka (s-sanjay) in branch 'master': bpo-29931 fix __lt__ check in ipaddress.ip_interface for both v4 and v6. (#879) https://github.com/python/cpython/commit/7bd8d3e794782582a4ad1c9749424fff86802c3e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:26:51 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 01 Apr 2017 06:26:51 +0000 Subject: [issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error In-Reply-To: <1464060517.76.0.559675330412.issue27100@psf.upfronthosting.co.za> Message-ID: <1491028011.28.0.0527369727844.issue27100@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: -martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:26:52 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 01 Apr 2017 06:26:52 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491028012.44.0.91359862734.issue27867@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: -martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:26:54 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 01 Apr 2017 06:26:54 +0000 Subject: [issue28556] typing.py upgrades In-Reply-To: <1477756009.46.0.442279756181.issue28556@psf.upfronthosting.co.za> Message-ID: <1491028014.46.0.825148851928.issue28556@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: -martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:29:33 2017 From: report at bugs.python.org (Zachary Ware) Date: Sat, 01 Apr 2017 06:29:33 +0000 Subject: [issue29763] test_site failing on AppVeyor In-Reply-To: <1489009179.7.0.320606146583.issue29763@psf.upfronthosting.co.za> Message-ID: <1491028173.47.0.574700500922.issue29763@psf.upfronthosting.co.za> Zachary Ware added the comment: New changeset cd815edf012dc6dd20dfeef91951270e96607616 by Zachary Ware in branch 'master': Revert "bpo-29763: Use unittest cleanup in test_site (GH-841)" (GH-942) https://github.com/python/cpython/commit/cd815edf012dc6dd20dfeef91951270e96607616 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:38:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 06:38:51 +0000 Subject: [issue29958] Use add_mutually_exclusive_group(required=True) in zipfile and tarfile CLI Message-ID: <1491028731.32.0.981459327576.issue29958@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: In the comment to the patch on issue28115 SilentGhost suggested to pass required=True to add_mutually_exclusive_group(). This makes the last "else" not needed. Proposed patch implements this idea for zipfile and tarfile. It also improves error handling when pass empty tar archive name, and adds a hyphen in "command-line". ---------- assignee: serhiy.storchaka components: Demos and Tools messages: 290966 nosy: SilentGhost, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use add_mutually_exclusive_group(required=True) in zipfile and tarfile CLI type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:40:30 2017 From: report at bugs.python.org (INADA Naoki) Date: Sat, 01 Apr 2017 06:40:30 +0000 Subject: [issue29949] sizeof set after set_merge() is doubled from 3.5 In-Reply-To: <1490897353.44.0.901506949839.issue29949@psf.upfronthosting.co.za> Message-ID: <1491028830.18.0.650859791781.issue29949@psf.upfronthosting.co.za> Changes by INADA Naoki : ---------- pull_requests: +1125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:40:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 06:40:36 +0000 Subject: [issue29958] Use add_mutually_exclusive_group(required=True) in zipfile and tarfile CLI In-Reply-To: <1491028731.32.0.981459327576.issue29958@psf.upfronthosting.co.za> Message-ID: <1491028836.43.0.0358126775778.issue29958@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1126 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 02:41:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 06:41:51 +0000 Subject: [issue28115] Use argparse for the zipfile module In-Reply-To: <1473750423.74.0.95052105427.issue28115@psf.upfronthosting.co.za> Message-ID: <1491028911.54.0.678944326189.issue28115@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Opened issue29958 for the latter patch. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 03:38:49 2017 From: report at bugs.python.org (bo qu) Date: Sat, 01 Apr 2017 07:38:49 +0000 Subject: [issue29959] re.match failed to match left square brackets as the first char Message-ID: <1491032329.85.0.64760293799.issue29959@psf.upfronthosting.co.za> New submission from bo qu: if "[" is the first char in a string, then re.match can't match any pattern from the string, but re.findall works fine details as follows: [da at namenode log]$ python3 Python 3.4.3 (default, Jun 14 2015, 14:23:40) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> cyzd="[abc]" >>> cyzd '[abc]' >>> pattern="ab(.*)" >>> pattern 'ab(.*)' >>> match=re.match(pattern, cyzd) >>> match >>> pattern=r'ab(.*)' >>> re.findall(pattern, cyzd) ['c]'] ---------- components: Regular Expressions messages: 290968 nosy: bo qu, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.match failed to match left square brackets as the first char type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 03:44:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 07:44:16 +0000 Subject: [issue29959] re.match failed to match left square brackets as the first char In-Reply-To: <1491032329.85.0.64760293799.issue29959@psf.upfronthosting.co.za> Message-ID: <1491032656.36.0.284676378832.issue29959@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: re.match() checks if the beginning of the string matches the regular expression pattern. Use re.search() if you want to find the match not at the beginning of the string. https://docs.python.org/3/library/re.html#re.match https://docs.python.org/3/library/re.html#re.search ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 04:20:27 2017 From: report at bugs.python.org (INADA Naoki) Date: Sat, 01 Apr 2017 08:20:27 +0000 Subject: [issue29949] sizeof set after set_merge() is doubled from 3.5 In-Reply-To: <1490897353.44.0.901506949839.issue29949@psf.upfronthosting.co.za> Message-ID: <1491034827.95.0.444951247739.issue29949@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset e82cf8675bacd7a03de508ed11865fc2701dcef5 by INADA Naoki in branch 'master': bpo-29949: Fix set memory usage regression (GH-943) https://github.com/python/cpython/commit/e82cf8675bacd7a03de508ed11865fc2701dcef5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 04:32:42 2017 From: report at bugs.python.org (INADA Naoki) Date: Sat, 01 Apr 2017 08:32:42 +0000 Subject: [issue29949] sizeof set after set_merge() is doubled from 3.5 In-Reply-To: <1490897353.44.0.901506949839.issue29949@psf.upfronthosting.co.za> Message-ID: <1491035562.54.0.769272268131.issue29949@psf.upfronthosting.co.za> Changes by INADA Naoki : ---------- pull_requests: +1127 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 04:51:28 2017 From: report at bugs.python.org (Vinay Sajip) Date: Sat, 01 Apr 2017 08:51:28 +0000 Subject: [issue29955] logging decimal point should come from locale In-Reply-To: <1490980687.61.0.0711345645767.issue29955@psf.upfronthosting.co.za> Message-ID: <1491036688.15.0.0787089220244.issue29955@psf.upfronthosting.co.za> Vinay Sajip added the comment: I would prefer to keep things as they are - which is conforming to the preferences expressed in ISO 8601, and preserving backwards compatibility. I agree that a period has some advantages, but I went with what the standard said as closely as I could. I'm not sure it has ever been a problem in practice - I don't remember any other issue raising it, and this functionality has been the same since around 2003 IIRC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 05:16:02 2017 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sat, 01 Apr 2017 09:16:02 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1491038162.5.0.496410558201.issue29943@psf.upfronthosting.co.za> Changes by Miro Hron?ok : ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 05:19:52 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 01 Apr 2017 09:19:52 +0000 Subject: [issue29954] multiprocessing.Pool.__exit__() calls terminate() instead of close() In-Reply-To: <1490978159.71.0.789108610011.issue29954@psf.upfronthosting.co.za> Message-ID: <1491038392.26.0.93629132136.issue29954@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I agree it's far too late. Multiple existing libraries may rely on the current behaviour. ---------- nosy: +pitrou resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 05:26:05 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 01 Apr 2017 09:26:05 +0000 Subject: [issue29782] Use __builtin_clzl for bits_in_digit if available In-Reply-To: <1489143237.03.0.753738364063.issue29782@psf.upfronthosting.co.za> Message-ID: <1491038765.6.0.232063022124.issue29782@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I don't think a 3% improvement on a micro-benchmark is worth it (this will translate into 0% improvement on real-world workloads). Are there other uses of _Py_bit_length() that show bigger benefits? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 05:37:30 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 01 Apr 2017 09:37:30 +0000 Subject: [issue28157] Document time module constants (timezone, tzname, etc.) as deprecated. In-Reply-To: <1473880626.53.0.480703935063.issue28157@psf.upfronthosting.co.za> Message-ID: <1491039450.13.0.0197944972683.issue28157@psf.upfronthosting.co.za> Cheryl Sabella added the comment: The datetime module has a separate section for strptime and strftime. Any interest in splitting those functions into their own section? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 05:41:17 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 01 Apr 2017 09:41:17 +0000 Subject: [issue28157] Document time module constants (timezone, tzname, etc.) as deprecated. In-Reply-To: <1473880626.53.0.480703935063.issue28157@psf.upfronthosting.co.za> Message-ID: <1491039677.6.0.559571334458.issue28157@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Also, back to the original title of saying timezone, altzone, etc are deprecated - there are examples in the datetime docs that use those constants. Should that be updated to tm_zone and tm_gmtoff? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 05:42:56 2017 From: report at bugs.python.org (Dominic Mayers) Date: Sat, 01 Apr 2017 09:42:56 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491039776.82.0.621868876144.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: Perhaps I should raise a separate issue, but it is related, because the current code "requires" that we define an handler class with `setup()`, `handle()` and `finish()` in its API. If you look at the actual code, there is no such requirement. We only have to pass a factory method that receives three arguments, creates a new handler instance and starts it. The handler does not have to offer any API - you don't even have to subclass the RequestHandlerBase class. I still say that it "requires" it, because it is part of the documentation and, if you don't, you could be in trouble in future versions. However, this requirement is clearly annoying, because if you have an handler for another server, you need to re-factorize the code to provide this API, which is not even used. I am sure there is no such requirement, but it's not clear at first. This is clearly not just a documentation issue. The intent in the code is the concern of the designers of the code. David and I assume that the intent is that we can provide any arbitrary factory method that receives the three arguments, creates and starts the handler, but we can be mistaken. In fact, to me this looks as a hack, especially given the parameter name, which says that we must pass the handler class. An handler class is indeed a factory method, but it is a very specific one, not the one that we want to pass if we must include extra parameters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 06:46:26 2017 From: report at bugs.python.org (Bryan G. Olson) Date: Sat, 01 Apr 2017 10:46:26 +0000 Subject: [issue29960] _random.Random state corrupted on exception Message-ID: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> New submission from Bryan G. Olson: Demo: Run the Python library's test_random.py under the Python debugger and check the generator at the start of test_shuffle(): C:\bin\Python36>python -m pdb Lib\test\test_random.py > c:\bin\python36\lib\test\test_random.py(1)() -> import unittest (Pdb) break 61 Breakpoint 1 at c:\bin\python36\lib\test\test_random.py:61 (Pdb) continue .............................> c:\bin\python36\lib\test\test_random.py(61)test_shuffle() -> shuffle = self.gen.shuffle (Pdb) list 56 # randomness source is not available. 57 urandom_mock.side_effect = NotImplementedError 58 self.test_seedargs() 59 60 def test_shuffle(self): 61 B-> shuffle = self.gen.shuffle 62 lst = [] 63 shuffle(lst) 64 self.assertEqual(lst, []) 65 lst = [37] 66 shuffle(lst) (Pdb) p self.gen.getrandbits(31) 2137781566 (Pdb) p self.gen.getrandbits(31) 2137781566 (Pdb) p self.gen.getrandbits(31) 2137781566 (Pdb) p self.gen.getrandbits(31) 2137781566 (Pdb) p self.gen.getrandbits(31) 2137781566 That's not random. Diagnosis: The order in which test functions run is the lexicographic order of their names. Thus unittest ran test_setstate_middle_arg() before running test_shuffle(). test_setstate_middle_arg() did some failed calls to _random.Random.setstate(), which raised exceptions as planned, but also trashed the state of the generator. test_random.py continues to use the same instance of _random.Random after setstate() raises exceptions. The documentation for Random.setstate() does not specify what happens to the state of the generator if setstate() raises an exception. Fortunately the generator recommended for secure applications, SystemRandom, does not implement setstate(). Solution: The fix I prefer is a small change to random_setstate() in _randommodule.c, so that it does not change the state of the generator until the operation is sure to succeed. ---------- components: Library (Lib) messages: 290977 nosy: bryangeneolson priority: normal severity: normal status: open title: _random.Random state corrupted on exception type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 06:50:49 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 01 Apr 2017 10:50:49 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491043849.46.0.0267428378321.issue29956@psf.upfronthosting.co.za> Mark Dickinson added the comment: > I suggest changing the main docs to match the existing docstring, "Return e raised to the power of x." +1 for this description. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 06:50:49 2017 From: report at bugs.python.org (Bryan G. Olson) Date: Sat, 01 Apr 2017 10:50:49 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1491043849.78.0.258349799505.issue29960@psf.upfronthosting.co.za> Bryan G. Olson added the comment: I'm going through https://docs.python.org/devguide/pullrequest.html and would like to be assigned this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 07:52:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 11:52:41 +0000 Subject: [issue29961] More compact sets and frozensets created from sets Message-ID: <1491047561.92.0.226119974337.issue29961@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: For now new set and frozenset objects can allocate 2 times larger table than necessary when are created from set or dict. For example if the size n of the original set is the power of two, resulting set will allocate the table of 4*n rather that 2*n. Up to 20% of new sets use twice more memory than necessary. Proposed patch makes set_merge() allocating the table of size n*5/3 instead of n*2. This is the minimal size necessary for inserting all elements with fill ration <=60%. $ ./python -c 'N = 6000; from sys import getsizeof; s = [getsizeof(frozenset(set(range(n)))) for n in range(N)]; print( [(n, s[n]) for n in range(N) if not n or s[n] != s[n-1]] )' Unpatched: [(0, 112), (5, 240), (8, 368), (16, 624), (32, 1136), (64, 2160), (128, 4208), (256, 8304), (512, 16496), (1024, 32880), (2048, 65648), (4096, 131184)] Patched: [(0, 112), (5, 240), (9, 368), (19, 624), (38, 1136), (77, 2160), (153, 4208), (307, 8304), (614, 16496), (1229, 32880), (2457, 65648), (4915, 131184)] ---------- components: Interpreter Core messages: 290980 nosy: inada.naoki, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: More compact sets and frozensets created from sets type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 07:53:48 2017 From: report at bugs.python.org (INADA Naoki) Date: Sat, 01 Apr 2017 11:53:48 +0000 Subject: [issue29949] sizeof set after set_merge() is doubled from 3.5 In-Reply-To: <1490897353.44.0.901506949839.issue29949@psf.upfronthosting.co.za> Message-ID: <1491047628.07.0.388003141887.issue29949@psf.upfronthosting.co.za> Changes by INADA Naoki : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 07:54:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 11:54:22 +0000 Subject: [issue29961] More compact sets and frozensets created from sets In-Reply-To: <1491047561.92.0.226119974337.issue29961@psf.upfronthosting.co.za> Message-ID: <1491047662.1.0.0473347653366.issue29961@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1128 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 07:57:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 11:57:56 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1491047876.44.0.383742658243.issue29960@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +mark.dickinson, rhettinger stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 08:02:46 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 01 Apr 2017 12:02:46 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1491048166.73.0.123816942875.issue29751@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Thank you. I've added that change. For the backporting, I think that would only be applicable to 3.6 and 3.7? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 08:22:58 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 01 Apr 2017 12:22:58 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491049378.99.0.107969787928.issue29725@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1129 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 08:27:29 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 01 Apr 2017 12:27:29 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491049649.81.0.0070749893164.issue29725@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Thank you so much for being patient with me and explaining that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 08:31:19 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 01 Apr 2017 12:31:19 +0000 Subject: [issue28157] Document time module constants (timezone, tzname, etc.) as deprecated. In-Reply-To: <1473880626.53.0.480703935063.issue28157@psf.upfronthosting.co.za> Message-ID: <1491049879.61.0.224234566902.issue28157@psf.upfronthosting.co.za> Cheryl Sabella added the comment: I think I may need to apologize. I'm new to this and was looking through the open docs issues and saw this one. Just now, I noticed that the 'assigned to' was filled in. I had only been looking at tickets that didn't have a pull request and not looking at the other values. I am so sorry if I started working on this when I shouldn't have and if I've caused more problems instead of helping. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 09:18:38 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 01 Apr 2017 13:18:38 +0000 Subject: [issue26947] Documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491052718.35.0.774189174373.issue26947@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1130 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 09:33:36 2017 From: report at bugs.python.org (svelankar) Date: Sat, 01 Apr 2017 13:33:36 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491053616.4.0.995281321431.issue29692@psf.upfronthosting.co.za> Changes by svelankar : ---------- pull_requests: +1131 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 10:29:33 2017 From: report at bugs.python.org (INADA Naoki) Date: Sat, 01 Apr 2017 14:29:33 +0000 Subject: [issue29949] sizeof set after set_merge() is doubled from 3.5 In-Reply-To: <1490897353.44.0.901506949839.issue29949@psf.upfronthosting.co.za> Message-ID: <1491056973.61.0.110847600003.issue29949@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset efde51ad54c58353f25ff80c8d30dbee82ef33a3 by INADA Naoki in branch '3.6': bpo-29949: Fix set memory usage regression (GH-945) https://github.com/python/cpython/commit/efde51ad54c58353f25ff80c8d30dbee82ef33a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 10:32:38 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 01 Apr 2017 14:32:38 +0000 Subject: [issue29962] Add math.remainder operation Message-ID: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> New submission from Mark Dickinson: IEEE 754, the C99 standard, the Decimal IBM standard and Java all support/specify a 'remainder-near' operation. Apart from being standard, this has a number of useful applications: 1. Argument reduction in numerical algorithms: it's common to want to reduce to a range [-modulus/2, modulus/2] rather than [0, modulus). 2. Particular case of the above: reduction of angles to lie in the range [-pi, pi] 3. Rounding a float x to the nearest multiple of y. This is a much-asked StackOverflow question, and the standard answer of y * round(x / y) risks introducing floating-point error and so can give incorrect results in corner cases. With a remainder operation, it's trivial to do this correctly: x - remainder(x, y) gives the closest representable float to the closest integer multiple of y to x. remainder(x, y) has some nice properties: it's *always* exactly representable (unlike x % y), it satisfies the symmetry remainder(-x, y) == -remainder(x, y), and it's periodic with period 2*y. I have a patch, and will make a PR shortly. ---------- components: Extension Modules messages: 290985 nosy: mark.dickinson priority: normal severity: normal stage: patch review status: open title: Add math.remainder operation type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 10:38:52 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 01 Apr 2017 14:38:52 +0000 Subject: [issue29962] Add math.remainder operation In-Reply-To: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> Message-ID: <1491057532.96.0.230204500335.issue29962@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- pull_requests: +1132 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 10:51:42 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 01 Apr 2017 14:51:42 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491058302.52.0.0888084803866.issue29956@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- pull_requests: +1133 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 10:53:01 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 01 Apr 2017 14:53:01 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491058381.64.0.989339649426.issue29956@psf.upfronthosting.co.za> Mark Dickinson added the comment: PR made. New wording is: """ Return e raised to the power *x*, where e = 2.718281... is the base of natural logarithms. """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 11:08:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 15:08:42 +0000 Subject: [issue29962] Add math.remainder operation In-Reply-To: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> Message-ID: <1491059322.03.0.113746946849.issue29962@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See also Decimal.remainder_near and _PyLong_DivmodNear. Shouldn't the new function be named math.remainder_near? In many cases the function that returns the nearest integer quotient is useful. See Fraction.__round__, datetime._divide_and_round, _pydecimal._div_nearest, etc. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 11:17:28 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 01 Apr 2017 15:17:28 +0000 Subject: [issue29962] Add math.remainder operation In-Reply-To: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> Message-ID: <1491059848.98.0.426976127535.issue29962@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Shouldn't the new function be named math.remainder_near? Not clear. :-) I'd prefer to keep the name that's consistent with both C and IEEE 754. (We already have plenty of naming differences between Decimal and math; attempting to reconcile them is likely futile.) FTR: IEEE 754: remainder C99: remainder IBM Decimal spec: remainder-near Java: IEEEremainder .NET: IEEERemainder ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 11:18:44 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 01 Apr 2017 15:18:44 +0000 Subject: [issue29962] Add math.remainder operation In-Reply-To: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> Message-ID: <1491059924.5.0.965467825084.issue29962@psf.upfronthosting.co.za> Mark Dickinson added the comment: > In many cases the function that returns the nearest integer quotient is useful. Agreed, but I'd like to keep the scope of this issue small for now: we're simply wrapping / implementing another C99 math.h function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 11:25:02 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 01 Apr 2017 15:25:02 +0000 Subject: [issue29962] Add math.remainder operation In-Reply-To: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> Message-ID: <1491060302.1.0.129937694527.issue29962@psf.upfronthosting.co.za> Mark Dickinson added the comment: FTR, I don't have strong opinions on the name: I could be persuaded by any of `remainder`, `remainder_near` or `ieee_remainder`. I find `ieee_remainder` somewhat more informative than `remainder_near`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 11:41:23 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Apr 2017 15:41:23 +0000 Subject: [issue29962] Add math.remainder operation In-Reply-To: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> Message-ID: <1491061283.2.0.802958661718.issue29962@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > I'd prefer to keep the name that's consistent with both C and IEEE 754. +1 Also, the decimal module names are a poor guide. Its usability has been impaired by opaque naming (i.e. needing to use quantize() when you want to round to a fixed number of places). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 11:43:39 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Apr 2017 15:43:39 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1491061419.05.0.547462783381.issue29960@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 11:53:26 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Apr 2017 15:53:26 +0000 Subject: [issue29961] More compact sets and frozensets created from sets In-Reply-To: <1491047561.92.0.226119974337.issue29961@psf.upfronthosting.co.za> Message-ID: <1491062006.6.0.951898984496.issue29961@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, I've long considered this to be a feature of set and dicts, it is the only way a user can affect sparseness. For lookup only sets, the extra sparseness is a virtue (fewer collisions). So, I would like to leave the current code in-place. With sets the goals are different from dicts. I place less value on compactness and more value on fast membership testing. And with dicts, the norm is that the looked-up key usually exists. With sets, the goal isn't looking an element known to be in the set, but more about determining whether an element is in the set. Accordingly, sets have to optimize for misses as well as hits. In the future, please assign set feature requests to me so that I don't miss them. ---------- assignee: -> rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 11:56:28 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Apr 2017 15:56:28 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491062188.1.0.652314390665.issue29957@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Rather than removing the defaultdict, I think a cleaner fix is to just remove the unnecessary LBYL. That leaves the code a little more compact, faster, and nice looking. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 12:06:01 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Apr 2017 16:06:01 +0000 Subject: [issue23033] Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard handling. In-Reply-To: <1418331823.45.0.0499057066046.issue23033@psf.upfronthosting.co.za> Message-ID: <1491062761.31.0.0517824096192.issue23033@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 12:12:12 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Apr 2017 16:12:12 +0000 Subject: [issue29897] itertools.chain behaves strangly when copied with copy.copy In-Reply-To: <1490382866.15.0.806348806156.issue29897@psf.upfronthosting.co.za> Message-ID: <1491063132.19.0.806970164781.issue29897@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Serhiy, feel free to take this in whatever direction you think is best. ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 12:16:37 2017 From: report at bugs.python.org (Dominic Mayers) Date: Sat, 01 Apr 2017 16:16:37 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491063397.42.0.79593992465.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: To sum up, David clarified that we can in fact easily pass an arbitrary factory method that creates and starts a request handler, instead of a request handler class with setup, handle and finish in its API. This could indeed be a valid reason to consider this issue resolved, but I would like to be sure that it is really a normal and supported use of the code. The only place where I can ask this is here. If I ask in StackOverflow, etc. I would get all kind of opinions and it would not be useful. To be honest, looking at the parameter name, the documentation, the examples, etc. it does not look at all a normal and supported use of the code, but who am I to decide that? If it turns out to be a normal and supported use of the code, then I will create a different issue only about the documentation, because it's not clear at all. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 12:26:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 01 Apr 2017 16:26:27 +0000 Subject: [issue29961] More compact sets and frozensets created from sets In-Reply-To: <1491047561.92.0.226119974337.issue29961@psf.upfronthosting.co.za> Message-ID: <1491063987.28.0.211385968717.issue29961@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is a program that uses 32 GB for sets. The patch could save up to 6 GB for it. I understood your arguments when you lowered the maximal fill ration from 2/3 to 60%. But in that case the fill ratio is between 15% and 30%! Isn't it too small? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 12:30:17 2017 From: report at bugs.python.org (Michael Selik) Date: Sat, 01 Apr 2017 16:30:17 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491064217.75.0.749463914333.issue29957@psf.upfronthosting.co.za> Michael Selik added the comment: Ok, I'll change the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 13:28:27 2017 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 01 Apr 2017 17:28:27 +0000 Subject: [issue28157] Document time module constants (timezone, tzname, etc.) as deprecated. In-Reply-To: <1473880626.53.0.480703935063.issue28157@psf.upfronthosting.co.za> Message-ID: <1491067707.77.0.915496568419.issue28157@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: Cheryl, There is no need to apologize. I assigned this issue to myself when I created it because I had a few ideas about refactoring the time module documentation and thought I would get to it soon. As often happens other priorities interfered. Contributions are welcome regardless of the "Assigned To" status on the issue. In fact, assigned issues may get a quicker response from the assignee than unassigned ones. When looking for simple issues to work on, look for an "easy" keyword. I did not mark this issue as "easy" because I planned to rearrange the module documentation in addition to adding a deprecation note. ---------- keywords: +3.2regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 13:32:41 2017 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 01 Apr 2017 17:32:41 +0000 Subject: [issue28157] Document time module constants (timezone, tzname, etc.) as deprecated. In-Reply-To: <1473880626.53.0.480703935063.issue28157@psf.upfronthosting.co.za> Message-ID: <1491067961.54.0.693802347398.issue28157@psf.upfronthosting.co.za> Alexander Belopolsky added the comment: > The datetime module .. Yes, the datetime module documentation can be improved, but let's keep this issue focused on the time module. Please open a new issue for the datetime module improvements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 13:34:38 2017 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 01 Apr 2017 17:34:38 +0000 Subject: [issue28157] Document time module constants (timezone, tzname, etc.) as deprecated. In-Reply-To: <1473880626.53.0.480703935063.issue28157@psf.upfronthosting.co.za> Message-ID: <1491068078.85.0.742770494666.issue28157@psf.upfronthosting.co.za> Changes by Alexander Belopolsky : ---------- keywords: -3.2regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 14:07:16 2017 From: report at bugs.python.org (Tim Peters) Date: Sat, 01 Apr 2017 18:07:16 +0000 Subject: [issue5906] Risk of confusion in multiprocessing module - daemonic processes In-Reply-To: <1241281680.28.0.426890622653.issue5906@psf.upfronthosting.co.za> Message-ID: <1491070036.87.0.897214370682.issue5906@psf.upfronthosting.co.za> Tim Peters added the comment: I'll take a crack at these ancient comments ;-) """ daemon The process?s daemon flag, a Boolean value. This must be set before start() is called. The initial value is inherited from the creating process. [1] When a process exits, it attempts to terminate all of its daemonic child processes. [2] [1] this sentence is weird: since daemonic processes are not allowed to have children, isn't this flag always False in a new Process instance ? """ Yes. I agree it's confusing; looks like it was pasted from the `threading` docs a long time ago, in which context it had a non-degenerate meaning. I've personally found this `multiprocessing` restriction (daemonic processes can't have children) to be nothing but a pain in the ass, especially since `Pool` worker processes are (although this doesn't appear to be documented) created as daemonic processes. (Note that `concurrent.futures.ProcessPoolExecutor` doesn't have this restriction.) """ [2] typo, it meant "all of its NON-daemonic child processes" instead, didn't it ? """ No, this was correct. When a process exits, it waits to join its non-daemonic children, but brutally terminates its daemonic children midstream. For example, run this: import multiprocessing as mp from time import sleep def e(tag): for i in range(10): print(tag, i) sleep(1) if __name__ == '__main__': p = mp.Process(target=e, args=("daemon",), daemon=True) q = mp.Process(target=e, args=("normal",)) p.start() q.start() sleep(5) You'll see that, after 5 seconds, the main process exits and terminates the daemonic process immediately, but waits for the non-daemonic process to finish: daemon 0 normal 0 daemon 1 normal 1 daemon 2 normal 2 daemon 3 normal 3 daemon 4 normal 4 normal 5 normal 6 normal 7 normal 8 normal 9 ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 16:00:38 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 01 Apr 2017 20:00:38 +0000 Subject: [issue28157] Document time module constants (timezone, tzname, etc.) as deprecated. In-Reply-To: <1473880626.53.0.480703935063.issue28157@psf.upfronthosting.co.za> Message-ID: <1491076838.07.0.144829765309.issue28157@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1134 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 16:30:30 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Apr 2017 20:30:30 +0000 Subject: [issue29339] Interactive: Move to same indentation level as previousline In-Reply-To: <1485039375.56.0.473197770315.issue29339@psf.upfronthosting.co.za> Message-ID: <1491078630.28.0.854779503953.issue29339@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- resolution: -> rejected stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 16:40:04 2017 From: report at bugs.python.org (R. David Murray) Date: Sat, 01 Apr 2017 20:40:04 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491079204.54.0.130621666777.issue29947@psf.upfronthosting.co.za> R. David Murray added the comment: Well, we could document it as a factory argument, and explain that the argument name is an historical artifact. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 16:50:22 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Apr 2017 20:50:22 +0000 Subject: [issue29162] pyshell.py: name 'sys' is not defined In-Reply-To: <1483579208.82.0.533923327462.issue29162@psf.upfronthosting.co.za> Message-ID: <1491079822.63.0.543204226924.issue29162@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The follow-up tkinter import issue is #29446 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 16:54:21 2017 From: report at bugs.python.org (R. David Murray) Date: Sat, 01 Apr 2017 20:54:21 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491080061.39.0.684303796833.issue29947@psf.upfronthosting.co.za> R. David Murray added the comment: Given how old socket server is, and that it doesn't actually require that API, we should probably just reword the documentation so that it is clear that RequestHandlerClass is the default Handler implementation (and that you can work with setup/handle/finish if you want to subclass it), and document what the *actual* requirements on the Handler are. We are unlikely to change socketserver's actual API at this point. I don't think there's any need for a new issue, let's just make this a documentation issue. The original title still even applies :) We will need signoff from someone with more direct interest in the socketserver module than me, but given that the "future" for the stuff socketserver handles is asyncio, I suspect the only objection we might get is "it's not worth it". But if someone wants to do the work, *I* don't see a reason to reject it. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python stage: resolved -> type: enhancement -> behavior versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 17:05:19 2017 From: report at bugs.python.org (Bryan G. Olson) Date: Sat, 01 Apr 2017 21:05:19 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1491080719.89.0.0873451962161.issue29960@psf.upfronthosting.co.za> Changes by Bryan G. Olson : ---------- pull_requests: +1135 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 17:05:47 2017 From: report at bugs.python.org (Zachary Ware) Date: Sat, 01 Apr 2017 21:05:47 +0000 Subject: [issue29763] test_site failing on AppVeyor In-Reply-To: <1489009179.7.0.320606146583.issue29763@psf.upfronthosting.co.za> Message-ID: <1491080747.15.0.196280052511.issue29763@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- pull_requests: +1136 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 18:16:24 2017 From: report at bugs.python.org (Dominic Mayers) Date: Sat, 01 Apr 2017 22:16:24 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491084984.73.0.490497235367.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: The reason why I feel we should not make it immediately a documentation issue is that I don't know how a person working on documentation could proceed ahead without a clear go ahead signal from developers. In that sense, having a documentation that says that the variable name does not reflect its intent seems tricky. It's very easy to change a variable name. It cannot possibly break the code, except for a collision, but they are easy to avoid. If we don't have the interest of developers, not even for a simple renaming, I don't see a go ahead signal in this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 18:34:22 2017 From: report at bugs.python.org (Dominic Mayers) Date: Sat, 01 Apr 2017 22:34:22 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491086062.66.0.942604041138.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: Oops, I did not realize that David was one of the developers. Well, may be this needs the attention of more than one developer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 19:13:50 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 01 Apr 2017 23:13:50 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491088430.63.0.545865076675.issue26947@psf.upfronthosting.co.za> Martin Panter added the comment: The pull request currently suggests ?All of Python?s immutable built-in objects are hashable; mutable containers (such as lists or dictionaries) are not.? This seems better wording than the original. FWIW, I would have tried ?Python?s built-in immutable objects are hashable, while mutable containers (such as lists and dictionaries) are not hashable.? ---------- nosy: +martin.panter title: Documentation improvement needed -> Hashable documentation improvement needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 19:51:40 2017 From: report at bugs.python.org (Thomas Wouters) Date: Sat, 01 Apr 2017 23:51:40 +0000 Subject: [issue29941] Confusion between asserts and Py_DEBUG In-Reply-To: <1490805708.56.0.244134698101.issue29941@psf.upfronthosting.co.za> Message-ID: <1491090700.64.0.448611188457.issue29941@psf.upfronthosting.co.za> Changes by Thomas Wouters : ---------- pull_requests: +1137 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 19:54:16 2017 From: report at bugs.python.org (Thomas Wouters) Date: Sat, 01 Apr 2017 23:54:16 +0000 Subject: [issue29941] Confusion between asserts and Py_DEBUG In-Reply-To: <1490805708.56.0.244134698101.issue29941@psf.upfronthosting.co.za> Message-ID: <1491090856.7.0.134001187638.issue29941@psf.upfronthosting.co.za> Changes by Thomas Wouters : ---------- pull_requests: +1138 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 20:19:38 2017 From: report at bugs.python.org (Eryk Sun) Date: Sun, 02 Apr 2017 00:19:38 +0000 Subject: [issue5906] Risk of confusion in multiprocessing module - daemonic processes In-Reply-To: <1241281680.28.0.426890622653.issue5906@psf.upfronthosting.co.za> Message-ID: <1491092378.34.0.455833365483.issue5906@psf.upfronthosting.co.za> Eryk Sun added the comment: > I've personally found this `multiprocessing` restriction (daemonic > processes can't have children) to be nothing but a pain in the ass To make that reliable on Windows you could create a silent-breakaway, kill-on-close Job object in each process for its daemon children. Closing the job handle would cascade terminate all descendant daemon processes in that branch of the process tree, i.e. when a process is terminated it closes the Job handle, which terminates all of its daemon children, which closes their Job handles, which terminates all of their daemon children, and so on. Non-daemons would still be orphaned when the parent is terminated. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 20:50:21 2017 From: report at bugs.python.org (Tim Peters) Date: Sun, 02 Apr 2017 00:50:21 +0000 Subject: [issue5906] Risk of confusion in multiprocessing module - daemonic processes In-Reply-To: <1241281680.28.0.426890622653.issue5906@psf.upfronthosting.co.za> Message-ID: <1491094221.34.0.396503778247.issue5906@psf.upfronthosting.co.za> Tim Peters added the comment: @Eryk, not me ;-) I find the "daemonic or not?" distinction useless for processes - it just gets in the way at times (e.g., a Pool worker dies with an assert(!) error if it tries to create its own Pool for something). I don't care about orphans either. It's one reason `concurrent.futures.ProcessPoolExecutor` is sometimes more attractive (it has no "daemon" concept, the processes it creates don't vanish midstream at sometimes surprising times, and neither do they refuse to create additional cf process pools). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 22:29:45 2017 From: report at bugs.python.org (Eryk Sun) Date: Sun, 02 Apr 2017 02:29:45 +0000 Subject: [issue5906] Risk of confusion in multiprocessing module - daemonic processes In-Reply-To: <1241281680.28.0.426890622653.issue5906@psf.upfronthosting.co.za> Message-ID: <1491100185.85.0.186036186084.issue5906@psf.upfronthosting.co.za> Eryk Sun added the comment: > e.g., a Pool worker dies with an assert(!) error if it tries to create > its own Pool for something A daemon process could create a child daemon when the OS can ensure that no orphans are left behind (e.g. call Linux prctl to set PR_SET_PDEATHSIG as SIGKILL). This would allow a pool worker to create another process pool. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 22:50:50 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Apr 2017 02:50:50 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491101450.11.0.311811062274.issue26947@psf.upfronthosting.co.za> Senthil Kumaran added the comment: New changeset 64c887ab3a400cf91bde4f0c5ef69eacc88bc5e1 by Senthil Kumaran (csabella) in branch 'master': bpo-26947: DOC: clarify wording on hashable in glossary (#948) https://github.com/python/cpython/commit/64c887ab3a400cf91bde4f0c5ef69eacc88bc5e1 ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 22:52:58 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Apr 2017 02:52:58 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491101578.36.0.599101388013.issue26947@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- pull_requests: +1139 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 22:53:02 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Apr 2017 02:53:02 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491101582.58.0.792633602518.issue26947@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- pull_requests: +1140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:00:38 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Apr 2017 03:00:38 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491102038.66.0.817118401883.issue26947@psf.upfronthosting.co.za> Senthil Kumaran added the comment: New changeset a71a3ad54d14483cfaebd8e0fb96c97c798d9e32 by Senthil Kumaran in branch '3.6': bpo-26947: DOC: clarify wording on hashable in glossary (#948) (#957) https://github.com/python/cpython/commit/a71a3ad54d14483cfaebd8e0fb96c97c798d9e32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:00:43 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Apr 2017 03:00:43 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491102043.82.0.0950867325058.issue26947@psf.upfronthosting.co.za> Senthil Kumaran added the comment: New changeset 51fc7e3d6a29de7b3142e51f8caf4d31f7ac72a0 by Senthil Kumaran in branch '3.5': bpo-26947: DOC: clarify wording on hashable in glossary (#948) (#958) https://github.com/python/cpython/commit/51fc7e3d6a29de7b3142e51f8caf4d31f7ac72a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:02:29 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Apr 2017 03:02:29 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491102149.94.0.175264051625.issue26947@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:02:43 2017 From: report at bugs.python.org (Tim Peters) Date: Sun, 02 Apr 2017 03:02:43 +0000 Subject: [issue5906] Risk of confusion in multiprocessing module - daemonic processes In-Reply-To: <1241281680.28.0.426890622653.issue5906@psf.upfronthosting.co.za> Message-ID: <1491102163.95.0.00769172578278.issue5906@psf.upfronthosting.co.za> Tim Peters added the comment: Again, I don't care about orphans. In the usual cases people are running code with no concern about what happens in case of forced termination. The only thing stopping it now is that the code goes out of its way to prevent it (or, alternatively, goes out of its way to force Pool workers to be daemonic). So, e.g., people publish recipes for replacing multiprocessing.Pool to remove this restriction, like here: http://stackoverflow.com/questions/6974695/python-process-pool-non-daemonic/8963618#8963618 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:03:20 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Apr 2017 03:03:20 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491102200.64.0.430170185025.issue26947@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I reviewed in the pull request. I agree that the wording was slightly better than the original. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:11:39 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 02 Apr 2017 03:11:39 +0000 Subject: [issue26947] Hashable documentation improvement needed In-Reply-To: <1462364495.31.0.190726094652.issue26947@psf.upfronthosting.co.za> Message-ID: <1491102699.84.0.991356303846.issue26947@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I have to admit, I did not see some of the negative votes in this ticket before merging the patch. If your is opposition is strong, please comment and suggest a better improvement over the patch. thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:20:07 2017 From: report at bugs.python.org (Thomas Wouters) Date: Sun, 02 Apr 2017 03:20:07 +0000 Subject: [issue29941] Confusion between asserts and Py_DEBUG In-Reply-To: <1490805708.56.0.244134698101.issue29941@psf.upfronthosting.co.za> Message-ID: <1491103207.99.0.0236892209613.issue29941@psf.upfronthosting.co.za> Thomas Wouters added the comment: New changeset 90e3518225bafaff01469ed48c472ae7db5686f0 by T. Wouters in branch '3.6': bpo-29941: Assert fixes (#886) (#955) https://github.com/python/cpython/commit/90e3518225bafaff01469ed48c472ae7db5686f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:20:26 2017 From: report at bugs.python.org (Thomas Wouters) Date: Sun, 02 Apr 2017 03:20:26 +0000 Subject: [issue29941] Confusion between asserts and Py_DEBUG In-Reply-To: <1490805708.56.0.244134698101.issue29941@psf.upfronthosting.co.za> Message-ID: <1491103226.63.0.365890993348.issue29941@psf.upfronthosting.co.za> Thomas Wouters added the comment: New changeset 553275d125478a6563dde7523f4f28c92f1861b4 by T. Wouters in branch '3.5': bpo-29941: Assert fixes (#886) (#956) https://github.com/python/cpython/commit/553275d125478a6563dde7523f4f28c92f1861b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 1 23:20:32 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 02 Apr 2017 03:20:32 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1491103232.81.0.283717141782.issue29751@psf.upfronthosting.co.za> Martin Panter added the comment: Underscores are only applicable to 3.6+, but the original concern about leading zeros applies to 3.5. On Git Hub I suggested dropping the details and just referring to the Lexical Analysis section for the details. FWIW here is my understanding of integer literals (with base=0): * 0x10 => hexadecimal * 0b10 => binary * 0o10 => octal (corresponds to 010 in Python 2) * 01 => illegal (avoids conflict with Python 2) * 00 => zero (special case; was treated as octal zero in Python 2) * 10 => decimal (must not start with digit 0) If you want to spell out the rules, in my mind there are four special prefixes, 0x, 0b, 0o and 0, and the default is decimal if none of those prefixes apply. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 00:05:57 2017 From: report at bugs.python.org (INADA Naoki) Date: Sun, 02 Apr 2017 04:05:57 +0000 Subject: [issue29961] More compact sets and frozensets created from sets In-Reply-To: <1491047561.92.0.226119974337.issue29961@psf.upfronthosting.co.za> Message-ID: <1491105957.4.0.947348008783.issue29961@psf.upfronthosting.co.za> INADA Naoki added the comment: I also feel set created from iterator is too large sometimes. Especially, frozenset is used for "unordered tuple" dict key sometimes. $ python -c 'N = 6000; from sys import getsizeof; s = [getsizeof(frozenset(range(n))) for n in range(N)]; print( [(n, s[n]) for n in range(N) if not n or s[n] != s[n-1]] )' [(0, 224), (5, 736), (21, 2272), (85, 8416), (341, 32992), (1365, 131296), (5461, 524512)] $ python -c 'N = 6000; from sys import getsizeof; s = [getsizeof(dict.fromkeys(range(n))) for n in range(N)]; print( [(n, s[n]) for n in range(N) if not n or s[n] != s[n-1]] )' [(0, 240), (6, 368), (11, 648), (22, 1184), (43, 2280), (86, 4704), (171, 9320), (342, 18528), (683, 36968), (1366, 73824), (2731, 147560), (5462, 295008)] set size increases by *4 each resize. This is code of set_add_entry(): if ((size_t)so->fill*5 < mask*3) return 0; return set_table_resize(so, so->used>50000 ? so->used*2 : so->used*4); If we simply replace `so->used>50000 ? so->used*2 : so->used*4` with `so->used*2`, there may be not enough room when there are some dummy entries. (used + dummy = fill). But how about replacing `*4` with `*3`? In general, load factor after resize will be changed from 12.5% ~ 25% to 16.6% ~ 33.3%. It seems OK to me. In case of no removal (e.g. constructor called with iterator), set size increases by *2 each time: >>> for n in range(3, 20): ... print(math.ceil(2 ** n * 3/5) * 3, 2 ** (n+1)) 15 16 30 32 60 64 117 128 231 256 462 512 924 1024 1845 2048 3687 4096 7374 8192 14748 16384 29493 32768 58983 65536 117966 131072 235932 262144 471861 524288 943719 1048576 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 00:15:05 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Apr 2017 04:15:05 +0000 Subject: [issue29961] More compact sets and frozensets created from sets In-Reply-To: <1491047561.92.0.226119974337.issue29961@psf.upfronthosting.co.za> Message-ID: <1491106505.11.0.509454481937.issue29961@psf.upfronthosting.co.za> Raymond Hettinger added the comment: You guys seem to have an enormous about of spare time and seem to feel to need to redesign every single thing you see. Please slow down and allow me to breathe a bit. I cannot keep up with a new "let's change x" every single day. This set object has been a successful design for a very long time. I like the balance that it has struck and do not want to constantly mess with its tuning or parameters. I working on bigger ideas at the moment that will make all of this irrelevant but can't make progress with you two proposing micro changes on an almost daily basis. Please pick some actual bugs to go fix or implement a feature request to propel the language forward. Eating up 100% of my development time is crippling my ability to contribute. And I've grown weary of revisiting old ground over and over. Please move on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 00:19:59 2017 From: report at bugs.python.org (INADA Naoki) Date: Sun, 02 Apr 2017 04:19:59 +0000 Subject: [issue29961] More compact sets and frozensets created from sets In-Reply-To: <1491106505.11.0.509454481937.issue29961@psf.upfronthosting.co.za> Message-ID: INADA Naoki added the comment: OK, sorry about bothering you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 01:30:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 05:30:14 +0000 Subject: [issue29446] Improve tkinter 'import *' situation In-Reply-To: <1486243465.34.0.0929989866435.issue29446@psf.upfronthosting.co.za> Message-ID: <1491111014.42.0.0968878133373.issue29446@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- keywords: +easy stage: test needed -> needs patch versions: +Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 01:36:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 05:36:13 +0000 Subject: [issue29961] More compact sets and frozensets created from sets In-Reply-To: <1491047561.92.0.226119974337.issue29961@psf.upfronthosting.co.za> Message-ID: <1491111373.92.0.642186356516.issue29961@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Okay. I was going to provide patches for other set's weirdness (for example a set can increase its size after removing elements), but with your reaction I see that this doesn't make sense. I wash my hands from fixing set. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 01:44:07 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 02 Apr 2017 05:44:07 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491111847.33.0.913700721302.issue29947@psf.upfronthosting.co.za> Martin Panter added the comment: By ?factory instance?, I presume you just mean a function (or class or method) that returns an appropriate object when called. (I think these are normally called ?factory functions?. Instances are objects, the things that class constructors and factories return.) What is being proposed? The best idea that I understand is hinted in . That is, to document and allow any function (not just a class or factory) to be passed as (or instead of) the RequestHandlerClass parameter. This is a significant change to the documentation and API, but I would support it, and I think it should already be supported by the implementation. The question of renaming the RequestHandlerClass parameter is a harder decision IMO. I think it would be easier to make the documentation clear that it is a misnomer and does not have to be a class. But in the long term, renaming the parameter seems nicer. If it was ?renamed?, we would first have to add a competing parameter, keep the old parameter around, consider adding deprecation warnings in 2020 when Python 2 is dead, document both parameters, decide if anything should happen when both parameters are passed, etc. Much trickier, but possible. This renaming process is similar to ?base64.encodestring? vs ?encodebytes?, but more involved. I can?t think of an example where a function or constructor parameter was renamed like this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 02:02:33 2017 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 02 Apr 2017 06:02:33 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491112953.69.0.294058546441.issue29957@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 11fa3c7cd1b151e302d4eee0369cafbaf151c8fb by Benjamin Peterson (Michael Selik) in branch 'master': bpo-29957: change LBYL key lookup to dict.setdefault (#938) https://github.com/python/cpython/commit/11fa3c7cd1b151e302d4eee0369cafbaf151c8fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 02:41:14 2017 From: report at bugs.python.org (Dominic Mayers) Date: Sun, 02 Apr 2017 06:41:14 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491115274.44.0.184259610978.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: I did not think very far when said that renaming the parameter could not possibly break the code ! Oh well ! But, renaming the parameter was not important in itself. It was to make the situation clearer and easier for those who write the documentation. Martin mentioned that it is a big change for the API. This is what I had in mind. And yes, I should have used 'factory function', not 'factory instance'. Oh well ! I am glad things are working and that we will move ahead to resolve this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 05:12:12 2017 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Sun, 02 Apr 2017 09:12:12 +0000 Subject: [issue29897] itertools.chain behaves strangly when copied with copy.copy In-Reply-To: <1491063132.19.0.806970164781.issue29897@psf.upfronthosting.co.za> Message-ID: Kristj?n Valur J?nsson added the comment: It is a tricky issue. How deep do you go?what if you are chaining several of the itertools? Seems like we're entering a semantic sinkhole here. Deepcopy would be too deep... The original copy support in these objects stems from the desire to support pickling. On 1 Apr 2017 16:12, "Raymond Hettinger" wrote: > > Raymond Hettinger added the comment: > > Serhiy, feel free to take this in whatever direction you think is best. > > ---------- > assignee: -> serhiy.storchaka > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 06:26:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 10:26:14 +0000 Subject: [issue29654] SimpleHTTPRequestHandler should support browser cache In-Reply-To: <1488057635.77.0.128841709763.issue29654@psf.upfronthosting.co.za> Message-ID: <1491128774.64.0.545031575286.issue29654@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 351adda54bed3afbbf6db7725699679e68722d7d by Serhiy Storchaka (Pierre Quentel) in branch 'master': bpo-29654 : Support If-Modified-Since HTTP header (browser cache) (#298) https://github.com/python/cpython/commit/351adda54bed3afbbf6db7725699679e68722d7d ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 06:27:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 10:27:14 +0000 Subject: [issue29654] SimpleHTTPRequestHandler should support browser cache In-Reply-To: <1488057635.77.0.128841709763.issue29654@psf.upfronthosting.co.za> Message-ID: <1491128834.0.0.0562896405392.issue29654@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your contribution Pierre. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 06:45:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 10:45:42 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491129942.57.0.106981000781.issue19225@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e8c763128fb459c5c98194e4312f31493c0f12df by Serhiy Storchaka (cocoatomo) in branch 'master': bpo-19225: Add a table of warning names and missed exception names in C API doc (#881) https://github.com/python/cpython/commit/e8c763128fb459c5c98194e4312f31493c0f12df ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 06:48:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 10:48:03 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491130083.3.0.713499171293.issue19225@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your patch Kinebuchi. Do you mind to backport it to other branches? ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 07:37:57 2017 From: report at bugs.python.org (Andre Merzky) Date: Sun, 02 Apr 2017 11:37:57 +0000 Subject: [issue26793] uuid causing thread issues when forking using os.fork py3.4+ In-Reply-To: <1460955119.44.0.370193254434.issue26793@psf.upfronthosting.co.za> Message-ID: <1491133077.67.0.876019448643.issue26793@psf.upfronthosting.co.za> Andre Merzky added the comment: This one might be related: https://bugs.python.org/issue27889 ---------- nosy: +Andre Merzky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 07:46:04 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Sun, 02 Apr 2017 11:46:04 +0000 Subject: [issue29963] Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h Message-ID: <1491133564.75.0.911637792932.issue29963@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Couldn't trace exactly when it was removed from tokenizer.c but the corresponding declaration in the header file survived. I'm not sure how to tag this small clean-up. ---------- messages: 291033 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 07:47:07 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Sun, 02 Apr 2017 11:47:07 +0000 Subject: [issue29963] Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h In-Reply-To: <1491133564.75.0.911637792932.issue29963@psf.upfronthosting.co.za> Message-ID: <1491133627.64.0.793586833563.issue29963@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- pull_requests: +1141 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 07:52:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 11:52:41 +0000 Subject: [issue29963] Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h In-Reply-To: <1491133564.75.0.911637792932.issue29963@psf.upfronthosting.co.za> Message-ID: <1491133961.85.0.757435399518.issue29963@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Good catch Jim! Seems the implementation was removed in Python 3. This is a private header, so no need to backport the change. ---------- nosy: +serhiy.storchaka stage: -> patch review type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 08:40:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 12:40:24 +0000 Subject: [issue29897] itertools.chain behaves strangly when copied with copy.copy In-Reply-To: <1490382866.15.0.806348806156.issue29897@psf.upfronthosting.co.za> Message-ID: <1491136824.63.0.430023238482.issue29897@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, this issue is tricky, and I don't have . If implement __copy__ for builtin compound iterators I would implement filter.__copy__ and map.__copy__ something like: def __copy__(self): cls, *args = self.__reduce__() return cls(*map(copy, args)) If the underlying iterators properly support copying, the copying of filter and map iterators will be successful. If they don't support copying, the copying of filter and map iterators should fail, and don't accumulate elements in the tee() object. But there are open questions. 1. This is a behavior change. What if any code depends on the current behavior? This is silly, copy(filter) and copy(map) could just return the original iterator if this is a desirable behavior. 2. Depending on the copy module in the method of the builtin type looks doubtful. Should we implement copy.copy() in C and provide a public C API? 3. If make a copying of limited depth, shouldn't we use a memo as for deepcopy() to prevent unwanted duplications? Otherwise the copied `map(func, it, it)` would behave differently from the original. This example is not so silly as looked. 4. Is it possible to implement the copying for all compound iterators? For example the copying of chain() should change the state of the original object (by using __setstate__), so that it makes copies of subiterators before using them. Perhaps all this deserves a PEP. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 08:57:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 12:57:40 +0000 Subject: [issue29169] update zlib to 1.2.11 In-Reply-To: <1483629107.49.0.982374684244.issue29169@psf.upfronthosting.co.za> Message-ID: <1491137860.5.0.733631037961.issue29169@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1029 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 09:34:53 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 02 Apr 2017 13:34:53 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491140093.97.0.250192515553.issue29947@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, the difficulty in renaming the parameter was why I suggested a doc change only. I'm not sure it it is worth it to go through a deprecation cycle for socketserver to change the name, though it certainly would be nice. Martin and I could make that decision, but it would be better to get input from other devs. And, if we make this the documentation issue, we should open a separate issue for the parameter rename. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 09:51:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 13:51:12 +0000 Subject: [issue29416] Path.mkdir can get into a recursive error loop In-Reply-To: <1485989192.98.0.740495069051.issue29416@psf.upfronthosting.co.za> Message-ID: <1491141072.42.0.935029073666.issue29416@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 09:55:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 13:55:45 +0000 Subject: [issue15083] Rewrite ElementTree tests in a cleaner and safer way In-Reply-To: <1339818759.87.0.747348787779.issue15083@psf.upfronthosting.co.za> Message-ID: <1491141345.52.0.343416940281.issue15083@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 68903b656d4e1011525a46cbd1338c6cbab83d6d by Serhiy Storchaka in branch '2.7': bpo-15083: Convert ElementTree doctests to unittests. (#906) https://github.com/python/cpython/commit/68903b656d4e1011525a46cbd1338c6cbab83d6d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 10:26:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 14:26:36 +0000 Subject: [issue15083] Rewrite ElementTree tests in a cleaner and safer way In-Reply-To: <1339818759.87.0.747348787779.issue15083@psf.upfronthosting.co.za> Message-ID: <1491143196.31.0.858580463924.issue15083@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 11:55:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 15:55:32 +0000 Subject: [issue27863] multiple issues in _elementtree module In-Reply-To: <1472141830.55.0.358852521473.issue27863@psf.upfronthosting.co.za> Message-ID: <1491148532.1.0.683493100743.issue27863@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 11:56:06 2017 From: report at bugs.python.org (Andrew Nester) Date: Sun, 02 Apr 2017 15:56:06 +0000 Subject: [issue29553] Argparser does not display closing parentheses in nested mutex groups In-Reply-To: <1487084393.73.0.392893421751.issue29553@psf.upfronthosting.co.za> Message-ID: <1491148566.09.0.0704780319771.issue29553@psf.upfronthosting.co.za> Andrew Nester added the comment: >From my perspective current behaviour is a bit frustrate that's why it would be nice to have this issue fixed, but I would say it's critic one. At the same time it doesn't introduce any BC breaking changes and kind safe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 13:37:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Apr 2017 17:37:05 +0000 Subject: [issue27863] multiple issues in _elementtree module In-Reply-To: <1472141830.55.0.358852521473.issue27863@psf.upfronthosting.co.za> Message-ID: <1491154625.71.0.197802045435.issue27863@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 9c2c42c221d7996070c0c0a2a114ab42fe3ddb9d by Serhiy Storchaka in branch '2.7': bpo-27863: Fixed multiple crashes in ElementTree. (#765) (#903) (#963) https://github.com/python/cpython/commit/9c2c42c221d7996070c0c0a2a114ab42fe3ddb9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 14:06:40 2017 From: report at bugs.python.org (Christian Heimes) Date: Sun, 02 Apr 2017 18:06:40 +0000 Subject: [issue23033] Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard handling. In-Reply-To: <1418331823.45.0.0499057066046.issue23033@psf.upfronthosting.co.za> Message-ID: <1491156400.24.0.723098905876.issue23033@psf.upfronthosting.co.za> Christian Heimes added the comment: Ned, Benjamin, are you ok with a backport to 2.7 and 3.6? Substring (aka partial) matching of wildcards is a MAY feature according to RFC 6125 https://tools.ietf.org/html/rfc6125#section-6.4.3 . They are a violation of CA/B Form's baseline requirements, so no publicaly trusted cert may contain a CN or SAN entry with a partial wildcard. Several libraries and languages do not implement the feature either. Improper wildcard matching caused a bunch of security issues and CVEs in Python. ---------- nosy: +benjamin.peterson, ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 16:19:38 2017 From: report at bugs.python.org (Paul Pinterits) Date: Sun, 02 Apr 2017 20:19:38 +0000 Subject: [issue29964] %z directive has no effect on the output of time.strptime Message-ID: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> New submission from Paul Pinterits: %z is listed as a supported directive in the python 3 documentation (https://docs.python.org/3.5/library/time.html#time.strftime), but it doesn't actually do anything: >>> from time import strptime >>> strptime('+0000', '%z') == strptime('+0200', '%z') True As far as I can tell, there aren't any footnotes saying that %z might not be supported on some platforms, like it was back in python 2. In case it matters, I'm using python 3.5.3 on linux. ---------- components: Library (Lib) messages: 291041 nosy: Paul Pinterits priority: normal severity: normal status: open title: %z directive has no effect on the output of time.strptime type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 16:57:06 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 02 Apr 2017 20:57:06 +0000 Subject: [issue29964] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1491166626.52.0.902888450105.issue29964@psf.upfronthosting.co.za> Martin Panter added the comment: Are you sure? It works for me: >>> strptime("+0200", "%z").tm_gmtoff 7200 >>> strptime("+0000", "%z").tm_gmtoff 0 The "struct_time" class is documented as a named tuple, but the time zone offset is not one of the tuple elements, so isn?t going to be checked for equality. ---------- nosy: +martin.panter resolution: -> works for me stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 17:42:18 2017 From: report at bugs.python.org (Paul Pinterits) Date: Sun, 02 Apr 2017 21:42:18 +0000 Subject: [issue29964] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1491169338.9.0.0300789819519.issue29964@psf.upfronthosting.co.za> Paul Pinterits added the comment: I see. You're right, it does make a difference. However, this behaviour is quite unexpected. Perhaps I just didn't read the docs carefully enough, but it wasn't clear to me that the time module had such half-baked support for time zones. An unsuspecting user, like me, reads the documentation on strptime, which directs you to strftime. There you read that %z is a supported directive. Along the way you've come across the conversion table, which tells you that mktime() can convert struct_time objects to timestamps. But then when you try to parse a time string, the information gets lost somewhere along the way: >>> mktime(strptime("+0000", "%z")) == mktime(strptime("+0200", "%z")) True If you visit the section about struct_time objects, you find this footnote: "Changed in version 3.3: tm_gmtoff and tm_zone attributes are available on platforms with C library supporting the corresponding fields in struct tm." But even after reading that, I'd still expect the tm_gmtoff attribute to have some sort of effect and not get silently discarded. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 18:32:57 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 02 Apr 2017 22:32:57 +0000 Subject: [issue29964] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1491172377.66.0.487676199727.issue29964@psf.upfronthosting.co.za> Martin Panter added the comment: As far as I can see, the documentation only claims that ?mktime? converts local time. If you saw a suggestion that it supports arbitrary time zones, please point it out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 18:53:05 2017 From: report at bugs.python.org (Paul Pinterits) Date: Sun, 02 Apr 2017 22:53:05 +0000 Subject: [issue29964] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1491173585.78.0.833911831101.issue29964@psf.upfronthosting.co.za> Paul Pinterits added the comment: No no, the docs are correct. This was definitely my mistake. I'm just trying to say that it's rather confusing how there's only partial support for time zones. When I saw that there is support for parsing the time zone offset, I assumed that the functions provided in the time module would be enough to solve my problem - having to rely on the datetime module to have proper time zone support caught me by surprise. It's quite counterintuitive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 19:37:38 2017 From: report at bugs.python.org (Kinebuchi Tomohiko) Date: Sun, 02 Apr 2017 23:37:38 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491176258.59.0.00613213126901.issue19225@psf.upfronthosting.co.za> Changes by Kinebuchi Tomohiko : ---------- pull_requests: +1143 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 19:42:25 2017 From: report at bugs.python.org (Kinebuchi Tomohiko) Date: Sun, 02 Apr 2017 23:42:25 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491176545.22.0.969531144226.issue19225@psf.upfronthosting.co.za> Changes by Kinebuchi Tomohiko : ---------- pull_requests: +1144 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 19:45:42 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 02 Apr 2017 23:45:42 +0000 Subject: [issue29964] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1491176742.18.0.829411318199.issue29964@psf.upfronthosting.co.za> Martin Panter added the comment: We could change this to a documentation issue if you have any suggestions to make the documentation clearer. I understand the ?time? module is mainly a wrapper or emulator of the OS?s own strptime, mktime, etc functions, which explains some of these quirks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 19:46:13 2017 From: report at bugs.python.org (Kinebuchi Tomohiko) Date: Sun, 02 Apr 2017 23:46:13 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491176773.01.0.683395298228.issue19225@psf.upfronthosting.co.za> Changes by Kinebuchi Tomohiko : ---------- pull_requests: +1145 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 21:43:30 2017 From: report at bugs.python.org (Kinebuchi Tomohiko) Date: Mon, 03 Apr 2017 01:43:30 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491183810.29.0.611219598359.issue19225@psf.upfronthosting.co.za> Kinebuchi Tomohiko added the comment: I created backporting pull requests for 2.7, 3.5 and 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 22:06:58 2017 From: report at bugs.python.org (Dominic Mayers) Date: Mon, 03 Apr 2017 02:06:58 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491185218.1.0.355910391077.issue29947@psf.upfronthosting.co.za> Changes by Dominic Mayers : Removed file: http://bugs.python.org/file46768/factorymixinclass _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 22:07:52 2017 From: report at bugs.python.org (Dominic Mayers) Date: Mon, 03 Apr 2017 02:07:52 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491185272.14.0.579028999151.issue29947@psf.upfronthosting.co.za> Changes by Dominic Mayers : ---------- keywords: +patch Added file: http://bugs.python.org/file46770/Issue29947_for_discussion.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 22:10:35 2017 From: report at bugs.python.org (Dominic Mayers) Date: Mon, 03 Apr 2017 02:10:35 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491185435.79.0.00484421808982.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: I started to look at the documentation to see what would need to be changed, assuming that we agree for a change in the API. Just for the purpose of this discussion, I created a patch that only change the comments in socketserver.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 23:37:12 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 03 Apr 2017 03:37:12 +0000 Subject: [issue29926] time.sleep ignores _thread.interrupt_main() In-Reply-To: <1490655071.78.0.435370193059.issue29926@psf.upfronthosting.co.za> Message-ID: <1491190632.79.0.531121803883.issue29926@psf.upfronthosting.co.za> Martin Panter added the comment: Hi Terry, this patch is what I imagined a fix would look like for Linux. I am not familiar with Idle (internally nor externally), so there may be improvements you can make. It works as I expected for normal blocking functions and a tight ?for? loop: it interrupts any blocking call, and triggers the usual SIGINT handler. If SIGINT has a Python handler (e.g. by default), that gets called which usually raises KeyboardInterrupt. My change has a major flaw: it seems to deadlock something if you interrupt ?input()? or ?sys.stdin.readline()?. Perhaps you might have a better clue what the problem is. With the default SIGINT handler, this is what I see in the Idle window: >>> input() # Press Ctrl+C Traceback (most recent call last): <-- cursor flashing at end of line If SIGINT is ignored, or the Python handler doesn?t raise an exception, Ctrl+C seems to have the effect of inputting a newline: >>> input() # Press Ctrl+C '' >>> sys.stdin.readline() # Press Ctrl+C '\n' ---------- keywords: +patch nosy: +martin.panter Added file: http://bugs.python.org/file46771/int-unix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 23:44:12 2017 From: report at bugs.python.org (Michael Selik) Date: Mon, 03 Apr 2017 03:44:12 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len Message-ID: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> New submission from Michael Selik: Currently, slicing a MatchObject causes an IndexError and len() a TypeError. It's natural to expect slicing and len to work on objects of a finite length that index by natural numbers. ---------- messages: 291050 nosy: selik priority: normal severity: normal status: open title: MatchObject __getitem__() should support slicing and len _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 23:44:36 2017 From: report at bugs.python.org (Michael Selik) Date: Mon, 03 Apr 2017 03:44:36 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len In-Reply-To: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> Message-ID: <1491191076.55.0.850511534774.issue29965@psf.upfronthosting.co.za> Changes by Michael Selik : ---------- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 23:47:02 2017 From: report at bugs.python.org (Michael Selik) Date: Mon, 03 Apr 2017 03:47:02 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len In-Reply-To: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> Message-ID: <1491191222.67.0.795066355753.issue29965@psf.upfronthosting.co.za> Michael Selik added the comment: This would also enable negative indexing, which currently raises "IndexError: no such group". Edit: I meant whole numbers, not natural numbers. ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 2 23:55:43 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 03 Apr 2017 03:55:43 +0000 Subject: [issue29926] time.sleep ignores _thread.interrupt_main() In-Reply-To: <1490655071.78.0.435370193059.issue29926@psf.upfronthosting.co.za> Message-ID: <1491191743.06.0.861634227941.issue29926@psf.upfronthosting.co.za> Martin Panter added the comment: BTW pthread_kill was only added to Python 3.3, so is not available for Python 2. I?m not sure what the best fix for 2.7 would be. Maybe it?s not worth it, or maybe you can find another way to a signal to the user process or its main thread without interfering with any background threads that Idle needs. But I don?t know enough about how Idle works to offer a solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 01:31:56 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 03 Apr 2017 05:31:56 +0000 Subject: [issue29863] Add a COMPACT constant to the json module In-Reply-To: <1490049199.07.0.61664177999.issue29863@psf.upfronthosting.co.za> Message-ID: <1491197516.39.0.0387658710936.issue29863@psf.upfronthosting.co.za> Berker Peksag added the comment: +1. See msg287773 for my reasoning. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 02:28:15 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Apr 2017 06:28:15 +0000 Subject: [issue29926] time.sleep ignores _thread.interrupt_main() In-Reply-To: <1490655071.78.0.435370193059.issue29926@psf.upfronthosting.co.za> Message-ID: <1491200895.42.0.111769090786.issue29926@psf.upfronthosting.co.za> Terry J. Reedy added the comment: A fix for 3.6+ will be better than nothing ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 03:39:56 2017 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 03 Apr 2017 07:39:56 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len In-Reply-To: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> Message-ID: <1491205196.0.0.207388329504.issue29965@psf.upfronthosting.co.za> Xiang Zhang added the comment: See also #24454. ---------- nosy: +serhiy.storchaka, xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 04:09:30 2017 From: report at bugs.python.org (Dominic Mayers) Date: Mon, 03 Apr 2017 08:09:30 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491206970.15.0.506154583981.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: The key point, IMHO, is that the BaseRequestHandler class is just provided as an option and its API (setup, handle and finish) is ignored by the code that we support. Some applications may have used the API, but these are details in applications. Simply, we keep BaseRequestHandler as it is so that we do not break these applications. So, yes, we should keep supporting the API, but we do not expect this API on our side. The latter is the key point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 05:16:56 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 03 Apr 2017 09:16:56 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491211016.19.0.278017792304.issue19225@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1146 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 05:20:56 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 03 Apr 2017 09:20:56 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491211256.36.0.650460591317.issue19225@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1147 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 05:49:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Apr 2017 09:49:45 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len In-Reply-To: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> Message-ID: <1491212985.21.0.161233885098.issue29965@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This has already been discussed in other issues. Adding support of indexing opened a can of worms. len() for match objects is ambiguous because of the group 0. Implementing len() will make the match object iterable, but in a way incompatible with issue9529 (because of the group 0). As for slicing and negative indexes, what is the use case? Do you know that you can get a tuple of groups by passing several arguments to group()? A regular expression usually has known set of groups, so you can just enumerate the indices (or better names) of needed groups (they can be not sequential). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 06:21:14 2017 From: report at bugs.python.org (Simon Percivall) Date: Mon, 03 Apr 2017 10:21:14 +0000 Subject: [issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs Message-ID: <1491214874.69.0.0315417893192.issue29966@psf.upfronthosting.co.za> New submission from Simon Percivall: For classes with ForwardRef annotations, typing.get_type_hints is unusable. As example, we have two files: a.py: class Base: a: 'A' class A: pass b.py: from a import Base class MyClass(Base): b: 'B' class B: pass >>> from typing import get_type_hints >>> from b import MyClass >>> get_type_hints(MyClass) # NameError What should globals/locals be here? ---------- messages: 291058 nosy: simon.percivall priority: normal severity: normal status: open title: typing.get_type_hints doesn't really work for classes with ForwardRefs versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 06:29:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 10:29:43 +0000 Subject: [issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue Message-ID: <1491215383.28.0.794511557475.issue29967@psf.upfronthosting.co.za> New submission from STINNER Victor: "make buildbottest" on "AMD64 FreeBSD 9.x 3.x" fails with: --- Cannot generate ./Include/opcode.h, python not found ! To skip re-generation of ./Include/opcode.h run or . Otherwise, set python in PATH and run configure or run . *** [./Include/opcode.h] Error code 1 --- http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/123/steps/test/logs/stdio Python has a "make touch" command which uses "hg --config extensions.touch=Tools/hg/hgtouch.py touch -v", but CPython moved to Git. ---------- components: Build messages: 291059 nosy: haypo, koobs, zach.ware priority: normal severity: normal status: open title: "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 06:33:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 10:33:07 +0000 Subject: [issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue In-Reply-To: <1491215383.28.0.794511557475.issue29967@psf.upfronthosting.co.za> Message-ID: <1491215587.41.0.503905326503.issue29967@psf.upfronthosting.co.za> STINNER Victor added the comment: See issue #23404: "'make touch' does not work with git clones of the source repository". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 06:36:46 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Mon, 03 Apr 2017 10:36:46 +0000 Subject: [issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs In-Reply-To: <1491214874.69.0.0315417893192.issue29966@psf.upfronthosting.co.za> Message-ID: <1491215806.34.0.862027001902.issue29966@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 06:40:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 10:40:27 +0000 Subject: [issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue In-Reply-To: <1491215383.28.0.794511557475.issue29967@psf.upfronthosting.co.za> Message-ID: <1491216027.68.0.256004057634.issue29967@psf.upfronthosting.co.za> STINNER Victor added the comment: According to koobs, the buildbot slave has "python2" and "python2.7" commands, but no "python". See issue #26662 for my previous complain on "python": Python build system should use "python2" or "python3", not "python". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 06:58:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 10:58:54 +0000 Subject: [issue27838] test_os.test_chown() failure on koobs-freebsd-{current, 9} In-Reply-To: <1471959658.26.0.0626423066304.issue27838@psf.upfronthosting.co.za> Message-ID: <1491217134.29.0.0919694027963.issue27838@psf.upfronthosting.co.za> STINNER Victor added the comment: Similar (or same?) failure on "x86 Gentoo Non-Debug with X 3.x": ====================================================================== ERROR: test_chown (test.test_os.ChownFileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_os.py", line 1218, in test_chown os.chown(support.TESTFN, uid, gid_1) PermissionError: [Errno 1] Operation not permitted: '@test_19914_tmp' http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%203.x/builds/542/steps/test/logs/stdio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 07:00:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 11:00:28 +0000 Subject: [issue29925] test_uuid fails on OS X Tiger In-Reply-To: <1490648746.25.0.479483160976.issue29925@psf.upfronthosting.co.za> Message-ID: <1491217228.91.0.583461085321.issue29925@psf.upfronthosting.co.za> STINNER Victor added the comment: Ping. Buildbot is still failing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 07:05:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 11:05:04 +0000 Subject: [issue29925] test_uuid fails on OS X Tiger In-Reply-To: <1490648746.25.0.479483160976.issue29925@psf.upfronthosting.co.za> Message-ID: <1491217504.1.0.698172544091.issue29925@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1148 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 07:05:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 11:05:48 +0000 Subject: [issue29925] test_uuid fails on OS X Tiger In-Reply-To: <1490648746.25.0.479483160976.issue29925@psf.upfronthosting.co.za> Message-ID: <1491217548.23.0.114699703186.issue29925@psf.upfronthosting.co.za> STINNER Victor added the comment: I proposed the most obvious fix: skip the test on OS X Tiger, see attached PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 07:19:17 2017 From: report at bugs.python.org (Garvit Khatri) Date: Mon, 03 Apr 2017 11:19:17 +0000 Subject: [issue29851] Have importlib.reload() raise ImportError when a spec can't be found In-Reply-To: <1489882196.37.0.503568145678.issue29851@psf.upfronthosting.co.za> Message-ID: <1491218357.41.0.825947516243.issue29851@psf.upfronthosting.co.za> Changes by Garvit Khatri : ---------- pull_requests: +1149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 07:27:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 11:27:54 +0000 Subject: [issue28087] macOS 12 poll syscall returns prematurely In-Reply-To: <1473637008.93.0.918549766701.issue28087@psf.upfronthosting.co.za> Message-ID: <1491218874.11.0.574449344071.issue28087@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1150 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 07:29:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 11:29:11 +0000 Subject: [issue28087] macOS 12 poll syscall returns prematurely In-Reply-To: <1473637008.93.0.918549766701.issue28087@psf.upfronthosting.co.za> Message-ID: <1491218951.47.0.305210548033.issue28087@psf.upfronthosting.co.za> STINNER Victor added the comment: test_asyncore also fails on Python 2.7 on macOS Sierra. So I proposed a backport: see my PR 973. ====================================================================== FAIL: test_handle_expt (test.test_asyncore.TestAPI_UsePoll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.7.billenstein-sierra/build/Lib/test/test_asyncore.py", line 620, in test_handle_expt self.loop_waiting_for_flag(client) File "/Users/buildbot/buildarea/2.7.billenstein-sierra/build/Lib/test/test_asyncore.py", line 519, in loop_waiting_for_flag self.fail("flag not set") AssertionError: flag not set http://buildbot.python.org/all/builders/x86-64%20Sierra%202.7/builds/2/steps/test/logs/stdio ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 08:00:40 2017 From: report at bugs.python.org (Patrick van der Leer) Date: Mon, 03 Apr 2017 12:00:40 +0000 Subject: [issue5672] Implement a way to change the python process name In-Reply-To: <1238701084.1.0.0781987214897.issue5672@psf.upfronthosting.co.za> Message-ID: <1491220840.16.0.290098689263.issue5672@psf.upfronthosting.co.za> Changes by Patrick van der Leer : ---------- nosy: +Patrick van der Leer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 08:01:56 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 03 Apr 2017 12:01:56 +0000 Subject: [issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue In-Reply-To: <1491215383.28.0.794511557475.issue29967@psf.upfronthosting.co.za> Message-ID: <1491220916.17.0.228910289751.issue29967@psf.upfronthosting.co.za> Martin Panter added the comment: I think this is the same underlying problem as Issue 23404. Either we get ?make touch? working without Mercurial, or we use some other mechanism to either disable regeneration by default (my preference), or disable regeneration by explicit request (possible compromise with Nick who liked the automatic regeneration because it saved him remembering other commands: ). ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 08:49:25 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Mon, 03 Apr 2017 12:49:25 +0000 Subject: [issue29968] Document that no characters are allowed to proceed \ in explicit line joining Message-ID: <1491223765.12.0.65807116216.issue29968@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: After looking through the code, the tokenizer only allows a new line character to proceed `\` in explicit line joining [1]. The Devguide section on it [2] actually states many of the limitations of using `\` but not directly that nothing is allowed after it (it does have a remark on comments). Would it be a good idea to amend it to state that no characters are allowed after `\`? [1]: https://github.com/python/cpython/blob/734125938d4653459593ebd28a0aec086efb1f27/Parser/tokenizer.c#L1847 [2]: https://docs.python.org/3/reference/lexical_analysis.html#explicit-line-joining ---------- assignee: docs at python components: Documentation messages: 291067 nosy: Jim Fasarakis-Hilliard, docs at python priority: normal severity: normal status: open title: Document that no characters are allowed to proceed \ in explicit line joining _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 08:57:04 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Mon, 03 Apr 2017 12:57:04 +0000 Subject: [issue29968] Document that no characters are allowed to proceed \ in explicit line joining In-Reply-To: <1491223765.12.0.65807116216.issue29968@psf.upfronthosting.co.za> Message-ID: <1491224224.93.0.0642389600066.issue29968@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: Alternatively, stripping all white-space that proceed `\` could be considered if it seems like a good idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 09:06:45 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 03 Apr 2017 13:06:45 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1491224805.6.0.0500436395099.issue23404@psf.upfronthosting.co.za> Martin Panter added the comment: I had mainly been using my boot-flag.patch with BSD Make (bmake) rather than Gnu Make. It seems I was relying on a bug in BSD Make that merges escaped newlines in command lines, despite Posix and Gnu Make. Anyway, Chi?s fix seems appropriate. I am posting the patches I used for 3.5 and 2.7, in case others are interested. The 3.5 one would also need Chi?s fix merging the ?_freeze_importlib? line. It may be possible to have the configure script adjust the default for the BOOT flag rather than setting GENERATED_COMMENT. But the side effect would be disabling regeneration of additional things (e.g. that aren?t specifically broken with cross compilation. Anyway my preference was to stop automatically regenerating files, and to keep the build system as simple as practical without hacks like the BOOT="#" flag. ---------- Added file: http://bugs.python.org/file46772/boot-flag.py3.5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 09:06:55 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 03 Apr 2017 13:06:55 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1491224815.02.0.172523749512.issue23404@psf.upfronthosting.co.za> Changes by Martin Panter : Added file: http://bugs.python.org/file46773/boot-flag.py2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 09:48:45 2017 From: report at bugs.python.org (Angus Hollands) Date: Mon, 03 Apr 2017 13:48:45 +0000 Subject: [issue29969] Typo in decimal error message Message-ID: <1491227325.12.0.305742350956.issue29969@psf.upfronthosting.co.za> New submission from Angus Hollands: When passing an object that fails Py_FloatCheck, the error message raised reads "argument must be int of float", rather than "argument must be int or float" ---------- components: Extension Modules messages: 291070 nosy: Angus Hollands priority: normal severity: normal status: open title: Typo in decimal error message type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 09:55:54 2017 From: report at bugs.python.org (Angus Hollands) Date: Mon, 03 Apr 2017 13:55:54 +0000 Subject: [issue29969] Typo in decimal error message In-Reply-To: <1491227325.12.0.305742350956.issue29969@psf.upfronthosting.co.za> Message-ID: <1491227754.13.0.442009160984.issue29969@psf.upfronthosting.co.za> Changes by Angus Hollands : ---------- pull_requests: +1151 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 10:10:15 2017 From: report at bugs.python.org (kyuupichan) Date: Mon, 03 Apr 2017 14:10:15 +0000 Subject: [issue29970] Severe open file leakage running asyncio SSL server Message-ID: <1491228615.05.0.224246839796.issue29970@psf.upfronthosting.co.za> New submission from kyuupichan: Original report at old repo here: https://github.com/python/asyncio/issues/483 There this is reported fixed by https://github.com/python/cpython/pull/480 I wish to report that whilst the above patch might have a small positive effect, it is far from solving the actual issue. Several users report eventual exhaustion of the open file resource running SSL asyncio servers. Here are graphs provided by a friend running my ElectrumX server software, first accepting SSL connections and the second accepting TCP connections only. Both of the servers were monkey-patched with the pull-480 fix above, so this is evidence it isn't solving the issue. http://imgur.com/a/cWnSu As you can see, the TCP server (which has far less connections; most users use SSL) has no leaked file handles, whereas the SSL server has over 300. This becomes an easy denial of service vector against asyncio servers. One way to trigger this (though I doubt it explains the numbers above) is simply to connect to the SSL server from telnet, and do nothing. asyncio doesn't time you out, the telnet session seems to sit there forever, and the open file resources are lost in the SSL handshake stage until the remote host kindly decides to disconnect. I suspect these resource issues all revolve around the SSL handshake process, certainly at the opening of a connection, but also perhaps when closing. As the application author I am not informed by asyncio of a potential connection until the initial handshake is complete, so I cannot do anything to close these phantom socket connections. I have to rely on asyncio to be properly handling DoS issues and it is not currently doing so robustly. ---------- components: asyncio messages: 291071 nosy: kyuupichan, yselivanov priority: normal severity: normal status: open title: Severe open file leakage running asyncio SSL server type: resource usage versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 10:43:38 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 03 Apr 2017 14:43:38 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows Message-ID: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> New submission from Antoine Pitrou: On Windows, Lock.acquire() (and other synchronization primitives derived from it, such as queue.Queue) cannot be interrupted with Ctrl-C, which makes it difficult to interrupt a process waiting on such a primitive. Judging by the code in Python/_thread_nt.h, it should be relatively easy to add such support for the "legacy" semaphore-based implementation (by using WaitForMultipleObjects instead of WaitForSingleObject), but it would be much hairier for the new condition variable-based implementation. Of course, many other library calls are prone to this limitation (not being interruptible with Ctrl-C on Windows). See https://github.com/dask/dask/pull/2144#issuecomment-290556996 for original report. ---------- components: Library (Lib), Windows messages: 291072 nosy: kristjan.jonsson, paul.moore, pitrou, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Lock.acquire() not interruptible on Windows type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 11:14:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 15:14:20 +0000 Subject: [issue29972] Skip tests known to fail on AIX Message-ID: <1491232460.4.0.914311825782.issue29972@psf.upfronthosting.co.za> New submission from STINNER Victor: Extract of David Edelsohn's email: """ The testsuite failures on AIX are issues with the AIX kernel and C Library, often corner cases. I don't want to get into arguments about the POSIX standard. Some of the issues are actual conformance issues and some are different interpretations of the standard. Addressing the problems in AIX is a slow process. If the failing testcases are too annoying, I would recommend to skip the testcases. Despite the testsuite failures, Python builds and runs on AIX for the vast majority of users and applications. I don't see the benefit in dropping support for a platform that functions because it doesn't fully pass the testsuite. """ ref: https://mail.python.org/pipermail/python-dev/2017-April/147748.html I agree, so let's skip tests known to fail on AIX! ---------- components: Tests messages: 291073 nosy: haypo priority: normal severity: normal status: open title: Skip tests known to fail on AIX versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 11:23:02 2017 From: report at bugs.python.org (Eric N. Vander Weele) Date: Mon, 03 Apr 2017 15:23:02 +0000 Subject: [issue29972] Skip tests known to fail on AIX In-Reply-To: <1491232460.4.0.914311825782.issue29972@psf.upfronthosting.co.za> Message-ID: <1491232982.39.0.101694265011.issue29972@psf.upfronthosting.co.za> Changes by Eric N. Vander Weele : ---------- nosy: +ericvw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 11:24:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 15:24:49 +0000 Subject: [issue29972] Skip tests known to fail on AIX In-Reply-To: <1491232460.4.0.914311825782.issue29972@psf.upfronthosting.co.za> Message-ID: <1491233089.3.0.264544147329.issue29972@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1152 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 11:25:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 15:25:35 +0000 Subject: [issue29972] Skip tests known to fail on AIX In-Reply-To: <1491232460.4.0.914311825782.issue29972@psf.upfronthosting.co.za> Message-ID: <1491233135.57.0.834638526343.issue29972@psf.upfronthosting.co.za> STINNER Victor added the comment: See also https://github.com/python/cpython/pull/978 which should fix one unit test of test_ssl. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 11:34:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 15:34:14 +0000 Subject: [issue29973] Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment Message-ID: <1491233654.37.0.108307382934.issue29973@psf.upfronthosting.co.za> New submission from STINNER Victor: https://travis-ci.org/python/cpython/jobs/218107336 CPython: master branch Sphinx 1.5.4 make[1]: Entering directory `/home/travis/build/python/cpython/Doc' ./venv/bin/python -m sphinx -b suspicious -d build/doctrees -D latex_elements.papersize= -q -W . build/suspicious Exception occurred: File "/home/travis/virtualenv/python3.6.0/lib/python3.6/site-packages/sphinx/domains/python.py", line 317, in before_content if prefix: UnboundLocalError: local variable 'prefix' referenced before assignment ---------- assignee: docs at python components: Documentation, Tests messages: 291075 nosy: docs at python, haypo priority: normal severity: normal status: open title: Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 11:44:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Apr 2017 15:44:19 +0000 Subject: [issue29973] Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment In-Reply-To: <1491233654.37.0.108307382934.issue29973@psf.upfronthosting.co.za> Message-ID: <1491234259.02.0.793047127359.issue29973@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This already is fixed in mainstream. https://github.com/sphinx-doc/sphinx/issues/3597 Sphinx 1.5.5 will be released soon. https://github.com/sphinx-doc/sphinx/issues/3598 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 12:07:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 16:07:45 +0000 Subject: [issue29973] Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment In-Reply-To: <1491233654.37.0.108307382934.issue29973@psf.upfronthosting.co.za> Message-ID: <1491235665.76.0.0601650711045.issue29973@psf.upfronthosting.co.za> STINNER Victor added the comment: https://pypi.org/project/Sphinx/1.5.5/ has been released. How can I schedule a recheck on Travis CI on PRs where the docs job failed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 12:11:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 16:11:24 +0000 Subject: [issue28087] macOS 12 poll syscall returns prematurely In-Reply-To: <1473637008.93.0.918549766701.issue28087@psf.upfronthosting.co.za> Message-ID: <1491235884.32.0.722556578972.issue28087@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 23d6eb656ec29140fcca1c9261b7953e2312b171 by Victor Stinner in branch '2.7': bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. (#462) (#973) https://github.com/python/cpython/commit/23d6eb656ec29140fcca1c9261b7953e2312b171 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 12:13:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 16:13:56 +0000 Subject: [issue29973] Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment In-Reply-To: <1491233654.37.0.108307382934.issue29973@psf.upfronthosting.co.za> Message-ID: <1491236036.96.0.989795007993.issue29973@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, Zachary Were "restarted the docs job on most of the blocked PRs". So I close this issue. That one was hopefully quickly fixed :-) ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 12:21:53 2017 From: report at bugs.python.org (Stefan Krah) Date: Mon, 03 Apr 2017 16:21:53 +0000 Subject: [issue29969] Typo in decimal error message In-Reply-To: <1491227325.12.0.305742350956.issue29969@psf.upfronthosting.co.za> Message-ID: <1491236513.2.0.636498592417.issue29969@psf.upfronthosting.co.za> Stefan Krah added the comment: Merged, thank you. ---------- assignee: -> skrah nosy: +skrah resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 12:35:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Apr 2017 16:35:51 +0000 Subject: [issue29851] Have importlib.reload() raise ImportError when a spec can't be found In-Reply-To: <1489882196.37.0.503568145678.issue29851@psf.upfronthosting.co.za> Message-ID: <1491237351.55.0.423731833933.issue29851@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Wouldn't ModuleNotFoundError be more appropriate? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 12:41:21 2017 From: report at bugs.python.org (Thomas Wouters) Date: Mon, 03 Apr 2017 16:41:21 +0000 Subject: [issue29941] Confusion between asserts and Py_DEBUG In-Reply-To: <1490805708.56.0.244134698101.issue29941@psf.upfronthosting.co.za> Message-ID: <1491237681.96.0.211618168786.issue29941@psf.upfronthosting.co.za> Changes by Thomas Wouters : ---------- pull_requests: +1153 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 12:50:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Apr 2017 16:50:04 +0000 Subject: [issue28087] macOS 12 poll syscall returns prematurely In-Reply-To: <1473637008.93.0.918549766701.issue28087@psf.upfronthosting.co.za> Message-ID: <1491238204.84.0.196511717929.issue28087@psf.upfronthosting.co.za> STINNER Victor added the comment: Ah! Python 2.7 tests succeeded on Sierra! http://buildbot.python.org/all/builders/x86-64%20Sierra%202.7/builds/3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 13:03:54 2017 From: report at bugs.python.org (Josh Rosenberg) Date: Mon, 03 Apr 2017 17:03:54 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1491239034.71.0.525780091714.issue29971@psf.upfronthosting.co.za> Changes by Josh Rosenberg : ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 13:11:06 2017 From: report at bugs.python.org (Michael Sghaier) Date: Mon, 03 Apr 2017 17:11:06 +0000 Subject: [issue29406] asyncio SSL contexts leak sockets after calling close with certain Apache servers In-Reply-To: <1485909545.04.0.650924943503.issue29406@psf.upfronthosting.co.za> Message-ID: <1491239466.49.0.514642700596.issue29406@psf.upfronthosting.co.za> Changes by Michael Sghaier : ---------- pull_requests: +1154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 13:14:18 2017 From: report at bugs.python.org (Thomas Wouters) Date: Mon, 03 Apr 2017 17:14:18 +0000 Subject: [issue29941] Confusion between asserts and Py_DEBUG In-Reply-To: <1490805708.56.0.244134698101.issue29941@psf.upfronthosting.co.za> Message-ID: <1491239658.05.0.348439629455.issue29941@psf.upfronthosting.co.za> Thomas Wouters added the comment: PR #980 adds a configure flag (--with-assertions), defaulting to the old behaviour (no assertions by default, except when --with-pydebug is passed). I would like to backport that to (at least) 3.6 so that we can set up a buildbot with it, to prevent regressions. Opinions on that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 13:28:57 2017 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 03 Apr 2017 17:28:57 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len In-Reply-To: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> Message-ID: <1491240537.16.0.0231411629713.issue29965@psf.upfronthosting.co.za> Eric V. Smith added the comment: Short of a compelling use case, I suggest we reject this enhancement request. len() was deliberately not added in #24454. It's not like any normal code would be iterating over match groups. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 13:32:43 2017 From: report at bugs.python.org (Mathias Rav) Date: Mon, 03 Apr 2017 17:32:43 +0000 Subject: [issue29974] typing.TYPE_CHECKING doc example is incorrect Message-ID: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> New submission from Mathias Rav: The documentation of typing.TYPE_CHECKING has an example (introduced in issue #26141) that would lead to NameError at runtime. The example shows how to limit the import of "expensive_mod" to type checkers, but then goes on to use "expensive_mod.some_type" in a type annotation that is evaluated at runtime ("local_var: expensive_mod.some_type"). The use case of TYPE_CHECKING is probably meant for type annotations placed in comments, e.g. "local_var # type: expensive_mod.some_type". ---------- assignee: docs at python components: Documentation messages: 291085 nosy: docs at python, rav priority: normal severity: normal status: open title: typing.TYPE_CHECKING doc example is incorrect type: enhancement versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 13:33:16 2017 From: report at bugs.python.org (Mathias Rav) Date: Mon, 03 Apr 2017 17:33:16 +0000 Subject: [issue29974] typing.TYPE_CHECKING doc example is incorrect In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1491240796.51.0.109430967793.issue29974@psf.upfronthosting.co.za> Changes by Mathias Rav : ---------- pull_requests: +1155 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 13:49:36 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 03 Apr 2017 17:49:36 +0000 Subject: [issue29964] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1491241776.97.0.357486862196.issue29964@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, that's exactly right. 'time' is a low-level os-function wrapper, and inherits many of the deficiencies of the platform. datetime attempts to be a more comprehensive, portable solution. (But even it has its quirks...timezones are *hard*.) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 13:58:40 2017 From: report at bugs.python.org (Michael Selik) Date: Mon, 03 Apr 2017 17:58:40 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len In-Reply-To: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> Message-ID: <1491242320.87.0.218566357848.issue29965@psf.upfronthosting.co.za> Michael Selik added the comment: Yesterday I wanted to do a destructuring bind on a slice of groups in a finditer. Similar situation to the use case of Issue #24454. It might not be "normal code" but I end up in that situation every month or so when parsing semi-structured documents. I found myself wishing for a mapping-destructuring bind, but that's another story. I haven't read the full discussion of ``len`` on MatchObject yet, but I tentatively agree with Brandon Rhodes' comment in Issue #19536: "My retort is that concentric groups can happen anyway: that Group Zero, holding the entire match, is not really as special as the newcomer might suspect, because you can always wind up with groups inside of other groups; it is simply part of the semantics of regular expressions that groups might overlap or might contain one another ..." @Serhiy, I was unaware of the feature of passing several arguments to groups. Unfortunately, the regex pattern I was using had a very large set of groups. A slice would have been particularly elegant. Passing several arguments to mo.groups() will be helpful, but still more awkward than a slice. Perhaps it is a can of worms, but I was pleased to see indexing available and was disappointed not to find the typically supported corresponding features. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 14:09:54 2017 From: report at bugs.python.org (Michael Selik) Date: Mon, 03 Apr 2017 18:09:54 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len In-Reply-To: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> Message-ID: <1491242994.47.0.565392745622.issue29965@psf.upfronthosting.co.za> Michael Selik added the comment: Sorry, it looks like I got the issue number wrong. My comparison should not have been with #24454, but instead with an issue I can't locate at the moment. Reproducing the example: for g0, g1, g2 in re.finditer(r'(\d+)/(\d+)', 'Is 1/3 the same as 2/6?'): ratio = Fraction(int(g1), int(g2)) Better: for mo in re.finditer(r'(\d+)/(\d+)', 'Is 1/3 the same as 2/6?'): ratio = Fraction(*map(int, mo[1:3])) The map in the last one isn't very pretty, but I hope it illustrates the gist of what I'd like to do for a much larger pattern with many capture groups. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 14:19:01 2017 From: report at bugs.python.org (Eryk Sun) Date: Mon, 03 Apr 2017 18:19:01 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1491243541.78.0.32674274201.issue29971@psf.upfronthosting.co.za> Eryk Sun added the comment: >From the linked issue: > proc.send_signal(CTRL_C_EVENT) raises the KeyboardInterrupt > in both the original and subprocess on Windows GenerateConsoleCtrlEvent takes process group IDs, so it should have been used to implement os.killpg, not os.kill. If you call it on a process ID that's attached to the console that isn't also a group ID (i.e. the group leader), then it defaults to group 0, which includes every process that's attached to the console. Popen.send_signal should only send CTRL_C_EVENT or CTRL_BREAK_EVENT when the child process was created with CREATE_NEW_PROCESS_GROUP in its creationflags. Also, since kill() falls back on TerminateProcess, for added safety send_signal also needs to call poll() instead of using returncode because Windows reuses process IDs. Also, to avoid confusion, it should be noted that CTRL_C_EVENT will be ignored by a process in a new group unless said process manually enables Ctrl+C handling by calling SetConsoleCtrlHandler(NULL, FALSE). This setting will be inherited by child processes. In the long run I think it would be better to clarify this by implementing os.killpg on Windows using GenerateConsoleCtrlEvent, with support for CTRL_C_EVENT, CTRL_BREAK_EVENT, SIGINT, and SIGBREAK. Deprecate using os.kill to send console control events. There is no Windows API to send a console control event to a particular process ID. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 14:45:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Apr 2017 18:45:02 +0000 Subject: [issue29965] MatchObject __getitem__() should support slicing and len In-Reply-To: <1491191052.84.0.321633971824.issue29965@psf.upfronthosting.co.za> Message-ID: <1491245102.02.0.87914420765.issue29965@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: You can use mo.group(1, 2). If you need to slice arbitrary groups, you can slice the result of the groups() method (which is just a tuple). The re module is already complex, and let use existing API rather than add the new one. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 14:56:13 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 Apr 2017 18:56:13 +0000 Subject: [issue29897] itertools.chain behaves strangly when copied with copy.copy In-Reply-To: <1490382866.15.0.806348806156.issue29897@psf.upfronthosting.co.za> Message-ID: <1491245773.24.0.163327954131.issue29897@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > Perhaps all this deserves a PEP. If Serhiy and Kristj?n are on a course of action, that will suffice. Copying iterators is an esoteric endeavor of interest to very few users (no one has even noticed until now). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 14:58:10 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 Apr 2017 18:58:10 +0000 Subject: [issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error In-Reply-To: <1464060517.76.0.559675330412.issue27100@psf.upfronthosting.co.za> Message-ID: <1491245890.2.0.41678428488.issue27100@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Can this be closed now? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 16:39:03 2017 From: report at bugs.python.org (Brett Cannon) Date: Mon, 03 Apr 2017 20:39:03 +0000 Subject: [issue29964] %z directive has no effect on the output of time.strptime In-Reply-To: <1491164378.66.0.775281160942.issue29964@psf.upfronthosting.co.za> Message-ID: <1491251943.82.0.735178946934.issue29964@psf.upfronthosting.co.za> Brett Cannon added the comment: There's actually a footnote pointing out that %z is not supported by all libc implementations: https://docs.python.org/3/library/time.html#id2. Probably adding a note for %z in the strftime() table would be good. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 18:11:52 2017 From: report at bugs.python.org (Eryk Sun) Date: Mon, 03 Apr 2017 22:11:52 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1491257512.68.0.513647768162.issue29971@psf.upfronthosting.co.za> Eryk Sun added the comment: Alternatively we could use the SleepEx and WaitFor*Ex functions with alertable waits (i.e. using APCs) instead of the SIGINT Event. This avoids having to replace all single-object waits with multiple-object waits, and would even allow calling SleepEx in pysleep. That said, issue 29871 proposes to switch to the condition variable and SRW lock implementation, so first it needs to be decided whether to continue to use kernel waits or switch to conditional variables. Or maybe refactor to use condition variables in performance-critical code and otherwise use kernel waits, if that makes sense. An orthogonal improvement is to have the signal handler call CancelSynchronousIo. This would entail handling ERROR_OPERATION_ABORTED in _winapi Readfile, WriteFile, and WaitNamedPipe by calling PyErr_CheckSignals. Also in _Py_Read and _Py_Write, if errno is EINVAL and the last Windows error is ERROR_OPERATION_ABORTED, it could manually set errno to EINTR. Winsock waits (e.g. select) will remain a problem in any case. Winsock uses alertable waits, so a queued user-mode APC will be executed while it's waiting. But then it just resumes its original wait instead of failing with WSAEINTR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 19:25:10 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 03 Apr 2017 23:25:10 +0000 Subject: [issue29968] Document that no characters are allowed to proceed \ in explicit line joining In-Reply-To: <1491223765.12.0.65807116216.issue29968@psf.upfronthosting.co.za> Message-ID: <1491261910.66.0.0873196552603.issue29968@psf.upfronthosting.co.za> R. David Murray added the comment: I think you meant "the language reference" rather than "the devguide". The sentence about the comment is redundant with the preceding line that says that the thing that results in a join is a physical line that ends with a backslash ("that is not part of..."), which is a definitive statement that no characters may follow it. So, I don't see any doc bug here, unless we want to delete that redundant statement about the comment because it is confusing. But I doubt we want to do that, as some people will think that a comment is "the same as there being nothing" (despite the statement about "physical line") which it is not. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 19:26:03 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 03 Apr 2017 23:26:03 +0000 Subject: [issue29968] Document that no characters are allowed to proceed \ in explicit line joining In-Reply-To: <1491223765.12.0.65807116216.issue29968@psf.upfronthosting.co.za> Message-ID: <1491261963.48.0.70953147055.issue29968@psf.upfronthosting.co.za> R. David Murray added the comment: I also have no idea what your comment about stripping white space is in reference to ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 21:36:23 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 04 Apr 2017 01:36:23 +0000 Subject: [issue29974] typing.TYPE_CHECKING doc example is incorrect In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1491269783.47.0.879641351143.issue29974@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- stage: -> patch review type: enhancement -> behavior versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 22:32:59 2017 From: report at bugs.python.org (Martin Panter) Date: Tue, 04 Apr 2017 02:32:59 +0000 Subject: [issue29968] Document that no characters are allowed to proceed \ in explicit line joining In-Reply-To: <1491223765.12.0.65807116216.issue29968@psf.upfronthosting.co.za> Message-ID: <1491273179.08.0.850128458022.issue29968@psf.upfronthosting.co.za> Martin Panter added the comment: I think he means make something like the following legal, where dots (.) indicate space characters: a.=.\. ....b At the moment it is a SyntaxError: >>> a = \ File "", line 1 a = \ ^ SyntaxError: unexpected character after line continuation character I don?t think it is worthwhile changing that. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 22:36:41 2017 From: report at bugs.python.org (Namjun Kim) Date: Tue, 04 Apr 2017 02:36:41 +0000 Subject: [issue29975] Issue in extending documentation Message-ID: <1491273401.15.0.69165837027.issue29975@psf.upfronthosting.co.za> New submission from Namjun Kim: https://docs.python.org/3.7/extending/extending.html "Should it become a dangling pointer, C code which raises the exception could cause a core dump or other unintended side effects." The typo error in this sentence. "If it become a dangling pointer, C code which raises the exception could cause a core dump or other unintended side effects." fix the typo error. ---------- assignee: docs at python components: Documentation messages: 291098 nosy: Namjun Kim, docs at python priority: normal severity: normal status: open title: Issue in extending documentation versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 3 23:12:35 2017 From: report at bugs.python.org (Martin Panter) Date: Tue, 04 Apr 2017 03:12:35 +0000 Subject: [issue29975] Issue in extending documentation In-Reply-To: <1491273401.15.0.69165837027.issue29975@psf.upfronthosting.co.za> Message-ID: <1491275555.14.0.520609541028.issue29975@psf.upfronthosting.co.za> Martin Panter added the comment: FWIW I don?t see any error in the first quote. ?Should X happen, Y happens? is valid English. Though I admit this kind of grammar is not used that often. If it is too hard to understand, it should be okay to change it to ?If it becomes a danging pointer, . . .?. [become ? becomes] ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 00:15:21 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Apr 2017 04:15:21 +0000 Subject: [issue29975] Issue in extending documentation In-Reply-To: <1491273401.15.0.69165837027.issue29975@psf.upfronthosting.co.za> Message-ID: <1491279321.93.0.782011843648.issue29975@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1156 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 00:54:17 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 04:54:17 +0000 Subject: [issue29976] urllib.parse clarify what ' ' in schemes mean Message-ID: <1491281657.78.0.713830439385.issue29976@psf.upfronthosting.co.za> New submission from Senthil Kumaran: urllib.parse has the following information in this module. ``` # A classification of schemes ('' means apply by default) uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap', 'wais', 'file', 'https', 'shttp', 'mms', 'prospero', 'rtsp', 'rtspu', '', 'sftp', 'svn', 'svn+ssh', 'ws', 'wss'] ``` Note the '' in the list. 1) First it needs to be first one for easy identification. 2) It needs to be clarified. '' means apply by default does not help the reader. ---------- assignee: orsenthil messages: 291100 nosy: orsenthil priority: normal severity: normal stage: needs patch status: open title: urllib.parse clarify what ' ' in schemes mean type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 00:56:37 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 04 Apr 2017 04:56:37 +0000 Subject: [issue29974] typing.TYPE_CHECKING doc example is incorrect In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1491281797.12.0.0022375223878.issue29974@psf.upfronthosting.co.za> Jelle Zijlstra added the comment: The example is actually correct; I just confirmed by running it in my shell. Type annotations on local variables are not evaluated at runtime; see PEP 526. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 00:57:31 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 04:57:31 +0000 Subject: [issue29976] urllib.parse clarify what ' ' in schemes mean In-Reply-To: <1491281657.78.0.713830439385.issue29976@psf.upfronthosting.co.za> Message-ID: <1491281851.76.0.791421379437.issue29976@psf.upfronthosting.co.za> Senthil Kumaran added the comment: https://github.com/python/cpython/pull/984 proposes a change. I'll need some reviews on this changed text. Note: I am aware that there is an issue (long pending), which suggests deal away with these schemes at the top. If we get to that immediately, I will be happy, if not, consider this PR as the improvement over the status quo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 01:15:09 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 05:15:09 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491282909.72.0.632086850238.issue29725@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Thanks for working on this. row_factory seems to be another parameter that can be set in the Cursor object. https://github.com/python/cpython/blob/master/Modules/_sqlite/cursor.c#L65 This can addressed in a different issue/ pr. ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 01:16:16 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 05:16:16 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491282976.24.0.797407406525.issue29725@psf.upfronthosting.co.za> Senthil Kumaran added the comment: New changeset 02e12138000da834f23719521a011fa93763384d by Senthil Kumaran (csabella) in branch 'master': bpo-29725: DOC: add text for arraysize in sqlite3.Cursor (#947) https://github.com/python/cpython/commit/02e12138000da834f23719521a011fa93763384d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 01:21:21 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 05:21:21 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491283281.93.0.33114075084.issue29725@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- pull_requests: +1157 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 01:21:26 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 05:21:26 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491283285.99.0.621382954612.issue29725@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- pull_requests: +1158 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 01:27:17 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 05:27:17 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491283637.51.0.668888492095.issue29725@psf.upfronthosting.co.za> Senthil Kumaran added the comment: New changeset cb1e002c07622e027e80a3843d27a623d1617430 by Senthil Kumaran in branch '3.6': bpo-29725: DOC: add text for arraysize in sqlite3.Cursor (#947) (#985) https://github.com/python/cpython/commit/cb1e002c07622e027e80a3843d27a623d1617430 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 01:28:25 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 05:28:25 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491283705.91.0.629569381913.issue29725@psf.upfronthosting.co.za> Senthil Kumaran added the comment: New changeset 0f9ceaf322cc9358373167115fd4c21ab2d9ad50 by Senthil Kumaran in branch '3.5': bpo-29725: DOC: add text for arraysize in sqlite3.Cursor (#947) (#986) https://github.com/python/cpython/commit/0f9ceaf322cc9358373167115fd4c21ab2d9ad50 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 01:29:07 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 05:29:07 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491283747.01.0.836162217374.issue29725@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 02:30:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Apr 2017 06:30:34 +0000 Subject: [issue19180] some RFC references could be updated In-Reply-To: <525144B9.3040305@python.org> Message-ID: <1491287434.24.0.0868269422997.issue19180@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +christian.heimes stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 03:00:42 2017 From: report at bugs.python.org (Robert Lujo) Date: Tue, 04 Apr 2017 07:00:42 +0000 Subject: [issue29977] re.sub stalls forever on an unmatched non-greedy case Message-ID: <1491289242.07.0.894132585391.issue29977@psf.upfronthosting.co.za> New submission from Robert Lujo: Hello, I assume I have hit some bug/misbehaviour in re module. I will provide you "working" example: import re RE_C_COMMENTS = re.compile(r"/\*(.|\s)*?\*/", re.MULTILINE|re.DOTALL|re.UNICODE) text = "Special section /* valves:\n\n\nsilicone\n\n\n\n\n\n\nHarness:\n\n\nmetal and plastic fibre\n\n\n\n\n\n\nInner frame:\n\n\nmultibutylene\n\n\n\n\n\n\nWeight:\n\n\n147 g\n\n\n\n\n\n\n\n\n\n\n\n\n\nSelection guide\n" and then this command takes forever: RE_C_COMMENTS.sub(" ", text, re.MULTILINE|re.DOTALL|re.UNICODE) and the same problem you can notice on first 90 chars, it takes 10s on my machine: RE_C_COMMENTS.sub(" ", text[:90], re.MULTILINE|re.DOTALL|re.UNICODE) Some clarification: I try to remove the C style comments from text with non-greedy regular expression, and in this case start of comment (/*) is found, and end of comment (*/) can not be found. Notice the multiline and other re options. Python versions used: '2.7.11 (default, Jan 22 2016, 16:30:50) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]' / macOs 10.12.13 and: '2.7.12 (default, Nov 19 2016, 06:48:10) \n[GCC 5.4.0 20160609]' -> Linux 84-Ubuntu SMP Wed Feb 1 17:20:32 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux ---------- components: Regular Expressions messages: 291107 nosy: Robert Lujo, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.sub stalls forever on an unmatched non-greedy case type: performance versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 03:22:44 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 04 Apr 2017 07:22:44 +0000 Subject: [issue29968] Document that no characters are allowed to proceed \ in explicit line joining In-Reply-To: <1491223765.12.0.65807116216.issue29968@psf.upfronthosting.co.za> Message-ID: <1491290564.47.0.779824892862.issue29968@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: Ah, yes, the Ref. Manual, not the devguide, silly mistake. It definitely isn't a documentation bug (the documentation doesn't state something wrong) as much as I think it might be a slight omission. I really wasn't aware of how strict the tokenizer is with any characters after `\`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:03:16 2017 From: report at bugs.python.org (Gareth Rees) Date: Tue, 04 Apr 2017 08:03:16 +0000 Subject: [issue29977] re.sub stalls forever on an unmatched non-greedy case In-Reply-To: <1491289242.07.0.894132585391.issue29977@psf.upfronthosting.co.za> Message-ID: <1491292996.09.0.871584916325.issue29977@psf.upfronthosting.co.za> Gareth Rees added the comment: The problem here is that both "." and "\s" match a whitespace character, and because you have the re.DOTALL flag turned on this includes "\n", and so the number of different ways in which (.|\s)* can be matched against a string is exponential in the number of whitespace characters in the string. It is best to design your regular expression so as to limit the number of different ways it can match. Here I recommend the expression: /\*(?:[^*]|\*[^/])*\*/ which can match in only one way. ---------- nosy: +gdr at garethrees.org _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:06:43 2017 From: report at bugs.python.org (Gareth Rees) Date: Tue, 04 Apr 2017 08:06:43 +0000 Subject: [issue29977] re.sub stalls forever on an unmatched non-greedy case In-Reply-To: <1491289242.07.0.894132585391.issue29977@psf.upfronthosting.co.za> Message-ID: <1491293203.38.0.55441796158.issue29977@psf.upfronthosting.co.za> Gareth Rees added the comment: See also issue28690, issue212521, issue753711, issue1515829, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:09:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Apr 2017 08:09:37 +0000 Subject: [issue29977] re.sub stalls forever on an unmatched non-greedy case In-Reply-To: <1491289242.07.0.894132585391.issue29977@psf.upfronthosting.co.za> Message-ID: <1491293377.56.0.247906000313.issue29977@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a well known issue called catastrophic backtracking. It can't be solved with the current implementation of the regular expression engine. The best you can rewrite your regular expression. Even replacing "(.|\s)" with just "." can help. ---------- nosy: +serhiy.storchaka resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:11:11 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 04 Apr 2017 08:11:11 +0000 Subject: [issue29931] ipaddress.ip_interface __lt__ check seems to be broken In-Reply-To: <1490697440.73.0.104969617886.issue29931@psf.upfronthosting.co.za> Message-ID: <1491293471.23.0.700388927361.issue29931@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Serhiy, just checking whether this needs backport? The PR has the backport to 3.5 and 3.6 labels, but it's not indicated in this ticket. If it doesn't need backport, then perhaps we can close this issue. Thanks. ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:27:28 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 04 Apr 2017 08:27:28 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1491294448.29.0.051414641792.issue29971@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I am not competent enough to pronounce on the technical detail of what you are proposing, but: > Or maybe refactor to use condition variables in performance-critical code and otherwise use kernel waits, if that makes sense. That can make sense IMHO. Lock and RLock are Python-facing objects, so I'm not sure using high-performance userspace primitives is really important there (after all, people will primarily suffer the evaluation cost of pure Python code so, unless you do something silly such as acquire and release a Python lock in a loop, the acquisition cost doesn't really matter). OTOH, the GIL may be more performance-critical (and needn't be interrupted), so can use userspace CV primitives. That will however entail a complication of the internal locking API, since we basically need two separate PyThread lock APIs: an "interruptible lock" API and a "fast lock" API. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:32:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Apr 2017 08:32:51 +0000 Subject: [issue29931] ipaddress.ip_interface __lt__ check seems to be broken In-Reply-To: <1490697440.73.0.104969617886.issue29931@psf.upfronthosting.co.za> Message-ID: <1491294771.2.0.197166996865.issue29931@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: needs patch -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:35:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Apr 2017 08:35:18 +0000 Subject: [issue29972] Skip tests known to fail on AIX In-Reply-To: <1491232460.4.0.914311825782.issue29972@psf.upfronthosting.co.za> Message-ID: <1491294918.51.0.748739202733.issue29972@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 5de85a17029356084b96db63e04d9eb150efd9c0 by Victor Stinner in branch 'master': bpo-29972: Skip tests known to fail on AIX (#979) https://github.com/python/cpython/commit/5de85a17029356084b96db63e04d9eb150efd9c0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:40:54 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 04 Apr 2017 08:40:54 +0000 Subject: [issue29978] Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7 Message-ID: <1491295254.15.0.485735428902.issue29978@psf.upfronthosting.co.za> New submission from Mariatta Wijaya: In https://github.com/python/cpython/pull/212, merge=union was added to the .gitattributes, but was later removed in https://github.com/python/cpython/pull/460. Somehow this attribute made their way into 3.6 and 2.7. I will remove it. ---------- assignee: Mariatta messages: 291115 nosy: Mariatta priority: normal severity: normal stage: needs patch status: open title: Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7 versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:49:21 2017 From: report at bugs.python.org (Pierre Quentel) Date: Tue, 04 Apr 2017 08:49:21 +0000 Subject: [issue11066] cgi.py proposals : sys.stdout encoding + rewriting of parsing functions In-Reply-To: <1296335741.52.0.506773731017.issue11066@psf.upfronthosting.co.za> Message-ID: <1491295761.03.0.103590820635.issue11066@psf.upfronthosting.co.za> Pierre Quentel added the comment: I close this issue and will open a more specific one for the rewriting of parse_multipart() ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:54:03 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 04 Apr 2017 08:54:03 +0000 Subject: [issue29931] ipaddress.ip_interface __lt__ check seems to be broken In-Reply-To: <1490697440.73.0.104969617886.issue29931@psf.upfronthosting.co.za> Message-ID: <1491296043.52.0.961018939485.issue29931@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 04:58:51 2017 From: report at bugs.python.org (Pierre Quentel) Date: Tue, 04 Apr 2017 08:58:51 +0000 Subject: [issue29979] cgi.parse_multipart is not consistent with FieldStorage Message-ID: <1491296331.11.0.181533719685.issue29979@psf.upfronthosting.co.za> New submission from Pierre Quentel: In the cgi module, the parse_multipart() function duplicates code from FieldStorage, and the result is not compliant with that of FieldStorage for requests sent with multipart/form-data : for non-file fields, the value associated with a key is a list of *bytes* in parse_multipart() and a list of *strings* for FieldStorage (the bytes decoded with the argument "encoding" passed to FieldStorage()). I will propose a PR on the Github repo with a version of parse_multipart that uses FieldStorage and returns the same result (values as strings). The function will take an additional argument "encoding". ---------- components: Library (Lib) messages: 291117 nosy: quentel priority: normal severity: normal status: open title: cgi.parse_multipart is not consistent with FieldStorage type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 05:01:09 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 04 Apr 2017 09:01:09 +0000 Subject: [issue29978] Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7 In-Reply-To: <1491295254.15.0.485735428902.issue29978@psf.upfronthosting.co.za> Message-ID: <1491296469.59.0.506128091907.issue29978@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1159 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 05:12:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Apr 2017 09:12:10 +0000 Subject: [issue29971] Lock.acquire() not interruptible on Windows In-Reply-To: <1491230618.78.0.644794311178.issue29971@psf.upfronthosting.co.za> Message-ID: <1491297130.15.0.161094901912.issue29971@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 05:29:28 2017 From: report at bugs.python.org (Charalampos Stratakis) Date: Tue, 04 Apr 2017 09:29:28 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1491298168.49.0.26575279808.issue29943@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: Currently we haven't updated to Python 3.6.1 at Fedora 26 due to this issue. While it is a release blocker for 3.6.2, what can be done for 3.6.1? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 05:46:35 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 04 Apr 2017 09:46:35 +0000 Subject: [issue29978] Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7 In-Reply-To: <1491295254.15.0.485735428902.issue29978@psf.upfronthosting.co.za> Message-ID: <1491299195.8.0.700867240665.issue29978@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1160 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 06:46:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Apr 2017 10:46:28 +0000 Subject: [issue29649] struct.pack_into check boundary error message ignores offset In-Reply-To: <1488030784.09.0.674246877605.issue29649@psf.upfronthosting.co.za> Message-ID: <1491302788.09.0.339014170761.issue29649@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset f78b119364b521307237a1484ba5f43f42300898 by Serhiy Storchaka (Andrew Nester) in branch 'master': bpo-29649: Improve struct.pack_into() boundary error messages (#424) https://github.com/python/cpython/commit/f78b119364b521307237a1484ba5f43f42300898 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 06:47:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 04 Apr 2017 10:47:37 +0000 Subject: [issue29649] struct.pack_into check boundary error message ignores offset In-Reply-To: <1488030784.09.0.674246877605.issue29649@psf.upfronthosting.co.za> Message-ID: <1491302857.89.0.0913152189533.issue29649@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your contribution Andrew. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 08:11:01 2017 From: report at bugs.python.org (Mathias Rav) Date: Tue, 04 Apr 2017 12:11:01 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1491307861.84.0.625804987879.issue29974@psf.upfronthosting.co.za> Changes by Mathias Rav : ---------- title: typing.TYPE_CHECKING doc example is incorrect -> Change typing.TYPE_CHECKING doc example _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 08:13:36 2017 From: report at bugs.python.org (Mathias Rav) Date: Tue, 04 Apr 2017 12:13:36 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1491308016.83.0.00748743784017.issue29974@psf.upfronthosting.co.za> Mathias Rav added the comment: I have updated the patch after feedback from Jelle Zijlstra and Ivan Levkevskyi. Indeed the example was correct; the patch now adds wording from PEP 484 and PEP 526 to clarify why a function parameter annotation needs to be in quotes and a local variable annotation does not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 08:49:50 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 04 Apr 2017 12:49:50 +0000 Subject: [issue29978] Remove remove merge=union attribute for Misc/NEWS in 3.6 and 2.7 In-Reply-To: <1491295254.15.0.485735428902.issue29978@psf.upfronthosting.co.za> Message-ID: <1491310190.21.0.671921756057.issue29978@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 08:58:52 2017 From: report at bugs.python.org (Pierre Quentel) Date: Tue, 04 Apr 2017 12:58:52 +0000 Subject: [issue29979] cgi.parse_multipart is not consistent with FieldStorage In-Reply-To: <1491296331.11.0.181533719685.issue29979@psf.upfronthosting.co.za> Message-ID: <1491310732.72.0.619464964315.issue29979@psf.upfronthosting.co.za> Changes by Pierre Quentel : ---------- pull_requests: +1162 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 09:30:17 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 04 Apr 2017 13:30:17 +0000 Subject: [issue29979] cgi.parse_multipart is not consistent with FieldStorage In-Reply-To: <1491296331.11.0.181533719685.issue29979@psf.upfronthosting.co.za> Message-ID: <1491312617.0.0.981595131574.issue29979@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Looking forward to this. ---------- assignee: -> orsenthil nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 10:00:08 2017 From: report at bugs.python.org (Pierre Quentel) Date: Tue, 04 Apr 2017 14:00:08 +0000 Subject: [issue29979] cgi.parse_multipart is not consistent with FieldStorage In-Reply-To: <1491296331.11.0.181533719685.issue29979@psf.upfronthosting.co.za> Message-ID: <1491314408.3.0.282455293607.issue29979@psf.upfronthosting.co.za> Changes by Pierre Quentel : ---------- pull_requests: +1163 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 10:25:53 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 04 Apr 2017 14:25:53 +0000 Subject: [issue29968] Document that no characters are allowed to proceed \ in explicit line joining In-Reply-To: <1491223765.12.0.65807116216.issue29968@psf.upfronthosting.co.za> Message-ID: <1491315953.32.0.979691245057.issue29968@psf.upfronthosting.co.za> R. David Murray added the comment: I don't see any omission, myself. Keep in mind that the language reference is as much or more of a specification as it is a reference, so we tend to try to use the minimum language that precisely describes the expected behavior. Which is why I suggested that if anything the sentence about trailing comments should be dropped :) And I would vote -1 on allowing trailing whitespace. (More than -1, actually :) If that's what you meant: you said "proceed \", which doesn't sound like *trailing* whitespace. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 11:13:02 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 04 Apr 2017 15:13:02 +0000 Subject: [issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error In-Reply-To: <1464060517.76.0.559675330412.issue27100@psf.upfronthosting.co.za> Message-ID: <1491318782.66.0.300434526689.issue27100@psf.upfronthosting.co.za> Nick Coghlan added the comment: Reviewing the discussion, I assume this was left open to cover reordering the __aenter__ and __aexit__ checks for async with, but that can just as easily be handled as a separate issue (which would also be clearer at the NEWS level). ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 12:33:10 2017 From: report at bugs.python.org (Brett Cannon) Date: Tue, 04 Apr 2017 16:33:10 +0000 Subject: [issue29851] Have importlib.reload() raise ModuleNotFoundError when a spec can't be found In-Reply-To: <1489882196.37.0.503568145678.issue29851@psf.upfronthosting.co.za> Message-ID: <1491323590.49.0.450532931419.issue29851@psf.upfronthosting.co.za> Brett Cannon added the comment: That's a good point, Serhiy, since that's what the exception is signaling. So yes, the exception should be ModuleNotFounderror. ---------- title: Have importlib.reload() raise ImportError when a spec can't be found -> Have importlib.reload() raise ModuleNotFoundError when a spec can't be found _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 13:12:21 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 04 Apr 2017 17:12:21 +0000 Subject: [issue29980] OSError: multiple exceptions should preserve the exception type if it is common Message-ID: <1491325941.34.0.941861469291.issue29980@psf.upfronthosting.co.za> New submission from R. David Murray: create_connection will try multiple times to connect if there are multiple addresses returned by getaddrinfo. If all connections file it inspects the exceptions, and raises the first one if they are all equal. But since the addresses are often different (else why would we try multiple times?), the messages will usually be different. When the messages are different, the code raises an OSError with a list of the exceptions so the user can see them all. This, however, looses the information as to *what* kind of exception occurred (ie: ConnectioRefusedError, etc). I propose that if all of the exceptions raised are of the same subclass, that that subclass be raised with the multi-message list, rather than the base OSError. ---------- components: asyncio messages: 291126 nosy: r.david.murray, yselivanov priority: normal severity: normal status: open title: OSError: multiple exceptions should preserve the exception type if it is common _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 13:13:24 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 04 Apr 2017 17:13:24 +0000 Subject: [issue29980] OSError: multiple exceptions should preserve the exception type if it is common In-Reply-To: <1491325941.34.0.941861469291.issue29980@psf.upfronthosting.co.za> Message-ID: <1491326004.61.0.265484813634.issue29980@psf.upfronthosting.co.za> R. David Murray added the comment: If all connections fail (not file :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 13:44:01 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 04 Apr 2017 17:44:01 +0000 Subject: [issue29968] Document that no characters are allowed to proceed \ in explicit line joining In-Reply-To: <1491223765.12.0.65807116216.issue29968@psf.upfronthosting.co.za> Message-ID: <1491327841.32.0.440700351768.issue29968@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: Gotcha, thanks for the input, David. I'll leave it to you to decide if the sentence on the trailing comments warrants removal. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 14:01:11 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Apr 2017 18:01:11 +0000 Subject: [issue29981] Update Index set, dict, and generator 'comprehensions' Message-ID: <1491328871.52.0.864348862414.issue29981@psf.upfronthosting.co.za> New submission from Terry J. Reedy: The index currently has comprehensions *list* with *list* linked to 6.2.5 List displays. I suggest: 1. Link *comprehensions* to 6.2.4. Displays for lists, sets and dictionaries 2. Add subentries *set*, *dict*, and *generator* linked to 2a. 6.2.6. Set displays 2b. 6.2.7. Dictionary displays 2c. 6.2.8. Generator expressions We don't *call* generator expressions 'generator comprehensions', but that is what they are syntactically and one looking for 'comprehensions' should be able to find them there. There is already *list* ... *comprehensions* ... *list comprehensions* with 'list' and 'list comprehensions' linked to glossary entries, while 'list, comprehensions' links to the same section as 'comprehensions, list'. 3. Add 'set/dictionary, comprehensions' sub-entries linked like 'list, com 4. Add Glossary entries and links like 'list comprehensions' ---------- assignee: docs at python components: Documentation keywords: easy messages: 291129 nosy: docs at python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Update Index set, dict, and generator 'comprehensions' type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 14:26:18 2017 From: report at bugs.python.org (Max) Date: Tue, 04 Apr 2017 18:26:18 +0000 Subject: [issue29982] tempfile.TemporaryDirectory fails to delete itself Message-ID: <1491330378.49.0.274398190766.issue29982@psf.upfronthosting.co.za> New submission from Max: There's a known issue with `shutil.rmtree` on Windows, in that it fails intermittently. The issue is well known (https://mail.python.org/pipermail/python-dev/2013-September/128353.html), and the agreement is that it cannot be cleanly solved inside `shutil` and should instead be solved by the calling app. Specifically, python devs themselves faced it in their test suite and solved it by retrying delete. However, what to do about `tempfile.TemporaryDirectory`? Is it considered the calling app, and therefore should retry delete when it calls `shutil.rmtree` in its `cleanup` method? I don't think `tempfile` is protected by the same argument that `shutil.rmtree` is protected, in that it's too messy to solve it in the standard library. My rationale is that while it's very easy for the end user to retry `shutil.rmtree`, it's far more difficult to fix the problem with `tempfile.TempDirectory` not deleting itself - how would the end user retry the `cleanup` method (which is called from `weakref.finalizer`)? So perhaps the retry loop should be added to `cleanup`. ---------- components: Library (Lib) messages: 291130 nosy: max priority: normal severity: normal status: open title: tempfile.TemporaryDirectory fails to delete itself type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 14:31:12 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Apr 2017 18:31:12 +0000 Subject: [issue29983] Reference TOC: expand 'Atoms' and 'Primaries' Message-ID: <1491330672.66.0.700114037172.issue29983@psf.upfronthosting.co.za> New submission from Terry J. Reedy: Today there is a fairly long python-list thread about the difficult of finding info on 'dict comprehensions' in the doc. Point 1 is missing index entries. I opened #29981 for this. Point 2 is something I have also noticed: the obscurity of 'Atoms' and 'Primaries' as titles of sections in the Expressions chapter. These are fairly esoteric Computer Science language theory terms. Compare these to beginner-friendly 'Binary arithmetic operators' and 'Comparisons'. My specific suggestions, subject to change: Atoms, including identifiers, literals, displays, and comprehensions Primaries: attributes, subscripts, slices, and calls ---------- assignee: docs at python components: Documentation messages: 291131 nosy: docs at python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Reference TOC: expand 'Atoms' and 'Primaries' type: enhancement versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 14:33:04 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Apr 2017 18:33:04 +0000 Subject: [issue29981] Update Index for set, dict, and generator 'comprehensions' In-Reply-To: <1491328871.52.0.864348862414.issue29981@psf.upfronthosting.co.za> Message-ID: <1491330784.8.0.20606906074.issue29981@psf.upfronthosting.co.za> Terry J. Reedy added the comment: See #29983 for expanding the title of the 'atoms' section containing subsections on comprehensions. ---------- title: Update Index set, dict, and generator 'comprehensions' -> Update Index for set, dict, and generator 'comprehensions' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 14:45:31 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Apr 2017 18:45:31 +0000 Subject: [issue29983] Reference TOC: expand 'Atoms' and 'Primaries' In-Reply-To: <1491330672.66.0.700114037172.issue29983@psf.upfronthosting.co.za> Message-ID: <1491331531.15.0.594550293422.issue29983@psf.upfronthosting.co.za> Terry J. Reedy added the comment: 'displays' is partly redundant with 'comprehensions'. Since many think of other 'displays' as a type of literal, leave 'displays' out. They are well indexed. I think the most likely term people have trouble finding in the TOC is 'comprehension'. It was not immediately obvious to most that should be 'atoms'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 14:53:15 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 04 Apr 2017 18:53:15 +0000 Subject: [issue13290] get vars for object with __slots__ In-Reply-To: <1319871850.77.0.869546838833.issue13290@psf.upfronthosting.co.za> Message-ID: <1491331995.48.0.0697681860948.issue13290@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- nosy: +Jim Fasarakis-Hilliard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 15:31:43 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 04 Apr 2017 19:31:43 +0000 Subject: [issue29905] TypeErrors not formatting values correctly In-Reply-To: <1490476220.4.0.605506915687.issue29905@psf.upfronthosting.co.za> Message-ID: <1491334303.76.0.485173967791.issue29905@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: As per #issue25002 and, specifically #msg250151, the TypeError in `asynchat` should probably not be included, I'll just make a PR for the TypeError in asyncio/proactor_events ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 15:38:26 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 04 Apr 2017 19:38:26 +0000 Subject: [issue28681] About function renaming in the tutorial In-Reply-To: <1479008196.92.0.673244295473.issue28681@psf.upfronthosting.co.za> Message-ID: <1491334706.09.0.202712926153.issue28681@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- nosy: +Jim Fasarakis-Hilliard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 15:52:13 2017 From: report at bugs.python.org (Brett Cannon) Date: Tue, 04 Apr 2017 19:52:13 +0000 Subject: [issue29970] Severe open file leakage running asyncio SSL server In-Reply-To: <1491228615.05.0.224246839796.issue29970@psf.upfronthosting.co.za> Message-ID: <1491335533.99.0.956809071315.issue29970@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- nosy: +giampaolo.rodola, haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 15:56:12 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 04 Apr 2017 19:56:12 +0000 Subject: [issue29970] Severe open file leakage running asyncio SSL server In-Reply-To: <1491228615.05.0.224246839796.issue29970@psf.upfronthosting.co.za> Message-ID: <1491335772.4.0.73683834932.issue29970@psf.upfronthosting.co.za> Yury Selivanov added the comment: I'm assigning this to myself to make sure I don't forget about this. If someone wants to tackle this please feel free to reassign. ---------- assignee: -> yselivanov versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:02:39 2017 From: report at bugs.python.org (Robert Day) Date: Tue, 04 Apr 2017 20:02:39 +0000 Subject: [issue29984] Improve test coverage for 'heapq' module Message-ID: <1491336159.04.0.480090056771.issue29984@psf.upfronthosting.co.za> New submission from Robert Day: It's currently at 97%: Name Stmts Miss Cover Missing -------------------------------------------- Lib/heapq.py 262 7 97% 187, 351-352, 375-376, 606-607 I'm submitting a Github PR to fix it. ---------- components: Tests messages: 291136 nosy: Robert Day priority: normal severity: normal status: open title: Improve test coverage for 'heapq' module versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:04:37 2017 From: report at bugs.python.org (Robert Day) Date: Tue, 04 Apr 2017 20:04:37 +0000 Subject: [issue29984] Improve test coverage for 'heapq' module In-Reply-To: <1491336159.04.0.480090056771.issue29984@psf.upfronthosting.co.za> Message-ID: <1491336277.58.0.884968095098.issue29984@psf.upfronthosting.co.za> Changes by Robert Day : ---------- pull_requests: +1165 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:09:22 2017 From: report at bugs.python.org (Maciej Szulik) Date: Tue, 04 Apr 2017 20:09:22 +0000 Subject: [issue29860] smtplib.py doesn't capitalize EHLO. In-Reply-To: <1490020373.29.0.308540627587.issue29860@psf.upfronthosting.co.za> Message-ID: <1491336562.23.0.778410031853.issue29860@psf.upfronthosting.co.za> Changes by Maciej Szulik : ---------- nosy: +maciej.szulik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:17:32 2017 From: report at bugs.python.org (Ennis Massey) Date: Tue, 04 Apr 2017 20:17:32 +0000 Subject: [issue28087] macOS 12 poll syscall returns prematurely In-Reply-To: <1491238204.84.0.196511717929.issue28087@psf.upfronthosting.co.za> Message-ID: Ennis Massey added the comment: Makes sense it would also fail. They both use the same syscall. Gud job on the backport Sent from my iPhone > On 4/04/2017, at 4:50 AM, STINNER Victor wrote: > > > STINNER Victor added the comment: > > Ah! Python 2.7 tests succeeded on Sierra! > > http://buildbot.python.org/all/builders/x86-64%20Sierra%202.7/builds/3 > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:22:08 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 04 Apr 2017 20:22:08 +0000 Subject: [issue7659] Attribute assignment on object() instances raises wrong exception In-Reply-To: <1262968332.68.0.476240777656.issue7659@psf.upfronthosting.co.za> Message-ID: <1491337328.05.0.858739543825.issue7659@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: I don't think a change is actually needed here (bumping to decide the fate of this issue) ---------- nosy: +Jim Fasarakis-Hilliard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:24:46 2017 From: report at bugs.python.org (Eryk Sun) Date: Tue, 04 Apr 2017 20:24:46 +0000 Subject: [issue29982] tempfile.TemporaryDirectory fails to delete itself In-Reply-To: <1491330378.49.0.274398190766.issue29982@psf.upfronthosting.co.za> Message-ID: <1491337486.29.0.798546983633.issue29982@psf.upfronthosting.co.za> Changes by Eryk Sun : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:29:56 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Tue, 04 Apr 2017 20:29:56 +0000 Subject: [issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs In-Reply-To: <1491214874.69.0.0315417893192.issue29966@psf.upfronthosting.co.za> Message-ID: <1491337796.51.0.0537990914165.issue29966@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: You could try: glob = globals.copy() glob.update(a.__dict__) glob.update(b.__dict__) You can do this automatically following MyClass.__mro__ and then collecting relevant __module__ attributes on bases. However, there is little chance this will be fixed in typing itself. It is difficult to cover all possible cases, so that users should choose custom globals/locals for their needs. ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:49:12 2017 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 04 Apr 2017 20:49:12 +0000 Subject: [issue29977] re.sub stalls forever on an unmatched non-greedy case In-Reply-To: <1491289242.07.0.894132585391.issue29977@psf.upfronthosting.co.za> Message-ID: <1491338952.7.0.859538294654.issue29977@psf.upfronthosting.co.za> Matthew Barnett added the comment: A slightly shorter form: /\*(?:(?!\*/).)*\*/ Basically it's: match start while not match end: consume character match end If the "match end" is a single character, you can use a negated character set, for example: [^\n]* otherwise you need a negative lookahead, for example: (?:(?!\r\n).)* ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 16:49:58 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 04 Apr 2017 20:49:58 +0000 Subject: [issue29905] TypeErrors not formatting values correctly In-Reply-To: <1490476220.4.0.605506915687.issue29905@psf.upfronthosting.co.za> Message-ID: <1491338998.46.0.850769671181.issue29905@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- pull_requests: +1166 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 17:18:07 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 04 Apr 2017 21:18:07 +0000 Subject: [issue7659] Attribute assignment on object() instances raises wrong exception In-Reply-To: <1262968332.68.0.476240777656.issue7659@psf.upfronthosting.co.za> Message-ID: <1491340687.1.0.659686922257.issue7659@psf.upfronthosting.co.za> R. David Murray added the comment: Agreed. Time to close this. ---------- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 17:43:17 2017 From: report at bugs.python.org (Dominic Mayers) Date: Tue, 04 Apr 2017 21:43:17 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491342197.63.0.823678123047.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: I simplified the patch. Using a class as a factory function is the simplest case, so I took advantage of this. I also give one way to pass extra parameters to the handler in the factory function, because it's the main reason why we cannot always use a class. ---------- Added file: http://bugs.python.org/file46774/Issue29947_for_discussion_02.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 17:45:15 2017 From: report at bugs.python.org (Dominic Mayers) Date: Tue, 04 Apr 2017 21:45:15 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491342315.75.0.428237415346.issue29947@psf.upfronthosting.co.za> Changes by Dominic Mayers : Removed file: http://bugs.python.org/file46770/Issue29947_for_discussion.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 18:00:54 2017 From: report at bugs.python.org (Chris Jerdonek) Date: Tue, 04 Apr 2017 22:00:54 +0000 Subject: [issue29985] make install doesn't seem to support --quiet Message-ID: <1491343254.68.0.574187952476.issue29985@psf.upfronthosting.co.za> New submission from Chris Jerdonek: When installing from source, the --quiet option works with "configure" and a bare "make": $ ./configure --quiet $ make --quiet However, it doesn't seem to work when passed to "make install" (and "make altinstall", etc). I tried a number of variations like: $ make --quiet install $ make install --quiet etc. The install output is quite verbose, so it would be useful to support --quiet. This should still allow warnings, etc, through like it does for configure and bare make. ---------- components: Installation messages: 291143 nosy: chris.jerdonek priority: normal severity: normal status: open title: make install doesn't seem to support --quiet type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 18:41:14 2017 From: report at bugs.python.org (Dominic Mayers) Date: Tue, 04 Apr 2017 22:41:14 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491345674.05.0.0306563682508.issue29947@psf.upfronthosting.co.za> Changes by Dominic Mayers : Removed file: http://bugs.python.org/file46774/Issue29947_for_discussion_02.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 18:41:29 2017 From: report at bugs.python.org (Dominic Mayers) Date: Tue, 04 Apr 2017 22:41:29 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491345689.95.0.160583221836.issue29947@psf.upfronthosting.co.za> Changes by Dominic Mayers : Added file: http://bugs.python.org/file46775/Issue29947_for_discussion_03.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 18:51:54 2017 From: report at bugs.python.org (Devin Jeanpierre) Date: Tue, 04 Apr 2017 22:51:54 +0000 Subject: [issue29986] Documentation recommends raising TypeError from tp_richcompare Message-ID: <1491346313.99.0.131506773991.issue29986@psf.upfronthosting.co.za> New submission from Devin Jeanpierre: am not sure when TypeError is the right choice. Definitely, most of the time I've seen it done, it causes trouble, and NotImplemented usually does something better. For example, see the work in https://bugs.python.org/issue8743 to get set to interoperate correctly with other set-like classes --- a problem caused by the use of TypeError instead of returning NotImplemented (e.g. https://hg.python.org/cpython/rev/3615cdb3b86d). This advice seems to conflict with the usual and expected behavior of objects from Python: e.g. object().__lt__(1) returns NotImplemented rather than raising TypeError, despite < not "making sense" for object. Similarly for file objects and other uncomparable classes. Even complex numbers only return NotImplemented! >>> 1j.__lt__(1j) NotImplemented If this note should be kept, this section could use a decent explanation of the difference between "undefined" (should return NotImplemented) and "nonsensical" (should apparently raise TypeError). Perhaps a reference to an example from the stdlib. ---------- assignee: docs at python components: Documentation messages: 291144 nosy: Devin Jeanpierre, docs at python priority: normal pull_requests: 1167 severity: normal status: open title: Documentation recommends raising TypeError from tp_richcompare _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 19:01:22 2017 From: report at bugs.python.org (Devin Jeanpierre) Date: Tue, 04 Apr 2017 23:01:22 +0000 Subject: [issue29986] Documentation recommends raising TypeError from tp_richcompare In-Reply-To: <1491346313.99.0.131506773991.issue29986@psf.upfronthosting.co.za> Message-ID: <1491346882.65.0.198052312144.issue29986@psf.upfronthosting.co.za> Devin Jeanpierre added the comment: Sorry, forgot to link to docs because I was copy-pasting from the PR: https://docs.python.org/2/c-api/typeobj.html#c.PyTypeObject.tp_richcompare https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_richcompare > Note: If you want to implement a type for which only a limited set of comparisons makes sense (e.g. == and !=, but not < and friends), directly raise TypeError in the rich comparison function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 19:32:03 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 04 Apr 2017 23:32:03 +0000 Subject: [issue29986] Documentation recommends raising TypeError from tp_richcompare In-Reply-To: <1491346313.99.0.131506773991.issue29986@psf.upfronthosting.co.za> Message-ID: <1491348723.99.0.753020484877.issue29986@psf.upfronthosting.co.za> R. David Murray added the comment: The documentation is technically correct, as far as I can see. Issue 8743 is not about disallowing certain comparison operations, but rather incorrectly implementing the earlier sentence in that same doc section: "If the comparison is undefined, it must return Py_NotImplemented". Perhaps the wording should be changed so that instead of saying "only a limited set of comparisons makes sense" it says "if you wish to disallow certain comparison operations while allowing others". It should also probably be demoted from being a '.. note', since it is, as you note, an exceptional case, not a common one. But you might be right that it would be better to delete it altogether, since it is generally better to let the comparison machinery raise the error if none of the types implements the comparison...what would be the rationale for a blanket *dis*allowing of a particular comparison operation? Let's see what Raymond thinks. ---------- nosy: +r.david.murray, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 19:35:15 2017 From: report at bugs.python.org (Thomas Antony) Date: Tue, 04 Apr 2017 23:35:15 +0000 Subject: [issue29987] inspect.isgeneratorfunction not working with partial functions Message-ID: <1491348915.09.0.197335598745.issue29987@psf.upfronthosting.co.za> New submission from Thomas Antony: When inspect.isgeneratorfunction is called on the output of functools.partial, it returns False even if the original function was a generator function. Test case is attached. Tested in fresh conda environment running Python 3.6.1 ---------- files: testcode.py messages: 291147 nosy: Thomas Antony priority: normal severity: normal status: open title: inspect.isgeneratorfunction not working with partial functions versions: Python 3.5 Added file: http://bugs.python.org/file46776/testcode.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 19:35:57 2017 From: report at bugs.python.org (Thomas Antony) Date: Tue, 04 Apr 2017 23:35:57 +0000 Subject: [issue29987] inspect.isgeneratorfunction not working with partial functions In-Reply-To: <1491348915.09.0.197335598745.issue29987@psf.upfronthosting.co.za> Message-ID: <1491348957.72.0.867866706355.issue29987@psf.upfronthosting.co.za> Changes by Thomas Antony : ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 19:42:58 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 04 Apr 2017 23:42:58 +0000 Subject: [issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like Message-ID: <1491349378.03.0.0671954460373.issue29988@psf.upfronthosting.co.za> New submission from Nathaniel Smith: You might hope the interpreter would enforce the invariant that for 'with' and 'async with' blocks, either '__(a)enter__' and '__(a)exit__' are both called, or else neither of them is called. But it turns out that this is not true once KeyboardInterrupt gets involved ? even if we write our (async) context manager in C, or otherwise guarantee that the actual '__(a)enter__' and '__(a)exit__' methods are immune to KeyboardInterrupt. The invariant is *almost* preserved for 'with' blocks: there's one instruction (SETUP_WITH) that atomically (wrt signals) calls '__enter__' and then enters the implicit 'try' block, and there's one instruction (WITH_CLEANUP_START) that atomically enters the implicit 'finally' block and then calls '__exit__'. But there's a gap between exiting the 'try' block and WITH_CLEANUP_START where a signal can arrive and cause us to exit without running the 'finally' block at all. In this disassembly, the POP_BLOCK at offset 7 is the end of the 'try' block; if a KeyboardInterrupt is raised between POP_BLOCK and WITH_CLEANUP_START, then it will propagate out without '__exit__' being run: In [2]: def f(): ...: with a: ...: pass ...: In [3]: dis.dis(f) 2 0 LOAD_GLOBAL 0 (a) 3 SETUP_WITH 5 (to 11) 6 POP_TOP 3 7 POP_BLOCK 8 LOAD_CONST 0 (None) >> 11 WITH_CLEANUP_START 12 WITH_CLEANUP_FINISH 13 END_FINALLY 14 LOAD_CONST 0 (None) 17 RETURN_VALUE For async context managers, the race condition is substantially worse, because the 'await' dance is inlined into the bytecode: In [4]: async def f(): ...: async with a: ...: pass ...: In [5]: dis.dis(f) 2 0 LOAD_GLOBAL 0 (a) 3 BEFORE_ASYNC_WITH 4 GET_AWAITABLE 5 LOAD_CONST 0 (None) 8 YIELD_FROM 9 SETUP_ASYNC_WITH 5 (to 17) 12 POP_TOP 3 13 POP_BLOCK 14 LOAD_CONST 0 (None) >> 17 WITH_CLEANUP_START 18 GET_AWAITABLE 19 LOAD_CONST 0 (None) 22 YIELD_FROM 23 WITH_CLEANUP_FINISH 24 END_FINALLY 25 LOAD_CONST 0 (None) 28 RETURN_VALUE Really the sequence from 3 BEFORE_ASYNC_WITH to 9 SETUP_ASYNC_WITH should be atomic wrt signal delivery, and from 13 POP_BLOCK to 22 YIELD_FROM likewise. This probably isn't the highest priority bug in practice, but I feel like it'd be nice if this kind of basic language invariant could be 100% guaranteed, not just 99% guaranteed :-). And the 'async with' race condition is plausible to hit in practice, because if I have an '__aenter__' that's otherwise protected from KeyboardInterrupt, then it can run for some time, and any control-C during that time will get noticed just before the WITH_CLEANUP_START, so e.g. 'async with lock: ...' might complete while still holding the lock. The traditional solution would be to define single "super-instructions" that do all of the work we want to be atomic. This would be pretty tricky here though, because WITH_CLEANUP_START is a jump target (so naively we'd need to jump into the "middle" of a hypothetical new super-instruction), and because the implementation of YIELD_FROM kind of assumes that it's a standalone instruction exposed directly in the bytecode. Probably there is some solution to these issues but some cleverness would be required. A alternative approach would be to keep the current bytecode, but somehow mark certain stretches of bytecode as bad places to run signal handlers. The eval loop's "check for signal handlers" code is run rarely, so we could afford to do relatively expensive things like check a lookaside table that says "no signal handlers when 13 < f_lasti <= 22". Or we could steal a bit in the opcode encoding or something. ---------- components: Interpreter Core messages: 291148 nosy: ncoghlan, njs, yselivanov priority: normal severity: normal status: open title: (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 20:15:20 2017 From: report at bugs.python.org (Devin Jeanpierre) Date: Wed, 05 Apr 2017 00:15:20 +0000 Subject: [issue29986] Documentation recommends raising TypeError from tp_richcompare In-Reply-To: <1491346313.99.0.131506773991.issue29986@psf.upfronthosting.co.za> Message-ID: <1491351320.7.0.708286063549.issue29986@psf.upfronthosting.co.za> Devin Jeanpierre added the comment: Yeah, I agree there might be a use-case (can't find one offhand, but in principle), but I think it's rare enough that you're more likely to be led astray from reading this note -- almost always, NotImplemented does what you want. In a way this is a special case of being able to raise an exception at all, which is mentioned earlier ("if another error occurred it must return NULL and set an exception condition.") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 22:01:08 2017 From: report at bugs.python.org (Martin Panter) Date: Wed, 05 Apr 2017 02:01:08 +0000 Subject: [issue29987] inspect.isgeneratorfunction not working with partial functions In-Reply-To: <1491348915.09.0.197335598745.issue29987@psf.upfronthosting.co.za> Message-ID: <1491357668.39.0.8833777643.issue29987@psf.upfronthosting.co.za> Martin Panter added the comment: Doesn't seem like a bug to me. Even if there was special support for "partial" objects, that won't help with other ways of producing the same sort of thing. test2 = functools.partial(test, a=10) @functools.wraps(test) def test2(): return test(a=10) Both ways produce a callable that returns a generator-iterator instance, but neither callables are really generator functions. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 22:38:53 2017 From: report at bugs.python.org (Raphael Gaschignard) Date: Wed, 05 Apr 2017 02:38:53 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors Message-ID: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> New submission from Raphael Gaschignard: >From the documentation of the io module: fileno() Return the underlying file descriptor (an integer) of the stream if it exists. An OSError is raised if the IO object does not use a file descriptor. However, when passing a file-like object without a file descriptor (that raises OSError when calling f.fileno()) to POpen (for stdout, for example), the raised exception is not handled properly. (However, on inspection of subprocess code, returning -1 will cause the code to handle this properly) I'm not sure whether this is an issue in the io module documentation or in the subprocess code. the core issue seems to be in POpen.get_handles, that seems to expect that -1 is used to signal "no file descriptor available". ---------- messages: 291151 nosy: rtpg priority: normal severity: normal status: open title: subprocess.Popen does not handle file-like objects without file descriptors type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 22:41:33 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 02:41:33 +0000 Subject: [issue13290] get vars for object with __slots__ In-Reply-To: <1319871850.77.0.869546838833.issue13290@psf.upfronthosting.co.za> Message-ID: <1491360093.68.0.12422877091.issue13290@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I think this API expansion should not be done. As a teacher of Python, I find that vars(o) is easily understood as a short-cut for o.__dict__ in much the same way as len(o) is a short-cut for o.__len__(). The proposed change makes this tool harder to teach. The vars() function is often used for more than viewing a dictionary, it is also used in situations where the dictionary can be modified. The proposed feature makes it harder to distinguish cases where it acts like a regular, updateable dict. Further, I believe the addition of invisible magic to vars() will actively promote a misunderstanding of how Python works. When applied to an instance variable, it creates an illusion that a dictionary is present when to whole point of __slots__ is to suppress an instance dictionary. In fact, the actual dictionary entries are the member objects at the class level. This fact would be hidden by the proposed change. In addition it creates confusion by treating __slots__ differently from other class-level descriptor entries such as property objects Another issue is that right now, if a user misspells __slots__ (perhaps as __slots_ por __slot__), the indication that something went wrong is that running vars() on an instance returns a dictionary rather than raising "TypeError: vars() argument must have __dict__ attribute". The proposed change will take away this active affirmation that __slots__ is working and will make debugging more difficult (and it will break any existing __slots__ tests that use assertRaises(TypeError) with vars() to verify that __slots__ is working). Overall, my assessment is that this proposed API expansion impairs the learnabilty and usability of vars(). In the entire long history of vars(), this feature has never been requested. Even the OP said, I just realized that it isn't built-out for inclusion __slots__; rather than saying, I really think this would have helped me with a real debugging problem. We have zero evidence that this proposed feature would be of any value and I have given reasons why it would make the language worse. Guido choose not to include this behavior when he added __slots__ back in Python 2.2 (when many introspection builtins were changed to accommodate new-style classes). IMO, no reason has surfaced in the last 15 years to warrant reversing his decision. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 23:50:03 2017 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Apr 2017 03:50:03 +0000 Subject: [issue29990] Range checking in GB18030 decoder Message-ID: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> New submission from Ma Lin: This issue is split from issue24117, that issue became a soup of small issues, so I'm going to close it. For 4-byte GB18030 sequence, the legal range is: 0x81-0xFE for the 1st byte 0x30-0x39 for the 2nd byte 0x81-0xFE for the 3rd byte 0x30-0x39 for the 4th byte GB18030 standard: https://en.wikipedia.org/wiki/GB_18030 https://pan.baidu.com/share/link?shareid=2606985291&uk=3341026630 The current code forgets to check 0xFE for the 1st and 3rd byte. Therefore, there are 8630 illegal 4-byte sequences can be decoded by GB18030 codec, here is an example: # legal sequence b'\x81\x31\x81\x30' is decoded to U+060A, it's fine. uchar = b'\x81\x31\x81\x30'.decode('gb18030') print(hex(ord(uchar))) # illegal sequence 0x8130FF30 can be decoded to U+060A as well, this should not happen. uchar = b'\x81\x30\xFF\x30' .decode('gb18030') print(hex(ord(uchar))) ---------- components: Unicode messages: 291153 nosy: Ma Lin, ezio.melotti, haypo priority: normal severity: normal status: open title: Range checking in GB18030 decoder type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 23:53:59 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 05 Apr 2017 03:53:59 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491364439.11.0.737230872219.issue29990@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1168 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 23:56:05 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 05 Apr 2017 03:56:05 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491364565.38.0.493995690962.issue29990@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 4 23:57:36 2017 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Apr 2017 03:57:36 +0000 Subject: [issue24117] Wrong range checking in GB18030 decoder. In-Reply-To: <1430641019.11.0.12743813091.issue24117@psf.upfronthosting.co.za> Message-ID: <1491364656.35.0.000350059470269.issue24117@psf.upfronthosting.co.za> Changes by Ma Lin : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 00:35:34 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 05 Apr 2017 04:35:34 +0000 Subject: [issue29981] Update Index for set, dict, and generator 'comprehensions' In-Reply-To: <1491328871.52.0.864348862414.issue29981@psf.upfronthosting.co.za> Message-ID: <1491366934.26.0.9204998625.issue29981@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 00:54:10 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 04:54:10 +0000 Subject: [issue29640] _PyThreadState_Init and fork race leads to inconsistent key list In-Reply-To: <1487927038.37.0.851881550844.issue29640@psf.upfronthosting.co.za> Message-ID: <1491368050.11.0.553094807273.issue29640@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:08:07 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 05 Apr 2017 05:08:07 +0000 Subject: [issue29981] Update Index for set, dict, and generator 'comprehensions' In-Reply-To: <1491328871.52.0.864348862414.issue29981@psf.upfronthosting.co.za> Message-ID: <1491368887.47.0.0111437285403.issue29981@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1170 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:12:47 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 05 Apr 2017 05:12:47 +0000 Subject: [issue29446] Improve tkinter 'import *' situation In-Reply-To: <1486243465.34.0.0929989866435.issue29446@psf.upfronthosting.co.za> Message-ID: <1491369167.32.0.075956293476.issue29446@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:36:24 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 05:36:24 +0000 Subject: [issue29549] Improve docstring for str.index In-Reply-To: <1487019442.21.0.885918615749.issue29549@psf.upfronthosting.co.za> Message-ID: <1491370584.22.0.857586407655.issue29549@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 43ba8861e0ad044efafa46a7cc04e12ac5df640e by Raymond Hettinger (Lisa Roach) in branch 'master': bpo-29549: Fixes docstring for str.index (#256) https://github.com/python/cpython/commit/43ba8861e0ad044efafa46a7cc04e12ac5df640e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:37:14 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 05:37:14 +0000 Subject: [issue29569] threading.Timer class: Continue periodical execution till action returns True In-Reply-To: <1487170450.59.0.269062661251.issue29569@psf.upfronthosting.co.za> Message-ID: <1491370634.36.0.8028315409.issue29569@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Antoine, do you care to make the call on this one? ---------- assignee: -> pitrou nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:40:38 2017 From: report at bugs.python.org (Thomas Antony) Date: Wed, 05 Apr 2017 05:40:38 +0000 Subject: [issue29987] inspect.isgeneratorfunction not working with partial functions In-Reply-To: <1491348915.09.0.197335598745.issue29987@psf.upfronthosting.co.za> Message-ID: <1491370838.8.0.755793338006.issue29987@psf.upfronthosting.co.za> Thomas Antony added the comment: Is there any way to distinguish such callables from "normal" functions without actually calling them? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:42:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 05:42:13 +0000 Subject: [issue20545] Use specific asserts in unicode tests In-Reply-To: <1391804725.49.0.807419128336.issue20545@psf.upfronthosting.co.za> Message-ID: <1491370933.89.0.592569202961.issue20545@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed Added file: http://bugs.python.org/file46777/test_unicode_asserts_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:43:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 05:43:00 +0000 Subject: [issue20547] Use specific asserts in bigmem tests In-Reply-To: <1391804756.75.0.781107542362.issue20547@psf.upfronthosting.co.za> Message-ID: <1491370980.02.0.486463195263.issue20547@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed Added file: http://bugs.python.org/file46778/test_bigmem_asserts_3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:44:23 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 05:44:23 +0000 Subject: [issue16510] Using appropriate checks in tests In-Reply-To: <1353321858.76.0.504726837876.issue16510@psf.upfronthosting.co.za> Message-ID: <1491371063.75.0.0754958351472.issue16510@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed Added file: http://bugs.python.org/file46779/tests_asserts_7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 01:46:12 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 05 Apr 2017 05:46:12 +0000 Subject: [issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like In-Reply-To: <1491349378.03.0.0671954460373.issue29988@psf.upfronthosting.co.za> Message-ID: <1491371172.24.0.329203149425.issue29988@psf.upfronthosting.co.za> Nick Coghlan added the comment: My first thought would be to inject a wordcode instruction that's essentially an eval loop directive: "ATOMIC_UNTIL " ATOMIC_UNTIL would have at least the following properties: - checks for signals are skipped until the given offset is reached - checks to release the GIL are skipped until the given offset is reached It may also have the following defensive coding property: - only wordcode instructions on a pre-approved whitelist are permitted during atomic execution blocks (i.e. we'd only add them to the whitelist on an as needed basis, to minimise the risk of undesirable side effects, like being able to use wordcode manipulation to put an entire loop inside an atomic block) The last bit would likely have undesirable performance implications, so it would probably be reasonable to only enable the check for debug builds, rather than always enforcing it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:19:52 2017 From: report at bugs.python.org (bo qu) Date: Wed, 05 Apr 2017 06:19:52 +0000 Subject: [issue29959] re.match failed to match left square brackets as the first char In-Reply-To: <1491032656.36.0.284676378832.issue29959@psf.upfronthosting.co.za> Message-ID: bo qu added the comment: hi Serhiy Storchaka thank you for your explanation, it helps a lot 2017-04-01 15:44 GMT+08:00 Serhiy Storchaka : > > Serhiy Storchaka added the comment: > > re.match() checks if the beginning of the string matches the regular > expression pattern. Use re.search() if you want to find the match not at > the beginning of the string. > > https://docs.python.org/3/library/re.html#re.match > https://docs.python.org/3/library/re.html#re.search > > ---------- > nosy: +serhiy.storchaka > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:21:19 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 06:21:19 +0000 Subject: [issue29984] Improve test coverage for 'heapq' module In-Reply-To: <1491336159.04.0.480090056771.issue29984@psf.upfronthosting.co.za> Message-ID: <1491373279.17.0.942208893346.issue29984@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:23:03 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 06:23:03 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1491373383.86.0.915218629108.issue29960@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:23:24 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 06:23:24 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1491373404.73.0.0562848855887.issue29960@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:28:48 2017 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Apr 2017 06:28:48 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491373728.46.0.800351559046.issue29990@psf.upfronthosting.co.za> Changes by Ma Lin : ---------- pull_requests: +1171 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:32:02 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 06:32:02 +0000 Subject: [issue29549] Improve docstring for str.index In-Reply-To: <1487019442.21.0.885918615749.issue29549@psf.upfronthosting.co.za> Message-ID: <1491373922.56.0.104328687056.issue29549@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks Lisa. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:34:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 06:34:15 +0000 Subject: [issue28754] Argument Clinic for bisect.bisect_left In-Reply-To: <1479660719.6.0.85429244405.issue28754@psf.upfronthosting.co.za> Message-ID: <1491374055.1.0.164819008928.issue28754@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Now `Py_ssize_t(accept={int, NoneType})` can be used instead of a local converter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:34:31 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 06:34:31 +0000 Subject: [issue29944] Argumentless super() fails in classes constructed with type() In-Reply-To: <1490855809.89.0.267666010996.issue29944@psf.upfronthosting.co.za> Message-ID: <1491374071.83.0.238204735931.issue29944@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:37:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 06:37:26 +0000 Subject: [issue29762] Use "raise from None" In-Reply-To: <1489007676.29.0.138385616596.issue29762@psf.upfronthosting.co.za> Message-ID: <1491374246.18.0.971235988118.issue29762@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 5affd23e6f42125998724787025080a24839266e by Serhiy Storchaka in branch 'master': bpo-29762: More use "raise from None". (#569) https://github.com/python/cpython/commit/5affd23e6f42125998724787025080a24839266e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:39:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 06:39:04 +0000 Subject: [issue29762] Use "raise from None" In-Reply-To: <1489007676.29.0.138385616596.issue29762@psf.upfronthosting.co.za> Message-ID: <1491374344.28.0.470148657132.issue29762@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:42:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 06:42:20 +0000 Subject: [issue28754] Argument Clinic for bisect.bisect_left In-Reply-To: <1479660719.6.0.85429244405.issue28754@psf.upfronthosting.co.za> Message-ID: <1491374540.05.0.0119803699669.issue28754@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Wouldn't it be easily to let the OP apply AC to some other module. Right now, it isn't a very good fit and was this a tough one to start with. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 02:54:17 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 05 Apr 2017 06:54:17 +0000 Subject: [issue29569] threading.Timer class: Continue periodical execution till action returns True In-Reply-To: <1487170450.59.0.269062661251.issue29569@psf.upfronthosting.co.za> Message-ID: <1491375257.11.0.0262143264606.issue29569@psf.upfronthosting.co.za> Antoine Pitrou added the comment: This will obviously break some existing code which passes a function returning true to Timer. I concur with Raymond: I don't think this is a good idea. Also, the Timer class itself is a rather simplistic answer to the problem of scheduling callbacks in the future (it uses a dedicated thread per callback, which is extremely wasteful). You'll find better solutions in more modern toolkits, such as asyncio; or you can easily write your own logic yourself. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 03:22:59 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 05 Apr 2017 07:22:59 +0000 Subject: [issue29955] logging decimal point should come from locale In-Reply-To: <1490980687.61.0.0711345645767.issue29955@psf.upfronthosting.co.za> Message-ID: <1491376979.67.0.102170025257.issue29955@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Since the date format itself isn't localized (fortunately), there is no reason to localize the decimal point either. People wanting a localized logging format can easily override the default configuration. And this proposal would break compatibility with existing log parsing tools. We could probably bikeshed the default logging configuration for a long time, but there is value in not changing the defaults from one release to another. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 04:04:42 2017 From: report at bugs.python.org (Paresh Verma) Date: Wed, 05 Apr 2017 08:04:42 +0000 Subject: [issue29991] http client marks valid multipart headers with defects. Message-ID: <1491379482.82.0.913101246746.issue29991@psf.upfronthosting.co.za> New submission from Paresh Verma: When http client parses a multipart response, it always taints the headers with defects. e.g. Use the attached file to start a simple http server, using current python exec, with commands: ```python .\example_bug.py server``` and run client with: ```python .\example_bug.py client``` which outputs: """[StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()]""" even though the multipart response is correct. This appears to be happening because http.client, when parsing headers of response doesn't specifies the headersonly option, which leads to email.feedparser to parse response body (but http.client only passes header lines for parsing in parse_headers method, and the request body isn't available to email.feedparser). The issue has been mentioned at: https://github.com/shazow/urllib3/issues/800 https://github.com/Azure/azure-storage-python/issues/167 The submitted PR partially fixes the problem: ```..\python.bat .\example_bug.py client``` which outputs """[MultipartInvariantViolationDefect()]""" ---------- components: Library (Lib) files: example_bug.py messages: 291165 nosy: pareshverma91 priority: normal pull_requests: 1172 severity: normal status: open title: http client marks valid multipart headers with defects. type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file46780/example_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 04:16:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 08:16:24 +0000 Subject: [issue10076] Regex objects became uncopyable in 2.5 In-Reply-To: <1286916324.24.0.772801528988.issue10076@psf.upfronthosting.co.za> Message-ID: <1491380184.35.0.649161683085.issue10076@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since the pattern and the match objects can be considered as immutable, it is worth to implement __copy__ and __deepcopy__ returning the object itself. Proposed PR does this. It also fixes signatures of __deepcopy__ methods. Since copying didn't work in all maintained version for long time, this is rather a new feature than a bug fix. ---------- nosy: +serhiy.storchaka type: behavior -> enhancement versions: +Python 3.7 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 04:16:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 08:16:56 +0000 Subject: [issue10076] Regex objects became uncopyable in 2.5 In-Reply-To: <1286916324.24.0.772801528988.issue10076@psf.upfronthosting.co.za> Message-ID: <1491380216.03.0.333657652381.issue10076@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1173 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 04:22:05 2017 From: report at bugs.python.org (Tobias Oberstein) Date: Wed, 05 Apr 2017 08:22:05 +0000 Subject: [issue29992] Expose parse_string in JSONDecoder Message-ID: <1491380525.56.0.628505740968.issue29992@psf.upfronthosting.co.za> New submission from Tobias Oberstein: Though the JSONDecoder already has all the hooks internally to allow for a custom parse_string (https://github.com/python/cpython/blob/master/Lib/json/decoder.py#L330), this currently is not exposed in the constructor JSONDecoder.__init__. It would be nice to expose it. Currently, I need to do hack it: https://gist.github.com/oberstet/fa8b8e04b8d532912bd616d9db65101a ---------- messages: 291167 nosy: oberstet priority: normal severity: normal status: open title: Expose parse_string in JSONDecoder type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 04:24:53 2017 From: report at bugs.python.org (Martin Panter) Date: Wed, 05 Apr 2017 08:24:53 +0000 Subject: [issue29991] http client marks valid multipart headers with defects. In-Reply-To: <1491379482.82.0.913101246746.issue29991@psf.upfronthosting.co.za> Message-ID: <1491380693.6.0.182641982916.issue29991@psf.upfronthosting.co.za> Martin Panter added the comment: Looks like a duplicate of Issue 29353, which has a more complete patch proposed. However, see my comment about a problem with using heartersonly=True. My policy-flag.v2.patch for Issue 24363 may help (the details have faded from my mind, but I suspect it will either fix the problem as-is, or could be adapted). ---------- nosy: +martin.panter resolution: -> duplicate superseder: -> Incorrect handling of HTTP response with "Content-Type: message/rfc822" header _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 04:35:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 08:35:45 +0000 Subject: [issue29878] Add global instances of int 0 and 1 In-Reply-To: <1490163311.47.0.711325721357.issue29878@psf.upfronthosting.co.za> Message-ID: <1491381345.42.0.786639379588.issue29878@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1174 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 04:49:12 2017 From: report at bugs.python.org (Martin Panter) Date: Wed, 05 Apr 2017 08:49:12 +0000 Subject: [issue29987] inspect.isgeneratorfunction not working with partial functions In-Reply-To: <1491348915.09.0.197335598745.issue29987@psf.upfronthosting.co.za> Message-ID: <1491382152.06.0.321484385718.issue29987@psf.upfronthosting.co.za> Martin Panter added the comment: Not in general. I think you would have to make special cases for partial functions, __wrapped__, and whatever else there is, and combinations of these. It would be very hard to determine the correct result for test2 in test2 = lambda: test(a=10) # test2() returns a generator def test(a): '''Redefined as a non-generator!''' # Now test2() returns None Maybe there is an argument for supporting partial as a new feature, but I don?t think it is a bug. I think there is precedent with the inspect.getargspec etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 05:00:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 09:00:44 +0000 Subject: [issue29878] Add global instances of int 0 and 1 In-Reply-To: <1490163311.47.0.711325721357.issue29878@psf.upfronthosting.co.za> Message-ID: <1491382844.64.0.947849697182.issue29878@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset bae6881b4215b2613ad08ef0dc7bed7743c2b8cc by Serhiy Storchaka in branch 'master': Update Argument Clinic generated code for bpo-29878. (#1001) https://github.com/python/cpython/commit/bae6881b4215b2613ad08ef0dc7bed7743c2b8cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 05:30:45 2017 From: report at bugs.python.org (sijian liang) Date: Wed, 05 Apr 2017 09:30:45 +0000 Subject: [issue29993] error of parsing encoded words in email of standard library Message-ID: <1491384645.5.0.116667122318.issue29993@psf.upfronthosting.co.za> New submission from sijian liang: This issue is fixed in python3 see https://github.com/python/cpython/commit/07ea53cb218812404cdbde820647ce6e4b2d0f8e ---------- components: email messages: 291171 nosy: barry, r.david.murray, sijian liang priority: normal severity: normal status: open title: error of parsing encoded words in email of standard library type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 05:38:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 09:38:40 +0000 Subject: [issue29992] Expose parse_string in JSONDecoder In-Reply-To: <1491380525.56.0.628505740968.issue29992@psf.upfronthosting.co.za> Message-ID: <1491385120.32.0.00843494219572.issue29992@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: JSONDecoder constructor already has too much parameters. Adding new parameters will decrease usability. For such uncommon case I think overriding a method in a subclass is the best solution. ---------- nosy: +ezio.melotti, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 05:58:50 2017 From: report at bugs.python.org (Tobias Oberstein) Date: Wed, 05 Apr 2017 09:58:50 +0000 Subject: [issue29992] Expose parse_string in JSONDecoder In-Reply-To: <1491380525.56.0.628505740968.issue29992@psf.upfronthosting.co.za> Message-ID: <1491386330.76.0.955096849979.issue29992@psf.upfronthosting.co.za> Tobias Oberstein added the comment: I agree, my use case is probably exotic: transparent roundtripping of binaries over JSON using a beginning \0 byte marker to distinguish plain string and base64 encoded binaries. FWIW, I do think however that adding "parse_string" kw param to the ctor of JSONDecoder would at least fit the current approach: there are parse_xxx parameters for all the other things already. If overriding string parsing would be via subclassing, while all the others stay with the kw parameter approach, that could be slightly confusing too, because it looses on consistency. Switching everything to subclassing/overriding for _all_ parse_XXX is I guess a no go, because it breaks existing stuff? > For me in my situation, it'll be messy anyways, because I need to support Py2 and 3, and CPy and PyPy .. I just filed the issue for "completeness". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 06:36:22 2017 From: report at bugs.python.org (Brecht Machiels) Date: Wed, 05 Apr 2017 10:36:22 +0000 Subject: [issue29994] site.USER_SITE is None for Windows embeddable Python 3.6 Message-ID: <1491388582.7.0.185144058431.issue29994@psf.upfronthosting.co.za> New submission from Brecht Machiels: Previous versions of the embeddable Python: Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import site >>> site.USER_SITE 'C:\\Users\\Brecht\\AppData\\Roaming\\Python\\Python35\\site-packages' >>> Version 3.6.0 and 3.6.1, both win32 and amd64: Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32 >>> import site >>> site.USER_SITE >>> This causes problems when importing pip for example. ---------- components: Windows messages: 291174 nosy: brechtm, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: site.USER_SITE is None for Windows embeddable Python 3.6 type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 07:00:54 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Apr 2017 11:00:54 +0000 Subject: [issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad In-Reply-To: <1476176180.11.0.398413685253.issue28415@psf.upfronthosting.co.za> Message-ID: <1491390054.02.0.257695704014.issue28415@psf.upfronthosting.co.za> Terry J. Reedy added the comment: (Response to what I believe is latest patch.) In msg278666, my two suggestions were 'either...or', not both. The list came from Antti's msg278528, but the correct list for Python appears to be different, and different for bytes and unicode. When I made the suggestion, I did not realize that 'exactly' was repeated for each conversion type in a table. As a note, I think the following might work. "For conversion types, the 0-conversion flag has effect even when a precision is given." I also think that 'exactly could be dropped when it is not exactly true. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 07:36:15 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 05 Apr 2017 11:36:15 +0000 Subject: [issue29353] Incorrect handling of HTTP response with "Content-Type: message/rfc822" header In-Reply-To: <1485197905.85.0.319696153354.issue29353@psf.upfronthosting.co.za> Message-ID: <1491392175.23.0.615386786796.issue29353@psf.upfronthosting.co.za> R. David Murray added the comment: I'm not surprised that trying to render a message parsed with 'headersonly' fails. headersonly treats the entire message body as a single string payload. I'm not sure what the correct behavior should be for the email package, but the fact that this doesn't work currently shouldn't matter to the http package. Given the error involves policy, it is quite possible as_string used to work in this context and I broke it when introducing policy because there is no test that covers this case. I'm guessing there is no test because turning a message parsed with headersonly back into a string wasn't considered to be useful. As for the multipart thing, that is actually consistent with the docs. get_content_type gives you the value of the header, is_multipart effectively reports whether or not the payload is a list, and when parsed with headersonly, the body is a string not a list, which is documented. Granted, you have to connect those dots yourself, so a sentence about that *could* be added to the headersonly docs. All of which should be in a separate issue from this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 10:17:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 14:17:51 +0000 Subject: [issue29995] re.escape() escapes too much Message-ID: <1491401871.1.0.717928370576.issue29995@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: re.escape() escapes all the characters except ASCII letters, numbers and '_'. This is too excessive, makes escaping and compiling slower and makes the pattern less human-readable. Characters "!\"%&\',/:;<=>@_`~" as well as non-ASCII characters are always literal in a regular expression and don't need escaping. Proposed patch makes re.escape() escaping only minimal set of characters that can have special meaning in regular expressions. This includes special characters ".\\[]{}()*+?^$|", "-" (a range in a character set), "#" (starts a comment in verbose mode) and ASCII whitespaces (ignored in verbose mode). The null character no longer need a special escaping. The patch also increases the speed of re.escape() (even if it produces the same result). $ ./python -m perf timeit -s 'from re import escape; s = "()[]{}?*+-|^$\\.# \t\n\r\v\f"' -- --duplicate 100 'escape(s)' Unpatched: Median +- std dev: 42.2 us +- 0.8 us Patched: Median +- std dev: 11.4 us +- 0.1 us $ ./python -m perf timeit -s 'from re import escape; s = b"()[]{}?*+-|^$\\.# \t\n\r\v\f"' -- --duplicate 100 'escape(s)' Unpatched: Median +- std dev: 38.7 us +- 0.7 us Patched: Median +- std dev: 18.4 us +- 0.2 us $ ./python -m perf timeit -s 'from re import escape; s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"' -- --duplicate 100 'escape(s)' Unpatched: Median +- std dev: 40.3 us +- 0.5 us Patched: Median +- std dev: 33.1 us +- 0.6 us $ ./python -m perf timeit -s 'from re import escape; s = b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"' -- --duplicate 100 'escape(s)' Unpatched: Median +- std dev: 54.4 us +- 0.7 us Patched: Median +- std dev: 40.6 us +- 0.5 us $ ./python -m perf timeit -s 'from re import escape; s = "??????????????????????????????????????????????????????????????????"' -- --duplicate 100 'escape(s)' Unpatched: Median +- std dev: 156 us +- 3 us Patched: Median +- std dev: 43.5 us +- 0.5 us $ ./python -m perf timeit -s 'from re import escape; s = "??????????????????????????????????????????????????????????????????".encode()' -- --duplicate 100 'escape(s)' Unpatched: Median +- std dev: 200 us +- 4 us Patched: Median +- std dev: 77.0 us +- 0.6 us And the speed of compilation of escaped string. $ ./python -m perf timeit -s 'from re import escape; from sre_compile import compile; s = "??????????????????????????????????????????????????????????????????"; p = escape(s)' -- --duplicate 100 'compile(p)' Unpatched: Median +- std dev: 1.96 ms +- 0.02 ms Patched: Median +- std dev: 1.16 ms +- 0.02 ms $ ./python -m perf timeit -s 'from re import escape; from sre_compile import compile; s = "??????????????????????????????????????????????????????????????????".encode(); p = escape(s)' -- --duplicate 100 'compile(p)' Unpatched: Median +- std dev: 3.69 ms +- 0.04 ms Patched: Median +- std dev: 2.13 ms +- 0.03 ms ---------- components: Library (Lib), Regular Expressions messages: 291177 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: re.escape() escapes too much type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 10:19:23 2017 From: report at bugs.python.org (=?utf-8?q?Jo=C3=A3o_Bernardo?=) Date: Wed, 05 Apr 2017 14:19:23 +0000 Subject: [issue13290] get vars for object with __slots__ In-Reply-To: <1319871850.77.0.869546838833.issue13290@psf.upfronthosting.co.za> Message-ID: <1491401963.32.0.126485128745.issue13290@psf.upfronthosting.co.za> Jo?o Bernardo added the comment: Being the OP, at that time I felt it was important to have a vars() function that worked on __slots__ to ease something I was developing. The truth for me is: __slots__ is not really relevant anymore. The benefits it brings are not enough to make the feature usable because of these incompatibilities with normal classes. Also, it does not bring real benefits even for most people who think they need this. If you believe having vars() working on __slots__ is bad because people may want to update it, why would locals() exist at all? Also, your argument that having vars() working on __slots__ classes may mask the wrong use of the attribute, why would someone use vars() on __slots__ if it doesn't work right now? If it is not useful for identifying this problem now, then I am ok with it not being useful in the future as well. On any case, feel free to mark this as "rejected" or "wont fix" because if in 6 years no one cared enough to have it working means that either it is not important and/or __slots__ classes are also not relevant for others as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 10:23:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 14:23:39 +0000 Subject: [issue29995] re.escape() escapes too much In-Reply-To: <1491401871.1.0.717928370576.issue29995@psf.upfronthosting.co.za> Message-ID: <1491402219.66.0.859744738586.issue29995@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1175 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 10:26:26 2017 From: report at bugs.python.org (=?utf-8?q?Charles_Bouchard-L=C3=A9gar=C3=A9?=) Date: Wed, 05 Apr 2017 14:26:26 +0000 Subject: [issue26789] Please do not log during shutdown In-Reply-To: <1460905927.74.0.222378341822.issue26789@psf.upfronthosting.co.za> Message-ID: <1491402386.27.0.512172207705.issue26789@psf.upfronthosting.co.za> Changes by Charles Bouchard-L?gar? : ---------- nosy: +Charles Bouchard-L?gar? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:07:40 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 15:07:40 +0000 Subject: [issue13290] get vars for object with __slots__ In-Reply-To: <1319871850.77.0.869546838833.issue13290@psf.upfronthosting.co.za> Message-ID: <1491404860.6.0.432887438915.issue13290@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > On any case, feel free to mark this as "rejected" or "wont fix" Okay, will do. And though I think the idea had some significant downsides, it is was creative and we appreciate the suggestion. ---------- resolution: -> rejected stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:10:03 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 15:10:03 +0000 Subject: [issue29992] Expose parse_string in JSONDecoder In-Reply-To: <1491380525.56.0.628505740968.issue29992@psf.upfronthosting.co.za> Message-ID: <1491405003.5.0.106731440478.issue29992@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I agree with Serhiy that the JSON module is already complex enough that adding more features will have a negative net effect on usability. Bob, what do you think? ---------- assignee: -> bob.ippolito nosy: +bob.ippolito _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:13:01 2017 From: report at bugs.python.org (Dominic Mayers) Date: Wed, 05 Apr 2017 15:13:01 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491405181.56.0.419300396161.issue29947@psf.upfronthosting.co.za> Dominic Mayers added the comment: An improved version of the patch, I hope. I will remove the old patch, because it's really does not help to see the old versions. ---------- Added file: http://bugs.python.org/file46781/Issue29947_for_discussion_04.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:13:24 2017 From: report at bugs.python.org (Dominic Mayers) Date: Wed, 05 Apr 2017 15:13:24 +0000 Subject: [issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself? In-Reply-To: <1490875733.83.0.750732897079.issue29947@psf.upfronthosting.co.za> Message-ID: <1491405204.57.0.971509490071.issue29947@psf.upfronthosting.co.za> Changes by Dominic Mayers : Removed file: http://bugs.python.org/file46775/Issue29947_for_discussion_03.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:25:10 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 15:25:10 +0000 Subject: [issue29992] Expose parse_string in JSONDecoder In-Reply-To: <1491380525.56.0.628505740968.issue29992@psf.upfronthosting.co.za> Message-ID: <1491405910.21.0.838872337158.issue29992@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- components: +Library (Lib) versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:26:37 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 15:26:37 +0000 Subject: [issue29993] error of parsing encoded words in email of standard library In-Reply-To: <1491384645.5.0.116667122318.issue29993@psf.upfronthosting.co.za> Message-ID: <1491405997.82.0.479450923514.issue29993@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Barry, is this something that should go back to 2.7 or is that pretty much settled business at this point? ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:27:34 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 15:27:34 +0000 Subject: [issue29569] threading.Timer class: Continue periodical execution till action returns True In-Reply-To: <1487170450.59.0.269062661251.issue29569@psf.upfronthosting.co.za> Message-ID: <1491406054.79.0.741456510983.issue29569@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:30:39 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 15:30:39 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491406239.78.0.714359962398.issue29692@psf.upfronthosting.co.za> Raymond Hettinger added the comment: PEP 8's rule makes sense elsewhere, but for context managers I think an implicit return None is the norm and that making it explicit wouldn't improve readability. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:32:42 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 05 Apr 2017 15:32:42 +0000 Subject: [issue29993] error of parsing encoded words in email of standard library In-Reply-To: <1491405997.82.0.479450923514.issue29993@psf.upfronthosting.co.za> Message-ID: <20170405113239.6667735a@subdivisions.wooz.org> Barry A. Warsaw added the comment: On Apr 05, 2017, at 03:26 PM, Raymond Hettinger wrote: >Barry, is this something that should go back to 2.7 or is that pretty much >settled business at this point? I think we should not backport this. It's a behavior change and my concern would be that anybody who's bitten by this in Python 2.7 is either already dealing with it or has already worked around it. I wouldn't want to change that in a 2.7 point release. @r.david.murray might have a different opinion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 11:44:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 15:44:49 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491407089.12.0.637053225547.issue29692@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Then the exception for the __exit__ method should be documented in PEP 8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 12:00:18 2017 From: report at bugs.python.org (Bob Ippolito) Date: Wed, 05 Apr 2017 16:00:18 +0000 Subject: [issue29992] Expose parse_string in JSONDecoder In-Reply-To: <1491380525.56.0.628505740968.issue29992@psf.upfronthosting.co.za> Message-ID: <1491408018.74.0.729762720798.issue29992@psf.upfronthosting.co.za> Bob Ippolito added the comment: I agree with that sentiment. If we were to want to support this use case I would rather put together a coherent way to augment the parsing/encoding of anything than bolt it on to what we have. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 12:04:29 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 05 Apr 2017 16:04:29 +0000 Subject: [issue29640] _PyThreadState_Init and fork race leads to inconsistent key list In-Reply-To: <1487927038.37.0.851881550844.issue29640@psf.upfronthosting.co.za> Message-ID: <1491408269.11.0.543877044948.issue29640@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 12:29:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 16:29:16 +0000 Subject: [issue29996] Use terminal width by default in pprint Message-ID: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: pprint() uses width=80 by default. But default output stream is sys.stdout which often is connected to a terminal, and terminals now usually have larger width than 80 columns. Proposed patch change the default value of the width parameter in pprint(). If the width is specified and the output is a terminal, then the width of the terminal is used. ---------- components: Library (Lib) messages: 291187 nosy: fdrake, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use terminal width by default in pprint type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 12:42:30 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 16:42:30 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491410550.26.0.299094991312.issue29996@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1176 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 13:34:29 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Apr 2017 17:34:29 +0000 Subject: [issue29962] Add math.remainder operation In-Reply-To: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> Message-ID: <1491413669.82.0.227444270454.issue29962@psf.upfronthosting.co.za> Mark Dickinson added the comment: New changeset a0ce375e10b50f7606cb86b072fed7d8cd574fe7 by Mark Dickinson in branch 'master': bpo-29962: add math.remainder (#950) https://github.com/python/cpython/commit/a0ce375e10b50f7606cb86b072fed7d8cd574fe7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 13:34:29 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 05 Apr 2017 17:34:29 +0000 Subject: [issue29993] error of parsing encoded words in email of standard library In-Reply-To: <1491384645.5.0.116667122318.issue29993@psf.upfronthosting.co.za> Message-ID: <1491413669.99.0.662655231745.issue29993@psf.upfronthosting.co.za> R. David Murray added the comment: I consciously decided not to backport this to 2.7 at the time, though I'm not sure I said that out loud. I think it is too much of a behavior change for 2.7. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 13:36:36 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Apr 2017 17:36:36 +0000 Subject: [issue29962] Add math.remainder operation In-Reply-To: <1491057158.44.0.328286654069.issue29962@psf.upfronthosting.co.za> Message-ID: <1491413796.68.0.251505572426.issue29962@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 13:39:17 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 05 Apr 2017 17:39:17 +0000 Subject: [issue29993] error of parsing encoded words in email of standard library In-Reply-To: <1491384645.5.0.116667122318.issue29993@psf.upfronthosting.co.za> Message-ID: <1491413957.64.0.26848073378.issue29993@psf.upfronthosting.co.za> R. David Murray added the comment: Actually, looking at the issue related to the patch, we conferred at the time, Barry, and decided on no backports. It was applied only to default. Sijian: the reason we put the issue number in the commit message is because the issue often contains relevant discussion that can supplement the commit message. ---------- resolution: rejected -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 14:35:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 18:35:18 +0000 Subject: [issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex In-Reply-To: <1479743857.98.0.418828964214.issue28765@psf.upfronthosting.co.za> Message-ID: <1491417318.82.0.660696753826.issue28765@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1177 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 14:36:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 18:36:50 +0000 Subject: [issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex In-Reply-To: <1479743857.98.0.418828964214.issue28765@psf.upfronthosting.co.za> Message-ID: <1491417410.14.0.532594214005.issue28765@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The patch makes some operations slightly faster. $ ./python -m perf timeit -s 'import re; m = re.match(r"(?P\d+)(?:\.(?P\d*))?", "12.34")' -- --duplicate 100 'm.lastgroup' Unpatched: Median +- std dev: 204 ns +- 1 ns Patched: Median +- std dev: 167 ns +- 2 ns $ ./python -m perf timeit -s 'import re; m = re.match(r"(?P\d+)(?:\.(?P\d*))?", "12.34")' -- --duplicate 100 'm.groupdict()' Unpatched: Median +- std dev: 2.78 us +- 0.05 us Patched: Median +- std dev: 1.98 us +- 0.04 us $ ./python -m perf timeit -s 'import re; m = re.match(r"(?P\d+)(?:\.(?P\d*))?", "12.34")' -- --duplicate 100 'm.start("frac")' Unpatched: Median +- std dev: 638 ns +- 22 ns Patched: Median +- std dev: 576 ns +- 16 ns $ ./python -m perf timeit -s 'import re; m = re.match(r"(?P\d+)(?:\.(?P\d*))?", "12.34")' -- --duplicate 100 'm.group("frac")' Unpatched: Median +- std dev: 1.15 us +- 0.03 us Patched: Median +- std dev: 1.07 us +- 0.03 us ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 14:46:35 2017 From: report at bugs.python.org (Arthur Goldberg) Date: Wed, 05 Apr 2017 18:46:35 +0000 Subject: [issue29997] Suggested changes for https://docs.python.org/3.6/extending/extending.html Message-ID: <1491417995.71.0.832434605196.issue29997@psf.upfronthosting.co.za> New submission from Arthur Goldberg: I've just taught myself how to write C extensions to Python with https://docs.python.org/3.6/extending/extending.html. I think it's quite good. Nevertheless, I've some suggested improvements. These all use the vi s/// replacement syntax. Ambiguous 'it': s/If the latter header file does not exist on your system, it declares the functions malloc(), free() and realloc() directly./If the latter header file does not exist on your system, Python.h declares the functions malloc(), free() and realloc() directly./ Unclear, as 'The C function' refers to the specific example, whereas 'always has' implies that this applies to all calls from Python to C: s/The C function always has two arguments, conventionally/A C function called by Python always has two arguments, conventionally/ In PyMODINIT_FUNC PyInit_spam(void) { PyObject *m; m = PyModule_Create(&spammodule); if (m == NULL) return NULL; SpamError = PyErr_NewException("spam.error", NULL, NULL); Py_INCREF(SpamError); PyModule_AddObject(m, "error", SpamError); return m; } remove m = PyModule_Create(&spammodule); if (m == NULL) return NULL; and replace it with ... because it won't compile because spammodule has not been described yet on the page. Self-contradictory: 'normally always' is an oxymoron. s/It should normally always be METH_VARARGS or METH_VARARGS | METH_KEYWORDS; a value of 0 means that an obsolete variant of PyArg_ParseTuple() is used./It should always be METH_VARARGS or METH_VARARGS | METH_KEYWORDS; however, legacy code may use 0, which indicates that an obsolete variant of PyArg_ParseTuple() is being used./ Incomplete: this comment doesn't contain a complete thought s/module documentation, may be NULL/pointer to a string containing the module's documentation, or NULL if none is provided/ Provide hyperlink: for user convenience, add a hyperlink to 'Modules/xxmodule.c' s/included in the Python source distribution as Modules/xxmodule.c/included in the Python source distribution as Modules/xxmodule.c/ Incomplete: It would be good to lead programmers towards the easiest approach. s/ If you use dynamic loading,/ If you can use dynamic loading, the the easiest approach is to use Python's distutils module to build your module. If you use dynamic loading,/ ---------- assignee: docs at python components: Documentation messages: 291192 nosy: ArthurGoldberg, docs at python priority: normal severity: normal status: open title: Suggested changes for https://docs.python.org/3.6/extending/extending.html type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 15:52:21 2017 From: report at bugs.python.org (Arthur Goldberg) Date: Wed, 05 Apr 2017 19:52:21 +0000 Subject: [issue29997] Suggested changes for https://docs.python.org/3.6/extending/extending.html In-Reply-To: <1491417995.71.0.832434605196.issue29997@psf.upfronthosting.co.za> Message-ID: <1491421941.58.0.657837531516.issue29997@psf.upfronthosting.co.za> Arthur Goldberg added the comment: Also, Incorrect number agreement: s/strategy that minimizes this kind of errors/strategy that minimizes this kind of error/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 16:07:15 2017 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Wed, 05 Apr 2017 20:07:15 +0000 Subject: [issue29997] Suggested changes for https://docs.python.org/3.6/extending/extending.html In-Reply-To: <1491417995.71.0.832434605196.issue29997@psf.upfronthosting.co.za> Message-ID: <1491422835.28.0.708448054341.issue29997@psf.upfronthosting.co.za> Changes by Fred L. Drake, Jr. : ---------- nosy: +fdrake _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 16:34:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 20:34:36 +0000 Subject: [issue29998] Pickling and copying ImportError doesn't preserve name and path Message-ID: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Pickling and copying ImportError doesn't preserve name and path attributes. >>> import copy, pickle >>> e = ImportError('test', name='n', path='p') >>> e.name 'n' >>> e.path 'p' >>> e2 = pickle.loads(pickle.dumps(e, 4)) >>> e2.name >>> e2.path >>> e2 = copy.copy(e) >>> e2.name >>> e2.path Proposed patch fixes this. ---------- components: Interpreter Core messages: 291194 nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Pickling and copying ImportError doesn't preserve name and path type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 16:39:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 20:39:54 +0000 Subject: [issue29998] Pickling and copying ImportError doesn't preserve name and path In-Reply-To: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za> Message-ID: <1491424794.61.0.377070572165.issue29998@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1178 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 17:37:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 05 Apr 2017 21:37:20 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491428240.96.0.887746483984.issue29996@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Some thoughts: * I'm not sure the terminal width will always be knowable, for example when using IDLE. * I often need smaller widths when printing short dicts and lists. The smaller widths better show the parallel structure. I think having it fill the width of my screen is rarely what I would want. * ISTM, this will cause reproducibility issues, esp for doctests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 17:45:22 2017 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Wed, 05 Apr 2017 21:45:22 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491428722.6.0.29864319628.issue29996@psf.upfronthosting.co.za> Fred L. Drake, Jr. added the comment: This is not a problem for doctests, since the output stream is not a terminal; the check for terminal-ness seems reasonable. (Though I don't have any idea if it works on Windows, but it seems properly factored.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 17:58:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 21:58:11 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491429491.32.0.705381184548.issue29996@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: * In IDLE sys.stdout.isatty() returns True, but sys.stdout.fileno() raises an exception. Terminal width can't be determined and the default 80 is used. * You always can pass explicit width to pprint. This may be needed even with default width 80. Now on wide a terminal wider 80 columns you have unused space than can cause unneeded wrapping. On a terminal narrower 80 columns the pprint() output is formatted incorrectly and is wrapped twice: by pprint() and by terminal. * The output in doctests is not connected to a terminal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 18:07:04 2017 From: report at bugs.python.org (Eryk Sun) Date: Wed, 05 Apr 2017 22:07:04 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491430024.07.0.206487024267.issue29996@psf.upfronthosting.co.za> Eryk Sun added the comment: > Though I don't have any idea if it works on Windows, but it seems > properly factored. Generally it should. However, os.get_terminal_size is unnecessarily limited to the standard handles with a hard-coded mapping 0 => StandardInput, 1 => StandardOutput, and 2 => StandardError, and otherwise raises ValueError. Example failure: >>> fd = os.open('conout$', os.O_RDWR) >>> os.isatty(fd) True >>> os.get_terminal_size(fd) Traceback (most recent call last): File "", line 1, in ValueError: bad file descriptor There is no need to involve the standard handles. It should call _get_osfhandle(fd). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 18:09:39 2017 From: report at bugs.python.org (=?utf-8?q?Fran=C3=A7ois_Bissey?=) Date: Wed, 05 Apr 2017 22:09:39 +0000 Subject: [issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc' In-Reply-To: <1443130331.16.0.912755488197.issue25229@psf.upfronthosting.co.za> Message-ID: <1491430179.97.0.0408643013139.issue25229@psf.upfronthosting.co.za> Fran?ois Bissey added the comment: I am seeing this with clang on linux. It breaks the building pyzmq. I'll concur with Calvin that using just "-R" is wrong in the first place. Some compiler may pass it directly to the linker. But even in the linker, interpreting "-R" as a rpath if the argument is a directory, is a legacy behavior. "-R" is supposed to be used to add remarks (see ld's man page). On linux it should just be "-Wl,-rpath" and it should work with all compilers. ---------- nosy: +fbissey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 18:29:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 22:29:11 +0000 Subject: [issue29999] repr() of ImportError misses keyword arguments name and path Message-ID: <1491431351.79.0.0513888316468.issue29999@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The repr of standard exceptions usually looks as exception constructor used for creating that exception. But the repr of ImportError misses keyword arguments name and path. >>> ImportError('test', name='somename', path='somepath') ImportError('test',) Proposed patch make the repr of ImportError containing keyword arguments. >>> ImportError('test', name='somename', path='somepath') ImportError('test', name='somename', path='somepath') I don't know how to classify this issue and whether the patch should be backported. ---------- components: Interpreter Core messages: 291200 nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: repr() of ImportError misses keyword arguments name and path versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 18:30:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 05 Apr 2017 22:30:49 +0000 Subject: [issue29999] repr() of ImportError misses keyword arguments name and path In-Reply-To: <1491431351.79.0.0513888316468.issue29999@psf.upfronthosting.co.za> Message-ID: <1491431449.68.0.568740106178.issue29999@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 19:28:22 2017 From: report at bugs.python.org (Ellison Marks) Date: Wed, 05 Apr 2017 23:28:22 +0000 Subject: [issue30000] Inconsistency in the zlib module Message-ID: <1491434902.87.0.645672242128.issue30000@psf.upfronthosting.co.za> New submission from Ellison Marks: In the zlib module, three of the methods support the wbits parameter, those being zlib.compressobj, zlib.decompress and zlib.decompressobj. zlib.compress does not support the wbits parameter. Looking at the source for these functions, those that support the wbits parameter use the "advanced" version of the zlib functions, deflateInit2 and inflateInit2, whereas zlib.compress uses the "basic" function deflateInit. The effect of this is that while you can decode from zlib data with non-default wbits values in one call with zlib.decompress, you cannot encode to zlib data with non-default wbits in one call with zlib.compress. You need to take to extra step of creating a compression object with the appropriate values, then use that to compress the data. eg: zlib.compress(data) # can't use wbits here vs. compressor = zlib.compressobj(wbits=16+zlib.MAX_WBITS) compressor.compress(data) + compressor.flush() Some quick benchmarking shows little speed difference between the two implementations: $ python -m timeit -s 'import zlib' -s 'import random' -s 'import string' -s 's="".join(random.choice(string.printable) for _ in xrange(10000000))' 'zlib.compress(s)' 10 loops, best of 3: 356 msec per loop $ python -m timeit -s 'import zlib' -s 'import random' -s 'import string' -s 's="".join(random.choice(string.printable) for _ in xrange(10000000))' 'compressor=zlib.compressobj()' 'compressor.compress(s)+compressor.flush()' 10 loops, best of 3: 364 msec per loop so I can't see any downside of switching zlib.compress to the "advanced" implementation and exposing the extra parameters to python. ---------- components: Library (Lib) messages: 291201 nosy: Ellison Marks priority: normal severity: normal status: open title: Inconsistency in the zlib module type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 20:50:50 2017 From: report at bugs.python.org (AJ Jordan) Date: Thu, 06 Apr 2017 00:50:50 +0000 Subject: [issue30001] CPython contribution docs reference missing /issuetracker page Message-ID: <1491439850.02.0.465996386955.issue30001@psf.upfronthosting.co.za> New submission from AJ Jordan: https://cpython-devguide.readthedocs.io/pullrequest.html#licensing (and presumably other pages in this project) references https://cpython-devguide.readthedocs.io/issuetracker, but this page returns 404 Not Found. ---------- assignee: docs at python components: Documentation messages: 291202 nosy: docs at python, strugee priority: normal severity: normal status: open title: CPython contribution docs reference missing /issuetracker page _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 22:29:36 2017 From: report at bugs.python.org (Arthur Goldberg) Date: Thu, 06 Apr 2017 02:29:36 +0000 Subject: [issue30002] Minor change to https://docs.python.org/3.6/extending/building.html Message-ID: <1491445776.09.0.388961752083.issue30002@psf.upfronthosting.co.za> New submission from Arthur Goldberg: The core example on this page starts: from distutils.core import setup, Extension module1 = Extension('demo', sources = ['demo.c']) ... I suggest that 'sources = ['demo.c']' be changed to 'sources = ['demomodule.c']', because this would make the example consistent with https://docs.python.org/3.6/extending/extending.html which says: "Begin by creating a file spammodule.c. (Historically, if a module is called spam, the C file containing its implementation is called spammodule.c; ... )" This minor change may help encourage this standard practice. Arthur ---------- assignee: docs at python components: Documentation messages: 291203 nosy: ArthurGoldberg, docs at python priority: normal severity: normal status: open title: Minor change to https://docs.python.org/3.6/extending/building.html type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 22:43:59 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Apr 2017 02:43:59 +0000 Subject: [issue30002] Minor change to https://docs.python.org/3.6/extending/building.html In-Reply-To: <1491445776.09.0.388961752083.issue30002@psf.upfronthosting.co.za> Message-ID: <1491446639.74.0.287387931993.issue30002@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'm not really sure that is a standard or even a best practice. I think some people do it and some don't. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 23:23:12 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 06 Apr 2017 03:23:12 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491448992.67.0.282476330948.issue29990@psf.upfronthosting.co.za> Xiang Zhang added the comment: The table in wikipedia is somewhat complex. I find ftp://ftp.software.ibm.com/software/globalization/documents/gb18030m.pdf and the table in it is same as https://pan.baidu.com/share/link?shareid=2606985291&uk=3341026630 (except 0x80) but in English. I agree with Ma Lin bytes sequences like b'\x81\x30\xFF\x30' are invalid. For current implementation, you could see: >>> invalid = b'\x81\x30\xff\x30' >>> invalid.decode('gb18030').encode('gb18030') == invalid False ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 23:24:45 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 06 Apr 2017 03:24:45 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491449085.32.0.768782674128.issue29990@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- stage: -> patch review versions: +Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 23:36:12 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 06 Apr 2017 03:36:12 +0000 Subject: [issue30001] CPython contribution docs reference missing /issuetracker page In-Reply-To: <1491439850.02.0.465996386955.issue30001@psf.upfronthosting.co.za> Message-ID: <1491449772.23.0.963305506416.issue30001@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Thanks for the report, Alex. The issue tracker for the devguide is at https://github.com/python/devguide Do you mind filling the issue there? I'm closing this since this tracks only issues for CPython. Thanks :) ---------- nosy: +Mariatta stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 5 23:42:17 2017 From: report at bugs.python.org (Ma Lin) Date: Thu, 06 Apr 2017 03:42:17 +0000 Subject: [issue30003] Remove hz codec Message-ID: <1491450137.17.0.519356226961.issue30003@psf.upfronthosting.co.za> New submission from Ma Lin: hz is a Simplified Chinese codec, available in Python since around 2004. However, hz encoder has a serious bug, it forgets to escape ~ >>> 'hi~'.encode('hz') b'hi~' # the correct output should be b'hi~~' As a result, we can't finish a roundtrip: >>> b'hi~'.decode('hz') Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'hz' codec can't decode byte 0x7e in position 2: incomplete multibyte In these years, no one has reported this bug, so I think it's pretty safe to remove hz codec. FYI: HZ codec is a 7-bit wrapper for GB2312, was formerly commonly used in email and USENET postings. It was designed in 1989 by Fung Fung Lee, and subsequently codified in 1995 into RFC 1843. It was popular in USENET networks, which in the late 1980s and early 1990s, generally did not allow transmission of 8-bit characters or escape characters. https://en.wikipedia.org/wiki/HZ_(character_encoding) Does other languages have hz codec? Java 8: no [1] .NET: yes [2] PHP: yes [3] Perl: yes [4] [1] http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html [2] https://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx [3] http://php.net/manual/en/mbstring.supported-encodings.php [4] http://perldoc.perl.org/Encode/CN.html ---------- components: Unicode messages: 291207 nosy: Ma Lin, ezio.melotti, haypo, xiang.zhang priority: normal severity: normal status: open title: Remove hz codec type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 00:18:36 2017 From: report at bugs.python.org (Ma Lin) Date: Thu, 06 Apr 2017 04:18:36 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491452316.37.0.725171306465.issue29990@psf.upfronthosting.co.za> Ma Lin added the comment: > except 0x80 (?) I suppose the English edition is not the final release of GB18030-2000. At the end of official Chinese edition of GB18030-2005, listed the difference between GB18030-2000 and GB18030-2005 clearly, it doesn't mention 0x80 (?), so GB18030-2000 should not has 0x80 as well. Why 0x80 (?) appear in English edition? I searched on Google, this topic said 0x80 appears in *draft* of GB18030-2000. http://www.pkucn.com/thread-304395-1-1.html So maybe the English edition is a translation of GB18030-2000 draft, this logic seems ok. Anyway, 0x80 is another story, not conflict with this issue. Zhang, do I need to make PR for 3.6/3.5/2.7 respectively? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 00:40:42 2017 From: report at bugs.python.org (Cristian Barbarosie) Date: Thu, 06 Apr 2017 04:40:42 +0000 Subject: [issue30004] in regex-howto, improve example on grouping Message-ID: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> New submission from Cristian Barbarosie: In the Regular Expression HOWTO https://docs.python.org/3.6/howto/regex.html#regex-howto the last example in the "Grouping" section has a bug. The code is supposed to find repeated words, but it catches false repetitions. >>> p = re.compile(r'(\b\w+)\s+\1') >>> p.search('Paris in the the spring').group() 'the the' >>> p.search('k is the thermal coefficient').group() 'the the' I propose adding a \b after \1, this solves the problem : >>> p = re.compile(r'(\b\w+)\s+\1\b') >>> p.search('Paris in the the spring').group() 'the the' >>> print p.search('k is the thermal coefficient') None ---------- assignee: docs at python components: Documentation messages: 291209 nosy: Cristian Barbarosie, docs at python priority: normal severity: normal status: open title: in regex-howto, improve example on grouping type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 01:05:02 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 06 Apr 2017 05:05:02 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491455102.29.0.999893625561.issue29990@psf.upfronthosting.co.za> Xiang Zhang added the comment: Yes, 0x80 doesn't matter here. It's nice to make the backporting PRs. But let's wait some time for ezio and haypo's comments and reviews. Get the master PR merged first and then continue on backporting. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 01:16:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Apr 2017 05:16:16 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1491455776.43.0.251527296291.issue30004@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +akuchling _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 01:19:42 2017 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 06 Apr 2017 05:19:42 +0000 Subject: [issue28837] 2to3 does not wrap zip correctly In-Reply-To: <1480503898.29.0.0471565347052.issue28837@psf.upfronthosting.co.za> Message-ID: <1491455982.62.0.00217884353233.issue28837@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 93b4b47e3a720171d67f3b608de406aef462835c by Benjamin Peterson (Stuart Berg) in branch 'master': bpo-28837: Fix lib2to3 handling of map/zip/filter calls when followed with a 'trailer', e.g. zip()[x] (#24) https://github.com/python/cpython/commit/93b4b47e3a720171d67f3b608de406aef462835c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 01:59:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Apr 2017 05:59:35 +0000 Subject: [issue30005] Pickling and copying exceptions doesn't preserve non-__dict__ attributes Message-ID: <1491458375.12.0.99955546052.issue30005@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Pickling and copying exceptions preserves only __dict__ attributes. This includes writeable internal fields initialized in constructor: >>> import pickle, copy >>> e = StopIteration(12) >>> e.value = 34 >>> e.value 34 >>> e2 = pickle.loads(pickle.dumps(e, 4)) >>> e2.value 12 >>> e2 = copy.copy(e) >>> e2.value 12 And __slots__: >>> class E(Exception): __slots__ = ('x', 'y') ... >>> e = E() >>> e.x = 12 >>> e.x 12 >>> e2 = pickle.loads(pickle.dumps(e, 4)) >>> e2.x Traceback (most recent call last): File "", line 1, in AttributeError: x >>> e2 = copy.copy(e) >>> e2.x Traceback (most recent call last): File "", line 1, in AttributeError: x __context__, __cause__ and __traceback__ are lost too (see issue29466). Issue26579 is similar, but resolving it will not resolve this issue since BaseException has its own __reduce__ and __setstate__ implementations. The solution of this issue will look similar to issue29998, but more complex and general. ---------- components: Interpreter Core messages: 291212 nosy: alexandre.vassalotti, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Pickling and copying exceptions doesn't preserve non-__dict__ attributes type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 02:00:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Apr 2017 06:00:00 +0000 Subject: [issue30005] Pickling and copying exceptions doesn't preserve non-__dict__ attributes In-Reply-To: <1491458375.12.0.99955546052.issue30005@psf.upfronthosting.co.za> Message-ID: <1491458400.02.0.25015127207.issue30005@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- dependencies: +Pickling and copying ImportError doesn't preserve name and path _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 02:54:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Apr 2017 06:54:09 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491461649.78.0.446433582025.issue29990@psf.upfronthosting.co.za> STINNER Victor added the comment: An incorrect implementation of a decoder might lead to security vulnerabilities: http://unicodebook.readthedocs.io/issues.html#security-vulnerabilities *But* UTF-8 decoder of Python 2 is *not* strict and nobody complained. I suggest that, once the changed is merged in master, backport the fix to 3.6 and 3.5. But I'm not sure that it's worth it to backport it to 2.7? Is there a risk to break an application? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 03:27:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Apr 2017 07:27:33 +0000 Subject: [issue30003] Remove hz codec In-Reply-To: <1491450137.17.0.519356226961.issue30003@psf.upfronthosting.co.za> Message-ID: <1491463653.91.0.873865604313.issue30003@psf.upfronthosting.co.za> STINNER Victor added the comment: Can't we fix the bug instead of removing the whole codec? Or do you know other bugs? The bug is only on the encoder part, right? I see unit test for '~' on the hz decoder. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 03:31:53 2017 From: report at bugs.python.org (Ma Lin) Date: Thu, 06 Apr 2017 07:31:53 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1491463913.76.0.480441863739.issue29990@psf.upfronthosting.co.za> Ma Lin added the comment: This is a very trivial bug, it's hard to imagine a scene that someone trying to decode those 8630 illegal 4-byte sequences with GB18030 decoder. And I think this bug can't lead to security vulnerabilities. As far as I can see, GB2312/GBK/GB18030 codecs are bugfree except this bug, of course maybe I'm wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 03:54:32 2017 From: report at bugs.python.org (Ma Lin) Date: Thu, 06 Apr 2017 07:54:32 +0000 Subject: [issue30003] Remove hz codec In-Reply-To: <1491450137.17.0.519356226961.issue30003@psf.upfronthosting.co.za> Message-ID: <1491465272.5.0.211744546263.issue30003@psf.upfronthosting.co.za> Ma Lin added the comment: I tried to fix this two years ago, here is the patch (not merged): http://bugs.python.org/review/24117/diff/14803/Modules/cjkcodecs/_codecs_cn.c But later, I thought it's a good opportunity to remove this codec, this serious bug indicates that almost no one is using it. But fixing will create a possibility that someone will using it in future. So I suggest we don't fix it, just remove it or leave it as is. hz is outdated, searching on internet almost no one talking about it. > Or do you know other bugs? It has another small bug in decoder, about state switch, but it's trivial, also fixed in the patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 04:39:02 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 06 Apr 2017 08:39:02 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491467942.68.0.256225258861.issue29989@psf.upfronthosting.co.za> Xiang Zhang added the comment: Hmm, what do you mean by 'the raised exception is not handled properly'? Currently the exception is just propagated to the user to signal the argument seems to be wrong, right? ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 05:03:28 2017 From: report at bugs.python.org (Jaysinh shukla) Date: Thu, 06 Apr 2017 09:03:28 +0000 Subject: [issue11978] Report correct coverage.py data for tests that invoke subprocesses In-Reply-To: <1304343970.06.0.71963253791.issue11978@psf.upfronthosting.co.za> Message-ID: <1491469408.94.0.118277202491.issue11978@psf.upfronthosting.co.za> Jaysinh shukla added the comment: I found the regrtest wasn't displaying correct coverage for when the code is executed from call `Lib.test.support.script_helper.assert_python_ok`. I found `assert_python_ok` is using `subprocess` under the hood. It seems this problem is unobserved from a long time but it is having status `open`. What should be the ideal situation for this? I request any core-developer to guide on this. I am interested in doing some more research on this issue. Thanks! ---------- nosy: +jaysinh.shukla _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 05:26:01 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 06 Apr 2017 09:26:01 +0000 Subject: [issue11978] Report correct coverage.py data for tests that invoke subprocesses In-Reply-To: <1304343970.06.0.71963253791.issue11978@psf.upfronthosting.co.za> Message-ID: <1491470761.91.0.557073284246.issue11978@psf.upfronthosting.co.za> Nick Coghlan added the comment: As a starting point, I'd suggest looking at what can be achieved without making any changes to CPython or its test suite: 1. Set COVERAGE_PROCESS_START in the environment where the tests are being run 2. Inject a sitecustomize.py file into Lib (and add `Lib/sitecustomize.py` to `.gitignore`) There are cases that won't cover (like subprocesses with a custom environment), but it will provide a starting point for the tests that just pass the current environment through, and will also provide a way to notify test.support.script_helper of the expected value of COVERAGE_PROCESS_START in the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 05:30:44 2017 From: report at bugs.python.org (Raphael Gaschignard) Date: Thu, 06 Apr 2017 09:30:44 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491471044.9.0.550563658513.issue29989@psf.upfronthosting.co.za> Raphael Gaschignard added the comment: the subprocess module has code to handle file objects that don't use file descriptors. It's not that file descriptors are necessary for the parameter, but that the way POpen is trying to detect "no file descriptor support" is through "fileno returns -1" rather than "fileno raises OSError" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 05:39:25 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 06 Apr 2017 09:39:25 +0000 Subject: [issue11978] Report correct coverage.py data for tests that invoke subprocesses In-Reply-To: <1304343970.06.0.71963253791.issue11978@psf.upfronthosting.co.za> Message-ID: <1491471565.56.0.979622421493.issue11978@psf.upfronthosting.co.za> Nick Coghlan added the comment: To be more specific regarding `sitecustomize.py`: $ echo "print('Hello from sitecustomize.py')" > Lib/sitecustomize.py $ ./python -c "print('Hello from command line')" Hello from sitecustomize.py Hello from command line Since we only need these instructions to work for a local checkout, we can rely on the `sitecustomize.py` hook. It means we'll still miss coverage results from subprocess tests run in isolated mode or with site.py processing disabled, but those are both relatively rare and involve *not* running code that is normally run, so shouldn't impact the aggregate coverage results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 07:02:15 2017 From: report at bugs.python.org (Julia Dolgova) Date: Thu, 06 Apr 2017 11:02:15 +0000 Subject: [issue29533] urllib2 works slowly with proxy on windows In-Reply-To: <1486802607.23.0.387912582288.issue29533@psf.upfronthosting.co.za> Message-ID: <1491476535.92.0.842687884536.issue29533@psf.upfronthosting.co.za> Julia Dolgova added the comment: Steve, do you mean that there should be no address to IE configuration from urllib? I could undertake it if I understand the task. gethostbyaddr() is ok. It just makes a reverse lookup, that some dns-servers work up too slow. The command "nslookup" also works slowly in same conditions. The problem is in those dns-servers I think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 08:41:01 2017 From: report at bugs.python.org (Marc Schlaich) Date: Thu, 06 Apr 2017 12:41:01 +0000 Subject: [issue29533] urllib2 works slowly with proxy on windows In-Reply-To: <1486802607.23.0.387912582288.issue29533@psf.upfronthosting.co.za> Message-ID: <1491482461.06.0.495264191287.issue29533@psf.upfronthosting.co.za> Marc Schlaich added the comment: This could be even a security issue. People might rely on a proxy as a privacy feature. In this case the proxy should do forward/reverse DNS requests and not the client. Doing DNS lookups to check for proxy bypass doesn't seem right. I don't think that major browsers are doing this, at least Firefox is not (https://bugzilla.mozilla.org/show_bug.cgi?id=136789). ---------- nosy: +schlamar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 08:41:11 2017 From: report at bugs.python.org (Thomas Moreau) Date: Thu, 06 Apr 2017 12:41:11 +0000 Subject: [issue30006] Deadlocks in `concurrent.futures.ProcessPoolExecutor` Message-ID: <1491482471.73.0.550300132711.issue30006@psf.upfronthosting.co.za> New submission from Thomas Moreau: The design of ProcessPoolExecutor contains some possible race conditions that may freeze the interpreter due to deadlocks. This is notably the case with pickling and unpickling errors for a submitted job and returned results. This makes it hard to reuse a launched executor. We propose in the joint PR to fix some of those situations to make the ProcessPoolExecutor more robust to failure in the different threads and worker. ---------- components: Library (Lib) messages: 291224 nosy: tomMoral priority: normal pull_requests: 1180 severity: normal status: open title: Deadlocks in `concurrent.futures.ProcessPoolExecutor` type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 08:45:18 2017 From: report at bugs.python.org (Yared Gebre) Date: Thu, 06 Apr 2017 12:45:18 +0000 Subject: [issue30007] report bug Message-ID: New submission from Yared Gebre: Hello, I am using python 3.6 could you look at this bug. Thanks. /home/yared/anaconda3/lib/python3.6/site-packages/mlimages/util/file_api.py in add_ext_name(cls, path, ext_name) 63 @classmethod 64 def add_ext_name(cls, path, ext_name):---> 65 name, ext = os.path.splitext(os.path.basename(path)) 66 added = os.path.join(os.path.dirname(path), name + ext_name + ext) 67 return added /home/yared/anaconda3/lib/python3.6/posixpath.py in basename(p) 142 def basename(p): 143 """Returns the final component of a pathname"""--> 144 p = os.fspath(p) 145 sep = _get_sep(p) 146 i = p.rfind(sep) + 1 TypeError: expected str, bytes or os.PathLike object, not ImageProperty ---------- messages: 291225 nosy: Yaredoh priority: normal severity: normal status: open title: report bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 09:12:07 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 06 Apr 2017 13:12:07 +0000 Subject: [issue30007] report bug In-Reply-To: Message-ID: <1491484327.4.0.474460078374.issue30007@psf.upfronthosting.co.za> Xiang Zhang added the comment: This tracker is for CPython developing. Your problem is in the third party module. You could refer Google or stackoverflow. ---------- nosy: +xiang.zhang resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 09:49:26 2017 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Apr 2017 13:49:26 +0000 Subject: [issue29955] logging decimal point should come from locale In-Reply-To: <1490980687.61.0.0711345645767.issue29955@psf.upfronthosting.co.za> Message-ID: <1491486566.36.0.503631152807.issue29955@psf.upfronthosting.co.za> Vinay Sajip added the comment: I would like to close this issue now, without making changes. Will do in one day, unless someone pipes up. ---------- resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 10:00:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Apr 2017 14:00:26 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491487226.26.0.154991416479.issue19225@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 2cfe583ac8d3eaa98e3d2aca597577ce4787ca20 by Serhiy Storchaka (cocoatomo) in branch '3.5': [3.5] bpo-19225: Lack of c api exceptions doc (#965) https://github.com/python/cpython/commit/2cfe583ac8d3eaa98e3d2aca597577ce4787ca20 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 10:22:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Apr 2017 14:22:28 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491488548.0.0.0576164416152.issue19225@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Sorry, but I just found that warning categories are enumerated near the documentation of PyErr_WarnEx(). I think that that enumeration is no longer needed and can be removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 11:09:10 2017 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Apr 2017 15:09:10 +0000 Subject: [issue26789] Please do not log during shutdown In-Reply-To: <1460905927.74.0.222378341822.issue26789@psf.upfronthosting.co.za> Message-ID: <1491491350.22.0.577539935465.issue26789@psf.upfronthosting.co.za> Vinay Sajip added the comment: In the OP, the error is caused by `open` being unavailable, which is a builtin. According to what Serhiy says, this error would be after step 6 in his list, so `sys` wouldn't be available either, and nor perhaps would any other builtins. As some termination issues are asyncio-related (e.g. this one, "coroutine was never awaited"), it would make more sense for this kind of error handling to happen there - there's more contextual information available than there is in logging, so the error message displayed would be more useful because it could use the additional context available. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 11:15:31 2017 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Apr 2017 15:15:31 +0000 Subject: [issue29939] Compiler warning in _ctypes_test.c In-Reply-To: <1490769884.15.0.305944990861.issue29939@psf.upfronthosting.co.za> Message-ID: <1491491731.07.0.551113657032.issue29939@psf.upfronthosting.co.za> Vinay Sajip added the comment: Should be fixed by 164d30e. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 11:16:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 06 Apr 2017 15:16:49 +0000 Subject: [issue29939] Compiler warning in _ctypes_test.c In-Reply-To: <1490769884.15.0.305944990861.issue29939@psf.upfronthosting.co.za> Message-ID: <1491491809.11.0.738634282242.issue29939@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Vinay! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 11:24:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Apr 2017 15:24:23 +0000 Subject: [issue29939] Compiler warning in _ctypes_test.c In-Reply-To: <1490769884.15.0.305944990861.issue29939@psf.upfronthosting.co.za> Message-ID: <1491492263.56.0.583441819368.issue29939@psf.upfronthosting.co.za> STINNER Victor added the comment: IHMO it's worth it to backport the fix, since Benjamin showed that GCC optimizer removes the function body and so defeat the purpose of the test. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 11:43:19 2017 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Apr 2017 15:43:19 +0000 Subject: [issue29939] Compiler warning in _ctypes_test.c In-Reply-To: <1490769884.15.0.305944990861.issue29939@psf.upfronthosting.co.za> Message-ID: <1491493399.88.0.621934956375.issue29939@psf.upfronthosting.co.za> Vinay Sajip added the comment: Added relevant "needs backport" tags to PR, will get to it soon. Reopening till then. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 12:04:10 2017 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 06 Apr 2017 16:04:10 +0000 Subject: [issue29955] logging decimal point should come from locale In-Reply-To: <1491486566.36.0.503631152807.issue29955@psf.upfronthosting.co.za> Message-ID: Skip Montanaro added the comment: Vinay> I would like to close this issue now... Go for it. As I indicated in a previous comment, the exercise was as much to try and come to grips with the process as to actually make the change. There certainly appear to be good reasons to leave well enough alone. My primary (though minor) concerns at this point are: * the datetime module hard-coded it one way (period) while the logging package hard-coded it the other way. * other logging packages I've used/inherited in other languages (admittedly, pretty much Americo-centric) all seem to have used periods. This only became an issue for me because I recently started using Flask, which sets up the logging environment and provides no straightforward API for me to reconfigure its logger. (Peter Otten demonstrated a way to do this using functools.partial, which, while doable, certainly doesn't strike me as straightforward.) In cases where I'm in complete control, configuring my own logging environment makes sense. (In reality, when I'm in complete control, I tend to roll my own 20-line Logger class and not use the logging module at all, but that's a historical artifact of me discovering performance issues several years ago in applications which logged heavily. Those issues may well not exist today.) Skip ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 12:34:45 2017 From: report at bugs.python.org (Mike Gilbert) Date: Thu, 06 Apr 2017 16:34:45 +0000 Subject: [issue30008] OpenSSL 1.1.0 deprecated functions Message-ID: <1491496485.65.0.239768530197.issue30008@psf.upfronthosting.co.za> New submission from Mike Gilbert: Some effort was made to port Python to OpenSSL 1.1.0 (see issue 26470). However, the code still uses several deprecated functions, and fails to compile against OpenSSL 1.1.0 if these functions are disabled. This may be replicated by building OpenSSL with --api=1.1.0. This will disable all functions marked as deprecated. I have attached a build log from the cpython master branch. Downstream bug: https://bugs.gentoo.org/show_bug.cgi?id=592480 ---------- components: Library (Lib) files: build.log messages: 291236 nosy: floppymaster priority: normal severity: normal status: open title: OpenSSL 1.1.0 deprecated functions type: compile error versions: Python 3.7 Added file: http://bugs.python.org/file46782/build.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 13:01:14 2017 From: report at bugs.python.org (Alex Jordan) Date: Thu, 06 Apr 2017 17:01:14 +0000 Subject: [issue30001] CPython contribution docs reference missing /issuetracker page In-Reply-To: <1491439850.02.0.465996386955.issue30001@psf.upfronthosting.co.za> Message-ID: <1491498074.05.0.10955529986.issue30001@psf.upfronthosting.co.za> Alex Jordan added the comment: Filed https://github.com/python/devguide/issues/156. Sorry for the noise! I just assumed everything went through bpo. Guess not :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 13:24:43 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Apr 2017 17:24:43 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491499483.69.0.455709060094.issue29996@psf.upfronthosting.co.za> Raymond Hettinger added the comment: After more thought, put me down for -1 on this proposal. I use pprint() quite a bit when teaching Python courses. I expect that 100% of the time that users are following the live examples, I will get stopped and asked why their output is different from mine. Also, I question the usefulness of the auto-resizing. When I pprint a dir() listing or some such, the intended effect is almost always that I want a vertical presentation. If a horizontal one-liner was desired, I would have used print() instead. ISTM, this proposal is out of touch with the actual needs and desires of users. As a reference point, consider that IPython pretty prints output by default and is not terminal width sensitive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 13:45:08 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Apr 2017 17:45:08 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491500708.44.0.778258739161.issue29996@psf.upfronthosting.co.za> Raymond Hettinger added the comment: One other thought: This module has a very long history. It is widely used, has had many feature requests and bug reports, but this particular feature has never been requested. That should tell us something about whether there is an actual need. To me, this seems like a new made-up requirement, invented in complete isolation from users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 13:53:05 2017 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 06 Apr 2017 17:53:05 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491501185.34.0.698742071348.issue29989@psf.upfronthosting.co.za> Changes by Josh Rosenberg : ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 13:55:58 2017 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Thu, 06 Apr 2017 17:55:58 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491501358.92.0.107104131783.issue29996@psf.upfronthosting.co.za> Fred L. Drake, Jr. added the comment: I wouldn't go so far as to say it's never come up; it's something I've thought about a number of times, and I've waffled on it a few times. It's not fundamentally unreasonable to want it to adapt to the current terminal window, though I think it would be in a minority among the Unix command line tools that I use. Raymond's point about potentially confusing students is an important one, though. If adaptive behavior is sufficiently desirable, the module should check the value of an environment variable, and default to the current behavior. PYTHONADAPTIVEPPRINT ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 13:56:01 2017 From: report at bugs.python.org (Brett Cannon) Date: Thu, 06 Apr 2017 17:56:01 +0000 Subject: [issue29999] repr() of ImportError misses keyword arguments name and path In-Reply-To: <1491431351.79.0.0513888316468.issue29999@psf.upfronthosting.co.za> Message-ID: <1491501361.82.0.318377029137.issue29999@psf.upfronthosting.co.za> Brett Cannon added the comment: I consider it an enhancement, especially if someone was slopping with their tests and explicitly checks the repr of ImportError. ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 13:57:43 2017 From: report at bugs.python.org (Brett Cannon) Date: Thu, 06 Apr 2017 17:57:43 +0000 Subject: [issue11978] Report correct coverage.py data for tests that invoke subprocesses In-Reply-To: <1304343970.06.0.71963253791.issue11978@psf.upfronthosting.co.za> Message-ID: <1491501463.22.0.237491832624.issue11978@psf.upfronthosting.co.za> Brett Cannon added the comment: There's also what changes might occur in the coverage results when we start using fullcoverage: https://github.com/python/core-workflow/issues/18 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 13:58:21 2017 From: report at bugs.python.org (Christoph Gohlke) Date: Thu, 06 Apr 2017 17:58:21 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1491501501.46.0.511224760997.issue29943@psf.upfronthosting.co.za> Changes by Christoph Gohlke : ---------- nosy: +cgohlke _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 14:06:09 2017 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 06 Apr 2017 18:06:09 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491501969.67.0.773691026392.issue29996@psf.upfronthosting.co.za> Josh Rosenberg added the comment: If you want the dir listing output in a column, you're just relying on your listing to be wider than 80 characters, it still doesn't columnize unless you pass that point. Personally, I feel if I made the terminal wider, I'd like to actually use that width. I suppose an alternative, if you really don't want autosizing, is to make auto-sizing supported without having to explicitly call getterminalsize over and over, perhaps by creating some sentinel value (pprint.AUTOWIDTH or whatever) to make it trivial to do (or to allow those who desire it to use partial binding to make it the default for a session up front). ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 14:08:41 2017 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 06 Apr 2017 18:08:41 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491502121.63.0.240458308786.issue29996@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Thus, you keep your default behavior of width=80, while I just add the following to my PYTHONSTARTUP file: from functools import partial from pprint import pprint, AUTOWIDTH pprint = partial(pprint, width=AUTOWIDTH) and we both get what we want. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 14:47:28 2017 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 06 Apr 2017 18:47:28 +0000 Subject: [issue29955] logging decimal point should come from locale In-Reply-To: <1490980687.61.0.0711345645767.issue29955@psf.upfronthosting.co.za> Message-ID: <1491504448.74.0.512359642349.issue29955@psf.upfronthosting.co.za> Vinay Sajip added the comment: > and provides no straightforward API for me to reconfigure its logger. As far as I know, you just need to do something which configures a Flask logger, then call logging.config.dictConfig() with a suitable configuration which doesn't disable existing loggers and configures the Flask logger how you want. (The dictConfig call should replace any existing configuration with what you've passed to it). See this: https://stackoverflow.com/questions/11816236/how-to-config-flask-app-logger-from-a-configure-file ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 16:57:53 2017 From: report at bugs.python.org (Cristian Barbarosie) Date: Thu, 06 Apr 2017 20:57:53 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1491512273.49.0.387945928937.issue30004@psf.upfronthosting.co.za> Cristian Barbarosie added the comment: Just discovered that a nearly identical example is presented in the end of section "Non-capturing and Named Groups". My proposal applies to this other example, too. And, by the way, reading this HOWTO has been very useful to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 17:58:09 2017 From: report at bugs.python.org (Ellison Marks) Date: Thu, 06 Apr 2017 21:58:09 +0000 Subject: [issue30000] Inconsistency in the zlib module In-Reply-To: <1491434902.87.0.645672242128.issue30000@psf.upfronthosting.co.za> Message-ID: <1491515889.11.0.724240534395.issue30000@psf.upfronthosting.co.za> Ellison Marks added the comment: I made a try at a patch for this. My C is rudimentary at best, so I was hoping someone could look it over before I submitted a PR? https://github.com/gotyaoi/cpython/commit/2906fc9069ce6ec4888a547b5088ef9177a21c9a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 22:14:58 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 Apr 2017 02:14:58 +0000 Subject: [issue29353] Incorrect handling of HTTP response with "Content-Type: message/rfc822" header In-Reply-To: <1485197905.85.0.319696153354.issue29353@psf.upfronthosting.co.za> Message-ID: <1491531298.64.0.923746027753.issue29353@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 6 23:43:54 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 07 Apr 2017 03:43:54 +0000 Subject: [issue29996] Use terminal width by default in pprint In-Reply-To: <1491409756.85.0.158082896832.issue29996@psf.upfronthosting.co.za> Message-ID: <1491536634.46.0.603137457937.issue29996@psf.upfronthosting.co.za> Xiang Zhang added the comment: I use screens and usually like to open a terminal to fill the screen. One of my use case is changed by this patch from: 'manufacturers_specifications': '2U 2*Intel Xeon E5-2603 4? 8*8G ' 'DDR3-1333 ECC 1.35v,12*300G 15K ' 'RPM 3.5? SAS,RAID ' '????cache????1GB,?? Raid0 1 10 5 ' '6 50 60[D23]', to: 'manufacturers_specifications': '2U 2*Intel Xeon E5-2603 4? 8*8G DDR3-1333 ECC 1.35v,12*300G 15K RPM 3.5? SAS,RAID ????cache????1GB,?? Raid0 1 10 5 6 50 60[D23]', Actually looks not bad. But why change the default behaviour? Can we provide this as a bonus and keep the default behaviour? Current defaults 80 is not unreasonable even for large terminals. If users prefer long lines and don't want to choose an arbitrary number, they could use this feature. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 00:02:05 2017 From: report at bugs.python.org (Tri Nguyen) Date: Fri, 07 Apr 2017 04:02:05 +0000 Subject: [issue30009] Integer conversion failure Message-ID: <1491537725.94.0.500502995113.issue30009@psf.upfronthosting.co.za> New submission from Tri Nguyen: This code below shows a situation when Python int() library would return a value of int(1.0) -> 0.0 ---------------CODE---------------------------- CHANGES = [1.00, 0.50, 0.25, 0.10, 0.05, 0.01] # This code was originally to solve the least number of changes needed. # However, in an attempt to solve this. A bug is found. def get_change(R): for change in CHANGES: # This division and int() is where failure is happening num = int(R / change) # This printing line shows the failure. print 'int(%s)\t = %s' % (R / change, num) R = R - num * change print 'R = %s' % R get_change(4.01) -------------OUTPUT---------------------- int(4.01) = 4 int(0.02) = 0 int(0.04) = 0 int(0.1) = 0 int(0.2) = 0 int(1.0) = 0 # This should be 1, right? R = 0.01 ---------- components: Library (Lib) files: int_bug.py messages: 291249 nosy: nvutri priority: normal severity: normal status: open title: Integer conversion failure type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file46783/int_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 00:19:16 2017 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Apr 2017 04:19:16 +0000 Subject: [issue30009] Integer conversion failure In-Reply-To: <1491537725.94.0.500502995113.issue30009@psf.upfronthosting.co.za> Message-ID: <1491538756.78.0.526397567537.issue30009@psf.upfronthosting.co.za> Eryk Sun added the comment: Use %r instead of %s to show the repr. Hopefully that should clear things up for you. int() truncates toward 0. The float in this case is slightly less than 1. ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 00:20:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 04:20:16 +0000 Subject: [issue30009] Integer conversion failure In-Reply-To: <1491537725.94.0.500502995113.issue30009@psf.upfronthosting.co.za> Message-ID: <1491538816.79.0.762136220205.issue30009@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: "%s" rounds float representation to 12 digits in Python 2.7. Replace "%s" with "%r" and you will get precise representation of floats. int(4.01) = 4 int(0.019999999999999574) = 0 int(0.03999999999999915) = 0 int(0.09999999999999787) = 0 int(0.19999999999999574) = 0 int(0.9999999999999787) = 0 R = 0.009999999999999787 See also https://docs.python.org/2/tutorial/floatingpoint.html . ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 01:32:06 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 07 Apr 2017 05:32:06 +0000 Subject: [issue30000] Inconsistency in the zlib module In-Reply-To: <1491434902.87.0.645672242128.issue30000@psf.upfronthosting.co.za> Message-ID: <1491543126.01.0.740669932993.issue30000@psf.upfronthosting.co.za> Xiang Zhang added the comment: Such a change in my mind is an enhancement and only could get into 3.7. IMHO zlib.compress() and zlib.decompress() are for simple usage, zlib.compressobj() and zlib.decompressobj() for advanced usage if you want more controls. Actually I would prefer simplifying zlib.decompress() signature (dropping the wbits parameter) than adding more complex to zlib.compress(). Of course we can't do that to maintain backwards compatibility. :-) -1 on this change. ---------- nosy: +martin.panter, xiang.zhang versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 01:56:17 2017 From: report at bugs.python.org (Ellison Marks) Date: Fri, 07 Apr 2017 05:56:17 +0000 Subject: [issue30000] Inconsistency in the zlib module In-Reply-To: <1491434902.87.0.645672242128.issue30000@psf.upfronthosting.co.za> Message-ID: <1491544577.16.0.336209946883.issue30000@psf.upfronthosting.co.za> Ellison Marks added the comment: I'm not sure I agree with that. The docs for compressobj just say "Returns a compression object, to be used for compressing data streams that won?t fit into memory at once." Which I don't think says much about the complexity aspect. Whether you're compressing a smaller bit of data or a stream, I think the optional parameters in compressobj are just as applicable to compress. When you've got an in-memory chunk of data, it seems to be going out of the way to construct a compressobj just to get at the optional parameters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 02:23:23 2017 From: report at bugs.python.org (Bryan G. Olson) Date: Fri, 07 Apr 2017 06:23:23 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1491546203.4.0.953447054631.issue29960@psf.upfronthosting.co.za> Changes by Bryan G. Olson : ---------- pull_requests: +1181 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 03:40:16 2017 From: report at bugs.python.org (Samuli G) Date: Fri, 07 Apr 2017 07:40:16 +0000 Subject: [issue30010] Initial bytes to BytesIO cannot be seeked to Message-ID: <1491550816.13.0.724625022482.issue30010@psf.upfronthosting.co.za> New submission from Samuli G: The initial bytes provided for the BytesIO constructor are lost when the stream is written to. Seeking to offset zero, and then getting the value of the entire buffer results of getting only the bytes that have been appended by calling "write". ---------- components: IO files: bytesio_bug.py messages: 291254 nosy: Samuli G priority: normal severity: normal status: open title: Initial bytes to BytesIO cannot be seeked to type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file46784/bytesio_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 03:55:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 07:55:10 +0000 Subject: [issue30010] Initial bytes to BytesIO cannot be seeked to In-Reply-To: <1491550816.13.0.724625022482.issue30010@psf.upfronthosting.co.za> Message-ID: <1491551710.33.0.450502661497.issue30010@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is expected behavior. When you write to ByitesIO you overwrites the old content. If you want to append to ByitesIO, first move the position to the end: b.seek(0, io.SEEK_END). ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 04:26:37 2017 From: report at bugs.python.org (Alessandro Vesely) Date: Fri, 07 Apr 2017 08:26:37 +0000 Subject: [issue30011] HTMLParser class is not thread safe Message-ID: <1491553597.55.0.784750933175.issue30011@psf.upfronthosting.co.za> New submission from Alessandro Vesely: SYMPTOM: When used in a multithreaded program, instances of a class derived from HTMLParser may convert an entity or leave it alone, in an apparently random fashion. CAUSE: The class has a static attribute, entitydefs, which, on first use, is initialized from None to a dictionary of entity definitions. Initialization is not atomic. Therefore, instances in concurrent threads assume that initialization is complete and catch a KeyError if the entity at hand hasn't been set yet. In that case, the entity is left alone as if it were invalid. WORKAROUND: class Dummy(HTMLParser): """this class is defined here so that we can initialize its base class""" def __init__(self): HTMLParser.__init__(self) # Initialize HTMLParser by loading htmlentitydefs dummy = Dummy() dummy.feed('') del dummy, Dummy ---------- components: Library (Lib) messages: 291256 nosy: ale2017 priority: normal severity: normal status: open title: HTMLParser class is not thread safe type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 04:34:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 08:34:06 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491554046.62.0.923844849657.issue27867@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 04:41:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 08:41:40 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491554500.36.0.448154996568.issue27867@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If don't make PySlice_GetIndicesEx a macro when Py_LIMITED_API is not defined, it should be expanded to PySlice_Unpack and PySlice_AdjustIndices. PR 1023 does this for master branch. The patch is generated by Coccinelle's semantic patch. ---------- Added file: http://bugs.python.org/file46786/PySlice_GetIndicesEx.cocci _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 04:54:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 08:54:19 +0000 Subject: [issue30011] HTMLParser class is not thread safe In-Reply-To: <1491553597.55.0.784750933175.issue30011@psf.upfronthosting.co.za> Message-ID: <1491555259.48.0.308746960244.issue30011@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- keywords: +easy nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 05:29:47 2017 From: report at bugs.python.org (Peter) Date: Fri, 07 Apr 2017 09:29:47 +0000 Subject: [issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb Message-ID: <1491557387.23.0.595235956819.issue30012@psf.upfronthosting.co.za> New submission from Peter: Under Python 2, gzip.open defaults to giving (non-unicode) strings. Under Python 3, gzip.open defaults to giving bytes. Therefore it was fixed to allow text mode be specified, see http://bugs.python.org/issue13989 In order to write Python 2 and 3 compatible code to get strings from gzip, I now use: >>> import gzip >>> handle = gzip.open(filename, "rt") In general mode="rt" works great, but I just found this fails under Windows XP running Python 2.7, example below using the following gzipped plain text file: https://github.com/biopython/biopython/blob/master/Doc/examples/ls_orchid.gbk.gz This works perfectly on Linux giving strings on both Python 2 and 3 - not I am printing with repr to confirm we have a string object: $ python2.7 -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline())); import sys; print(sys.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 2.7.10 (default, Sep 28 2015, 13:58:31) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] Also with a slightly newer Python 2.7, $ /mnt/apps/python/2.7/bin/python -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline())); import sys; print(sys.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 2.7.13 (default, Mar 9 2017, 15:07:48) [GCC 4.9.2 20150212 (Red Hat 4.9.2-6)] $ python3.5 -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline())); import sys; print(sys.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 3.5.0 (default, Sep 28 2015, 11:25:31) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] $ python3.4 -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline())); import sys; print(sys.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 3.4.3 (default, Aug 21 2015, 11:12:32) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] $ python3.3 -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline())); import sys; print(sys.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 3.3.0 (default, Nov 7 2012, 21:52:39) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] This works perfectly on macOS giving strings on both Python 2 and 3: $ python2.7 -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline())); import sys; print(sys.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 2.7.10 (default, Jul 30 2016, 19:40:32) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] $ python3.6 -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline())); import sys; print(sys.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] This works perfectly on Python 3 running on Windows XP, C:\repositories\biopython\Doc\examples>c:\Python33\python.exe -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline()\ )); import sys; print(sys.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 10:37:12) [MSC v.1600 32 bit (Intel)] C:\repositories\biopython\Doc\examples> C:\Python34\python.exe -c "import gzip; print(repr(gzip.open('ls_orchid.gbk.gz', 'rt').readline(\ ))); import sys; print(sy s.version)" 'LOCUS Z78533 740 bp DNA linear PLN 30-NOV-2006\n' 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] However, it fails on Windows XP running Python 2.7.11 and (after upgrading) Python 2.7.13 though: C:\repositories\biopython\Doc\examples>c:\Python27\python -c "import sys; print(sys.version); import gzip; print(repr(gzip.open('ls_orch\ id.gbk.gz', 'rt').readlines()))" 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] Traceback (most recent call last): File "", line 1, in File "c:\Python27\lib\gzip.py", line 34, in open return GzipFile(filename, mode, compresslevel) File "c:\Python27\lib\gzip.py", line 94, in __init__ fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb') ValueError: Invalid mode ('rtb') Note that the strangely contradictory mode seems to be accepted by Python 2.7 under Linux or macOS: $ python Python 2.7.10 (default, Sep 28 2015, 13:58:31) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gzip >>> gzip.open('ls_orchid.gbk.gz', 'rt') >>> quit() $ python2.7 Python 2.7.10 (default, Jul 30 2016, 19:40:32) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import gzip >>> gzip.open('ls_orchid.gbk.gz', 'rt') >>> quit() ---------- components: Library (Lib) messages: 291259 nosy: maubp priority: normal severity: normal status: open title: gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 05:56:44 2017 From: report at bugs.python.org (Louie Lu) Date: Fri, 07 Apr 2017 09:56:44 +0000 Subject: [issue30013] Compiling warning in Modules/posixmodule.c Message-ID: <1491559004.62.0.18619105038.issue30013@psf.upfronthosting.co.za> New submission from Louie Lu: Using gcc-6.3.1 20170306 on Linux 4.10.1, it gave the warning: gcc -pthread -c -Wno-unused-result -Wsign-compare -g -Og -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/pyctype.o Python/pyctype.c :./Modules/posixmodule.c: In function ?os_major_impl?: ./Modules/posixmodule.c:8584:13: warning: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly. If you did not intend to use a system-defined macro "major", you should undefine it after including . return major(device); ^~~~~~~~~~~~~ ./Modules/posixmodule.c: In function ?os_minor_impl?: ./Modules/posixmodule.c:8601:13: warning: In the GNU C Library, "minor" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "minor", include directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including . return minor(device); ^~~~~~~~~~~~~ ./Modules/posixmodule.c: In function ?os_makedev_impl?: ./Modules/posixmodule.c:8619:13: warning: In the GNU C Library, "makedev" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "makedev", include directly. If you did not intend to use a system-defined macro "makedev", you should undefine it after including . return makedev(major, minor); ^~~~~~~~~~~~~~~~~~~~~ The problem introduce in glibc 2.25, going to deprecate the definition of 'major', 'minor', and 'makedev' by sys/types.h. And the autoconf didn't change the behavior of `AC_HEADER_MAJOR`, see: https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html There is a workaround path for this in libvirt, which take from autoconf patch, see: https://www.redhat.com/archives/libvir-list/2016-September/msg00459.html ---------- components: Extension Modules messages: 291260 nosy: louielu priority: normal severity: normal status: open title: Compiling warning in Modules/posixmodule.c type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 05:58:49 2017 From: report at bugs.python.org (Louie Lu) Date: Fri, 07 Apr 2017 09:58:49 +0000 Subject: [issue30013] Compiler warning in Modules/posixmodule.c In-Reply-To: <1491559004.62.0.18619105038.issue30013@psf.upfronthosting.co.za> Message-ID: <1491559129.75.0.787123838993.issue30013@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- title: Compiling warning in Modules/posixmodule.c -> Compiler warning in Modules/posixmodule.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 06:02:14 2017 From: report at bugs.python.org (Louie Lu) Date: Fri, 07 Apr 2017 10:02:14 +0000 Subject: [issue30013] Compiler warning in Modules/posixmodule.c In-Reply-To: <1491559004.62.0.18619105038.issue30013@psf.upfronthosting.co.za> Message-ID: <1491559334.86.0.548390382949.issue30013@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 06:26:11 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 07 Apr 2017 10:26:11 +0000 Subject: [issue29549] Improve docstring for str.index In-Reply-To: <1487019442.21.0.885918615749.issue29549@psf.upfronthosting.co.za> Message-ID: <1491560771.03.0.796958971437.issue29549@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1185 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 06:40:07 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 10:40:07 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x Message-ID: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> New submission from Giampaolo Rodola': Patch in attachment modifies DefaultSelector.modify() so that it uses the underlying selector's modify() method instead of unregister() and register() resulting in a 2x speedup. Without patch: ~/svn/cpython {master}$ ./python bench.py 0.006010770797729492 With patch: ~/svn/cpython {master}$ ./python bench.py 0.00330352783203125 ---------- files: selectors_modify.diff keywords: patch messages: 291261 nosy: giampaolo.rodola priority: normal severity: normal status: open title: Speedup DefaultSelectors.modify() by 2x Added file: http://bugs.python.org/file46787/selectors_modify.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 06:40:26 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 10:40:26 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491561626.9.0.952034164393.issue30014@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- versions: +Python 3.7 Added file: http://bugs.python.org/file46788/bench.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 06:41:47 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 10:41:47 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491561707.14.0.0746872698702.issue30014@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +gvanrossum, haypo, neologix, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 07:01:15 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 11:01:15 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491562875.87.0.733018421593.issue30014@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- components: +Library (Lib), asyncio stage: -> patch review type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 07:28:03 2017 From: report at bugs.python.org (=?utf-8?b?5p6X5bu65L2R?=) Date: Fri, 07 Apr 2017 11:28:03 +0000 Subject: [issue30015] Windows also treats full-width spaces as a delimiter when parsing arguments Message-ID: <1491564483.72.0.230621154457.issue30015@psf.upfronthosting.co.za> New submission from ???: Windows also treats full-width spaces as a delimiter when parsing command line arguments. Therefore, subprocess.run() and subprocess.Popen() also need to quote the arg in the sequence of arguments if there is any full-width spaces in it. Example: >> subprocess.run(['foo', 'half-width space', 'full-width?space']) should be executed as >> foo "half-width space" "full-width?space" Windows will treat it as 3 arguments but now it is incorrectly executed as >> foo "half-width space" full-width?space Windows will treat it as 4 arguments ---------- components: Library (Lib), Windows messages: 291262 nosy: paul.moore, steve.dower, tim.golden, zach.ware, ??? priority: normal severity: normal status: open title: Windows also treats full-width spaces as a delimiter when parsing arguments type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 07:37:00 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Apr 2017 11:37:00 +0000 Subject: [issue30015] Windows also treats full-width spaces as a delimiter when parsing arguments In-Reply-To: <1491564483.72.0.230621154457.issue30015@psf.upfronthosting.co.za> Message-ID: <1491565020.9.0.115667891502.issue30015@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 07:52:24 2017 From: report at bugs.python.org (Jensen Taylor) Date: Fri, 07 Apr 2017 11:52:24 +0000 Subject: [issue30016] No sideways scrolling in IDLE Message-ID: <1491565944.11.0.294911632507.issue30016@psf.upfronthosting.co.za> New submission from Jensen Taylor: This has been a bug since 2.7 as far as I know. ---------- assignee: terry.reedy components: IDLE messages: 291263 nosy: Jensen Taylor, terry.reedy priority: normal severity: normal status: open title: No sideways scrolling in IDLE type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 08:02:25 2017 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 07 Apr 2017 12:02:25 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491562875.89.0.00899470278969.issue30014@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: Hm, do you have a realistic benchmark which would show the benefit? Because this is really a micro-benchmark, and I'm not convinced that Selector.modify() is a significant bottleneck in a real-world application. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 08:19:16 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 12:19:16 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491567556.92.0.935015162585.issue30014@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: modify() can be used often in verbose protocols such as FTP and SMTP where a lot of requests and responses are continuously exchanged between client and server, so you need to switch from EVENT_READ to EVENT_WRITE all the time. I did a similar change some years ago in pyftpdlib but I don't have another benchmark other than this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 08:24:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Apr 2017 12:24:37 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491567877.48.0.947926348403.issue30014@psf.upfronthosting.co.za> STINNER Victor added the comment: Hi Giampaolo Rodola'! It seems like you proposed the same idea 4 years ago and I wrote a similar patch: issue #18932 :-) I suggest you to use my perf module to produce more reliable benchmarks. Here is my results on my computer smithers tuned for benchmarks: haypo at smithers$ ./python bench_selectors.py -o ref.json [apply the patch] haypo at smithers$ ./python bench_selectors.py -o patch.json haypo at smithers$ ./python -m perf compare_to ref.json patch.json --table +----------------------+---------+------------------------------+ | Benchmark | ref | patch | +======================+=========+==============================+ | PollSelector.modify | 11.3 us | 8.22 us: 1.37x faster (-27%) | +----------------------+---------+------------------------------+ | EpollSelector.modify | 13.5 us | 8.88 us: 1.52x faster (-34%) | +----------------------+---------+------------------------------+ Not significant (1): SelectSelector.modify @neologix: "Hm, do you have a realistic benchmark which would show the benefit?" I don't think that selector.modify() can be a bottleneck, but IMHO the change is simple and safe enough to be worth it. In a network server with 10k client, an optimization making .modify() 1.52x faster is welcomed. ---------- Added file: http://bugs.python.org/file46789/bench_selectors_modify.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 08:28:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Apr 2017 12:28:21 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491568101.83.0.72461017142.issue30014@psf.upfronthosting.co.za> STINNER Victor added the comment: @Giampaolo Rodola: CPython development moved to GitHub, can you please create a pull request instead of a patch? Thank you. https://docs.python.org/devguide/pullrequest.html Hum, I see that my old patch of issue #18932 (selectors_optimize_modify-2.patch) is different. I tried to factorize code. What do you think of my change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 08:40:38 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 12:40:38 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491568838.38.0.632771405104.issue30014@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Hey Stinner, thanks for chiming in! Your old patch uses unregister() and register() so I'm not sure what speedup that'll take as the whole point is to avoid doing that. You may want to rewrite it and benchmark it but it looks like it'll be slower. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 08:49:22 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 12:49:22 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491569362.66.0.75129727904.issue30014@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: PR: https://github.com/python/cpython/pull/1030 ---------- pull_requests: +1187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 08:58:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Apr 2017 12:58:56 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491569936.63.0.0618191707221.issue30014@psf.upfronthosting.co.za> STINNER Victor added the comment: @neologix: Do you have a GitHub account? It's hard to me to see if https://github.com/neologix is you or not, and your GitHub username is not filled in the Bug Tracker database. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 09:03:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Apr 2017 13:03:12 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491570192.36.0.0583176386071.issue30014@psf.upfronthosting.co.za> STINNER Victor added the comment: Giampaolo Rodola': "Your old patch uses unregister() and register() so I'm not sure what speedup that'll take as the whole point is to avoid doing that." My patch calls generic unregister() and register() of the base classes, but it only uses one syscall per modify() call. Oh by the way, it seems like my patch changes KqueueSelector, but your change doesn't. Am I right? KqueueSelector is the default selector on FreeBSD and macOS. IMHO it's worth it to optimize it as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 09:03:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Apr 2017 13:03:27 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 1.5x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491570207.25.0.192973283923.issue30014@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Speedup DefaultSelectors.modify() by 2x -> Speedup DefaultSelectors.modify() by 1.5x _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 09:11:44 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 13:11:44 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 1.5x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491570704.76.0.86258702722.issue30014@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: > My patch calls generic unregister() and register() of the base > classes, but it only uses one syscall per modify() call. Doesn't that mean doing 3 operations (unregister(), register(), modify()) instead of the current 2 (unregister(), register())? I don't see how it can be faster than a single modify() syscall. > Oh by the way, it seems like my patch changes KqueueSelector, > but your change doesn't. Am I right? You are right but it looks like you end up doing the same thing as unregister() and register(). kqueue() has no modify() method so I don't think it can benefit from this change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 09:24:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Apr 2017 13:24:04 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 1.5x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491571444.46.0.308524635419.issue30014@psf.upfronthosting.co.za> STINNER Victor added the comment: > Doesn't that mean doing 3 operations (unregister(), register(), modify()) instead of the current 2 (unregister(), register())? I don't see how it can be faster than a single modify() syscall. The idea is to reuse _BaseSelectorImpl.register() and _BaseSelectorImpl.unregister() to factorize the code. These methods don't use syscall, they create the SelectorKey object and update _fd_to_key. So each class doesn't have to redo these things. I don't insist to redo what I did, I'm just trying to explain my change because your change basically copy/paste the same code 3 times, and you forgot KqueueSelector, so you even may have to copy it a 4th time ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 09:39:46 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 13:39:46 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 1.5x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491572386.67.0.193607596245.issue30014@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: > The idea is to reuse _BaseSelectorImpl.register() and > _BaseSelectorImpl.unregister() to factorize the code. You can't factorize the logic of modify() into those as they do two different things. I also don't like repeating the same thing 3 times but given how the module is organized I'm not sure how to do that as I need to pass 3 things around: the low-level selector (epoll, poll, whatever) and the read and write constants (POLLIN, EPOLLIN) which change depending on the selector being used. The same thing applies to the devpoll class (http://bugs.python.org/issue18931). I can write a second patch which to refactor the whole module if that is desirable but I prefer to do that in another PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 09:47:37 2017 From: report at bugs.python.org (Mathieu Sornay) Date: Fri, 07 Apr 2017 13:47:37 +0000 Subject: [issue27585] asyncio.Lock deadlock after cancellation In-Reply-To: <1469120801.4.0.62510822161.issue27585@psf.upfronthosting.co.za> Message-ID: <1491572857.22.0.206734241167.issue27585@psf.upfronthosting.co.za> Changes by Mathieu Sornay : ---------- pull_requests: +1188 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 10:21:06 2017 From: report at bugs.python.org (Jeremy Heiner) Date: Fri, 07 Apr 2017 14:21:06 +0000 Subject: [issue30017] zlib Message-ID: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> New submission from Jeremy Heiner: I had some statements inside a `with` statement to write data to an entry in a ZipFile. It worked great. I added a second `with` statement containing almost exactly the same statements. That still worked great. I refactored those common statements into a function and called that function from the two `with` statements... and got an exception: zlib.error: Error -2 while flushing: inconsistent stream state I can't figure out why it matters whether the writing happens in the `with` or in the function called by the `with`, but here's a trimmed-down version of the code that demonstrates the problem: -------------------------------------------------------------------------------- #!/usr/bin/env python import io, pprint, zipfile from zipfile import ZIP_DEFLATED def printLiteral( data, out ) : encoder = io.TextIOWrapper( out, encoding='utf-8', write_through=True ) pprint.pprint( data, stream=encoder ) data = { 'not' : 'much', 'just' : 'some K \N{RIGHTWARDS WHITE ARROW} V pairs' } with zipfile.ZipFile( 'zzz.zip', mode='w', compression=ZIP_DEFLATED ) as myzip : with myzip.open( 'this one works', 'w' ) as out : encoder = io.TextIOWrapper( out, encoding='utf-8', write_through=True ) pprint.pprint( data, stream=encoder ) with myzip.open( 'this one fails', 'w' ) as out : printLiteral( data, out ) print( 'printed but entry still open' ) print( 'entry has been closed but not file' ) print( 'zip file has been closed' ) -------------------------------------------------------------------------------- And here's the output on my Arch Linux 64bit with package `python 3.6.0-2`... A co-worker sees the same behavior on MacOS 10.11.6 Python 3.6.1 : -------------------------------------------------------------------------------- printed but entry still open Traceback (most recent call last): File "zzz.py", line 21, in print( 'printed but entry still open' ) File "/usr/lib/python3.6/zipfile.py", line 995, in close buf = self._compressor.flush() zlib.error: Error -2 while flushing: inconsistent stream state -------------------------------------------------------------------------------- I tried debugging this in PyDev but got lost. Turning off the compression makes the exception go away. ---------- messages: 291275 nosy: Jeremy Heiner priority: normal severity: normal status: open title: zlib type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 10:31:15 2017 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 07 Apr 2017 14:31:15 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 1.5x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491575475.04.0.273464356682.issue30014@psf.upfronthosting.co.za> Changes by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 10:32:24 2017 From: report at bugs.python.org (Jeremy Heiner) Date: Fri, 07 Apr 2017 14:32:24 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1491575544.83.0.961321354508.issue30017@psf.upfronthosting.co.za> Changes by Jeremy Heiner : ---------- title: zlib -> zlib.error: Error -2 while flushing: inconsistent stream state _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 11:50:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 15:50:25 +0000 Subject: [issue29914] Incorrect signatures of object.__reduce__() and object.__reduce_ex__() In-Reply-To: <1490601668.43.0.188654711703.issue29914@psf.upfronthosting.co.za> Message-ID: <1491580225.14.0.256608144641.issue29914@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 11:53:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 15:53:08 +0000 Subject: [issue29838] Check that sq_length and mq_length return non-negative result In-Reply-To: <1489779592.24.0.829471920216.issue29838@psf.upfronthosting.co.za> Message-ID: <1491580388.27.0.993871500086.issue29838@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 11:54:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 15:54:02 +0000 Subject: [issue29839] Avoid raising OverflowError in len() when __len__() returns negative large value In-Reply-To: <1489780334.51.0.943711507872.issue29839@psf.upfronthosting.co.za> Message-ID: <1491580442.16.0.684944596582.issue29839@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 11:56:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 15:56:14 +0000 Subject: [issue29958] Use add_mutually_exclusive_group(required=True) in zipfile and tarfile CLI In-Reply-To: <1491028731.32.0.981459327576.issue29958@psf.upfronthosting.co.za> Message-ID: <1491580574.3.0.348668662118.issue29958@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 150cd1916a59e750ce88c65325de9ef0c42c6cb5 by Serhiy Storchaka in branch 'master': bpo-29958: Minor improvements to zipfile and tarfile CLI. (#944) https://github.com/python/cpython/commit/150cd1916a59e750ce88c65325de9ef0c42c6cb5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 11:56:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Apr 2017 15:56:35 +0000 Subject: [issue29958] Use add_mutually_exclusive_group(required=True) in zipfile and tarfile CLI In-Reply-To: <1491028731.32.0.981459327576.issue29958@psf.upfronthosting.co.za> Message-ID: <1491580595.48.0.695588364353.issue29958@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 12:56:53 2017 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Apr 2017 16:56:53 +0000 Subject: [issue30015] Windows also treats full-width spaces as a delimiter when parsing arguments In-Reply-To: <1491564483.72.0.230621154457.issue30015@psf.upfronthosting.co.za> Message-ID: <1491584213.07.0.818860062036.issue30015@psf.upfronthosting.co.za> Eryk Sun added the comment: > Windows also treats full-width spaces as a delimiter when parsing > command line arguments. CreateProcess has to parse the beginning of the command-line string if the lpApplicationName parameter is omitted. According to the documentation, it treats "white space" as a delimiter, but it doesn't actually say which characters are in that set. We know for an unquoted name like "python{character}spam" that it will try to execute python.exe if "{character}" is parsed as a space. Otherwise we expect CreateProcess to fail with ERROR_FILE_NOT_FOUND because it's looking for the non-existent file "python{character}spam". Here's a test that checks all characters that Unicode considers to be whitespace, which includes "ideographic space" (U+3000): import os import sys import subprocess space_chars = [chr(c) for c in range(sys.maxunicode) if chr(c).isspace()] assert '\N{IDEOGRAPHIC SPACE}' in space_chars # U+3000 def get_create_delims(): assert not os.path.exists('spam') filename = 'python{}spam' basepath = os.path.dirname(sys.executable) delims = [] for space in space_chars: path = os.path.join(basepath, filename.format(space)) assert not os.path.exists(path) try: subprocess.check_output(path, stderr=subprocess.STDOUT) except FileNotFoundError: pass # not a delimiter except subprocess.CalledProcessError: delims.append(space) else: assert False, 'python.exe should have failed' return delims >>> get_create_delims() ['\t', ' '] CreateProcess considers only space and horizontal tab as white-space delimiters, at least on this Windows 10 system. Otherwise Windows itself doesn't care about the command line. It's up to each application to parse its command line however it wants. subprocess.list2cmdline assumes an application uses argv from Microsoft's C runtime. The Windows shell function CommandLineToArgvW is supposed to follow the same rules. The following calls CommandLineToArgvW on a test command-line string for each character in the space_chars set: import ctypes from ctypes import wintypes shell32 = ctypes.WinDLL('shell32', use_last_error=True) PLPWSTR = ctypes.POINTER(wintypes.LPWSTR) shell32.CommandLineToArgvW.restype = PLPWSTR def cmdline2argv(cmdline): argc = ctypes.c_int() pargv = shell32.CommandLineToArgvW(cmdline, ctypes.byref(argc)) if not pargv: raise ctypes.WinError(ctypes.get_last_error()) return pargv[:argc.value] def get_argv_delims(): cmdline = 'test{}space' delims = [] for space in space_chars: if len(cmdline2argv(cmdline.format(space))) > 1: delims.append(space) return delims >>> get_argv_delims() ['\t', '\n', '\x0b', '\x0c', '\r', '\x1c', '\x1d', '\x1e', '\x1f', ' '] In addition to space and horizontal tab, CommandLineToArgvW also considers line feed, vertical tab, form feed, carriage return, file separator, group separator, record separator, and unit separator to be white-space delimiters. This disagrees with [1], which says it should be limited to space and horizontal tab, like CreateProcess. Let's test this as well: def get_msvc_argv_delims(): template = '"{}" -c "import sys;print(len(sys.argv))" test{}space' delims = [] for space in space_chars: cmdline = template.format(sys.executable, space) out = subprocess.check_output(cmdline) argc = int(out) if argc > 2: delims.append(space) return delims >>> get_msvc_argv_delims() ['\t', ' '] Apparently CommandLineToArgvW is inconsistent with the C runtime in this case. On my Windows 10 system, ideographic space (U+3000) is not generally a command-line delimiter. That's not to say that some applications (and maybe localized CRTs?) don't use it that way. But I don't think it's the place of the subprocess module to handle it. [1]: https://msdn.microsoft.com/en-us/library/17w5ykft ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 13:22:30 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 07 Apr 2017 17:22:30 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1491585750.77.0.0678556775872.issue30017@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 13:25:19 2017 From: report at bugs.python.org (Charles McEachern) Date: Fri, 07 Apr 2017 17:25:19 +0000 Subject: [issue30018] multiprocessing.Pool garbles call stack for __new__ Message-ID: <1491585919.25.0.878478189526.issue30018@psf.upfronthosting.co.za> New submission from Charles McEachern: I'm calling the constructor of Foo, a subclass of str. Expected output: Called Foo.__new__ with args = ('TIMESTAMP', 'INPUT0') TIMESTAMP OUTPUT0 When I make the call using a multiprocessing.pool.ThreadPool, it works fine. But when I make the call using a multiprocessing.Pool (using the apply or apply_async method), I get: Called Foo.__new__ with args = ('TIMESTAMP', 'INPUT0') Called Foo.__new__ with args = ('TIMESTAMP OUTPUT0',) Exception in thread Thread-3: ... ValueError: Bad Foo input: ('TIMESTAMP OUTPUT0',) That is, the object I just constructed seems to be getting shoved right back into the constructor. When I swap out the Foo class for the similar Goo class, which is not a str, and uses __init__ instead of __new__, I again see no problems: Called Goo.__init__ with args = ('TIMESTAMP', 'INPUT0') I see this in 2.7.9 as well as 3.4.5. Looks like it's present in 2.7.2 and 3.5.2 as well: https://github.com/charles-uno/python-new-pool-bug/issues/1 ---------- components: Library (Lib) files: newpool.py messages: 291278 nosy: Charles McEachern priority: normal severity: normal status: open title: multiprocessing.Pool garbles call stack for __new__ type: behavior versions: Python 2.7, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file46790/newpool.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 13:28:25 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 07 Apr 2017 17:28:25 +0000 Subject: [issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb In-Reply-To: <1491557387.23.0.595235956819.issue30012@psf.upfronthosting.co.za> Message-ID: <1491586105.13.0.0231645416184.issue30012@psf.upfronthosting.co.za> R. David Murray added the comment: I don't think this is really a bug, I think it's a consequence of the different byte/string models of python2 and python3 coupled with the different binary/text models of posix and windows. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 13:34:58 2017 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 07 Apr 2017 17:34:58 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491567877.48.0.947926348403.issue30014@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: > I don't think that selector.modify() can be a bottleneck, but IMHO the change is simple and safe enough to be worth it. In a network server with 10k client, an optimization making .modify() 1.52x faster is welcomed. IMHO it complicates the code for little benefit: that's why I asked for a realistic benchmark. This patch could made modify() 10x faster, if modify() only accounts for 1% of the overall overhead in a realistic use-case, then it's not worth it. ---------- title: Speedup DefaultSelectors.modify() by 1.5x -> Speedup DefaultSelectors.modify() by 2x _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 13:36:32 2017 From: report at bugs.python.org (LCY) Date: Fri, 07 Apr 2017 17:36:32 +0000 Subject: [issue30015] Windows also treats full-width spaces as a delimiter when parsing arguments In-Reply-To: <1491564483.72.0.230621154457.issue30015@psf.upfronthosting.co.za> Message-ID: <1491586592.38.0.240503265942.issue30015@psf.upfronthosting.co.za> LCY added the comment: Thank you for testing and explanation. My test cases are not enough. I will close this issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 13:50:07 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 07 Apr 2017 17:50:07 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1491587407.75.0.366242920306.issue29974@psf.upfronthosting.co.za> Changes by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 14:09:29 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 18:09:29 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491588569.64.0.737380369627.issue30014@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: In certain protocols modify() is supposed to be used on every interaction between client and server. E.g. an FTP server does this: - register(fd, EVENT_READ); recv() # wait command from client - modify(fd, EVENT_WRITE); send(response) # send response - modify(fd, EVENT_READ); recv() # wait for new command ...so it's two calls for each command received. In asyncio modify() is also used in different circumstances. If you're worried about code duplication I can refactor selectors.py first, but IMO it would be a bad idea to reject this or future improvements because the current code status prevents code reuse. Right now there are already 3 classes sharing basically the same code (poll, epoll and devpoll related classes). Those can be refactored similarly to this: https://github.com/giampaolo/pyftpdlib/blob/ab699b5f89223e03593f3e004d6a370b4c2e5308/pyftpdlib/ioloop.py#L465-L565 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 14:23:44 2017 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Apr 2017 18:23:44 +0000 Subject: [issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb In-Reply-To: <1491557387.23.0.595235956819.issue30012@psf.upfronthosting.co.za> Message-ID: <1491589424.15.0.0667227280552.issue30012@psf.upfronthosting.co.za> Eryk Sun added the comment: In Python 3, gzip.open(filename, "rt") returns a TextIOWrapper using the system's default encoding. The decoded output is potentially very different from the byte string returned by 'text mode' in Python 2, even if using "rt" mode didn't result in the nonsensical "rtb" mode. I suggest using the default binary mode, and manually wrapping the file in an io.TextIOWrapper. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 14:30:17 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 18:30:17 +0000 Subject: [issue29071] IDLE doesn't highlight f-strings properly In-Reply-To: <1482714978.44.0.603392455768.issue29071@psf.upfronthosting.co.za> Message-ID: <1491589817.65.0.859202330971.issue29071@psf.upfronthosting.co.za> Terry J. Reedy added the comment: #29287 is about syntax highlighting the code within f-strings as code rather than as part of the string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 14:38:07 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Apr 2017 18:38:07 +0000 Subject: [issue23984] Documentation error: Descriptors In-Reply-To: <1429245728.01.0.810263114275.issue23984@psf.upfronthosting.co.za> Message-ID: <1491590287.76.0.3424058761.issue23984@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 14:55:09 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 18:55:09 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491591309.24.0.20154156875.issue29956@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Is math.exp(x) always more accurate than math.e ** x? If so, doc could say so. Otherwise, should this be closed? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 15:25:28 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 07 Apr 2017 19:25:28 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491593128.93.0.93926480117.issue30014@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: @neologix: here's a PR which refactors the poll-related classes: https://github.com/python/cpython/pull/1035/files >From there, we'll be able to avoid modify() code duplication. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 15:29:47 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 19:29:47 +0000 Subject: [issue29975] Issue in extending documentation In-Reply-To: <1491273401.15.0.69165837027.issue29975@psf.upfronthosting.co.za> Message-ID: <1491593387.32.0.266088808946.issue29975@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I agree with the rejection on the PR. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 15:33:56 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 07 Apr 2017 19:33:56 +0000 Subject: [issue29976] urllib.parse clarify what ' ' in schemes mean In-Reply-To: <1491281657.78.0.713830439385.issue29976@psf.upfronthosting.co.za> Message-ID: <1491593636.7.0.286418649049.issue29976@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- pull_requests: +1190 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 15:47:43 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 19:47:43 +0000 Subject: [issue29980] OSError: multiple exceptions should preserve the exception type if it is common In-Reply-To: <1491325941.34.0.941861469291.issue29980@psf.upfronthosting.co.za> Message-ID: <1491594463.49.0.795729889852.issue29980@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I agree. And if the sub-exceptions are different, prepend them to the messages in the OSError list. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 16:15:46 2017 From: report at bugs.python.org (David E. Franco G.) Date: Fri, 07 Apr 2017 20:15:46 +0000 Subject: [issue30019] IDLE got unexpexted bahavior when trying to use some characters Message-ID: <1491596146.33.0.970912299828.issue30019@psf.upfronthosting.co.za> New submission from David E. Franco G.: wandering for the internet I fount some unicode character in a random comment, and just for curiosity I wanted to use python (3.6.1) to see their value, so I copy those characters and paste them in IDLE, and in doing so it just close without warning or explanation. the character in question are: ? ? (chr(128299) and chr(128298)) then I put them in a script text = "? ?" print(text) and try to load it but instead it open a new empty scrip, again without apparent reason, which for some reason I can't close, I needed to kill the process for that. I try the same with the IDLE in python 2.7.13 for the first one I got Unsupported characters in input which at least is something, and changing the script a little # -*- coding: utf-8 -*- text = u"? ?" print(text) it work without problem and print correctly. Also opening the script in interactive mode (python -i myscript.py) it work as expected and I get their numbers (that I put above). So why is that? and please fix it. ---------- assignee: terry.reedy components: IDLE messages: 291289 nosy: David E. Franco G., terry.reedy priority: normal severity: normal status: open title: IDLE got unexpexted bahavior when trying to use some characters type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 16:23:13 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 20:23:13 +0000 Subject: [issue29987] inspect.isgeneratorfunction not working with partial functions In-Reply-To: <1491348915.09.0.197335598745.issue29987@psf.upfronthosting.co.za> Message-ID: <1491596593.94.0.521127199211.issue29987@psf.upfronthosting.co.za> Terry J. Reedy added the comment: A generator function *gf* is a function that contain *yield* in its body. When it is compiled, flag CO_GENERATOR is set in gf.__code__.co_flags. When the function is called, the flag is queried and if set, a special path is taken that attaches the live but suspended code instance to a generator instance. *isgeneratorfunction* tests that an object is a function and that the flag is set. return bool((isfunction(object) or ismethod(object)) and object.__code__.co_flags & CO_GENERATOR) This is exactly what it should do. Any function could potentially call a generator function and return its result. Martin's *test2*, with or without the wrapper, is an example. Note that *iscoroutinefunction* and *isaynchgenfunction* follow the same pattern, but with different flags. A 4th flag is queried by *isawaitable*. The return object of any of these could also by returned by other functions. ---------- nosy: +terry.reedy resolution: -> rejected stage: -> resolved status: open -> closed type: -> enhancement versions: +Python 3.7 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 16:27:44 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 20:27:44 +0000 Subject: [issue29987] inspect.isgeneratorfunction not working with partial functions In-Reply-To: <1491348915.09.0.197335598745.issue29987@psf.upfronthosting.co.za> Message-ID: <1491596864.96.0.589166638262.issue29987@psf.upfronthosting.co.za> Terry J. Reedy added the comment: If you want to know if a function returns a generator, you have to call it and pass the result to *isgenerator*, or use type-annotated functions (see the typing module) and static type checkers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 16:49:12 2017 From: report at bugs.python.org (Davin Potts) Date: Fri, 07 Apr 2017 20:49:12 +0000 Subject: [issue30018] multiprocessing.Pool garbles call stack for __new__ In-Reply-To: <1491585919.25.0.878478189526.issue30018@psf.upfronthosting.co.za> Message-ID: <1491598152.58.0.538958129278.issue30018@psf.upfronthosting.co.za> Davin Potts added the comment: It looks like the first 'Called Foo.__new__' is being reported by the child (pool of 1) process and the second 'Called Foo.__new__' is being reported by the parent process. In multiprocessing, because objects are by default serialized using pickle, this may be caused by the unpickling of the Foo object by the parent process which is something you would not experience when using ThreadPool because it does not have the same need for serialization. Example showing invocation of __new__ as part of unpickling: >>> class Foo(object): ... def __new__(cls): ... print("New") ... return object.__new__(cls) ... >>> import pickle >>> f = Foo() New >>> pf = pickle.dumps(f, protocol=2) >>> pickle.loads(pf) # unpickling triggers __new__ New <__main__.Foo object at 0x1084a06d0> Having discovered this phenomenon, is this causing a problem for you somewhere in code? (Your example code on github was helpful, thank you, but it didn't merely demonstrated the behavior and didn't show where this was causing you pain.) ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 16:53:42 2017 From: report at bugs.python.org (Peter) Date: Fri, 07 Apr 2017 20:53:42 +0000 Subject: [issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb In-Reply-To: <1491557387.23.0.595235956819.issue30012@psf.upfronthosting.co.za> Message-ID: <1491598422.31.0.269231537042.issue30012@psf.upfronthosting.co.za> Peter added the comment: I want a simple cross platform (Linux/Mac/Windows) and cross version (Python 2/3) way to be able to open a gzipped file and get a string handle (default encoding TextIOWrapper under Python 3 is fine). My use-case is specifically for documentation examples. Previously I used gzip.open(filename) but with the introduction of Python 3 that stopped working because the Python 3 default was to give you bytes. Thanks to http://bugs.python.org/issue13989 switching to gzip.open(filename, "rt") almost covered my use case, leaving Python 2 windows as the odd one out. I propose that under Python 2.7, gzip.open explicit accept but ignore "t" as part of the mode argument in order to allow cross-platform code to work nicely. i.e. Formalise the observed Python 2.7 behaviour under Linux and Mac which ignore the "t", and change Windows so that it ignores the "t" as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 16:58:35 2017 From: report at bugs.python.org (Davin Potts) Date: Fri, 07 Apr 2017 20:58:35 +0000 Subject: [issue30018] multiprocessing.Pool garbles call stack for __new__ In-Reply-To: <1491585919.25.0.878478189526.issue30018@psf.upfronthosting.co.za> Message-ID: <1491598715.86.0.819546625264.issue30018@psf.upfronthosting.co.za> Davin Potts added the comment: Expanding my above example to show how multiprocessing relates: >>> import multiprocessing >>> import os >>> class Floof(object): ... def __new__(cls): ... print("New via pid=%d" % os.getpid()) ... return object.__new__(cls) ... >>> os.getpid() # parent pid 46560 >>> pool = multiprocessing.Pool(1) >>> getter = pool.apply_async(Floof, (), {}) # output seen from child AND parent >>> New via pid=46583 New via pid=46560 >>> getter.get() # everything seems to be working as intended <__main__.Floof object at 0x10866f250> FWIW, near the end of my prior message: s/it didn't merely/it merely/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:02:57 2017 From: report at bugs.python.org (Douglas Greiman) Date: Fri, 07 Apr 2017 21:02:57 +0000 Subject: [issue28643] Broken makefile depends for profile-opt target In-Reply-To: <1478634995.26.0.389156722395.issue28643@psf.upfronthosting.co.za> Message-ID: <1491598977.71.0.32449158851.issue28643@psf.upfronthosting.co.za> Changes by Douglas Greiman : ---------- nosy: +dgreiman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:06:56 2017 From: report at bugs.python.org (Charles McEachern) Date: Fri, 07 Apr 2017 21:06:56 +0000 Subject: [issue30018] multiprocessing.Pool garbles call stack for __new__ In-Reply-To: <1491585919.25.0.878478189526.issue30018@psf.upfronthosting.co.za> Message-ID: <1491599216.59.0.724934820559.issue30018@psf.upfronthosting.co.za> Charles McEachern added the comment: This caused me several hours of misery yesterday, trying to isolate what was going wrong. I am unfortunately not at liberty to share the code I'm working on. The example on GitHub has the general thrust of it: my constructor was always called in a specific way, and didn't expect to be given something that was already processed. Interesting to see that this is a product of pickling. That makes me think that "fixing" this corner case would probably be a lot of work. I suppose I should just work around it by checking right away if the input to my constructor has already been constructed! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:10:52 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 21:10:52 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491599452.44.0.970986918003.issue29989@psf.upfronthosting.co.za> Terry J. Reedy added the comment: 'crash' means OS message rather than Python exiting with exception traceback and message. Can you post a minimal reproducer? What OS? subprocess.Popen._get_handles is different on POSIX and windows, though both seem to call f.fileno() without try-except. All filenoes are initialized to -1, so it seems to me that either a. all accesses should be wrapped with try-except: pass, or b. subprocess doc should say that file-like objects must include a fileno method returning -1. I am puzzled though. The 2.7 doc for (builtin)file.fileno() says " Note File-like objects which do not have a real file descriptor should not provide this method! " " Rather than return -1 In must be that the subprocess test does not test with a 'file-like object without a file descriptor' ---------- nosy: +terry.reedy type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:14:32 2017 From: report at bugs.python.org (Davin Potts) Date: Fri, 07 Apr 2017 21:14:32 +0000 Subject: [issue30018] multiprocessing.Pool garbles call stack for __new__ In-Reply-To: <1491585919.25.0.878478189526.issue30018@psf.upfronthosting.co.za> Message-ID: <1491599672.97.0.519779745143.issue30018@psf.upfronthosting.co.za> Davin Potts added the comment: > I am unfortunately not at liberty to share the code I'm working on. I very much understand and am very thankful you took the time to create a simple example that you could share. Honestly, that's the reason I felt inspired to stop what I was doing to look at this now rather than later. > I suppose I should just work around it by checking right away if the input to my constructor has already been constructed! There are probably a number of different ways to address it but your suggestion of adding a check to see if this is the first time that object has been constructed sounds like it might be an easy win. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:35:28 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 21:35:28 +0000 Subject: [issue30003] Remove hz codec In-Reply-To: <1491450137.17.0.519356226961.issue30003@psf.upfronthosting.co.za> Message-ID: <1491600928.6.0.244195384242.issue30003@psf.upfronthosting.co.za> Terry J. Reedy added the comment: We seldom just remove things; we usually deprecate in the doc and if possible, issue a runtime warning. This is probably not the only obsolete codec. There should be a uniform policy for deprecation and removal, if ever. But for any codec, there might be archives, even if the codec is not used for new files. If the codec is buggy, I think it should be fixed. Bt you yourself closed #24117, suggesting that you did not believe that the patches should be applied. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:36:41 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 21:36:41 +0000 Subject: [issue30008] OpenSSL 1.1.0 deprecated functions In-Reply-To: <1491496485.65.0.239768530197.issue30008@psf.upfronthosting.co.za> Message-ID: <1491601001.54.0.115355476682.issue30008@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- nosy: +alex, christian.heimes, dstufft, janssen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:39:05 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 07 Apr 2017 21:39:05 +0000 Subject: [issue30018] multiprocessing.Pool garbles call stack for __new__ In-Reply-To: <1491585919.25.0.878478189526.issue30018@psf.upfronthosting.co.za> Message-ID: <1491601145.52.0.368874373043.issue30018@psf.upfronthosting.co.za> R. David Murray added the comment: I suspect you just need to add pickle support to your class. When I subclassed str in the email package, I found I needed to do that. I'd have to go through the docs again to remember how the code works, but you can take a look at the BaseHeader class in email.headerregistry to see what I did. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:51:12 2017 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Apr 2017 21:51:12 +0000 Subject: [issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb In-Reply-To: <1491557387.23.0.595235956819.issue30012@psf.upfronthosting.co.za> Message-ID: <1491601872.67.0.548024402022.issue30012@psf.upfronthosting.co.za> Eryk Sun added the comment: You want to hack a fake text mode, which won't do new-line translation or treat ^Z (0x1a) as EOF like a normal 2.x text mode on Windows. Can't you just use io.TextIOWrapper(gzip.open(filename))? This reads Unicode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:54:26 2017 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Apr 2017 21:54:26 +0000 Subject: [issue29939] Compiler warning in _ctypes_test.c In-Reply-To: <1490769884.15.0.305944990861.issue29939@psf.upfronthosting.co.za> Message-ID: <1491602066.07.0.783479475858.issue29939@psf.upfronthosting.co.za> Changes by Vinay Sajip : ---------- pull_requests: +1191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 17:57:51 2017 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Apr 2017 21:57:51 +0000 Subject: [issue29939] Compiler warning in _ctypes_test.c In-Reply-To: <1490769884.15.0.305944990861.issue29939@psf.upfronthosting.co.za> Message-ID: <1491602271.23.0.871702072872.issue29939@psf.upfronthosting.co.za> Changes by Vinay Sajip : ---------- pull_requests: +1192 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 18:03:06 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Apr 2017 22:03:06 +0000 Subject: [issue1207613] Idle Editor: Bottom Scroll Bar Message-ID: <1491602586.74.0.133361435419.issue1207613@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I don't like telling people to hand-edit .idlerc files. It causes too many problems. We added Extensions tab to avoid this. I think all supported options should be on dialog. Windows are resizable and accommodate lines up to current width. Default width is user settable option. So people who want to edit 100 char lines for code can and have editor open with 100 char width. Shell,Edit, and Output windows should not necessarily be same. Currently, Shell wraps both input and output while Editor Output truncate code input and grep output respectively. I plan to review this, including possible scrollbar, but not a priority. ---------- assignee: -> terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 18:06:58 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 07 Apr 2017 22:06:58 +0000 Subject: [issue23894] lib2to3 doesn't recognize rb'...' and f'...' in Python 3.6 In-Reply-To: <1428585495.21.0.103830054834.issue23894@psf.upfronthosting.co.za> Message-ID: <1491602818.15.0.0875028354265.issue23894@psf.upfronthosting.co.za> Changes by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 18:11:26 2017 From: report at bugs.python.org (Charles McEachern) Date: Fri, 07 Apr 2017 22:11:26 +0000 Subject: [issue30018] multiprocessing.Pool garbles call stack for __new__ In-Reply-To: <1491585919.25.0.878478189526.issue30018@psf.upfronthosting.co.za> Message-ID: <1491603086.32.0.900474358211.issue30018@psf.upfronthosting.co.za> Charles McEachern added the comment: That seems to do it! Looks like the trick is to define __reduce__ to help out the serializer. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 18:13:25 2017 From: report at bugs.python.org (Peter) Date: Fri, 07 Apr 2017 22:13:25 +0000 Subject: [issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb In-Reply-To: <1491557387.23.0.595235956819.issue30012@psf.upfronthosting.co.za> Message-ID: <1491603205.46.0.764267388363.issue30012@psf.upfronthosting.co.za> Peter added the comment: A workaround for my use case is even simpler, something like this: try: handle = gzip.open(filename, "rt") except ValueError: # Workaround for Python 2.7 under Windows handle = gzip.open(filename, "r") However, even this is troublesome for use in documentation intended to work on Python 2 and 3, over Linux, Mac and Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 18:23:10 2017 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Apr 2017 22:23:10 +0000 Subject: [issue29939] Compiler warning in _ctypes_test.c In-Reply-To: <1490769884.15.0.305944990861.issue29939@psf.upfronthosting.co.za> Message-ID: <1491603790.11.0.600147141309.issue29939@psf.upfronthosting.co.za> Vinay Sajip added the comment: New changeset d0d575a6db8cb3b2a720be9f404af3d754da9a5d by Vinay Sajip in branch '3.6': bpo-29939: suppress compiler warnings in _ctypes_test (#1038) https://github.com/python/cpython/commit/d0d575a6db8cb3b2a720be9f404af3d754da9a5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 18:24:54 2017 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 07 Apr 2017 22:24:54 +0000 Subject: [issue29939] Compiler warning in _ctypes_test.c In-Reply-To: <1490769884.15.0.305944990861.issue29939@psf.upfronthosting.co.za> Message-ID: <1491603894.2.0.402012623957.issue29939@psf.upfronthosting.co.za> Vinay Sajip added the comment: New changeset ae0915e42d8cd96e5ced1fc442ea078b4a59e82d by Vinay Sajip in branch '3.5': Closes bpo-29939: suppress compiler warnings in _ctypes_test (#1039) https://github.com/python/cpython/commit/ae0915e42d8cd96e5ced1fc442ea078b4a59e82d ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 18:41:26 2017 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Fri, 07 Apr 2017 22:41:26 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491593128.93.0.93926480117.issue30014@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: This refactoring was already suggested a long time ago, and at the time both Guido and I didn't like it because it makes the code actually more complicated: DRY in this case doesn't apply IMO. Also, this whole thread is a repeat of: http://bugs.python.org/issue18932 At the time, I already asked for one realistic use case demonstrating the benefit of implementing modify() natively instead of unregister()+register(). I know that this code makes modify() faster, but as I said multiple times, I'd like to se the impact on something else than a micro-benchmark: arguably if you propose this it's because you've profiled/found it to be an actual bottleneck, do you have *one* benchmark to support this change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 19:23:14 2017 From: report at bugs.python.org (Martin Panter) Date: Fri, 07 Apr 2017 23:23:14 +0000 Subject: [issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb In-Reply-To: <1491557387.23.0.595235956819.issue30012@psf.upfronthosting.co.za> Message-ID: <1491607394.82.0.742921330888.issue30012@psf.upfronthosting.co.za> Martin Panter added the comment: I agree this is not a bug. It is just one of the unfortunate compatibility breaks between Py 2 and 3. Mode="rt" is not one of the values that are supported according to the documentation; adding support would be a new feature. I understand the file mode handling is stricter on Windows because the underlying OS or C library would crash. To have code that works with Py 2 and 3, I would switch the mode depending on the version of Python: if sys.version_info >= (3,): handle = gzip.open(filename, "rt") else: handle = gzip.open(filename) ---------- nosy: +martin.panter resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 20:09:57 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 08 Apr 2017 00:09:57 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491610197.9.0.601539058204.issue29989@psf.upfronthosting.co.za> Martin Panter added the comment: Raphael: Can you point to the implementation code that handles file objects without a file descriptor (or give a demonstration of it)? I suspect there is no such support and you are mistaken. Perhaps we can instead clarify in the ?subprocess? documentation that ?fileno? is required. Issue 19992 already proposes this. Issue 1260171 and Issue 10482 are also related, about streaming data between Python file objects in the parent and pipes connected to the child. ---------- nosy: +martin.panter stage: -> test needed superseder: -> subprocess documentation not explicit about fileno() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 20:26:14 2017 From: report at bugs.python.org (Ellison Marks) Date: Sat, 08 Apr 2017 00:26:14 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1491611174.57.0.451767848034.issue30017@psf.upfronthosting.co.za> Ellison Marks added the comment: At a guess, when encoder goes out of scope, it closes the underlying file object. Then, on exiting the with block, the zipfile tries to take some action with the closed file and errors out? ---------- nosy: +Ellison Marks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 21:23:00 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 08 Apr 2017 01:23:00 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1491614580.14.0.0516060806349.issue30017@psf.upfronthosting.co.za> Martin Panter added the comment: It looks like the zip entry writer object may not expect its ?close? method to be called multiple times. Other file objects tend to allow this with no ill effect. Adding Serhiy and Thomas who implemented the writer object in Issue 26039. The first time it is called will be when the context manager (?with? statement) exits. The second time will be when the TextIOWrapper is garbage-collected. This is documented behaviour , but I think it is a design mistake of the IOBase hierarchy; see Issue 19829. A reasonable workaround would be to call encoder.detach() after you have finished writing the zip entry. ---------- nosy: +martin.panter, serhiy.storchaka, takluyver stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 22:08:09 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 08 Apr 2017 02:08:09 +0000 Subject: [issue30000] Inconsistency in the zlib module In-Reply-To: <1491434902.87.0.645672242128.issue30000@psf.upfronthosting.co.za> Message-ID: <1491617289.06.0.186875952623.issue30000@psf.upfronthosting.co.za> Martin Panter added the comment: I don?t have a strong opinion on adding the missing parameters to the one-shot ?compress? function, though it does seem beneficial to have a consistent set of parameters supported across the relevant APIs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 22:32:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 08 Apr 2017 02:32:42 +0000 Subject: [issue30003] Remove hz codec In-Reply-To: <1491600928.6.0.244195384242.issue30003@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: "But for any codec, there might be archives, even if the codec is not used for new files." The bug is in the encoder. The codec is still usable to *decode* files. So maybe a few people use it but didn't notice the encoder bug? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 22:57:35 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 Apr 2017 02:57:35 +0000 Subject: [issue30019] IDLE freezes when opening a file with astral characters In-Reply-To: <1491596146.33.0.970912299828.issue30019@psf.upfronthosting.co.za> Message-ID: <1491620255.43.0.590371448998.issue30019@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Your report touches on four different issues. 1. IDLE uses tkinter for the GUI and tkinter wraps tcl/tk 8.6 or earlier, which only handles Basic Multilingual Plane chars (codepoints 0000 to FFFF). The gun and knife chars are out of that range. I have read that 8.7 will handle all unicode chars and that it might be released this year. This will fix multiple IDLE issues (#21084, #22742, #13153, #14304). 2. Until 3.3, CPython used two internal unicode encoding schemes: Narrow and wide builds. Narrow builds used pairs of surrogate chars in the BMP to represent chars not in the BMP. So your '3 char' string is stored as 5 chars. # -*- coding: utf-8 -*- text = u"? ?" for c in text: print(ord(c)) *prints, on 2.7.13 on Windows 55357 56619 32 55357 56618 Windows releases and a few *nix releases used narrow builds. I have Windows, so I could copy and paste your string and run the above. Most *nix releases used wide builds and could not. In 3.3, CPython switched to a flexible representation used on all releases. Like earlier wide builds, it does not use surrogate chars, and the above no longer loads into a text widget, let alone run. 3. Any exception not caught by IDLE generates a traceback that appears on the console used to start IDLE, if there is one. Otherwise, it is lost. Running " -m idlelib" in a console and loading the code above results in a traceback ending with "_tkinter.TclError: character U+1f52b is above the range (U+000)-(U+ffff) allowed by Tcl". I have though about (and previously commented about) trying to put such messages in a tk message box when IDLE and tk are still functioning well enough to do so before stopping. 4. It appears the IDLE opens a file that is not already open by creating a blank editor window and then loading the file into it. In this case, when the load fails, a frozen window is left that blocks IDLE closing. This nasty behavior, which I verified, is new to me, so I am leaving this issue open specifically for this bug. A likely fix is to catch TclError in the appropriate place (not yet known to me), recover (delete the new EditorWindow and ???), display an explanatory error message, and continue when user hits [OK]. We already have a test string. If needed, I will try to separate 'opening a file name' from 'reading the contents', so a test can use a simple mock file object. If a file were opened and read *before* creating a new window, there would be less cleanup to do. ---------- stage: -> needs patch title: IDLE got unexpexted bahavior when trying to use some characters -> IDLE freezes when opening a file with astral characters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 7 23:04:51 2017 From: report at bugs.python.org (Isaac Morland) Date: Sat, 08 Apr 2017 03:04:51 +0000 Subject: [issue30020] Make attrgetter use namedtuple Message-ID: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> New submission from Isaac Morland: I would find it useful if the tuples returned by attrgetter functions were namedtuples. An initial look at the code for attrgetter suggests that this would be an easy change and should make little difference to performance. Giving a namedtuple where previously a tuple was returned seems unlikely to trigger bugs in existing code so I propose to simply change attrgetter rather than providing a parameter to specify whether or not to use the new behaviour. Patch will be forthcoming but comments appreciated. ---------- components: Library (Lib) messages: 291314 nosy: Isaac Morland priority: normal severity: normal status: open title: Make attrgetter use namedtuple type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 00:09:51 2017 From: report at bugs.python.org (Ma Lin) Date: Sat, 08 Apr 2017 04:09:51 +0000 Subject: [issue30003] Remove hz codec In-Reply-To: <1491450137.17.0.519356226961.issue30003@psf.upfronthosting.co.za> Message-ID: <1491624591.16.0.564113509383.issue30003@psf.upfronthosting.co.za> Ma Lin added the comment: >From my subjective feelings, probably no old archives still exist, but I can't assert it. That's why I suggest remove it, or at least don't fix it. Ah, let's slow down the pace, this bug exists over a dacade, we don't need to solve it at once. I closed #24117, because it became a soup of small issues, so I split it into individual issues (such as this issue). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 00:13:43 2017 From: report at bugs.python.org (Ma Lin) Date: Sat, 08 Apr 2017 04:13:43 +0000 Subject: [issue24117] Wrong range checking in GB18030 decoder. In-Reply-To: <1430641019.11.0.12743813091.issue24117@psf.upfronthosting.co.za> Message-ID: <1491624823.21.0.764100367458.issue24117@psf.upfronthosting.co.za> Ma Lin added the comment: I closed this issue, because it involved too many things. 1, for GB18030 decoder bug, see issue29990. 2, for hz encoder bug, see issue30003. 3, for problem in Traditional Chinese codecs, please create a new issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 00:23:47 2017 From: report at bugs.python.org (Eryk Sun) Date: Sat, 08 Apr 2017 04:23:47 +0000 Subject: [issue30019] IDLE freezes when opening a file with astral characters In-Reply-To: <1491596146.33.0.970912299828.issue30019@psf.upfronthosting.co.za> Message-ID: <1491625427.57.0.233862121021.issue30019@psf.upfronthosting.co.za> Eryk Sun added the comment: In Windows IDLE 3.x, you should still be able to print a surrogate transcoding, which sneaks the native UTF-16LE encoding around tkinter: def transurrogate(s): b = s.encode('utf-16le') return ''.join(b[i:i+2].decode('utf-16le', 'surrogatepass') for i in range(0, len(b), 2)) def print_surrogate(*args, **kwds): new_args = [] for arg in args: if isinstance(arg, str): new_args.append(transurrogate(s)) else: new_args.append(arg) return print(*new_args, **kwds) >>> s = '\U0001f52b \U0001f52a' >>> print_surrogate(s) ? ? Pasting non-BMP text into IDLE fails on Windows for a similar reason. Tk naively encodes the surrogate codes in the native Windows UTF-16 text as invalid UTF-8, which I've seen refereed to as WTF-8 (Wobbly). I see the following error when I run IDLE using python.exe (i.e. with a console) and paste "? ?" into the window: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 1: invalid continuation byte This is the second byte of the WTF-8 encoding: >>> transurrogate('"\U0001f52b').encode('utf-8', 'surrogatepass') b'"\xed\xa0\xbd\xed\xb4\xab' Hackiness aside, I don't think it's worth supporting this just for Windows. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 01:06:55 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 08 Apr 2017 05:06:55 +0000 Subject: [issue27973] urllib.urlretrieve() fails on second ftp transfer In-Reply-To: <1473174596.52.0.952829730129.issue27973@psf.upfronthosting.co.za> Message-ID: <1491628015.13.0.7143460527.issue27973@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- pull_requests: +1193 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:19:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 06:19:26 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491632366.43.0.941411276548.issue19225@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7f85947106aff5b1f166a57f644f987db4d38bf0 by Serhiy Storchaka (cocoatomo) in branch '2.7': [2.7] bpo-19225: Lack of c api exceptions doc (#964) https://github.com/python/cpython/commit/7f85947106aff5b1f166a57f644f987db4d38bf0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:33:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 06:33:40 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1491633220.31.0.570778738951.issue30017@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I agree, that close() should be an idempotent operation. Proposed patch fixes this. ---------- assignee: -> serhiy.storchaka components: +Library (Lib) stage: needs patch -> patch review versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:34:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 06:34:32 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1491633272.68.0.977980297854.issue30017@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1194 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:35:29 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 08 Apr 2017 06:35:29 +0000 Subject: [issue30020] Make attrgetter use namedtuple In-Reply-To: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> Message-ID: <1491633329.27.0.152698688388.issue30020@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Before writing a patch that may be rejected, can you explain in detail what change you propose? Example(s) will be good. For example: py> from operator import attrgetter py> f = attrgetter('keys') py> f({}) I don't see a tuple here, so what (if anything) are you planning to change? How about the example from help(attrgetter)? | After h = attrgetter('name.first', 'name.last'), the call h(r) returns | (r.name.first, r.name.last). ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:38:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 06:38:07 +0000 Subject: [issue23894] lib2to3 doesn't recognize rb'...' and f'...' in Python 3.6 In-Reply-To: <1428585495.21.0.103830054834.issue23894@psf.upfronthosting.co.za> Message-ID: <1491633487.44.0.957588855567.issue23894@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Should this issue be closed now? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:43:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 06:43:07 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491633787.75.0.881732002115.issue29956@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Not always. For example for x = 0 both methods give the same exact result. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:53:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 06:53:01 +0000 Subject: [issue29914] Incorrect signatures of object.__reduce__() and object.__reduce_ex__() In-Reply-To: <1490601668.43.0.188654711703.issue29914@psf.upfronthosting.co.za> Message-ID: <1491634381.62.0.966536743175.issue29914@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 205e00c5cfd495a4dc6dae8e8fa0fb828fb3dca9 by Serhiy Storchaka in branch 'master': bpo-29914: Fix default implementations of __reduce__ and __reduce_ex__(). (#843) https://github.com/python/cpython/commit/205e00c5cfd495a4dc6dae8e8fa0fb828fb3dca9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:55:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 06:55:09 +0000 Subject: [issue29998] Pickling and copying ImportError doesn't preserve name and path In-Reply-To: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za> Message-ID: <1491634509.84.0.469639082982.issue29998@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b785396ab451b0c9d6ae9ee5a9e56c810209a6cb by Serhiy Storchaka in branch 'master': bpo-29998: Pickling and copying ImportError now preserves name and path (#1010) https://github.com/python/cpython/commit/b785396ab451b0c9d6ae9ee5a9e56c810209a6cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 02:56:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 06:56:08 +0000 Subject: [issue29914] Incorrect signatures of object.__reduce__() and object.__reduce_ex__() In-Reply-To: <1490601668.43.0.188654711703.issue29914@psf.upfronthosting.co.za> Message-ID: <1491634568.82.0.299481951066.issue29914@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 03:06:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 07:06:44 +0000 Subject: [issue29998] Pickling and copying ImportError doesn't preserve name and path In-Reply-To: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za> Message-ID: <1491635204.33.0.6839767085.issue29998@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1195 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 03:07:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 07:07:35 +0000 Subject: [issue29998] Pickling and copying ImportError doesn't preserve name and path In-Reply-To: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za> Message-ID: <1491635255.02.0.541910515389.issue29998@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1196 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 03:15:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 07:15:27 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491635727.13.0.315471269446.issue27867@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1197 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 03:16:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 07:16:05 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491635765.42.0.39857837162.issue27867@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1198 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 03:16:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 07:16:13 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491635773.5.0.937910301399.issue27867@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1199 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 04:04:22 2017 From: report at bugs.python.org (Peter) Date: Sat, 08 Apr 2017 08:04:22 +0000 Subject: [issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb In-Reply-To: <1491557387.23.0.595235956819.issue30012@psf.upfronthosting.co.za> Message-ID: <1491638662.32.0.470059655399.issue30012@psf.upfronthosting.co.za> Peter added the comment: OK, thanks. Given this is regarded as an enhancement rather than a bug fix, I understand the choice not to change this in Python 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 04:12:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 08:12:54 +0000 Subject: [issue30021] Add examples for re.escape() Message-ID: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch adds examples of using re.escape(). See also issue29995. ---------- assignee: docs at python components: Documentation, Regular Expressions messages: 291326 nosy: docs at python, ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add examples for re.escape() type: enhancement versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 04:14:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 08:14:33 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1491639273.63.0.0133154164135.issue30021@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1200 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 04:25:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 08:25:49 +0000 Subject: [issue29998] Pickling and copying ImportError doesn't preserve name and path In-Reply-To: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za> Message-ID: <1491639949.13.0.928671362436.issue29998@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset af685f9050416da8050e0ec11a8dff9afd4130e7 by Serhiy Storchaka in branch '3.6': bpo-29998: Pickling and copying ImportError now preserves name and path (#1010) (#1042) https://github.com/python/cpython/commit/af685f9050416da8050e0ec11a8dff9afd4130e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 04:26:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 08:26:05 +0000 Subject: [issue29998] Pickling and copying ImportError doesn't preserve name and path In-Reply-To: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za> Message-ID: <1491639965.08.0.636585261403.issue29998@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e63f8f293a96ceebf06de15b4e1c97dbbff0f6a8 by Serhiy Storchaka in branch '3.5': bpo-29998: Pickling and copying ImportError now preserves name and path (#1010) (#1043) https://github.com/python/cpython/commit/e63f8f293a96ceebf06de15b4e1c97dbbff0f6a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 04:28:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 08:28:27 +0000 Subject: [issue29998] Pickling and copying ImportError doesn't preserve name and path In-Reply-To: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za> Message-ID: <1491640107.03.0.290341975666.issue29998@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 04:49:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 08:49:00 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491641340.05.0.128036422195.issue27867@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e41390aca51e4e3eb455cf3b70f5d656a2814db9 by Serhiy Storchaka in branch '2.7': bpo-27867: Expand the PySlice_GetIndicesEx macro. (#1023) (#1046) https://github.com/python/cpython/commit/e41390aca51e4e3eb455cf3b70f5d656a2814db9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 04:58:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 08:58:45 +0000 Subject: [issue27867] various issues due to misuse of PySlice_GetIndicesEx In-Reply-To: <1472226685.15.0.242668202848.issue27867@psf.upfronthosting.co.za> Message-ID: <1491641925.39.0.641335032006.issue27867@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8 by Serhiy Storchaka in branch 'master': Expand the PySlice_GetIndicesEx macro. (#1023) https://github.com/python/cpython/commit/b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8 New changeset c26b19d5c7aba51b50a4d7fb5f8291036cb9da24 by Serhiy Storchaka in branch '3.6': Expand the PySlice_GetIndicesEx macro. (#1023) (#1046) https://github.com/python/cpython/commit/c26b19d5c7aba51b50a4d7fb5f8291036cb9da24 New changeset fa25f16a4499178d7d79c18d2d68be7f70594106 by Serhiy Storchaka in branch '3.5': Expand the PySlice_GetIndicesEx macro. (#1023) (#1045) https://github.com/python/cpython/commit/fa25f16a4499178d7d79c18d2d68be7f70594106 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 05:26:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 09:26:33 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1491643593.52.0.29444171154.issue29943@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 05:27:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 09:27:37 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1491643657.36.0.276269498009.issue29943@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1202 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 05:36:31 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 09:36:31 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1491644191.07.0.638623621346.issue29943@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 1049 and PR 1050 restore ABI compatibility in 3.5 and 2.7. Unfortunately this restores the original bug with using PySlice_GetIndicesEx in third-party code (but CPython core and standard extensions no longer use PySlice_GetIndicesEx). Can we consider 3.6.0 rather than 3.6.1 as broken release? ---------- components: +Interpreter Core stage: -> patch review type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 06:05:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 10:05:39 +0000 Subject: [issue30022] Get rid of using EnvironmentError and IOError Message-ID: <1491645939.23.0.623640815202.issue30022@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: EnvironmentError and IOError now are aliases to OSError. But some code still use them. Proposed patch replaces all uses of EnvironmentError and IOError (except tests and scripts) with OSError. This will make the code cleaner and more uniform. ---------- messages: 291332 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Get rid of using EnvironmentError and IOError type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 06:07:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 10:07:41 +0000 Subject: [issue30022] Get rid of using EnvironmentError and IOError In-Reply-To: <1491645939.23.0.623640815202.issue30022@psf.upfronthosting.co.za> Message-ID: <1491646061.49.0.0608289403917.issue30022@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1203 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 07:57:53 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 08 Apr 2017 11:57:53 +0000 Subject: [issue30006] Deadlocks in `concurrent.futures.ProcessPoolExecutor` In-Reply-To: <1491482471.73.0.550300132711.issue30006@psf.upfronthosting.co.za> Message-ID: <1491652673.73.0.744335402561.issue30006@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- nosy: +bquinlan, davin, pitrou stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 08:25:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 12:25:41 +0000 Subject: [issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing In-Reply-To: <1354138508.41.0.9459136379.issue16572@psf.upfronthosting.co.za> Message-ID: <1491654341.0.0.358027266618.issue16572@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 11:19:34 2017 From: report at bugs.python.org (Isaac Morland) Date: Sat, 08 Apr 2017 15:19:34 +0000 Subject: [issue30020] Make attrgetter use namedtuple In-Reply-To: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> Message-ID: <1491664774.62.0.488138717365.issue30020@psf.upfronthosting.co.za> Isaac Morland added the comment: I've attached a file which illustrates what I'm proposing to happen with the examples from the help. Note that attrgetter (attr) is not affected, only attrgetter (*attrs) for more than one attribute. The idea is that tuples resulting from attrgetter functions will retain the attribute names from the original object. In some work I have done recently this would have been very handy with groupby. I had some initial confusion because changing the Python attrgetter implementation didn't make any difference. Once I realized I needed to turn off import of the C implementation, I figured the rest out fairly quickly. Here is the diff: diff --git a/Lib/operator.py b/Lib/operator.py index 0e2e53e..9b2a8fa 100644 --- a/Lib/operator.py +++ b/Lib/operator.py @@ -247,8 +247,12 @@ class attrgetter: else: self._attrs = (attr,) + attrs getters = tuple(map(attrgetter, self._attrs)) + + from collections import namedtuple + nt = namedtuple ('attrgetter', self._attrs, rename=True) + def func(obj): - return tuple(getter(obj) for getter in getters) + return nt._make (getter(obj) for getter in getters) self._call = func def __call__(self, obj): @@ -409,7 +413,7 @@ def ixor(a, b): try: - from _operator import * + pass except ImportError: pass else: There are some issues that still need to be addressed. The biggest is that I've turned off the C implementation. I assume that we'll need a C implementation the new version. In addition to this: 1) I just call the namedtuple type "attrgetter". I'm thinking something obtained by mashing together the field names or something similar might be more appropriate. However, I would prefer not to repeat the logic within namedtuple that deals with field names that aren't identifiers. So I'm wondering if maybe I should also modify namedtuple to allow None as the type name, in which case it would use an appropriate default type name based on the field names. 2) I import from collections inside the function. It didn't seem to work at the top-level, I'm guessing because I'm in the library and collections isn't ready when operator is initialized. This may be fine I just point it out as something on which I could use advice. I'm hoping this provides enough detail for people to understand what I'm proposing and evaluate whether this is a desireable enhancement. If so, I'll dig into the C implementation next, although I may need assistance with that. ---------- Added file: http://bugs.python.org/file46791/test_attrgetter.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 11:32:38 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 08 Apr 2017 15:32:38 +0000 Subject: [issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing In-Reply-To: <1354138508.41.0.9459136379.issue16572@psf.upfronthosting.co.za> Message-ID: <1491665558.43.0.48008087473.issue16572@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Multi-inheritance is tricky to get right, both for the class being extended and the class extending it. The APIs mentioned here were never designed for multiple inheritance and aren't supposed to support it. Your use case would probably be better served by using composition rather than inheritance. Speaking personally, I almost never subclass Thread, instead I make it an attribute of whatever class I'm writing. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 12:07:15 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 08 Apr 2017 16:07:15 +0000 Subject: [issue29725] sqlite3.Cursor doesn't properly document "arraysize" In-Reply-To: <1488732449.69.0.822466282685.issue29725@psf.upfronthosting.co.za> Message-ID: <1491667635.33.0.80350248839.issue29725@psf.upfronthosting.co.za> Berker Peksag added the comment: > row_factory seems to be another parameter that can be set in the Cursor object. > https://github.com/python/cpython/blob/master/Modules/_sqlite/cursor.c#L65 > > This can addressed in a different issue/ pr. Like I already said in msg290943, Cursor.row_factory is kept for backwards compatibility reasons and it shouldn't be documented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 12:09:12 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Sat, 08 Apr 2017 16:09:12 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491667752.36.0.0369213371902.issue19225@psf.upfronthosting.co.za> KINEBUCHI Tomohiko added the comment: Oh, I have overlooked these sentences. I will create an additional pull request to remove duplication. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 13:02:14 2017 From: report at bugs.python.org (Josh Rosenberg) Date: Sat, 08 Apr 2017 17:02:14 +0000 Subject: [issue30020] Make attrgetter use namedtuple In-Reply-To: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> Message-ID: <1491670934.96.0.642655863678.issue30020@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Aside from other issues, namedtuples can't have fields beginning with underscores, attrgetter can get attributes beginning with underscores (and dotted attributes for that matter). There isn't going to be an obvious or intuitive mapping to apply here. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 13:38:12 2017 From: report at bugs.python.org (Isaac Morland) Date: Sat, 08 Apr 2017 17:38:12 +0000 Subject: [issue30020] Make attrgetter use namedtuple In-Reply-To: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> Message-ID: <1491673092.24.0.0168359485034.issue30020@psf.upfronthosting.co.za> Isaac Morland added the comment: What are the "other issues"? As to the issue you raise here, that's why I use rename=True. First create a type with an underscore attribute: >>> t = namedtuple ('t', ['a', '1234'], rename=True) (just an easy way of creating such a type; used of namedtuple specifically is admittedly a bit of a red herring) Now create an object and illustrate its attributes: >>> tt = t ('c', 'd') >>> tt.a 'c' >>> tt._1 'd' Now use my modified attrgetter to get the attributes as a namedtuple: >>> attrgetter ('a', '_1') (tt) attrgetter(a='c', _1='d') >>> And the example from the help, used in the test file I've already attached, illustrates that the dotted attribute case also works. Essentially, my patch provides no benefit for attrgetter specified attributes that aren't valid namedtuple attribute names, but because of rename=True it still works and doesn't break anything. So if you give "a" as an attribute name, the output will have an "a" attribute; if you give "_b" as an attribute name, the output will have an "_1" (or whatever number) attribute. Similarly, it doesn't help with dotted attributes, but it doesn't hurt either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 13:40:01 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Sat, 08 Apr 2017 17:40:01 +0000 Subject: [issue29944] Argumentless super() fails in classes constructed with type() In-Reply-To: <1490855809.89.0.267666010996.issue29944@psf.upfronthosting.co.za> Message-ID: <1491673201.95.0.759242907421.issue29944@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- nosy: +Jim Fasarakis-Hilliard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 13:42:07 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Sat, 08 Apr 2017 17:42:07 +0000 Subject: [issue29963] Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h In-Reply-To: <1491133564.75.0.911637792932.issue29963@psf.upfronthosting.co.za> Message-ID: <1491673327.57.0.257041062561.issue29963@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 13:49:14 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Sat, 08 Apr 2017 17:49:14 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491673754.56.0.0230646092075.issue29957@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: bump to close issue now that PR was merged ---------- nosy: +Jim Fasarakis-Hilliard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 14:31:40 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 08 Apr 2017 18:31:40 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491676300.7.0.951966566111.issue30014@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: For the sake of experiment I'm attaching a toy echo server which uses modify() to switch between EVENT_READ and EVENT_WRITE. Without patch I get 35000 req/sec, with patch around 39000 req/sec (11.4% faster). To be entirely honest a smarter echo server would switch between EVENT_READ / EVENT_WRITE only in case of BlockingIOError on send() or recv(), but unfortunately it's a condition which (for send()) does not occur often by testing on localhost (for recv() it naturally occurs +27000 times out of 39000). On the other hand, by experimenting with a real network it occurs quite soon: import socket sock = socket.socket() sock.connect(('google.com', 80)) sock.setblocking(False) print(sock.send(b'x' * 50000)) print(sock.send(b'x' * 50000)) # raise BlockingIOError So basically my benchmark is emulating a worst case scenario in which send() always blocks on the first call and succeed on the next one, in order to mimic recv() which blocks half of the times. The whole point is that the speedup entirely depends on how many times send() or recv() will block in a real world app connected to the internet (because that's when modify() is supposed to be used) but that's hard to determine, especially under heavy server loads which is hard to emulate. This also involves the SSL handshake when it fails with WANT_READ / WANT_WRITE, which is another circumstance where modify() is going to be used and for which I have no benchmarks. I personally don't mind about selectors module per-se, but given that it's the core of important libs such as asyncio and curio I would like to hear a better rationale than "let's reject this 1.5x speedup because DRY does not apply in this case". Also please consider that Tornado, Twisted and gevent use native modify() method. ---------- Added file: http://bugs.python.org/file46792/echo_server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 14:31:53 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 08 Apr 2017 18:31:53 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491561607.45.0.330964035773.issue30014@psf.upfronthosting.co.za> Message-ID: <1491676313.6.0.0472610249197.issue30014@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : Added file: http://bugs.python.org/file46793/echo_client.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 16:13:07 2017 From: report at bugs.python.org (R. David Murray) Date: Sat, 08 Apr 2017 20:13:07 +0000 Subject: [issue30020] Make attrgetter use namedtuple In-Reply-To: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> Message-ID: <1491682387.47.0.730316397831.issue30020@psf.upfronthosting.co.za> R. David Murray added the comment: This is a clever idea, but I vote -1 for this proposal. I think it makes attrgetter more complex for little purpose. The fact that only some attribute names work and the others get mangled makes the API very ugly and not, IMO, desirable. Finally, if you want this, you can pretty easily write a function that wraps attrgetter to do it. I don't think it has enough utility to justify being in the stdlib. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 16:45:06 2017 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 Apr 2017 20:45:06 +0000 Subject: [issue30020] Make attrgetter use namedtuple In-Reply-To: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> Message-ID: <1491684306.12.0.880847160536.issue30020@psf.upfronthosting.co.za> Christian Heimes added the comment: I'm with RDM and vote -1, too. A namedtuple is a bit more costly than a normal tuple. That's especially try for dynamic attrgetter() that are defined ad-hoc, e.g. as key function for sorted(). The creation of type classes doesn't come for free. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 16:56:27 2017 From: report at bugs.python.org (Christian Heimes) Date: Sat, 08 Apr 2017 20:56:27 +0000 Subject: [issue30008] OpenSSL 1.1.0 deprecated functions In-Reply-To: <1491496485.65.0.239768530197.issue30008@psf.upfronthosting.co.za> Message-ID: <1491684987.58.0.632530873927.issue30008@psf.upfronthosting.co.za> Christian Heimes added the comment: Thanks for your report. Python is going to require legacy functions like TLSv1_method() for a while. They are required to provide constants like PROTOCOL_TLSv1. I have deprecated these constants in 3.6 and they will be removed in 3.8. In the mean time Python is not compatible with OpenSSL api=1.1.0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 17:07:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 08 Apr 2017 21:07:13 +0000 Subject: [issue30020] Make attrgetter use namedtuple In-Reply-To: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> Message-ID: <1491685633.48.0.778375941628.issue30020@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I vote -1 too. 1. As was said, this doesn't work with all attribute names. 2. This adds circular dependency between operator and collections modules. 3. This increases memory consumption and startup time for small programs that don't use the collections module. 4. Performance. Creating a namedtuple is slower than creating a tuple, and many code is optimized for raw tuples. 5. This increases the complexity of attrgetter() implementation and can introduce new bugs. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 17:36:33 2017 From: report at bugs.python.org (Mike Gilbert) Date: Sat, 08 Apr 2017 21:36:33 +0000 Subject: [issue30008] OpenSSL 1.1.0 deprecated functions In-Reply-To: <1491496485.65.0.239768530197.issue30008@psf.upfronthosting.co.za> Message-ID: <1491687393.54.0.899071597886.issue30008@psf.upfronthosting.co.za> Mike Gilbert added the comment: Thanks for the reply. OpenSSL 1.1.0 added functions to control the SSL/TLS version used by SSL contexts created using TLS_method(). You might consider updating the code for existing Python branches to use these functions. SSL_CTX_set_min_proto_version SSL_CTX_set_max_proto_version https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 17:40:52 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 08 Apr 2017 21:40:52 +0000 Subject: [issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple In-Reply-To: <1461678306.82.0.694875654943.issue26860@psf.upfronthosting.co.za> Message-ID: <1491687652.95.0.106801678365.issue26860@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Should we have concerns about performances? Accessing a namedtuple value is almost 4x times slower compared to a plain tuple [1] and os.walk() may iterate hundreds of times. http://stackoverflow.com/questions/2646157/what-is-the-fastest-to-access-struct-like-object-in-python ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 17:43:04 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 08 Apr 2017 21:43:04 +0000 Subject: [issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher In-Reply-To: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za> Message-ID: <1491687784.03.0.646531176648.issue29957@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 20:08:06 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 09 Apr 2017 00:08:06 +0000 Subject: [issue29944] Argumentless super() fails in classes constructed with type() In-Reply-To: <1490855809.89.0.267666010996.issue29944@psf.upfronthosting.co.za> Message-ID: <1491696486.21.0.755824551036.issue29944@psf.upfronthosting.co.za> Martin Panter added the comment: In Issue 23674, I posted a patch that changes to consistent parameter names (subclass, self). The exception message would avoid ?type?, becoming super(subclass, self): self must be an instance or subtype of subclass ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 8 20:16:35 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 09 Apr 2017 00:16:35 +0000 Subject: [issue23674] super() documentation isn't very clear In-Reply-To: <1426448451.56.0.492486239807.issue23674@psf.upfronthosting.co.za> Message-ID: <1491696995.46.0.285442537637.issue23674@psf.upfronthosting.co.za> Martin Panter added the comment: The magical no-argument call could also be clarified: 8. Define in the main text what happens when you omit the first argument (the subclass) to ?super?. At the moment, I think the reader could infer that it is the method?s class, but this is only hinted by reading the comment in the illustration and Raymond?s external web page. The documentation should also clarify how it works, or at least be clear when it is not supported (e.g. one method assigned to multiple classes, functions defined outside a class definition, decorators that re-create the class, ?super? renamed). 9. The no-argument call creates an instance bound to the first argument of the method, not an unbound instance. Determining the ?self? argument is also magical: it does not seem to work with default arguments, variable positional arguments, nor keyword-only arguments. List comprehensions, generator expressions, etc seem to override it, and the argument is not seen by exec and eval. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 00:02:27 2017 From: report at bugs.python.org (Dan Snider) Date: Sun, 09 Apr 2017 04:02:27 +0000 Subject: [issue29944] Argumentless super() fails in classes constructed with type() In-Reply-To: <1490855809.89.0.267666010996.issue29944@psf.upfronthosting.co.za> Message-ID: <1491710547.3.0.731608782899.issue29944@psf.upfronthosting.co.za> Dan Snider added the comment: Just wanted to add that I found this when I was trying to find a way to decorate all methods in a class without using a metaclass or modifying __getattr__. Using Josh's workaround, here's a simple demonstration that (at least at first glance) prints a message when a method is called and when it is finished: def mydec(*, enter=True, exit=True): def make_closure(__class__): return (lambda: super).__closure__ def outer(cls): def wrapper(method): @functools.wraps(method) def inner(*args, **kwargs): if enter: print('entering', method.__qualname__) r = method(*args, **kwargs) if exit: print('exiting', method.__qualname__) return method(*args, **kwargs) return inner for name, value in cls.__dict__.items(): if isinstance(value, types.FunctionType): method = types.FunctionType(getattr(cls, name).__code__, globals(), closure=make_closure(cls)) setattr(cls, name, wrapper(method)) return cls return outer ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 01:53:39 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Apr 2017 05:53:39 +0000 Subject: [issue30020] Make attrgetter use namedtuple In-Reply-To: <1491620691.38.0.777081738207.issue30020@psf.upfronthosting.co.za> Message-ID: <1491717219.08.0.817635264436.issue30020@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I concur with the others. This is unnecessary feature creep that doesn't make sense for typical use cases. ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 02:05:06 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Apr 2017 06:05:06 +0000 Subject: [issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing In-Reply-To: <1354138508.41.0.9459136379.issue16572@psf.upfronthosting.co.za> Message-ID: <1491717906.3.0.297727666845.issue16572@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'm going to decline this suggestion. Antoine is right that this is a can of worms best less closed. Likewise, Richard pointed out that there is potential to break existing code. FWIW, the existence of super() does not imply that all existing classes need to rewritten with super calls. "Cooperative multiple inheritance" implies a certain degree of pre-planning for meaningful cooperation between the classes. For generic threading that doesn't seem plausible. Also note that the referenced super-considered-super article shows how to incorporate non-cooperative classes in the chain without requiring that the original class be modified. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 02:08:56 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Apr 2017 06:08:56 +0000 Subject: [issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple In-Reply-To: <1461678306.82.0.694875654943.issue26860@psf.upfronthosting.co.za> Message-ID: <1491718136.45.0.801086868357.issue26860@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I would expect that the field access time is inconsequential compared to just about every other aspect of os.walk(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 02:16:55 2017 From: report at bugs.python.org (Philip Lee) Date: Sun, 09 Apr 2017 06:16:55 +0000 Subject: [issue30023] Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?" Message-ID: <1491718615.9.0.544401247511.issue30023@psf.upfronthosting.co.za> New submission from Philip Lee: There example code here becomes invalid https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result >>> squares = [] >>> for x in range(5): squares.append(lambda: x**2) >>> squares [ at 0x01FB7A08>, at 0x01F82390>, at 0x01FBA3D8>, at 0x01FBA420>, at 0x01FBA468>] >>> There returned value is a List of lambda functions, not numbers ---------- assignee: docs at python components: Documentation messages: 291353 nosy: docs at python, iMath priority: normal severity: normal status: open title: Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?" type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 03:28:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Apr 2017 07:28:29 +0000 Subject: [issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple In-Reply-To: <1461678306.82.0.694875654943.issue26860@psf.upfronthosting.co.za> Message-ID: <1491722909.79.0.871317049033.issue26860@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: namedtuple's attribute access was optimized in recent years. In 3.7 it is 30% faster than in 3.4. So now it is only 3x times slower compared to a plain tuple. On other hand, os.walk() and os.fwalk() was optimized too. In 3.7 they are up to 3.5x times faster than in 3.4 (with hot caches). I didn't make measurements, but I expect that using namedtuples with os.walk() can decrease its performance at least by few percents. My main concern is that this feature will increase the complexity of the documentation of the os module (very little) and may encourage writing less clear code (but this is just my own preference, others can found new style more clear). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 03:29:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Apr 2017 07:29:03 +0000 Subject: [issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple In-Reply-To: <1461678306.82.0.694875654943.issue26860@psf.upfronthosting.co.za> Message-ID: <1491722943.0.0.00988157168156.issue26860@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: s/at least/at most/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 03:47:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Apr 2017 07:47:15 +0000 Subject: [issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function" In-Reply-To: <1490918587.4.0.0607667805061.issue29951@psf.upfronthosting.co.za> Message-ID: <1491724035.16.0.19896342633.issue29951@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 64c8f705c0121a4b45ca2c3bc7b47b282e9efcd8 by Serhiy Storchaka (Michael Seifert) in branch 'master': bpo-29951: Include function name for some error messages in `PyArg_ParseTuple*` (#916) https://github.com/python/cpython/commit/64c8f705c0121a4b45ca2c3bc7b47b282e9efcd8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 03:49:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Apr 2017 07:49:51 +0000 Subject: [issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function" In-Reply-To: <1490918587.4.0.0607667805061.issue29951@psf.upfronthosting.co.za> Message-ID: <1491724191.66.0.356394469971.issue29951@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your contribution Michael. Since most builtin and extension functions and methods now use Argument Clinic and provide a function name, this should be a great enhancement. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 04:43:43 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 08:43:43 +0000 Subject: [issue29798] Handle "git worktree" in "make patchcheck" In-Reply-To: <1489299211.77.0.0188090534059.issue29798@psf.upfronthosting.co.za> Message-ID: <1491727423.0.0.636005419137.issue29798@psf.upfronthosting.co.za> Nick Coghlan added the comment: Oops, the new PRs and merges haven't shown up automatically because I didn't fix the spelling of the issue number. 3.7 (master): https://github.com/python/cpython/pull/1058 3.6: https://github.com/python/cpython/pull/1060 3.5: https://github.com/python/cpython/pull/1059 2.7: https://github.com/python/cpython/pull/1057 I'll see what happens if I edit the PR titles after the fact. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 04:43:59 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 08:43:59 +0000 Subject: [issue29798] Handle "git worktree" in "make patchcheck" In-Reply-To: <1489299211.77.0.0188090534059.issue29798@psf.upfronthosting.co.za> Message-ID: <1491727439.1.0.333293236833.issue29798@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1204 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 04:44:09 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 08:44:09 +0000 Subject: [issue29798] Handle "git worktree" in "make patchcheck" In-Reply-To: <1489299211.77.0.0188090534059.issue29798@psf.upfronthosting.co.za> Message-ID: <1491727449.71.0.835580815785.issue29798@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1205 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 04:44:21 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 08:44:21 +0000 Subject: [issue29798] Handle "git worktree" in "make patchcheck" In-Reply-To: <1489299211.77.0.0188090534059.issue29798@psf.upfronthosting.co.za> Message-ID: <1491727461.43.0.744974245508.issue29798@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 04:44:40 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 08:44:40 +0000 Subject: [issue29798] Handle "git worktree" in "make patchcheck" In-Reply-To: <1489299211.77.0.0188090534059.issue29798@psf.upfronthosting.co.za> Message-ID: <1491727480.13.0.922902410385.issue29798@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1207 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:12:01 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 09 Apr 2017 09:12:01 +0000 Subject: [issue26187] sqlite3 trace callback prints duplicate line In-Reply-To: <1453577672.38.0.77226221379.issue26187@psf.upfronthosting.co.za> Message-ID: <1491729121.91.0.395727124251.issue26187@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 0e6cb2ea624570ed08c354f1ed1f595dab4192d6 by Berker Peksag (Aviv Palivoda) in branch 'master': bpo-26187: Test that set_trace_callback() is not called multiple times (GH-461) https://github.com/python/cpython/commit/0e6cb2ea624570ed08c354f1ed1f595dab4192d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:12:02 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 09 Apr 2017 09:12:02 +0000 Subject: [issue9303] Migrate sqlite3 module to _v2 API to enhance performance In-Reply-To: <1279541286.68.0.824716490463.issue9303@psf.upfronthosting.co.za> Message-ID: <1491729122.02.0.786220714781.issue9303@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 0e6cb2ea624570ed08c354f1ed1f595dab4192d6 by Berker Peksag (Aviv Palivoda) in branch 'master': bpo-26187: Test that set_trace_callback() is not called multiple times (GH-461) https://github.com/python/cpython/commit/0e6cb2ea624570ed08c354f1ed1f595dab4192d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:12:48 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 09 Apr 2017 09:12:48 +0000 Subject: [issue26187] sqlite3 trace callback prints duplicate line In-Reply-To: <1453577672.38.0.77226221379.issue26187@psf.upfronthosting.co.za> Message-ID: <1491729168.69.0.059349100967.issue26187@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks, Anish and Aviv! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:22:38 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 09:22:38 +0000 Subject: [issue29798] Handle "git worktree" in "make patchcheck" In-Reply-To: <1489299211.77.0.0188090534059.issue29798@psf.upfronthosting.co.za> Message-ID: <1491729758.85.0.517062707696.issue29798@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 4c116cb3b3ee38cae229f7e0df0cd2045fe73c27 by Nick Coghlan in branch '3.6': bpo-29798: Handle git worktree in patchcheck (#1058) (#1060) https://github.com/python/cpython/commit/4c116cb3b3ee38cae229f7e0df0cd2045fe73c27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:22:52 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 09:22:52 +0000 Subject: [issue29798] Handle "git worktree" in "make patchcheck" In-Reply-To: <1489299211.77.0.0188090534059.issue29798@psf.upfronthosting.co.za> Message-ID: <1491729772.89.0.660372752233.issue29798@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset c82d39479a88154bd72a3a304be5f473c118da95 by Nick Coghlan in branch '3.5': bpo-29798: Handle git worktree in patchcheck https://github.com/python/cpython/commit/c82d39479a88154bd72a3a304be5f473c118da95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:24:05 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 09:24:05 +0000 Subject: [issue29798] Handle "git worktree" in "make patchcheck" In-Reply-To: <1489299211.77.0.0188090534059.issue29798@psf.upfronthosting.co.za> Message-ID: <1491729845.45.0.47252108963.issue29798@psf.upfronthosting.co.za> Nick Coghlan added the comment: OK, this should really be working now (and I checked it on my 2.7 checkout before submitting that PR). Any further problems found should go in a new issue. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:47:46 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 09:47:46 +0000 Subject: [issue13691] pydoc help (or help('help')) should show the doc for help In-Reply-To: <1325406152.03.0.315132806833.issue13691@psf.upfronthosting.co.za> Message-ID: <1491731266.76.0.912608987617.issue13691@psf.upfronthosting.co.za> Nick Coghlan added the comment: After reviewing Sanyam's PR at https://github.com/python/cpython/pull/172 I ended up rejecting it as an approach to resolving this issue. The core problem with the approach is that accessing `_sitebuiltins._Helper` is an implementation detail twice over: - Python implementations aren't required to have a _sitebuiltins module - that module isn't required to contain a _Helper class That means importing it into a general purpose module like pydoc would couple pydoc specifically to the way CPython works, which is something we try to avoid doing. By contrast, a richer `__help__()` protocol to override the `__doc__` based default behaviour would allow any object to implement it, and _sitebuiltins._Helper could just use that protocol to special case itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:55:54 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 09:55:54 +0000 Subject: [issue22702] to improve documentation for join() (str method) In-Reply-To: <1414017441.98.0.187335340973.issue22702@psf.upfronthosting.co.za> Message-ID: <1491731754.68.0.394817666882.issue22702@psf.upfronthosting.co.za> Nick Coghlan added the comment: Raymond, in the review comments on https://github.com/python/cpython/pull/156 Xiang noted that the current apparently duplicated iterable isn't entirely redundant: - the first reference is to the term "iterable" - the second reference is to the parameter name "*iterable*" "Return a string which is the concatenation of the strings in the :term:`iterable` *iterable*." So if we're going to drop one of them, it should probably be the link to the term, rather than the parameter name: "Return a string which is the concatenation of the strings in *iterable*." Does that sound reasonable to you? ---------- nosy: +ncoghlan, xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 05:59:20 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 09:59:20 +0000 Subject: [issue22702] to improve documentation for join() (str method) In-Reply-To: <1414017441.98.0.187335340973.issue22702@psf.upfronthosting.co.za> Message-ID: <1491731960.34.0.287927961867.issue22702@psf.upfronthosting.co.za> Nick Coghlan added the comment: Noting for the record: Marco Buttu proposed my suggested approach on the PR back in early March. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:03:19 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:03:19 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491732199.87.0.954252727948.issue29506@psf.upfronthosting.co.za> Nick Coghlan added the comment: Assigning to myself since Sanyam submitted the related PR at the PyCon Pune sprints. ---------- assignee: docs at python -> ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:17:03 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:17:03 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491733023.01.0.890038556343.issue29506@psf.upfronthosting.co.za> Nick Coghlan added the comment: I'm going to merge Sanyam's PR as-is, as while David's reformulation shorten the overall sentence, it complicates the core description of the problem (copying things that you didn't want copied) by merging it with the stereotypical example of why you might not want to copy something (i.e. you intended to share a common reference between otherwise independent copies). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:22:32 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:22:32 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491733352.98.0.381751522211.issue29506@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 19e04942562a980ad2519f6ff79c455a7472783b by Nick Coghlan (Sanyam Khurana) in branch 'master': bpo-29506: Clarify deep copy note in copy module https://github.com/python/cpython/commit/19e04942562a980ad2519f6ff79c455a7472783b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:25:08 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:25:08 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491733508.51.0.474016354328.issue29506@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1208 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:25:59 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:25:59 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491733559.36.0.0147277006461.issue29506@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1209 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:30:06 2017 From: report at bugs.python.org (svelankar) Date: Sun, 09 Apr 2017 10:30:06 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491733806.67.0.927304095083.issue29692@psf.upfronthosting.co.za> Changes by svelankar : ---------- nosy: +svelankar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:33:59 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:33:59 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491734039.07.0.00673888325775.issue29506@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1210 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:47:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Apr 2017 10:47:53 +0000 Subject: [issue13691] pydoc help (or help('help')) should show the doc for help In-Reply-To: <1325406152.03.0.315132806833.issue13691@psf.upfronthosting.co.za> Message-ID: <1491734873.52.0.909550318683.issue13691@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > It does make me wonder whether it might be worth defining a __help__ magic method that completely overrides what help(obj) displays. This should be very complex protocol if take to account that help() outputs formatted and highlighted text and pydoc can output to html format, and alternative Python shells can provide alternative help(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:56:08 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:56:08 +0000 Subject: [issue13691] pydoc help (or help('help')) should show the doc for help In-Reply-To: <1325406152.03.0.315132806833.issue13691@psf.upfronthosting.co.za> Message-ID: <1491735368.78.0.878819859154.issue13691@psf.upfronthosting.co.za> Nick Coghlan added the comment: Aye, it's definitely a tricky problem. While I didn't take them into account in my review, I now realise those issues also impacted the attempted workaround - I'd be surprised if it worked as intended in those other contexts (even the "pydoc -b" rendered HTML view). As far as how to deal with the rendering complexity in a protocol, one possible way to go would be to say that rather than returning a fully rendered string, __help__() methods should return either a Python function object or a type() instance (that doesn't define __help__()), and then pydoc would render the help based on that. Regardless of the exact approach, it would be a task requiring a PEP to resolve, since rendered documentation appears in so many different contexts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:57:06 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:57:06 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491735426.33.0.425875099058.issue29506@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset a524d6307273e3920d410452ace89610c843f051 by Nick Coghlan in branch '3.6': bpo-29506: Clarify deep copy note in copy module https://github.com/python/cpython/commit/a524d6307273e3920d410452ace89610c843f051 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:57:17 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:57:17 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491735437.82.0.827103196272.issue29506@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset bd18351c31573ab9a8580677004370a774a4eaae by Nick Coghlan in branch '3.5': bpo-29506: Clarify deep copy note in copy module https://github.com/python/cpython/commit/bd18351c31573ab9a8580677004370a774a4eaae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:57:31 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:57:31 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491735451.08.0.898708054742.issue29506@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset ab16dc180e362e4cdb9eb163fae0a75664dcea3e by Nick Coghlan in branch '2.7': bpo-29506: Clarify deep copy note in copy module https://github.com/python/cpython/commit/ab16dc180e362e4cdb9eb163fae0a75664dcea3e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 06:58:19 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 10:58:19 +0000 Subject: [issue29506] Incorrect documentation for the copy module In-Reply-To: <1486591364.1.0.297030175166.issue29506@psf.upfronthosting.co.za> Message-ID: <1491735499.28.0.997588410825.issue29506@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 07:11:54 2017 From: report at bugs.python.org (Victor Varvariuc) Date: Sun, 09 Apr 2017 11:11:54 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` Message-ID: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> New submission from Victor Varvariuc: https://mail.python.org/pipermail/python-ideas/2017-April/045405.html Hi there. I asked a question on Stackoverflow: > (Pdb) import brain.utils.mail > (Pdb) import brain.utils.mail as mail_utils > *** AttributeError: module 'brain.utils' has no attribute 'mail' > > I always thought that import a.b.c as m is roughly equivalent to m = sys.modules['a.b.c']. Why AttributeError? Python 3.6 I was pointed out that this is a somewhat weird behavior of Python: > The statement is not quite true, as evidenced by the corner case you met, namely if the required modules already exist in sys.modules but are yet uninitialized. The import ... as requires that the module foo.bar is injected in foo namespace as the attribute bar, in addition to being in sys.modules, whereas the from ... import ... as looks for foo.bar in sys.modules. Why would `import a.b.c` work when `a.b.c` is not yet fully imported, but `import a.b.c as my_c` would not? I though it would be vice versa. Using `import a.b.c as my_c` allows avoiding a number of circular import issues. Right now I have to use `from a.b import c as my_c` as a workaround, but this doesn't look right. The enhancement is to treat `import x.y.z as m` as `m = importlib.import_module('x.y.z')`. I don't see how this will break anything. ---------- components: Interpreter Core messages: 291376 nosy: Victor.Varvariuc priority: normal severity: normal status: open title: Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 07:20:44 2017 From: report at bugs.python.org (irdb) Date: Sun, 09 Apr 2017 11:20:44 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491736844.65.0.897694025451.issue30024@psf.upfronthosting.co.za> Changes by irdb : ---------- nosy: +irdb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 08:11:13 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 09 Apr 2017 12:11:13 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491739873.97.0.306327834959.issue30024@psf.upfronthosting.co.za> Nick Coghlan added the comment: The background here is the change in http://bugs.python.org/issue17636 that allows IMPORT_FROM to fall back to sys.modules when written as "from a.b import c as m", while the plain LOAD_ATTR generated for "import a.b.c as m" fails. One potential resolution to the discrepancy that occurred to me in the python-ideas discussion was to add a new IMPORT_ATTR opcode specifically for use in the latter case. The main downside I can see is the usual one with adding any new opcode for a niche use case like this one: it risks slowing the eval loop down in general for a marginal improvement in language consistency. However, I don't think we should reject the possibility out of hand on that basis. ---------- nosy: +brett.cannon, eric.snow, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 08:45:18 2017 From: report at bugs.python.org (David Kirkby) Date: Sun, 09 Apr 2017 12:45:18 +0000 Subject: [issue30025] useful information Message-ID: <1773686669.20170409154508@onetel.net> New submission from David Kirkby: Hi friend! I know you were looking for that kind of information, I guess I've just found it, here, take a look http://lexion-consultants.com/face.php?bcbd In haste, david.kirkby ---------- messages: 291378 nosy: drkirkby priority: normal severity: normal status: open title: useful information _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 09:18:00 2017 From: report at bugs.python.org (Zachary Ware) Date: Sun, 09 Apr 2017 13:18:00 +0000 Subject: [issue30025] useful information Message-ID: <1491743880.65.0.733699534923.issue30025@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- Removed message: http://bugs.python.org/msg291378 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 09:18:37 2017 From: report at bugs.python.org (Zachary Ware) Date: Sun, 09 Apr 2017 13:18:37 +0000 Subject: [issue30025] Spam Message-ID: <1491743917.94.0.503194694884.issue30025@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- nosy: -drkirkby resolution: -> not a bug stage: -> resolved status: open -> closed title: useful information -> Spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 10:29:22 2017 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 09 Apr 2017 14:29:22 +0000 Subject: [issue30023] Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?" In-Reply-To: <1491718615.9.0.544401247511.issue30023@psf.upfronthosting.co.za> Message-ID: <1491748162.7.0.19886821443.issue30023@psf.upfronthosting.co.za> Eric V. Smith added the comment: That's consistent with the example: it's showing you how to create a list of functions, that when called, return squares. "This gives you a list that contains 5 lambdas that calculate x**2" Maybe "squares" isn't the most awesome name, but I think if you read the example in its entirety, it's all consistent and correct. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 11:38:34 2017 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 09 Apr 2017 15:38:34 +0000 Subject: [issue30023] Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?" In-Reply-To: <1491718615.9.0.544401247511.issue30023@psf.upfronthosting.co.za> Message-ID: <1491752314.5.0.121853626935.issue30023@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 11:48:57 2017 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 09 Apr 2017 15:48:57 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491752937.07.0.0351763857325.issue30024@psf.upfronthosting.co.za> Guido van Rossum added the comment: Hm, the stackoverflow point to another stackoverflow (http://stackoverflow.com/questions/24807434/imports-in-init-py-and-import-as-statement/24968941#24968941) which is due to an import cycle. Is there also an import cycle here? Because I cannot seem repro this with just empty modules (and I'm too lazy to find out if brain is a real package). ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 12:12:54 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 09 Apr 2017 16:12:54 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491754374.45.0.458085211161.issue29956@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Is math.exp(x) always more accurate than math.e ** x? As Serhiy says: not always, and in general the answer is going to depend on the relative quality of the libm implementations of pow and exp. But on typical machines, it is going to be true that `math.exp(x)` is a better (faster, more accurate) way of computing the exponential function than `math.e ** x`. (Similarly, `math.sqrt(x)` should be preferred over `x ** 0.5`.) I'm not sure whether it's worth encoding such recommendations in the documentation or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 12:13:00 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 09 Apr 2017 16:13:00 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491754380.04.0.174042517749.issue30024@psf.upfronthosting.co.za> Changes by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 12:23:03 2017 From: report at bugs.python.org (Max) Date: Sun, 09 Apr 2017 16:23:03 +0000 Subject: [issue30026] Hashable doesn't check for __eq__ Message-ID: <1491754983.55.0.46541300109.issue30026@psf.upfronthosting.co.za> New submission from Max: I think collections.abc.Hashable.__subclasshook__ should check __eq__ method in addition to __hash__ method. This helps detect classes that are unhashable due to: to __eq__ = None Of course, it still cannot detect: def __eq__: return NotImplemented but it's better than nothing. In addition, it's probably worth documenting that explicitly inheriting from Hashable has (correct but unexpected) effect of *suppressing* hashability that was already present: from collections.abc import Hashable class X: pass assert issubclass(X, Hashable) x = X() class X(Hashable): pass assert issubclass(X, Hashable) x = X() # Can't instantiate abstract class X with abstract methods ---------- assignee: docs at python components: Documentation, Interpreter Core messages: 291382 nosy: docs at python, max priority: normal severity: normal status: open title: Hashable doesn't check for __eq__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 12:25:43 2017 From: report at bugs.python.org (Max) Date: Sun, 09 Apr 2017 16:25:43 +0000 Subject: [issue30026] Hashable doesn't check for __eq__ In-Reply-To: <1491754983.55.0.46541300109.issue30026@psf.upfronthosting.co.za> Message-ID: <1491755143.45.0.958313626576.issue30026@psf.upfronthosting.co.za> Max added the comment: Sorry, this should be just a documentation issue. I just realized that __eq__ = None isn't correct anyway, so instead we should just document that Hashable cannot check for __eq__ and that explicitly deriving from Hashable suppresses hashability. ---------- components: -Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 12:36:16 2017 From: report at bugs.python.org (Victor Varvariuc) Date: Sun, 09 Apr 2017 16:36:16 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491755776.59.0.310109297434.issue30024@psf.upfronthosting.co.za> Victor Varvariuc added the comment: # mytest/mod2.py: import sys import mytest.mod1 assert 'mytest.mod1' in sys.modules import mytest.mod1 as mod # this fails, though the prev. lines work perfectly ---------- Added file: http://bugs.python.org/file46794/test.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 14:40:47 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Apr 2017 18:40:47 +0000 Subject: [issue30026] Hashable doesn't check for __eq__ In-Reply-To: <1491754983.55.0.46541300109.issue30026@psf.upfronthosting.co.za> Message-ID: <1491763247.05.0.35238345932.issue30026@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > # Can't instantiate abstract class X with abstract methods Sorry, this is how ABCs are supposed to work. They use @abstractmethod to specify requirements that a subclass if required to implement. The ABC metaclass then enforces that requirement, preventing instantiation unless those requirements are met. If not met, they give a reasonably clear error message, "TypeError: Can't instantiate abstract class A with abstract methods __hash__". ---------- assignee: docs at python -> rhettinger nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 14:40:58 2017 From: report at bugs.python.org (=?utf-8?q?Christoph_B=C3=B6ddeker?=) Date: Sun, 09 Apr 2017 18:40:58 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1491763258.35.0.889373981526.issue29694@psf.upfronthosting.co.za> Christoph B?ddeker added the comment: I had a problem that can be solved with the presented change. But I had also problems to reproduce it in a small example. I am not sure if a test is allowed to depend on external libraries. The code at the end executed with mpirun -np 3 python test.py always breaks with the current code of pathlib and works with the fix. Maybe this helps to write a test and shows a usecase where this fix is necessary. P.S.: I was not able to produce the error with multiprosessing. from mpi4py import MPI from pathlib import Path import tempfile comm = MPI.COMM_WORLD rank = comm.rank size = comm.size with tempfile.TemporaryDirectory() as tmp_dir: tmp_dir = comm.bcast(tmp_dir, root=0) p = Path(tmp_dir) / 'a' / 'b' comm.barrier() p.mkdir(parents=True, exist_ok=True) ---------- nosy: +Christoph B?ddeker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 14:55:02 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Apr 2017 18:55:02 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491764102.55.0.385064251509.issue29956@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > Is math.exp(x) always more accurate than math.e ** x? It is usually at least as accurate, but we can't really guarantee anything because math.exp does whatever the underlying C math library does (so good libary -> good result, bad library -> bad result). Rather than gum-up the math library docs, I suggest having a FAQ entry or wiki entry somewhere. Getting extreme accuracy is a nebulous topic in general and even more so in Python (where there is very little you can do to prevent double rounding and whatnot). In addition to extreme accuracy issues, there are also performance issues which will vary from implementation to implementation and from release to release. Historically, the docs have tried to rise above the fray and make very few if any promises about accuracy or speed. This should be doubly true when it comes to numerical methods which are a mix of art, science, and dark art (and where the answers to "what is best" may change depending on the range of input values). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:03:04 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Apr 2017 19:03:04 +0000 Subject: [issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple In-Reply-To: <1461678306.82.0.694875654943.issue26860@psf.upfronthosting.co.za> Message-ID: <1491764584.69.0.335963559201.issue26860@psf.upfronthosting.co.za> Raymond Hettinger added the comment: There doesn't seem to be a consensus that the proposal is a net win. Serhiy make a persuasive argument that the added complexity isn't worth it. I'll leave this open for a day or two for anyone else to make their case. I'll make this add closed. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:11:49 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 Apr 2017 19:11:49 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491765109.76.0.383355573777.issue29956@psf.upfronthosting.co.za> Terry J. Reedy added the comment: To include corner cases, I should have asked 'at least as accurate' rather than 'more accurate'. It would be a sad libm that had specialized functions worse than pow, since the specialized functions could, at worse, use pow. For an expert point of view, the reason for math to have the specialized functions is to give access to functions in the libm of the compiler used. A beginner ignorant of such things might wonder whether exp and sqrt are just trivial abbreviations, and if not, which to use. I believe this question has appeared on python-list. It definitely has on StackOverflow. For e**x, there is, for instance, https://stackoverflow.com/questions/30756983/difference-between-math-exp2-and-math-e2 with this comment "Voting to reopen. There's more going on here than simply "floating-point is inaccurate". In particular, as the two answers explain, there are good reasons to expect exp(x) to be more accurate than e**x. ? Mark Dickinson " ;-). Searching "[python] math.sqrt pow" gets more hits. https://stackoverflow.com/questions/18965524/exponentiation-in-python-should-i-prefer-operator-instead-of-math-pow-and-m https://stackoverflow.com/questions/33684948/difference-between-1-2-math-sqrt-and-cmath-sqrt and multiple questions about relative speed. So I am inclined to add "This is generally better than math.e ** x and math.pow(e, 0.5)." (for math.exp) and "than x ** 0.5 and math.pow(x, 0.5)" for math.sqrt, and similarly for cmath.sqrt). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:17:17 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 Apr 2017 19:17:17 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491765437.93.0.47702327556.issue29956@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Raymond added his comment while I was writing mine. A FAQ with added caveats might be even better, but it will be mostly missed. If we add one, I might add a comment to some of the SO questions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:27:12 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Apr 2017 19:27:12 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491766032.1.0.879012879234.issue29956@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, these kind of nuances really aren't beginner topics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:36:58 2017 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 09 Apr 2017 19:36:58 +0000 Subject: [issue30027] test_xml_etree and test_xml_etree_c fail due to AssertionError: unhandled warning DeprecationWarning Message-ID: <1491766618.38.0.276477637378.issue30027@psf.upfronthosting.co.za> New submission from Arfrever Frehtes Taifersar Arahesis: test_xml_etree.py and test_xml_etree_c.py on 2.7 branch fail since this commit: commit 68903b656d4e1011525a46cbd1338c6cbab83d6d Author: Serhiy Storchaka Date: Sun Apr 2 16:55:43 2017 +0300 bpo-15083: Convert ElementTree doctests to unittests. (#906) Output of test suite: [388/399] test_xdrlib [389/399] test_xml_etree /tmp/cpython/Lib/test/test_xml_etree.py:1674: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x class MutatingElementPath(str): /tmp/cpython/Lib/test/test_xml_etree.py:1684: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x class BadElementPath(str): test test_xml_etree crashed -- : unhandled warning DeprecationWarning('Overriding __eq__ blocks inheritance of __hash__ in 3.x',) [390/399/1] test_xml_etree_c test test_xml_etree_c crashed -- : unhandled warning DeprecationWarning('classic int division',) [391/399/2] test_xmllib ... 360 tests OK. 2 tests failed: test_xml_etree test_xml_etree_c Re-running failed tests in verbose mode Re-running test 'test_xml_etree' in verbose mode /tmp/cpython/Lib/test/test_xml_etree.py:1674: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x class MutatingElementPath(str): /tmp/cpython/Lib/test/test_xml_etree.py:1684: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x class BadElementPath(str): ... Ran 117 tests in 0.934s OK test test_xml_etree crashed -- : unhandled warning DeprecationWarning('Overriding __eq__ blocks inheritance of __hash__ in 3.x',) Traceback (most recent call last): File "./Lib/test/regrtest.py", line 989, in runtest_inner File "/tmp/cpython/Lib/test/test_xml_etree.py", line 2671, in test_main support.run_unittest(*test_classes) File "/tmp/cpython/Lib/test/test_xml_etree.py", line 2630, in __exit__ self.checkwarnings.__exit__(*args) File "/tmp/cpython/Lib/contextlib.py", line 24, in __exit__ self.gen.next() File "/tmp/cpython/Lib/test/test_support.py", line 905, in _filterwarnings raise AssertionError("unhandled warning %r" % reraise[0]) AssertionError: unhandled warning DeprecationWarning('Overriding __eq__ blocks inheritance of __hash__ in 3.x',) Re-running test 'test_xml_etree_c' in verbose mode ... Ran 118 tests in 0.112s OK (skipped=19) test test_xml_etree_c crashed -- : unhandled warning DeprecationWarning('classic int division',) Traceback (most recent call last): File "./Lib/test/regrtest.py", line 989, in runtest_inner File "/tmp/cpython/Lib/test/test_xml_etree_c.py", line 64, in test_main test_xml_etree.test_main(module=cET) File "/tmp/cpython/Lib/test/test_xml_etree.py", line 2671, in test_main support.run_unittest(*test_classes) File "/tmp/cpython/Lib/test/test_xml_etree.py", line 2630, in __exit__ self.checkwarnings.__exit__(*args) File "/tmp/cpython/Lib/contextlib.py", line 24, in __exit__ self.gen.next() File "/tmp/cpython/Lib/test/test_support.py", line 905, in _filterwarnings raise AssertionError("unhandled warning %r" % reraise[0]) AssertionError: unhandled warning DeprecationWarning('classic int division',) 2 tests failed again: test_xml_etree test_xml_etree_c ---------- assignee: serhiy.storchaka components: Tests messages: 291392 nosy: Arfrever, eli.bendersky, ezio.melotti, serhiy.storchaka priority: normal severity: normal status: open title: test_xml_etree and test_xml_etree_c fail due to AssertionError: unhandled warning DeprecationWarning versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:40:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Apr 2017 19:40:06 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491766806.72.0.311794011928.issue29956@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Nuances of expm1(), log1p(), log2() and log10() aren't beginner topics, but they are documented. I think it wouldn't harm if add "This is usually more accurate than ``e ** x`` or ``pow(e, x)``." The only issue is how to distinguish ``math`` constant ``e`` from mathematical constant *e*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:45:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Apr 2017 19:45:47 +0000 Subject: [issue30027] test_xml_etree and test_xml_etree_c fail due to AssertionError: unhandled warning DeprecationWarning In-Reply-To: <1491766618.38.0.276477637378.issue30027@psf.upfronthosting.co.za> Message-ID: <1491767147.23.0.836277164547.issue30027@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ah, I ran tests with -Wa and -We, but forgot to run with -3. Thank you for noticing this Arfrever! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:45:52 2017 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 09 Apr 2017 19:45:52 +0000 Subject: [issue30027] test_xml_etree and test_xml_etree_c fail due to AssertionError: unhandled warning DeprecationWarning In-Reply-To: <1491766618.38.0.276477637378.issue30027@psf.upfronthosting.co.za> Message-ID: <1491767152.03.0.567685529253.issue30027@psf.upfronthosting.co.za> Arfrever Frehtes Taifersar Arahesis added the comment: To reproduce problem when running only these 2 files, use e.g.: python2.7 -3 -m test.test_xml_etree python2.7 -3 -m test.test_xml_etree_c For full test suite, this -3 option is set in Makefile: TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 15:54:51 2017 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sun, 09 Apr 2017 19:54:51 +0000 Subject: [issue30008] OpenSSL 1.1.0 deprecated functions In-Reply-To: <1491496485.65.0.239768530197.issue30008@psf.upfronthosting.co.za> Message-ID: <1491767691.65.0.16485920407.issue30008@psf.upfronthosting.co.za> Changes by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 16:00:25 2017 From: report at bugs.python.org (Anselm Kruis) Date: Sun, 09 Apr 2017 20:00:25 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe Message-ID: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> New submission from Anselm Kruis: The context manager test.support.temp_cwd() creates a temporary directory and removes it on exit. The test runner test.regrtest uses this context manager. I observed an annoying behaviour of test.support.temp_cwd() on Linux/UNIX: if the code, that runs in the temp_cwd() context forks and if the forked child terminates (without calling exec), then the temporary directory will be removed twice: by the child and by the parent. This can cause errors in the parent, if the parent tries to access the no longer existing directory. I discovered this problem, when a test in test_multiprocessing_fork failed and the test directory for the complete test.regrtest-run got removed. Of course all other tests failed too. I propose to modify test.support.temp_cwd() to remove the created directory only, if the process id (os.getpid()) is unchanged. I'll create a pull request. ---------- components: Tests messages: 291396 nosy: anselm.kruis priority: normal severity: normal status: open title: make test.support.temp_cwd() fork-safe type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 16:09:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 09 Apr 2017 20:09:28 +0000 Subject: [issue30027] test_xml_etree and test_xml_etree_c fail due to AssertionError: unhandled warning DeprecationWarning In-Reply-To: <1491766618.38.0.276477637378.issue30027@psf.upfronthosting.co.za> Message-ID: <1491768568.94.0.826430963477.issue30027@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1211 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 16:12:59 2017 From: report at bugs.python.org (Anselm Kruis) Date: Sun, 09 Apr 2017 20:12:59 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491768779.72.0.0634454978234.issue30028@psf.upfronthosting.co.za> Changes by Anselm Kruis : ---------- pull_requests: +1212 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 17:35:47 2017 From: report at bugs.python.org (Adam Meily) Date: Sun, 09 Apr 2017 21:35:47 +0000 Subject: [issue29883] asyncio: Windows Proactor Event Loop UDP Support In-Reply-To: <1490210881.18.0.553215827239.issue29883@psf.upfronthosting.co.za> Message-ID: <1491773747.94.0.687412650043.issue29883@psf.upfronthosting.co.za> Changes by Adam Meily : ---------- pull_requests: +1213 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 18:17:08 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 09 Apr 2017 22:17:08 +0000 Subject: [issue29549] Improve docstring for str.index In-Reply-To: <1487019442.21.0.885918615749.issue29549@psf.upfronthosting.co.za> Message-ID: <1491776228.13.0.478748234228.issue29549@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 577fc04a7157f6e904cffd6a0e1ad83d3460acd6 by Mariatta in branch '3.6': [3.6] bpo-29549: Fixes docstring for str.index (GH-256) (GH-1028) https://github.com/python/cpython/commit/577fc04a7157f6e904cffd6a0e1ad83d3460acd6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 19:26:16 2017 From: report at bugs.python.org (anthony shaw) Date: Sun, 09 Apr 2017 23:26:16 +0000 Subject: [issue30029] Compiler "'await' outside function" error message is unreachable Message-ID: <1491780376.9.0.908690557717.issue30029@psf.upfronthosting.co.za> New submission from anthony shaw: This is related to issue26188, Using await in a simple statement (outside of an async def method) raises SyntaxError with the unhelpful message "invalid syntax". It seems obvious once you've read PEP492 in detail, but I think that as more and more developers use async/await this will stump lots of people. I've been trying to pick apart where this constraint is raised to see whether I can help with a PR, I've been through Grammar, Parser and then the AST and Compiler. Looking at https://github.com/python/cpython/blob/master/Python/compile.c#L4307-L4319 I can see there are helpful error messages, but during the tokenizer phase it checks that the syntax cannot be used unless you're within an async def method https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Parser/tokenizer.c#L1574-L1583 I can't reproduce this in a REPL for 3.7.0a0, it never gets any further than the grammar or tokenizer phase. ---------- messages: 291398 nosy: anthonypjshaw priority: normal severity: normal status: open title: Compiler "'await' outside function" error message is unreachable versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 19:33:59 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Sun, 09 Apr 2017 23:33:59 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1491780838.99.0.585405469827.issue19225@psf.upfronthosting.co.za> Changes by KINEBUCHI Tomohiko : ---------- pull_requests: +1214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 20:02:45 2017 From: report at bugs.python.org (anthony shaw) Date: Mon, 10 Apr 2017 00:02:45 +0000 Subject: [issue30029] Compiler "'await' outside function" error message is unreachable In-Reply-To: <1491780376.9.0.908690557717.issue30029@psf.upfronthosting.co.za> Message-ID: <1491782565.48.0.601621505977.issue30029@psf.upfronthosting.co.za> anthony shaw added the comment: yey! I figured it out!! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 20:11:32 2017 From: report at bugs.python.org (anthony shaw) Date: Mon, 10 Apr 2017 00:11:32 +0000 Subject: [issue30029] Compiler "'await' outside function" error message is unreachable In-Reply-To: <1491780376.9.0.908690557717.issue30029@psf.upfronthosting.co.za> Message-ID: <1491783092.02.0.686769661737.issue30029@psf.upfronthosting.co.za> Changes by anthony shaw : ---------- pull_requests: +1215 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 20:32:43 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 10 Apr 2017 00:32:43 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491784363.7.0.975896579055.issue30024@psf.upfronthosting.co.za> Guido van Rossum added the comment: So to save others the bother to check what's in the zip file, the contents of mytest/mod1.py is as follows: import mytest.mod2 as mod def func(): print('mod1.func called') mod.func() There's no __init__.py (so mytest is a namespace package, PEP 420) but adding an empty __init__.py makes no difference. The problem occurs with both Python 2 and 3. The root cause is the import cycle. I played around with dis and found the following (I suspect others have already found this but the thread was hard to follow for me initially): >>> dis.dis('import a.b') 1 0 LOAD_CONST 0 (0) 2 LOAD_CONST 1 (None) 4 IMPORT_NAME 0 (a.b) 6 STORE_NAME 1 (a) 8 LOAD_CONST 1 (None) 10 RETURN_VALUE >>> compared to >>> dis.dis('import a.b as c') 1 0 LOAD_CONST 0 (0) 2 LOAD_CONST 1 (None) 4 IMPORT_NAME 0 (a.b) 6 LOAD_ATTR 1 (b) <-- error here 8 STORE_NAME 2 (c) 10 LOAD_CONST 1 (None) 12 RETURN_VALUE >>> What this shows is that the implementation of "import a.b" and "import a.b as c" are different. The former calls __import__('a.b', ...) which returns the module 'a' and stores that in the variable 'a'. In the OP's case, because of the import cycle, while sys.modules['a.b'] exists, module 'a' does not yet have the attribute 'b'. That's the reason that in the latter example, the LOAD_ATTR opcode fails. I'm inclined not to attempt to fix this. The reason that we don't pull 'a.b' out of sys.modules at this point is that if later in the execution of a/b.py we get an exception, the import will be cancelled, and sys.modules['a.b'] will be *deleted*, and then the variable 'c' would have a reference to a half-loaded module. The semantics of imports in the case of cycles are somewhat complex but clearly defined and there are only a few rules to consider, and from these rules it is possible to reason out whether any particular case is valid or not. I would prefer to keep it this way rather than add more special cases. There's a good reason why, *in general* (regardless of import cycles), "import a.b as c" is implemented as a getattr operation on a, not as an index operation on sys.modules (it is possible for module a to override its attribute b without updating sys.modules) and I'd rather keep those semantics than give them up for this particular edge case. Cyclic imports are hard. If they don't work for you, avoid them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 20:53:04 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Apr 2017 00:53:04 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491785584.56.0.69680322682.issue29956@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > The only issue is how to distinguish ``math`` constant ``e`` > from mathematical constant *e*. Sorry, I think you're inventing an issue here. ``math.e`` is the nearest representable value to the mathematical constant *e*. This is no more interesting or useful that distinguishing ``math.pi`` from the mathematical constant *pi*. I don't know of any other language that tries to split hairs like this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 20:55:45 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Apr 2017 00:55:45 +0000 Subject: [issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple In-Reply-To: <1461678306.82.0.694875654943.issue26860@psf.upfronthosting.co.za> Message-ID: <1491785745.4.0.106746104576.issue26860@psf.upfronthosting.co.za> Raymond Hettinger added the comment: There doesn't seem to be a consensus that the proposal is a net win. Serhiy made a persuasive argument that the added complexity isn't worth it. I'll leave this open for a day or two so that anyone else can make their case. Otherwise, I'll mark this as closed/rejected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 20:56:10 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Apr 2017 00:56:10 +0000 Subject: [issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple In-Reply-To: <1461678306.82.0.694875654943.issue26860@psf.upfronthosting.co.za> Message-ID: <1491785770.62.0.640702147734.issue26860@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- Removed message: http://bugs.python.org/msg291388 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 21:04:13 2017 From: report at bugs.python.org (anthony shaw) Date: Mon, 10 Apr 2017 01:04:13 +0000 Subject: [issue30029] Compiler "'await' outside function" error message is unreachable In-Reply-To: <1491780376.9.0.908690557717.issue30029@psf.upfronthosting.co.za> Message-ID: <1491786253.94.0.823111707998.issue30029@psf.upfronthosting.co.za> Changes by anthony shaw : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 21:31:30 2017 From: report at bugs.python.org (Raphael Gaschignard) Date: Mon, 10 Apr 2017 01:31:30 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491787890.61.0.875711278756.issue29989@psf.upfronthosting.co.za> Raphael Gaschignard added the comment: I'm sorry for the confusion here, it turns out I was misinterpreting the results of my program and my workaround was not working. Like others have said, the subprocess code seems to rely on the existence of file descriptors I would be pretty partial to the idea of having the subprocess's internal code catch OSError and raise a clearer error message like "subprocess can only operate on files with file descriptor support". Having "complete" file object support would seem like a major win, but looking at the internals/OS support it seems like a hard thing to set up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 22:42:35 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 10 Apr 2017 02:42:35 +0000 Subject: [issue14039] Add "metavar" argument to add_subparsers() in argparse In-Reply-To: <1329436304.54.0.709137632289.issue14039@psf.upfronthosting.co.za> Message-ID: <1491792155.66.0.645058181651.issue14039@psf.upfronthosting.co.za> Martin Panter added the comment: Thanks to Issue 11807, the documentation now lists ?metavar?. (However, it looks like a positional argument, rather than keyword-only, and its use seems to be discouraged, but those issues are not specific to ?metavar?.) Some points specific to ?metavar? that I think could be clarified: 1. Metavar seems to affect the placeholder in the ?usage? message, and a heading that precedes a multi-line list of commands, but it does not affect the presentation of the multi-line list itself. 2. The relationship between the ?metavar? parameter of ?add_argument? and ?add_subparsers? needs clarifying. At the moment, there is a hyperlink, which implies that the description of add_argument?s parameter applies to add_subparsers. But it only discusses the ?dest? parameter and CLI options (a.k.a. ?optionals?), neither of which make sense in the context of subcommands. Issue 29030 (choices vs metavar) may be related. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python, martin.panter versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 22:56:10 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 10 Apr 2017 02:56:10 +0000 Subject: [issue29030] argparse: choices override metavar In-Reply-To: <1482281546.0.0.613026945443.issue29030@psf.upfronthosting.co.za> Message-ID: <1491792969.99.0.384096922199.issue29030@psf.upfronthosting.co.za> Martin Panter added the comment: I think the documentation should be fixed to say choices overrides dest, and the implementation should be left alone. Even if the documentation is not a ?formal module reference?, it should not be wrong or misleading. Also, Issue 14039 is related, about ?metavar? with ?add_subparsers?. ---------- nosy: +martin.panter versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 23:02:58 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Mon, 10 Apr 2017 03:02:58 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1491793378.95.0.890552099192.issue29943@psf.upfronthosting.co.za> Nathaniel Smith added the comment: > Can we consider 3.6.0 rather than 3.6.1 as broken release? In the last week, pypi downloads were about evenly split between 3.6.0 and 3.6.1 (2269969 for "3.6.1", 1927189 for "3.6.0", and those two were ~2 orders of magnitude more common than other strings like "3.6.1+", "3.6.0b2", etc. [1]). Not sure what that to conclude from that, but certainly if people start uploading 3.6.1-only wheels right now then it will break things for a lot of end users. With my manylinux docker image maintainer hat on: we're currently shipping 3.6.0. I'm extremely confident that if we stick with this we'll never get any complaints about the obscure bug with malicious __index__ implementations that's being fixed here. OTOH if we upgrade to 3.6.1, or any version with this ABI change, then we'll definitely get many complaints so long as there's anyone at all still using 3.6.0, which is probably forever. So I'm not sure not sure what incentive we would have to ever upgrade to 3.6.1+ if this ABI change is kept? (This isn't saying the bug is unimportant! But it sure is hard to sell its importance to folks trying to ship packages and support end-users...) -------- [1] Somewhat crude query I used in case it's useful for future reference: SELECT REGEXP_EXTRACT(details.python, r"^([^\.]+\.[^\.]+\.[^\.]+)") as python_version, COUNT(*) as download_count, FROM TABLE_DATE_RANGE( [the-psf:pypi.downloads], DATE_ADD(CURRENT_TIMESTAMP(), -7, "day"), DATE_ADD(CURRENT_TIMESTAMP(), 0, "day") ) WHERE REGEXP_MATCH(details.python, r"^3\.6\.") GROUP BY python_version, ORDER BY download_count DESC LIMIT 100 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 23:14:39 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 10 Apr 2017 03:14:39 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491794079.8.0.0312071236201.issue29989@psf.upfronthosting.co.za> Martin Panter added the comment: The current exception seems to give a reasonable hint: >>> subprocess.Popen((executable,), stdout=BytesIO()) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/subprocess.py", line 914, in __init__ errread, errwrite) = self._get_handles(stdin, stdout, stderr) File "/usr/lib/python3.5/subprocess.py", line 1400, in _get_handles c2pwrite = stdout.fileno() io.UnsupportedOperation: fileno Perhaps we can close this in favour of fixing the documentation? (Issue 19992) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 9 23:22:55 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Mon, 10 Apr 2017 03:22:55 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1491794575.15.0.784442137072.issue29943@psf.upfronthosting.co.za> Nathaniel Smith added the comment: It looks like PyTorch got bitten by this: https://discuss.pytorch.org/t/pyslice-adjustindices-error/1475/11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 00:33:38 2017 From: report at bugs.python.org (Raphael Gaschignard) Date: Mon, 10 Apr 2017 04:33:38 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491798818.66.0.419513654027.issue29989@psf.upfronthosting.co.za> Raphael Gaschignard added the comment: that error is what is raised by StringIO (subclassing OSError), other file-like objects could just be raising OSError (according to the file object spec described in the documentation for the io module). Fixing documentation would already be helpful though. I will close this issue ---------- stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 00:49:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 04:49:12 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1491785584.56.0.69680322682.issue29956@psf.upfronthosting.co.za> Message-ID: <4909666.sEOa66sIsc@raxxla> Serhiy Storchaka added the comment: This is the original issue, it isn't invented by me. ``math.e`` is the nearest representable value to the mathematical constant *e* and ``math.exp(x)`` is the nearest representable value to the mathematical constant *e* raised to the power *x*, but not the nearest representable value to ``math.e`` raised to the power *x*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 01:29:39 2017 From: report at bugs.python.org (Victor Varvariuc) Date: Mon, 10 Apr 2017 05:29:39 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491802179.84.0.513231600867.issue30024@psf.upfronthosting.co.za> Victor Varvariuc added the comment: > I'm inclined not to attempt to fix this. The reason that we don't pull 'a.b' out of sys.modules at this point is that if later in the execution of a/b.py we get an exception, the import will be cancelled, and sys.modules['a.b'] will be *deleted*, and then the variable 'c' would have a reference to a half-loaded module. I think this is solvable -- track and delete the references too. It's your decision in the end, but I think it's not good to make the language inconsistent because of technical limitations -- the interface should be the primary source for decisions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 01:34:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 05:34:38 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491802478.18.0.316587698605.issue29956@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 01:36:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 05:36:57 +0000 Subject: [issue29956] math.exp documentation is misleading In-Reply-To: <1490990917.06.0.404933995002.issue29956@psf.upfronthosting.co.za> Message-ID: <1491802617.61.0.528584271349.issue29956@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Proposed patch applies Mark's fix to math.expm1() and cmath.exp(), adds the accuracy note to math.exp(), adds italic to mathematical constants, fixes empty lines. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 01:40:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 05:40:14 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491802814.54.0.329199597573.issue30028@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is os.getpid always available? I have found hasattr(os, 'getpid') in the logging module. ---------- nosy: +haypo, serhiy.storchaka, vinay.sajip stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 01:58:03 2017 From: report at bugs.python.org (Victor Varvariuc) Date: Mon, 10 Apr 2017 05:58:03 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491803883.71.0.63579709208.issue30024@psf.upfronthosting.co.za> Victor Varvariuc added the comment: > it is possible for module a to override its attribute b without updating sys.modules This sounds like a really strange application. Even if someone overrides the attribute, when you do in other place `import a.b.c as m` you expect `a.b.c` to be path to a module, otherwise it would be hard to debug. The docs https://docs.python.org/3/reference/simple_stmts.html#import say `import_stmt ::= "import" module ["as" name]` meaning everywhere that `module` is a path to a module. https://docs.python.org/3/reference/import.html#searching > To begin the search, Python needs the fully qualified name of the module (or package, but for the purposes of this discussion, the difference is immaterial) being imported. This name may come from various arguments to the import statement, or from the parameters to the importlib.import_module() or __import__() functions. So if you treat `import a.b.c as m` as `import a; m = a.b.c` -- it go go in some cases against the docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 02:02:56 2017 From: report at bugs.python.org (Christian Heimes) Date: Mon, 10 Apr 2017 06:02:56 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491804176.13.0.976513423524.issue30028@psf.upfronthosting.co.za> Christian Heimes added the comment: The line is from 2006. Some parts of the logging module are much older, maybe even from the time Python had DOS support. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 02:25:26 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 10 Apr 2017 06:25:26 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491805526.43.0.910662409597.issue30024@psf.upfronthosting.co.za> Nick Coghlan added the comment: Right, this problem only arises with import cycles, and that's why we resisted making eager submodule resolution work *at all* for so long (issue 992389 was filed way back in 2004). We only conceded the point (with issue 17636 being implemented for 3.5) specifically to address a barrier to adoption for explicit relative imports, as it turned out that "from . import bar" could fail in cases where "import foo.bar" previously worked. The best explanation I could find for that rationale in the related python-dev thread is PJE's post here: https://mail.python.org/pipermail/python-dev/2013-April/125121.html What Victor's python-ideas thread pointed out is that there are actually *3* flavours of import where this particular circular reference problem can come up: # Has worked as long as Python has had packages, # as long as you only lazily resolve foo.bar in # function and method implementations import foo.bar # Has worked since 3.5 due to the IMPORT_FROM # change that falls back to a sys.modules lookup from foo import bar # Still gives AttributeError since it # eagerly resolves the attribute lookup import foo.bar as bar While I think the architectural case for allowing this kind of circular dependency between different top level namespaces is *much* weaker than that for allowing it within packages, I do think there's a reasonable consistency argument to be made in favour of ensuring that `from foo import bar` and `import foo.bar as bar` are functionally equivalent when `bar` is a submodule of `foo`, especially since the latter form makes it clearer to the reader that `bar` *is* a submodule, rather than any arbitrary attribute. I don't think it's a big problem in practice (so I wouldn't spend any time on implementing it myself), but the notion of an IMPORT_ATTR opcode for the "import x.y.z as m" case that parallels IMPORT_FROM seems architecturally clean to me in a way that the proposed resolutions to issue 992389 weren't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 02:46:21 2017 From: report at bugs.python.org (Anselm Kruis) Date: Mon, 10 Apr 2017 06:46:21 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491806781.97.0.978853358964.issue30028@psf.upfronthosting.co.za> Anselm Kruis added the comment: I had the same concerns about os.getpid(), but test.support uses it unconditionally in various places. See https://github.com/python/cpython/blob/master/Lib/test/support/__init__.py#L803 for an example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 02:59:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 06:59:24 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491807564.44.0.262170141667.issue30028@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Then LGTM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 03:20:19 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Apr 2017 07:20:19 +0000 Subject: [issue29989] subprocess.Popen does not handle file-like objects without file descriptors In-Reply-To: <1491359933.76.0.94329407382.issue29989@psf.upfronthosting.co.za> Message-ID: <1491808819.19.0.188637446519.issue29989@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 03:51:43 2017 From: report at bugs.python.org (Armin Rigo) Date: Mon, 10 Apr 2017 07:51:43 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1491810703.35.0.538105504006.issue29694@psf.upfronthosting.co.za> Armin Rigo added the comment: Maybe we should review pathlib.py for this kind of issues and first apply the fixes and new tests inside PyPy. That sounds like a better way to get things done for these rare issues, where CPython is understandably reluctant to do much changes. Note that the PyPy version of the stdlib already contains fixes that have not been merged back to CPython (or only very slowly), though so far they are the kind of issues that trigger more often on PyPy than on CPython, like GC issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 04:02:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Apr 2017 08:02:33 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491811353.74.0.911471404385.issue30028@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1217 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 04:03:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Apr 2017 08:03:37 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491811417.67.0.352892358531.issue30028@psf.upfronthosting.co.za> STINNER Victor added the comment: I proposed PR 1074 to remove the hasattr(os, 'getpid') from logging.LogRecord constructor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 04:26:40 2017 From: report at bugs.python.org (Segev Finer) Date: Mon, 10 Apr 2017 08:26:40 +0000 Subject: [issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista In-Reply-To: <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za> Message-ID: <1491812800.1.0.95925265707.issue19764@psf.upfronthosting.co.za> Segev Finer added the comment: It's been a while since this got any attention... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 04:40:13 2017 From: report at bugs.python.org (INADA Naoki) Date: Mon, 10 Apr 2017 08:40:13 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491813613.94.0.646967025114.issue30028@psf.upfronthosting.co.za> INADA Naoki added the comment: #28156 added HAVE_GETPID check. Maybe, we should have dummy getpid() for CloudABI? ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 04:43:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Apr 2017 08:43:19 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491813799.8.0.848376780018.issue30028@psf.upfronthosting.co.za> STINNER Victor added the comment: Naoki: > #28156 added HAVE_GETPID check. > Maybe, we should have dummy getpid() for CloudABI? Oh. If os.getpid() is not always available, the documentation should be updated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 04:59:00 2017 From: report at bugs.python.org (INADA Naoki) Date: Mon, 10 Apr 2017 08:59:00 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491814740.74.0.744914792147.issue30028@psf.upfronthosting.co.za> INADA Naoki added the comment: > Oh. If os.getpid() is not always available, the documentation should be updated. Yes, but CloudABI is not officially supported platform. They have many patches to run Python on CloudABI. https://github.com/NuxiNL/cloudabi-ports/tree/master/packages/python How can we document about it? I hadn't used it. os.getlogin document says `Availability: Unix, Windows.` [1] Is it proper way to indicate "there may be some minor platforms which doesn't provide this."? [1] https://docs.python.org/3.6/library/os.html#os.getlogin ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 05:03:26 2017 From: report at bugs.python.org (Michael Sghaier) Date: Mon, 10 Apr 2017 09:03:26 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491815006.1.0.724435083875.issue29870@psf.upfronthosting.co.za> Changes by Michael Sghaier : ---------- pull_requests: +1218 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 05:17:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 09:17:38 +0000 Subject: [issue30030] Simplify _RandomNameSequence Message-ID: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: _RandomNameSequence was added in issue589982 when generator functions were new optional feature. _RandomNameSequence is implemented as an iterator class. Proposed patch simplifies _RandomNameSequence by implementing it as a generator function. This is a private name, all uses of _RandomNameSequence() need only the support of the iterator protocol. ---------- components: Library (Lib) messages: 291425 nosy: haypo, pitrou, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Simplify _RandomNameSequence type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 05:18:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 09:18:19 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1491815899.07.0.774610102558.issue30030@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1219 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 05:22:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 09:22:27 +0000 Subject: [issue30028] make test.support.temp_cwd() fork-safe In-Reply-To: <1491768025.09.0.83114690073.issue30028@psf.upfronthosting.co.za> Message-ID: <1491816147.76.0.345085945055.issue30028@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > os.getlogin document says `Availability: Unix, Windows.` Originally this meant "not in Mac OS, DOS, OS/2, VMS". But now the support of all these platforms is dropped and the note is outdated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 08:21:35 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 10 Apr 2017 12:21:35 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491826895.33.0.212913481945.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Can you record sys.getallocatedblocks() to see whether it grows continuously? ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 09:06:37 2017 From: report at bugs.python.org (Pavlo Kapyshin) Date: Mon, 10 Apr 2017 13:06:37 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) Message-ID: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> New submission from Pavlo Kapyshin: Currently Tools/demo/queens.py: - does manual sys.argv parsing - says ?Found 1 solutions? I propose to: 1) use argparse; 2) if q.nfound == 1, use ?solution?. I you are ok with this, I?ll make a pull request. ---------- components: Demos and Tools messages: 291428 nosy: paka priority: normal severity: normal status: open title: Improve queens demo (use argparse and singular form) type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 12:16:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 16:16:40 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1491841000.68.0.87381756235.issue30030@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The downside of this change: 1. The _RandomNameSequence iterator no longer has the rng field. But it isn't used in the stdlib. And since _RandomNameSequence is a private name, it shouldn't be used in third-party code. 2. The result of no longer copyable neither pickleable. This could cause a problem if it is set as an attribute of copyable of pickleable object. But it is used only as function local or module global instances in tempfile and class attribute of in multiprocessing.synchronize.SemLock and multiprocessing.heap.Arena. All these cases don't involved in copying or pickling. And in general copying and pickling the _RandomNameSequence object is a doubtful idea. 3. This makes iterating the _RandomNameSequence iterator slightly (about 6%) slower. Not a big deal, it isn't used in performance critical code. It is possible to speed up the _RandomNameSequence iterator by the same 6% by using functools.partial (functools already is imported in tempfile), but this makes the code slightly less clear, and I choose the simplicity of the code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:07:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 17:07:51 +0000 Subject: [issue29881] Add a new private API clear private variables, which are initialized once, at Python shutdown In-Reply-To: <1490201009.64.0.544065179107.issue29881@psf.upfronthosting.co.za> Message-ID: <1491844070.99.0.448955992497.issue29881@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Can you move forward this issue Victor? I'm very interesting in it. It is worth to advertise this API on Python-Dev. _PyArg_Parser also can utilize this API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:16:06 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 10 Apr 2017 17:16:06 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491844566.14.0.00454265784134.issue30024@psf.upfronthosting.co.za> Guido van Rossum added the comment: OK I won't close it but I'm withdrawing from the issue. If there are devs who want to implement this or mentor some contributor into implementing it feel free, but it sounds like Nick doesn't think it's important enough to fix (i.e. not worth his time) and I feel the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:16:15 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 10 Apr 2017 17:16:15 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491844575.62.0.975093844411.issue30024@psf.upfronthosting.co.za> Changes by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:18:28 2017 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 Apr 2017 17:18:28 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1491844708.11.0.831661477179.issue30031@psf.upfronthosting.co.za> Eric V. Smith added the comment: I think these are reasonable improvements. Also, move the initialization of "silent" in to __new__. ---------- keywords: +easy nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:27:52 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 10 Apr 2017 17:27:52 +0000 Subject: [issue29521] Minor warning messages when compiling documentation In-Reply-To: <1486714459.11.0.428886237265.issue29521@psf.upfronthosting.co.za> Message-ID: <1491845272.87.0.00978141591806.issue29521@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset e0cba5b45a5c4bafd1ae772be52ca0d69651da24 by Mariatta in branch '2.7': [2.7] bpo-29521: Fix two minor documentation build warnings (GH-41) (GH-670) https://github.com/python/cpython/commit/e0cba5b45a5c4bafd1ae772be52ca0d69651da24 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:41:26 2017 From: report at bugs.python.org (Jon Ribbens) Date: Mon, 10 Apr 2017 17:41:26 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks Message-ID: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> New submission from Jon Ribbens: The email module, when creating base64-encoded text parts, does not process line breaks correctly - RFC 2045 s6.8 says that line breaks must be converted to CRLF before base64-encoding, and the email module is not doing this. >>> from email.mime.text import MIMEText >>> import base64 >>> m = MIMEText("hello\nthere", _charset="utf-8") >>> m.as_string() 'Content-Type: text/plain; charset="utf-8"\nMIME-Version: 1.0\nContent-Transfer-Encoding: base64\n\naGVsbG8KdGhlcmU=\n' >>> base64.b64decode("aGVsbG8KdGhlcmU=") b'hello\nthere' You might say that it is the application's job to convert the line endings before calling MIMEText(), but I think all application authors would be surprised by this. Certainly the MailMan authors would be, as they say this is a Python bug not a MailMan bug ;-) ---------- components: Library (Lib) messages: 291434 nosy: jribbens priority: normal severity: normal status: open title: email module creates base64 output with incorrect line breaks type: behavior versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:45:40 2017 From: report at bugs.python.org (Jon Ribbens) Date: Mon, 10 Apr 2017 17:45:40 +0000 Subject: [issue30033] email module base64-encodes utf-8 text Message-ID: <1491846340.8.0.762117767462.issue30033@psf.upfronthosting.co.za> New submission from Jon Ribbens: The email module, when creating text parts using character encoding utf-8, base64-encodes the output even though this is often inappropriate (e.g. if it is a Western language it is almost never appropriate). >>> from email.mime.text import MIMEText >>> m = MIMEText("hello", _charset="utf-8") >>> m.as_string() 'Content-Type: text/plain; charset="utf-8"\nMIME-Version: 1.0\nContent-Transfer-Encoding: base64\n\naGVsbG8=\n' ---------- components: Library (Lib) messages: 291435 nosy: jribbens priority: normal severity: normal status: open title: email module base64-encodes utf-8 text type: behavior versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:58:21 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 17:58:21 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1491847101.4.0.752403323519.issue30031@psf.upfronthosting.co.za> R. David Murray added the comment: I'm not sure about using argparse. Currently the demo uses no imports. I'm not strongly against, though. Did you mean __init__ instead of __new__? Also, its value could be made True and False instead of 0 and 1. (Which tells you how old this demo is.) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 13:59:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 17:59:21 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491847161.5.0.96377690088.issue30024@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It is easy to implement this (just replace LOAD_ATTR with IMPORT_FROM in the compiler). The hardest part is writing tests. ---------- keywords: +easy (C) nosy: +serhiy.storchaka stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:05:47 2017 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 Apr 2017 18:05:47 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1491847547.03.0.218327773221.issue30031@psf.upfronthosting.co.za> Eric V. Smith added the comment: Oops, yes, __init__. Plenty of the demos use imports. I think it would be clearer with argparse, but I also don't feel strongly about it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:08:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 18:08:19 +0000 Subject: [issue30033] email module base64-encodes utf-8 text In-Reply-To: <1491846340.8.0.762117767462.issue30033@psf.upfronthosting.co.za> Message-ID: <1491847699.8.0.186047377238.issue30033@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: +email nosy: +barry, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:08:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Apr 2017 18:08:41 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491847721.75.0.0567214656087.issue30032@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: +email nosy: +barry, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:23:53 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 18:23:53 +0000 Subject: [issue30033] email module base64-encodes utf-8 text In-Reply-To: <1491846340.8.0.762117767462.issue30033@psf.upfronthosting.co.za> Message-ID: <1491848633.85.0.879649258533.issue30033@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, this sub-optimal, but it's the way it works in the legacy API, and we aren't going to change the legacy (compat32) API at this point. The new policies and the new API in python3 handle this sensibly. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:25:49 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 18:25:49 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1491848749.14.0.575637046725.issue30031@psf.upfronthosting.co.za> R. David Murray added the comment: Yeah, I was wondering if part of the demo was to show something that can be done with no library support...but that probably isn't the case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:38:20 2017 From: report at bugs.python.org (Alexander Mohr) Date: Mon, 10 Apr 2017 18:38:20 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491849500.33.0.0479760629933.issue29870@psf.upfronthosting.co.za> Alexander Mohr added the comment: @pitrou: sys.getallocatedblocks does not seem to increase ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:42:10 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 18:42:10 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491849730.9.0.740350994703.issue30032@psf.upfronthosting.co.za> R. David Murray added the comment: This appears to be a problem in the new API as well. I don't think we can change the legacy API because its been that way forever and applications might be depending on it (that is, the library preserves exactly what it is handed, and an application might break if that changes). In the new API, though, I think we could get away with fixing it to do the transformation on text strings in the default content manager so that the line endings follow the message policy. (That is, if you use default, you get \n, if you use SMTP, you get \r\n). I think we can get away with it because there aren't that many applications using the new API yet. ---------- components: -email _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:43:32 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 18:43:32 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491849812.75.0.00414666277283.issue30032@psf.upfronthosting.co.za> R. David Murray added the comment: Actually, I think the fix would go in the generator, not in the contentmanager, but it's been long enough since I've worked on the code that I'm not sure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:49:56 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 10 Apr 2017 18:49:56 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491850196.04.0.856920869942.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I see. This may mean the leak is in memory that's not managed directly by Python (e.g. some OpenSSL structure). Is there a way to reproduce without third-party libraries such as requests? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:54:52 2017 From: report at bugs.python.org (Jon Ribbens) Date: Mon, 10 Apr 2017 18:54:52 +0000 Subject: [issue30033] email module base64-encodes utf-8 text In-Reply-To: <1491846340.8.0.762117767462.issue30033@psf.upfronthosting.co.za> Message-ID: <1491850492.46.0.0748292918057.issue30033@psf.upfronthosting.co.za> Jon Ribbens added the comment: Just a note for anyone finding this in searching results: it appears that what David means by "python3 API" is actually a new API in Python 3.6 (email.message.EmailMessage). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 14:58:45 2017 From: report at bugs.python.org (Jon Ribbens) Date: Mon, 10 Apr 2017 18:58:45 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491850725.64.0.922959258576.issue30032@psf.upfronthosting.co.za> Jon Ribbens added the comment: OK cool, but please note that this is a MIME issue not an SMTP issue - if the message has text that is being base64-encoded then it must use CRLF line breaks regardless of whether SMTP is involved or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 15:03:34 2017 From: report at bugs.python.org (Alexander Mohr) Date: Mon, 10 Apr 2017 19:03:34 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491851014.1.0.749676040153.issue29870@psf.upfronthosting.co.za> Alexander Mohr added the comment: yes, in the gist I created you can switch between the various clients, by default right now it uses raw sockets. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 15:10:57 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 19:10:57 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491851457.23.0.369722998973.issue30032@psf.upfronthosting.co.za> R. David Murray added the comment: That is true for text/xxxx types, yes. The policy is named after the target wire protocol, and if you are transmitting an email message over SMTP, that implies MIME. What to do if you are not sending it over SMTP, though, is a tougher question. One could argue it either way for the 'default' policy, and I'm open to argument. ---------- versions: +Python 3.6, Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 15:11:05 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 19:11:05 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491851465.59.0.886650779607.issue30032@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 15:15:04 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 19:15:04 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491851704.75.0.137920235499.issue30032@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- components: +email _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 15:16:35 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 19:16:35 +0000 Subject: [issue30033] email module base64-encodes utf-8 text In-Reply-To: <1491846340.8.0.762117767462.issue30033@psf.upfronthosting.co.za> Message-ID: <1491851795.21.0.297138490907.issue30033@psf.upfronthosting.co.za> R. David Murray added the comment: The API exists in python3.5 and python3.4 as well, it was just provisional. Very few things changed between the provisional version and the final version in 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 16:26:21 2017 From: report at bugs.python.org (Jon Ribbens) Date: Mon, 10 Apr 2017 20:26:21 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491855981.65.0.00197162829519.issue30032@psf.upfronthosting.co.za> Jon Ribbens added the comment: So on further investigation, with the new API and policy=SMTP, it does generate correct base64 output. So I guess on the basis that the new version can generate the right output, and it appears to be a deliberate choice that the default policy breaks the RFCs, you can close this issue ;-) >>> from email.message import EmailMessage >>> from email.policy import SMTP >>> import base64 >>> msg = EmailMessage(policy=SMTP) >>> msg.set_content("hello\nthere", cte="base64") >>> msg.as_string() 'Content-Type: text/plain; charset="utf-8"\r\nContent-Transfer-Encoding: base64\r\nMIME-Version: 1.0\r\n\r\naGVsbG8NCnRoZXJlDQo=\r\n' >>> base64.b64decode("aGVsbG8NCnRoZXJlDQo=") b'hello\r\nthere\r\n' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 16:55:50 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 20:55:50 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491857750.59.0.784972244289.issue30032@psf.upfronthosting.co.za> R. David Murray added the comment: Huh. I ran something like that test and thought I saw the reverse. I guess I misread my terminal. Looking at the code, set_content does take care to fix the line ending according to the policy before doing the encoding. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 16:58:29 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 20:58:29 +0000 Subject: [issue30032] email module creates base64 output with incorrect line breaks In-Reply-To: <1491846086.02.0.299208621231.issue30032@psf.upfronthosting.co.za> Message-ID: <1491857909.82.0.834855615068.issue30032@psf.upfronthosting.co.za> R. David Murray added the comment: There is, however, an issue that if you pass a message with the default policy to the generator and specify SMTP as the policy, it doesn't *recode* the line endings. I thought there was an open issue for that, but I can't find it. One solution would be to do as you suggest and make \r\n what we always use when doing base64 encoding. I'm open to that as a possible fix, but it probably needs at least a brief discussion with Barry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 17:38:58 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 10 Apr 2017 21:38:58 +0000 Subject: [issue29549] Improve docstring for str.index In-Reply-To: <1487019442.21.0.885918615749.issue29549@psf.upfronthosting.co.za> Message-ID: <1491860338.75.0.639197080436.issue29549@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 17:50:25 2017 From: report at bugs.python.org (Keith Erskine) Date: Mon, 10 Apr 2017 21:50:25 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files Message-ID: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> New submission from Keith Erskine: If a csv file has a quote character at the beginning of a field but no closing quote, the csv module will keep reading the file until the very end in an attempt to close out the field. It's true this situation occurs only when the quoting in a csv file is incorrect, but it would be extremely helpful if the csv reader could be told to stop reading each row of fields when it encounters a newline character, even if it is within a quoted field at the time. At the moment, with large files, the csv reader will typically error out in this situation once it reads the maximum size of a string. Furthermore, this is not an easy situation to trap with custom code. Here's an example of the what I'm talking about. For a csv file with the following content: a,b,c d,"e,f g,h,i This code: import csv with open('file.txt') as f: reader = csv.reader(f) for row in reader: print(row) returns: ['a', 'b', 'c'] ['d', 'e,f\ng,h,i\n'] Note that the whole of the file after "e", including delimiters and newlines, has been added to the second field on the second line. This is correct csv behavior but is very unhelpful to me in this situation. On the grounds that most csv files do not have multiline values within them, perhaps a new dialect attribute called "multiline" could be added to the csv module, that defaults to True for backwards compatibility. It would indicate whether the csv file has any field values within it that span more than one line. If multiline is False, then the "parse_process_char" function in "_csv" would always close out a row of fields when it encounters a newline character. It might be best if this multiline attribute were taken into account only when "strict" is False. Right now, I do get badly-formatted files like this, and I cannot ask the source for a new file. I have to manually correct the file using a mixture of custom scripts and vi before the csv module will read it. It would be very helpful if csv would handle this directly. ---------- messages: 291453 nosy: keef604 priority: normal severity: normal status: open title: csv reader chokes on bad quoting in large files type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 17:53:37 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 10 Apr 2017 21:53:37 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491861217.93.0.573823047135.issue30034@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- components: +Library (Lib) nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 18:06:54 2017 From: report at bugs.python.org (Keith Erskine) Date: Mon, 10 Apr 2017 22:06:54 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491862014.88.0.482150762413.issue30034@psf.upfronthosting.co.za> Keith Erskine added the comment: Perhaps I should add what I would prefer the csv reader to return in my example above. That would be: ['a', 'b', 'c'] ['d', 'e,f'] ['g', 'h', 'i'] Yes, the second line is still mangled but at least the csv reader would carry on and read the third line correctly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 18:15:01 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 10 Apr 2017 22:15:01 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491862501.13.0.619648421121.issue30034@psf.upfronthosting.co.za> R. David Murray added the comment: In my experience CSV files with fields with embedded newlines are pretty common. I don't really think we want to support invalid CSV files. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 19:09:11 2017 From: report at bugs.python.org (Keith Erskine) Date: Mon, 10 Apr 2017 23:09:11 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491865751.3.0.0179216888452.issue30034@psf.upfronthosting.co.za> Keith Erskine added the comment: The csv reader already handles a certain amount of bad formatting. For example, using default behavior, the following file: a,b,c d,"e"X,f g,h,i is read as: ['a', 'b', 'c'] ['d', 'eX', 'f'] ['g', 'h', 'i'] It seems reasonable that csv should be able to handle delimited files that are not perfectly formatted. After all, even the CSV "standard" isn't really a standard. When dealing with large (10GB+) files, it's a pain if csv cannot read the file because of just one misplaced quote character. Besides, data files are only going to get bigger. Also, I have to say, I've been dealing with large ETL jobs for over 15 years now and I'm struggling to think of a time when I've ever seen a multiline CSV file. Of course, we've all have different experiences. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 20:33:19 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 11 Apr 2017 00:33:19 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491870799.68.0.262834494681.issue30034@psf.upfronthosting.co.za> R. David Murray added the comment: Well, ETL is semi-standardized. Try dealing with csv files exported from excel spreadsheets written by non-programmers :) "e"X is not a quoting the csv module will produce, but I don't think it is a csv error. insofar as csv has a standard, it is a defacto standard based on what Microsoft tools do. What does excel, for example, do with either of those examples? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 21:11:59 2017 From: report at bugs.python.org (Keith Erskine) Date: Tue, 11 Apr 2017 01:11:59 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491873119.94.0.245999605587.issue30034@psf.upfronthosting.co.za> Keith Erskine added the comment: As you say, David, however much we would like the world to stick to a given CSV standard, the reality is that people don't, which is all the more reason for making the csv reader flexible and forgiving. The csv module can and should be used for more than just "comma-separated-values" files. I use it for all sorts of different delimited files, and it works very well. Pandas uses it, as I'm sure do many other packages. It's such a good module, it would be a pity to restrict its scope to just Excel-related scenarios. Parsing delimited files is undoubtedly complex, and painfully slow if done with pure Python, so the more that can be done in C the better. I'm no C programmer, but my guesstimate is that the coding changes I'm proposing are relatively modest. In the IN_QUOTED_FIELD section (https://github.com/python/cpython/blob/master/Modules/_csv.c#L690), it would mean checking for newline characters if the new "multiline" attribute is False (and probably "strict" is False too). Of course there is more to this change than just that, but I'm guessing not that much more. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 22:02:11 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 11 Apr 2017 02:02:11 +0000 Subject: [issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple In-Reply-To: <1461678306.82.0.694875654943.issue26860@psf.upfronthosting.co.za> Message-ID: <1491876131.24.0.169842816386.issue26860@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 10 22:14:40 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 11 Apr 2017 02:14:40 +0000 Subject: [issue29030] argparse: choices override metavar In-Reply-To: <1482281546.0.0.613026945443.issue29030@psf.upfronthosting.co.za> Message-ID: <1491876880.45.0.286066291205.issue29030@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> bethard nosy: +bethard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 00:19:25 2017 From: report at bugs.python.org (Michael Seifert) Date: Tue, 11 Apr 2017 04:19:25 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1491884365.85.0.0221377357906.issue26828@psf.upfronthosting.co.za> Changes by Michael Seifert : ---------- pull_requests: +1220 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 00:33:01 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 11 Apr 2017 04:33:01 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1491885181.67.0.780333544342.issue26828@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 00:34:45 2017 From: report at bugs.python.org (Sunyeop Lee) Date: Tue, 11 Apr 2017 04:34:45 +0000 Subject: [issue30035] [RFC] PyMemberDef.name should be const char * Message-ID: <1491885285.14.0.166738608305.issue30035@psf.upfronthosting.co.za> New submission from Sunyeop Lee: PyMemberDef from Noddy examaple: https://docs.python.org/3/extending/newtypes.html static PyMemberDef Noddy_members[] = { {"first", T_OBJECT_EX, offsetof(Noddy, first), 0, "first name"}, {"last", T_OBJECT_EX, offsetof(Noddy, last), 0, "last name"}, {"number", T_INT, offsetof(Noddy, number), 0, "noddy number"}, {NULL} /* Sentinel */ }; When compiling the code with the PyMemberDef above with GCC, it compiles well. However, with G++, ISO C++11 complains(warns) it is deprecated to convert string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings] Should the example code be fixed, or should PyMemberDef fixed? I think PyMemberDef.name should bo const char * instead of char *. Compiled with: g++ test.cpp -I/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/include/python3.6m -L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -fPIC -shared Compiler versions: $ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.38) Target: x86_64-apple-darwin16.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin $ g++ -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.38) Target: x86_64-apple-darwin16.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin ---------- components: Extension Modules files: test.cpp messages: 291459 nosy: Sunyeop Lee priority: normal severity: normal status: open title: [RFC] PyMemberDef.name should be const char * type: compile error versions: Python 3.6 Added file: http://bugs.python.org/file46795/test.cpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 00:37:33 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 11 Apr 2017 04:37:33 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491885453.36.0.0725523786775.issue30034@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > In my experience CSV files with fields with embedded newlines > are pretty common. I don't really think we want to support > invalid CSV files. I concur with David on both points. Also, whether common or not, we don't want to break existing code that already works. I recommend marking this as rejected and closing. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 00:45:13 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 11 Apr 2017 04:45:13 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1491885913.5.0.801951377504.issue26828@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Length hints were intentionally omitted from the Python 3 map() and filter() which used to be in the itertools module. I explored that notion of iterator length transparency years ago. While I don't remember all the details, I did record some notes at the top of Lib/test/test_iterlen.py. BTW, I also don't think the list(map(...)) or list(filter(...)) case is worth optimizing. For big inputs, manifesting the whole input into a list is usually (but not always) the wrong thing to do if you care about performance (throwing away the iterator's superb L1 and L2 cache performance and throwing away the memory efficiency). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 03:39:06 2017 From: report at bugs.python.org (Peter Otten) Date: Tue, 11 Apr 2017 07:39:06 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491896346.31.0.132533972885.issue30034@psf.upfronthosting.co.za> Peter Otten added the comment: While I don't think that the csv module should second-guess broken input you might consider "fixing" your data on the fly: def close_quote(line): if line.count('"') % 2: line = line.rstrip("\n") + '"\n' return line with open("data.csv") as f: for row in csv.reader(map(close_quote, f)): print(row) That should give the desired output. ---------- nosy: +peter.otten _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 03:45:41 2017 From: report at bugs.python.org (Dutcho) Date: Tue, 11 Apr 2017 07:45:41 +0000 Subject: [issue30036] The bugs website doesn't use httpS by default Message-ID: <1491896741.65.0.130091825674.issue30036@psf.upfronthosting.co.za> New submission from Dutcho: The footer of httpS://python.org links to httP://bugs.python.org, compromising user data for login and register options ---------- assignee: christian.heimes components: SSL messages: 291463 nosy: Dutcho, christian.heimes priority: normal severity: normal status: open title: The bugs website doesn't use httpS by default type: security versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 03:51:50 2017 From: report at bugs.python.org (Dutcho) Date: Tue, 11 Apr 2017 07:51:50 +0000 Subject: [issue30037] inspect documentation on code attributes incomplete Message-ID: <1491897110.71.0.340435065051.issue30037@psf.upfronthosting.co.za> New submission from Dutcho: The table at the top of the inspect documentation (https://docs.python.org/3/library/inspect.html#types-and-members) omits co_cellvars, co_freevars, and co_kwonlyargcount attributes of type code (note: the type's doc string does provide these attributes) ---------- assignee: docs at python components: Documentation messages: 291464 nosy: Dutcho, docs at python priority: normal severity: normal status: open title: inspect documentation on code attributes incomplete type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 03:51:51 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 11 Apr 2017 07:51:51 +0000 Subject: [issue25828] PyCode_Optimize() (peephole optimizer) doesn't handle KeyboardInterrupt correctly In-Reply-To: <1449648204.19.0.769728792688.issue25828@psf.upfronthosting.co.za> Message-ID: <1491897111.36.0.937623489994.issue25828@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 04:08:51 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 11 Apr 2017 08:08:51 +0000 Subject: [issue25828] PyCode_Optimize() (peephole optimizer) doesn't handle KeyboardInterrupt correctly In-Reply-To: <1449648204.19.0.769728792688.issue25828@psf.upfronthosting.co.za> Message-ID: <1491898131.2.0.631171775842.issue25828@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1221 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 04:14:25 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 11 Apr 2017 08:14:25 +0000 Subject: [issue24076] sum() several times slower on Python 3 In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1491898465.12.0.832443083273.issue24076@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 04:14:58 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Apr 2017 08:14:58 +0000 Subject: [issue30036] The bugs website doesn't use httpS by default In-Reply-To: <1491896741.65.0.130091825674.issue30036@psf.upfronthosting.co.za> Message-ID: <1491898498.44.0.324347935704.issue30036@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- assignee: christian.heimes -> components: +Documentation -SSL type: security -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 04:16:30 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 11 Apr 2017 08:16:30 +0000 Subject: [issue24076] sum() several times slower on Python 3 64-bit In-Reply-To: <1430332618.4.0.236828536627.issue24076@psf.upfronthosting.co.za> Message-ID: <1491898590.85.0.437212493667.issue24076@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- title: sum() several times slower on Python 3 -> sum() several times slower on Python 3 64-bit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 04:27:16 2017 From: report at bugs.python.org (Martin Panter) Date: Tue, 11 Apr 2017 08:27:16 +0000 Subject: [issue30037] inspect documentation on code attributes incomplete In-Reply-To: <1491897110.71.0.340435065051.issue30037@psf.upfronthosting.co.za> Message-ID: <1491899236.33.0.164981769561.issue30037@psf.upfronthosting.co.za> Martin Panter added the comment: Looks like a there is already a patch discussed at Issue 26985. ---------- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Information about CodeType in inspect documentation is outdated _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 04:38:56 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 11 Apr 2017 08:38:56 +0000 Subject: [issue29881] Add a new private API clear private variables, which are initialized once, at Python shutdown In-Reply-To: <1490201009.64.0.544065179107.issue29881@psf.upfronthosting.co.za> Message-ID: <1491899936.61.0.101408343528.issue29881@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:11:15 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 11 Apr 2017 09:11:15 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491901875.95.0.414785133287.issue29692@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 00c75e9a45ff0366c185e9e8a2e23af5a35481b0 by Nick Coghlan (svelankar) in branch 'master': bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError (GH-949) https://github.com/python/cpython/commit/00c75e9a45ff0366c185e9e8a2e23af5a35481b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:11:23 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 11 Apr 2017 09:11:23 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd Message-ID: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> New submission from Nathaniel Smith: In trip_signal [1], the logic goes: 1) set the flag saying that this particular signal was tripped 2) write to the wakeup fd 3) set the global is_tripped flag saying "at least one signal was tripped", and do Py_AddPendingCall (which sets some global flags that the bytecode interpreter checks on every pass through the loop) So the problem here is that it's step (2) that wakes up the main thread to check for signals, but it's step (3) that actually arranges for the Python-level signal handler to run. (Step (1) turns out to be irrelevant, because no-one looks at the per-signal flags unless the global is_tripped flag is set. This might be why no-one noticed this bug through code inspection though ? I certainly missed it, despite explicitly checking for it several times!) The result is that the following sequence of events is possible: - signal arrives (e.g. SIGINT) - trip_signal writes to the wakeup fd - the main thread blocked in IO wait sees this, and wakes up - the main thread checks for signals, and doesn't find any - the main thread empties the wakeup fd - the main thread goes back to sleep - trip_signal sets the flags to request the Python-level signal handler be run - the main thread doesn't notice, because it's asleep It turns out that this is a real thing that can actually happen; it's causing an annoying intermittent failure in the trio testsuite on appveyor; and under the correct conditions I can reproduce it very reliably in my local Windows VM. See [2]. I think the fix is just to swap the order of steps (2) and (3), so we write to the wakeup fd last. Unfortunately I can't easily test this because I don't have a way to build CPython on Windows. But [2] has some IMHO pretty compelling evidence that this is what's happening. [1] https://github.com/python/cpython/blob/6fab78e9027f9ebd6414995580781b480433e595/Modules/signalmodule.c#L238-L291 [2] https://github.com/python-trio/trio/issues/119 ---------- messages: 291467 nosy: haypo, njs priority: normal severity: normal status: open title: Race condition in how trip_signal writes to wakeup fd versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:19:01 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 11 Apr 2017 09:19:01 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491902341.17.0.909195933129.issue29692@psf.upfronthosting.co.za> Nick Coghlan added the comment: This has been merged for 3.7, but cherry-picks to the other branches are still needed. I also inadvertently missed adding svelankar's name (Siddharth Velankar) to Misc/ACKS, so that oversight will need to be tidied up as well. ---------- resolution: -> fixed stage: test needed -> backport needed versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:19:12 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 11 Apr 2017 09:19:12 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491902352.43.0.945891631051.issue29692@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- assignee: -> ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:30:58 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 11 Apr 2017 09:30:58 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491903058.39.0.0104238887619.issue29692@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1222 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:33:27 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 11 Apr 2017 09:33:27 +0000 Subject: [issue30039] Resuming a 'yield from' stack is broken if a signal arrives in the middle Message-ID: <1491903207.11.0.00986687800627.issue30039@psf.upfronthosting.co.za> New submission from Nathaniel Smith: If we have a chain of generators/coroutines that are 'yield from'ing each other, then resuming the stack works like: - call send() on the outermost generator - this enters _PyEval_EvalFrameDefault, which re-executes the YIELD_FROM opcode - which calls send() on the next generator - which enters _PyEval_EvalFrameDefault, which re-executes the YIELD_FROM opcode - ...etc. However, every time we enter _PyEval_EvalFrameDefault, the first thing we do is to check for pending signals, and if there are any then we run the signal handler. And if it raises an exception, then we immediately propagate that exception *instead* of starting to execute bytecode. This means that e.g. a SIGINT at the wrong moment can "break the chain" ? it can be raised in the middle of our yield from chain, with the bottom part of the stack abandoned for the garbage collector. The fix is pretty simple: there's already a special case in _PyEval_EvalFrameEx where it skips running signal handlers if the next opcode is SETUP_FINALLY. (I don't see how this accomplishes anything useful, but that's another story.) If we extend this check to also skip running signal handlers when the next opcode is YIELD_FROM, then that closes the hole ? now the exception can only be raised at the innermost stack frame. This shouldn't have any performance implications, because the opcode check happens inside the "slow path" after we've already determined that there's a pending signal or something similar for us to process; the vast majority of the time this isn't true. I'll post a PR in a few minutes that has a test case that demonstrates the problem and fails on current master, plus the fix. ---------- components: Interpreter Core messages: 291469 nosy: njs, yselivanov priority: normal severity: normal status: open title: Resuming a 'yield from' stack is broken if a signal arrives in the middle versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:39:20 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 11 Apr 2017 09:39:20 +0000 Subject: [issue30040] new empty dict can be more small Message-ID: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> New submission from INADA Naoki: dict.clear() make the dict to empty key-sharing dict to reduce it's size. New dict can use same technique. $ ./python.default Python 3.7.0a0 (heads/master:6dfcc81, Apr 10 2017, 19:55:52) [GCC 6.2.0 20161005] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> d = {} >>> sys.getsizeof(d) 240 >>> d.clear() >>> sys.getsizeof(d) 72 $ ./python.patched Python 3.7.0a0 (heads/master-dirty:6dfcc81, Apr 11 2017, 18:11:02) [GCC 6.2.0 20161005] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.getsizeof({}) 72 ---------- messages: 291470 nosy: inada.naoki priority: normal severity: normal status: open title: new empty dict can be more small _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:42:13 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 11 Apr 2017 09:42:13 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491903733.0.0.583509858898.issue30040@psf.upfronthosting.co.za> Changes by INADA Naoki : ---------- pull_requests: +1223 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:42:21 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 11 Apr 2017 09:42:21 +0000 Subject: [issue30039] Resuming a 'yield from' stack is broken if a signal arrives in the middle In-Reply-To: <1491903207.11.0.00986687800627.issue30039@psf.upfronthosting.co.za> Message-ID: <1491903741.17.0.442224327747.issue30039@psf.upfronthosting.co.za> Changes by Nathaniel Smith : ---------- pull_requests: +1224 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:42:45 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 11 Apr 2017 09:42:45 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491903765.98.0.380026551421.issue30040@psf.upfronthosting.co.za> INADA Naoki added the comment: performance impact best case: $ ./python.patched -m perf timeit --compare-to=`pwd`/python.default -- '{}' python.default: ..................... 36.9 ns +- 0.9 ns python.patched: ..................... 25.3 ns +- 0.7 ns Mean +- std dev: [python.default] 36.9 ns +- 0.9 ns -> [python.patched] 25.3 ns +- 0.7 ns: 1.46x faster (-31%) worst case: $ ./python.patched -m perf timeit --compare-to=`pwd`/python.default -- 'x={}; x["a"]=1' python.default: ..................... 73.3 ns +- 1.2 ns python.patched: ..................... 82.8 ns +- 1.8 ns Mean +- std dev: [python.default] 73.3 ns +- 1.2 ns -> [python.patched] 82.8 ns +- 1.8 ns: 1.13x slower (+13%) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:43:22 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 11 Apr 2017 09:43:22 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491903802.68.0.828780628247.issue30040@psf.upfronthosting.co.za> Changes by INADA Naoki : ---------- components: +Interpreter Core type: -> resource usage versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:47:41 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 11 Apr 2017 09:47:41 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1491904061.63.0.917738432376.issue29692@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset e8a6bb4f3936123f3eca0b6cea05e2875a2722bc by Nick Coghlan in branch 'master': bpo-29692: Add missing ACKS entry (#1079) https://github.com/python/cpython/commit/e8a6bb4f3936123f3eca0b6cea05e2875a2722bc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 05:57:25 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 11 Apr 2017 09:57:25 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491904645.65.0.620541221246.issue30038@psf.upfronthosting.co.za> Changes by Nathaniel Smith : ---------- pull_requests: +1226 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:04:41 2017 From: report at bugs.python.org (Dimitri Merejkowsky) Date: Tue, 11 Apr 2017 10:04:41 +0000 Subject: [issue30041] subprocess: weird behavior with shell=True and args being a list Message-ID: <1491905081.01.0.57278380542.issue30041@psf.upfronthosting.co.za> New submission from Dimitri Merejkowsky: If you have: subprocess.run(["ls", "--help"], shell=True) you'll see that the command run is actually just "ls", not "ls --help" ---------- components: Library (Lib) messages: 291473 nosy: Dimitri Merejkowsky priority: normal severity: normal status: open title: subprocess: weird behavior with shell=True and args being a list _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:06:41 2017 From: report at bugs.python.org (Dimitri Merejkowsky) Date: Tue, 11 Apr 2017 10:06:41 +0000 Subject: [issue3041] autodoc does not support unicode docstrings In-Reply-To: <1212661294.93.0.247406907361.issue3041@psf.upfronthosting.co.za> Message-ID: <1491905201.1.0.742230822983.issue3041@psf.upfronthosting.co.za> Changes by Dimitri Merejkowsky : ---------- pull_requests: +1227 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:20:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Apr 2017 10:20:13 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491906013.12.0.848290814997.issue30038@psf.upfronthosting.co.za> STINNER Victor added the comment: Last time I had to make a major change related to signal handling, it was in the asyncio module because of a race conditon which occurred on FreeBSD. commit fe5649c7b7bf52147480d6b1124a3d8e3597aee3 Author: Victor Stinner Date: Thu Jul 17 22:43:40 2014 +0200 Python issue #21645, Tulip issue 192: Rewrite signal handling Since Python 3.3, the C signal handler writes the signal number into the wakeup file descriptor and then schedules the Python call using Py_AddPendingCall(). asyncio uses the wakeup file descriptor to wake up the event loop, and relies on Py_AddPendingCall() to schedule the final callback with call_soon(). If the C signal handler is called in a thread different than the thread of the event loop, the loop is awaken but Py_AddPendingCall() was not called yet. In this case, the event loop has nothing to do and go to sleep again. Py_AddPendingCall() is called while the event loop is sleeping again and so the final callback is not scheduled immediatly. This patch changes how asyncio handles signals. Instead of relying on Py_AddPendingCall() and the wakeup file descriptor, asyncio now only relies on the wakeup file descriptor. asyncio reads signal numbers from the wakeup file descriptor to call its signal handler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:31:41 2017 From: report at bugs.python.org (Martin Panter) Date: Tue, 11 Apr 2017 10:31:41 +0000 Subject: [issue30041] subprocess: weird behavior with shell=True and args being a list In-Reply-To: <1491905081.01.0.57278380542.issue30041@psf.upfronthosting.co.za> Message-ID: <1491906701.33.0.373161912113.issue30041@psf.upfronthosting.co.za> Martin Panter added the comment: This is as documented, but perhaps see Issue 20344 about clarifying the documentation. ---------- nosy: +martin.panter resolution: -> not a bug stage: -> resolved status: open -> closed superseder: -> subprocess.check_output() docs misrepresent what shell=True does _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:35:34 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 11 Apr 2017 10:35:34 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491906934.77.0.432375988854.issue30038@psf.upfronthosting.co.za> Nathaniel Smith added the comment: Right. My claim would be that the PR I just submitted is the correct fix for bpo-21645 as well. The approach asyncio uses is very elegant, but unfortunately it assumes that the wakeup fd has infinite buffer, which isn't true. If enough signals or other callbacks are scheduled to the event loop quickly enough, then the buffer can overflow and signals can get lost. This is a very classic issue and source of confusion for everyone learning Unix ? the reason that there are traditionally 32 unix signals, and that signals can be coalesced and SIGCHLD is so annoying, is that the kernel treats pending signals as flags, not a queue; this means that in the worst case it only takes 32 bits to store all pending signals. (Even the posix committee screwed this up when designing the real-time signals system, which is almost unusable as a result.) On Unix, if you send a process 10 SIGHUP and 1 SIGCHLD, then it might get only 1 SIGHUP and 1 SIGCHLD, but it's guaranteed to get that. With asyncio's model, it might get 10 SIGHUP and 0 SIGCHLD, or even 0 SIGHUP and 0 SIGCHLD (since other methods like call_soon_threadsafe also write to the wakeup fd). In any case, this is why other async libraries (at least twisted, libuv, tornado, trio) treat the wakeup fd as a boolean empty-or-not, and pass the actual information via some other out-of-band mechanism that involves a Python-level signal handler. So the patch here is necessary for everyone else to safely use set_wakeup_fd. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:36:31 2017 From: report at bugs.python.org (Xiang Zhang) Date: Tue, 11 Apr 2017 10:36:31 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491906991.19.0.982644533474.issue30040@psf.upfronthosting.co.za> Xiang Zhang added the comment: Isn't the latter case the more common one? Creating an empty dict and then populate it. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:39:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Apr 2017 10:39:41 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491907181.07.0.834506811513.issue30038@psf.upfronthosting.co.za> STINNER Victor added the comment: Previous changes in signal handling. It's the commit c13ef66649985025382c64f6af8e3b956411e05b of the issue #8407 which changed the order: became . I really *hate* having to think to these evil things which are signals and threads... Signals and threads don't go well altogether :-p It reminds me the "Ghosts of Unix past, part 3: Unfixable designs" article... https://lwn.net/Articles/414618/ commit 6c9b35bfe2585af08ea6480294e096e2d2397fe3 Author: Victor Stinner Date: Mon Apr 18 16:25:56 2011 +0200 Issue #11768: The signal handler of the signal module only calls Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or parallel calls. PyErr_SetInterrupt() writes also into the wake up file. commit c13ef66649985025382c64f6af8e3b956411e05b Author: Victor Stinner Date: Wed May 25 02:35:58 2011 +0200 Issue #8407: Fix the signal handler of the signal module: if it is called twice, it now writes the number of the second signal into the wakeup fd. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:40:27 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 11 Apr 2017 10:40:27 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491907227.25.0.143712196185.issue30038@psf.upfronthosting.co.za> Nathaniel Smith added the comment: Err, libuv obviously doesn't use a Python-level signal handler. I just meant to include them as another example of a library I checked that uses a self-pipe to handle signals but relies on out-of-band information to transmit what the actual signal is :-). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:43:31 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 11 Apr 2017 10:43:31 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491907411.64.0.353980489578.issue30038@psf.upfronthosting.co.za> Nathaniel Smith added the comment: I think the idea in c13ef6664998 wasn't so much that we wanted the wakeup fd to be written to first, as that the way the code was written back then, the presence of 'if (is_tripped) return;' meant that it wasn't getting written to *at all* in some cases. Since then the code got restructured and the early return was removed, so this isn't an issue anymore. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:45:48 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 11 Apr 2017 10:45:48 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491907548.26.0.262811882199.issue30040@psf.upfronthosting.co.za> INADA Naoki added the comment: > Isn't the latter case the more common one? Creating an empty dict and then populate it. This is memory usage optimization, not performance optimization. (But I think memory efficiency makes multi process application faster because L3 cache size is limited resource.) Later case shows how performance penalty is large. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:46:49 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 11 Apr 2017 10:46:49 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491907609.73.0.132359505037.issue30040@psf.upfronthosting.co.za> INADA Naoki added the comment: macro bench result: $ ./python.default -m perf compare_to -G --min-speed=1 default.json patched.json Slower (11): - scimark_lu: 362 ms +- 13 ms -> 383 ms +- 22 ms: 1.06x slower (+6%) - unpickle_pure_python: 882 us +- 18 us -> 924 us +- 18 us: 1.05x slower (+5%) - regex_v8: 45.4 ms +- 0.6 ms -> 46.7 ms +- 3.1 ms: 1.03x slower (+3%) - mako: 40.4 ms +- 0.4 ms -> 41.4 ms +- 0.4 ms: 1.03x slower (+3%) - meteor_contest: 200 ms +- 1 ms -> 204 ms +- 2 ms: 1.02x slower (+2%) - genshi_text: 88.8 ms +- 1.2 ms -> 90.1 ms +- 1.6 ms: 1.01x slower (+1%) - scimark_monte_carlo: 255 ms +- 6 ms -> 258 ms +- 7 ms: 1.01x slower (+1%) - richards: 176 ms +- 4 ms -> 178 ms +- 8 ms: 1.01x slower (+1%) - pickle: 24.2 us +- 0.5 us -> 24.4 us +- 0.7 us: 1.01x slower (+1%) - sympy_str: 438 ms +- 3 ms -> 442 ms +- 3 ms: 1.01x slower (+1%) - genshi_xml: 196 ms +- 3 ms -> 198 ms +- 2 ms: 1.01x slower (+1%) Faster (7): - logging_silent: 746 ns +- 12 ns -> 722 ns +- 11 ns: 1.03x faster (-3%) - xml_etree_generate: 272 ms +- 4 ms -> 264 ms +- 4 ms: 1.03x faster (-3%) - telco: 20.7 ms +- 0.7 ms -> 20.2 ms +- 0.4 ms: 1.02x faster (-2%) - xml_etree_parse: 311 ms +- 13 ms -> 305 ms +- 12 ms: 1.02x faster (-2%) - nqueens: 266 ms +- 4 ms -> 262 ms +- 2 ms: 1.02x faster (-2%) - unpack_sequence: 123 ns +- 1 ns -> 122 ns +- 2 ns: 1.01x faster (-1%) - raytrace: 1.27 sec +- 0.01 sec -> 1.25 sec +- 0.01 sec: 1.01x faster (-1%) Benchmark hidden because not significant (46) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:51:23 2017 From: report at bugs.python.org (Plenty Su) Date: Tue, 11 Apr 2017 10:51:23 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1491907883.94.0.599082242495.issue29606@psf.upfronthosting.co.za> Changes by Plenty Su : ---------- nosy: +supl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 06:55:29 2017 From: report at bugs.python.org (Xiang Zhang) Date: Tue, 11 Apr 2017 10:55:29 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491908129.4.0.685019717395.issue30040@psf.upfronthosting.co.za> Xiang Zhang added the comment: I mean creating a solo empty dict doesn't seem to make much sense. Although it saves memory, but when it's populated, it's resized and the memory occupation comes back. And this makes PyDict_New() hard to understand. :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 07:00:58 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 11 Apr 2017 11:00:58 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491908458.99.0.737169287216.issue30038@psf.upfronthosting.co.za> Nathaniel Smith added the comment: If it helps, notice that the SetEvent(sigint_event) call used to wake up the main thread on windows is also performed unconditionally and after the call to Py_AddPendingEvent. From the point of view of twisted/tornado/trio, this is exactly the same as the write to the wakeup fd -- the only reason we use the wakeup fd instead of the sigint_event is that it's more convenient to wait on an fd than on an event object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 07:53:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 11 Apr 2017 11:53:02 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491911582.18.0.459378536123.issue30040@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Use "--duplicate 100" when making microbenchmarks for such fast operations. The overhead of iterating can be significant and comparable with the time of the operation. ---------- nosy: +serhiy.storchaka stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 08:09:13 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 11 Apr 2017 12:09:13 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1491912553.46.0.518206306957.issue30024@psf.upfronthosting.co.za> Nick Coghlan added the comment: Huh, interesting - I'd missed that the only part of the "from a.b import c" that IMPORT_FROM implements is the LOAD_ATTR variant that falls back to sys.modules. The prior adjustment to get IMPORT_NAME to return "a.b" instead of "a" happens inside that opcode based on the fact that a non-empty from_list was passed in. So indeed, there's no new opcode needed - as Serhiy points out, the compiler just needs to emit IMPORT_FROM instead of LOAD_ATTR for this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 08:12:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Apr 2017 12:12:46 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491912766.68.0.856664903911.issue30038@psf.upfronthosting.co.za> STINNER Victor added the comment: "I think the idea in c13ef6664998 wasn't so much that we wanted the wakeup fd to be written to first, as that the way the code was written back then, the presence of 'if (is_tripped) return;' meant that it wasn't getting written to *at all* in some cases. Since then the code got restructured and the early return was removed, so this isn't an issue anymore." I agree. It wasn't deliberate to change the order, it's was more to write a short patch fixing a very specific use case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 08:13:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Apr 2017 12:13:56 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491912836.01.0.437564591381.issue30038@psf.upfronthosting.co.za> STINNER Victor added the comment: I know that it can be very difficult to write such test, but can you please try to write a script trying to reproduce the describe the race condition? Later, we can run the script in a test to check for non-regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 08:21:02 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 11 Apr 2017 12:21:02 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491913262.34.0.349292247604.issue30040@psf.upfronthosting.co.za> INADA Naoki added the comment: While I think it's preferable that {} and d.clear() have same memory footprint, I need real world example which empty dict affects overall memory usage. I'll check memory usage difference with application I used in this ML thread. https://mail.python.org/pipermail/python-dev/2017-January/147194.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:02:48 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 11 Apr 2017 13:02:48 +0000 Subject: [issue29590] Incorrect stack traces when re-entering a generator/coroutine stack via .throw() In-Reply-To: <1487341428.62.0.272190755105.issue29590@psf.upfronthosting.co.za> Message-ID: <1491915768.56.0.269241300552.issue29590@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- components: +Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:21:34 2017 From: report at bugs.python.org (karan) Date: Tue, 11 Apr 2017 13:21:34 +0000 Subject: [issue30042] fcntl module foe windows Message-ID: <1491916894.36.0.686800924149.issue30042@psf.upfronthosting.co.za> New submission from karan: NameError: global name 'fcntl' is not defined such error occurs while running software on windows. does fcntl module (urwid) is available for windows?? ---------- messages: 291490 nosy: kk_pednekar priority: normal severity: normal status: open title: fcntl module foe windows type: resource usage versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:21:44 2017 From: report at bugs.python.org (karan) Date: Tue, 11 Apr 2017 13:21:44 +0000 Subject: [issue30042] fcntl module for windows In-Reply-To: <1491916894.36.0.686800924149.issue30042@psf.upfronthosting.co.za> Message-ID: <1491916904.0.0.165780878074.issue30042@psf.upfronthosting.co.za> Changes by karan : ---------- title: fcntl module foe windows -> fcntl module for windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:21:56 2017 From: report at bugs.python.org (Pavlo Kapyshin) Date: Tue, 11 Apr 2017 13:21:56 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1491916916.2.0.915248069548.issue30031@psf.upfronthosting.co.za> Changes by Pavlo Kapyshin : ---------- pull_requests: +1228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:25:14 2017 From: report at bugs.python.org (Pierre Quentel) Date: Tue, 11 Apr 2017 13:25:14 +0000 Subject: [issue29979] cgi.parse_multipart is not consistent with FieldStorage In-Reply-To: <1491296331.11.0.181533719685.issue29979@psf.upfronthosting.co.za> Message-ID: <1491917114.64.0.631865811417.issue29979@psf.upfronthosting.co.za> Pierre Quentel added the comment: Senthil, Can you take a look at the Pull Request when you have time ? The correct PR is #991, not #990. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:25:37 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Apr 2017 13:25:37 +0000 Subject: [issue30042] fcntl module for windows In-Reply-To: <1491916894.36.0.686800924149.issue30042@psf.upfronthosting.co.za> Message-ID: <1491917137.92.0.414198078814.issue30042@psf.upfronthosting.co.za> Christian Heimes added the comment: Yes, it's Unix only: https://docs.python.org/2.7/py-modindex.html#cap-f ---------- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:41:57 2017 From: report at bugs.python.org (karan) Date: Tue, 11 Apr 2017 13:41:57 +0000 Subject: [issue30043] fcntl module for windows platform Message-ID: <1491918117.96.0.537988722419.issue30043@psf.upfronthosting.co.za> New submission from karan: is there any fcntl module alternative available that would support windows platform?? in any of futures release of python is it possible that fcntl would support windows?? ---------- messages: 291493 nosy: kk_pednekar priority: normal severity: normal status: open title: fcntl module for windows platform type: resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:49:01 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 11 Apr 2017 13:49:01 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491918541.98.0.289879229492.issue30040@psf.upfronthosting.co.za> R. David Murray added the comment: I've worked on an application (proprietary, unfortunately) that created a lot of empty dictionaries that only sometimes got populated. It involved sqlalchemy, but I don't remember if the dicts came from sqlalchemy itself or from the code that used it. That application did care about memory, and the shared-key dicts were a big benefit to it. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 09:52:16 2017 From: report at bugs.python.org (Keith Erskine) Date: Tue, 11 Apr 2017 13:52:16 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491918736.72.0.497627461849.issue30034@psf.upfronthosting.co.za> Keith Erskine added the comment: The csv reader already supports bad CSV - that's what I believe "strict" is for - but only in one specific scenario. My request is to make that "strict" attribute a bit more useful. Thank you for your suggestion, Peter. I have toyed with the idea of looking for an even number of double quotes in each line, but thank you for your neat way of encapsulating it. (I already have to strip null bytes out of the input data because they break csv, see issue #27580). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 10:03:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Apr 2017 14:03:36 +0000 Subject: [issue30043] fcntl module for windows platform In-Reply-To: <1491918117.96.0.537988722419.issue30043@psf.upfronthosting.co.za> Message-ID: <1491919416.23.0.697458619576.issue30043@psf.upfronthosting.co.za> STINNER Victor added the comment: The Python bug tracker is not a forum. Please ask such question on a Python help mailing list or any Python forum, but not here. Thank you ;-) (No, there is no fcntl module on Windows.) ---------- nosy: +haypo resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 10:14:49 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 11 Apr 2017 14:14:49 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491920089.48.0.643050369228.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: After adapting your test script to run against a local openssl server (`openssl s_server -www`), I can't see a single leak: the process is peaking at 20860 KB RSS. This is with Python 3.5 tip. Does it need a specific server to test against to showcase the leak? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 10:53:10 2017 From: report at bugs.python.org (Keith Erskine) Date: Tue, 11 Apr 2017 14:53:10 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1491922390.3.0.197922163322.issue30034@psf.upfronthosting.co.za> Keith Erskine added the comment: I should have said, Peter, an odd number of quotes does not necessarily mean the quoting is bad. For example, a line of: a,b",c will parse fine as ['a', 'b"', 'c']. Figuring out bad quoting is not easy, but if we know that there are no multiline fields in the file, then at least the parsing can stop at the end of the line. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 11:42:33 2017 From: report at bugs.python.org (Florent Coriat) Date: Tue, 11 Apr 2017 15:42:33 +0000 Subject: [issue30044] shutil.copystat should (allow to) copy ownership, and other attributes Message-ID: <1491925353.8.0.782070431072.issue30044@psf.upfronthosting.co.za> New submission from Florent Coriat: shutil.copystat() copies permissions, timestamps and even flags and xattrs (if supported), but not ownership. Furthermore, shutil.copy2() documentation until 2.7 used to say it behaves like cp -p, which preserves ownership, and not xattr nor flags. (On my system it silently fails to copy ownership when not root). It may not be related, but comments in source code for the except NotImplementedError block concerning chmod mistakenly mentions chown-related functions. I think copystat (and copy2) should at least provide an option to preserve ownership. I do not know if it currently preserves SELinux context and ACL, but if not, it may also allow it. It would be really useful for replication or backup applications to have a function that copies everything it can. ---------- components: Library (Lib) messages: 291499 nosy: noctiflore priority: normal severity: normal status: open title: shutil.copystat should (allow to) copy ownership, and other attributes type: enhancement versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 12:00:38 2017 From: report at bugs.python.org (chrysn) Date: Tue, 11 Apr 2017 16:00:38 +0000 Subject: [issue19084] No way to use TLS-PSK from python ssl In-Reply-To: <1380036748.95.0.439028811791.issue19084@psf.upfronthosting.co.za> Message-ID: <1491926438.77.0.883420553303.issue19084@psf.upfronthosting.co.za> Changes by chrysn : ---------- nosy: +chrysn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 12:04:35 2017 From: report at bugs.python.org (Alexander Mohr) Date: Tue, 11 Apr 2017 16:04:35 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491926675.02.0.843393898157.issue29870@psf.upfronthosting.co.za> Alexander Mohr added the comment: the interesting part is it doesn't leak with a local https server, it appears to need to be a remove server. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 12:14:05 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 11 Apr 2017 16:14:05 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491927245.04.0.698551844456.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Is there a fast enough remote server that shows the leak? I've tested with my own remote server (https://pitrou.net/), but it doesn't leak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 12:15:25 2017 From: report at bugs.python.org (Alexander Mohr) Date: Tue, 11 Apr 2017 16:15:25 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1491927245.04.0.698551844456.issue29870@psf.upfronthosting.co.za> Message-ID: Alexander Mohr added the comment: ya, my sample script hits google.com , it's pretty fast. It just does a "HEAD". > On Apr 11, 2017, at 9:14 AM, Antoine Pitrou wrote: > > > Antoine Pitrou added the comment: > > Is there a fast enough remote server that shows the leak? I've tested with my own remote server (https://pitrou.net/), but it doesn't leak. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 12:19:51 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 11 Apr 2017 16:19:51 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491927591.08.0.343456403579.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Google is not very fast here (a couple of requests / sec at most). How many requests does it take to see a clear tendency? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 12:21:23 2017 From: report at bugs.python.org (Alexander Mohr) Date: Tue, 11 Apr 2017 16:21:23 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491927683.68.0.395939557835.issue29870@psf.upfronthosting.co.za> Alexander Mohr added the comment: see graphs here: https://github.com/kennethreitz/requests/issues/3933, x-axis is number of requests not what it says (seconds). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 13:19:02 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 11 Apr 2017 17:19:02 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491931142.31.0.357233817645.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, thank you. I've tweaked the script to remove most threads and use maps.google.com (which is faster here), and I managed to bisect the leak to deduce that the offending changeset is 598894ff48e9c1171cb2ec1c798235826a75c7e0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 13:40:14 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 11 Apr 2017 17:40:14 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491932414.05.0.518495455141.issue30040@psf.upfronthosting.co.za> INADA Naoki added the comment: Thank you for your reply. Would you try to check how the patch [1] affects memory usage of your application? I think the patch can be applied to 3.6 easily. [1] https://patch-diff.githubusercontent.com/raw/python/cpython/pull/1080.patch ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 13:54:09 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 11 Apr 2017 17:54:09 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491933249.67.0.106619434946.issue30040@psf.upfronthosting.co.za> R. David Murray added the comment: Sorry, but I no longer have access to that application (I'm a consultant, and the owner is no longer a client). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 13:57:35 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 11 Apr 2017 17:57:35 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491933455.52.0.248902185909.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: The following addition fixes the leak: diff --git a/Modules/_ssl.c b/Modules/_ssl.c index bb40051..8f5facd 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1203,6 +1203,8 @@ _get_crl_dp(X509 *certificate) { Py_XDECREF(lst); #if OPENSSL_VERSION_NUMBER < 0x10001000L sk_DIST_POINT_free(dps); +#else + CRL_DIST_POINTS_free(dps); #endif return res; } Christian, what do you think? ---------- priority: normal -> high versions: +Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 14:14:26 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Apr 2017 18:14:26 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491934466.51.0.0235570145101.issue29870@psf.upfronthosting.co.za> Christian Heimes added the comment: CRL_DIST_POINTS_free() should be available in all supported OpenSSL versions. The function is defined by DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 14:16:48 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 11 Apr 2017 18:16:48 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491934608.31.0.482973648644.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: So we should use it instead of sk_DIST_POINT_free()? I'd like to minimize potential breakage here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 15:11:46 2017 From: report at bugs.python.org (Alexander Mohr) Date: Tue, 11 Apr 2017 19:11:46 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491937906.25.0.294951362786.issue29870@psf.upfronthosting.co.za> Alexander Mohr added the comment: awesome! Thanks for finding a proposing fix pitrou! btw I found an example of freeing this structure here: http://www.zedwood.com/article/c-openssl-parse-x509-certificate-pem ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 15:15:21 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Apr 2017 19:15:21 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491938121.41.0.915803184953.issue29870@psf.upfronthosting.co.za> Christian Heimes added the comment: Yes, I'm currently testing the change with a bunch of OpenSSL and LibreSSL versions. By the way the memory issue can be reproduced with any certificate that contains a CRL distribution point. Letsencrypt certs don't have a CRL DP. I guess Alexander's test cert doesn't have a CRL DP either. The Nokia test cert in our test suite contains one. --- import _ssl import sys PEM = 'Lib/test/nokia.pem' def mem(): with open('/proc/self/status') as f: for line in f: if line.startswith('RssAnon'): print(line, end='') for i in range(10000): if i % 1000 == 0: mem() d = _ssl._test_decode_cert(PEM) assert d['crlDistributionPoints'] mem() --- Without fix: $ ./python t.py RssAnon: 4376 kB RssAnon: 4840 kB RssAnon: 5224 kB RssAnon: 5608 kB RssAnon: 6120 kB RssAnon: 6504 kB RssAnon: 6888 kB RssAnon: 7272 kB RssAnon: 7656 kB RssAnon: 8040 kB RssAnon: 8424 kB With fix: $ ./python t.py RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB RssAnon: 4376 kB ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 15:33:53 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Apr 2017 19:33:53 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491939233.83.0.129948234332.issue29870@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- pull_requests: +1229 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 16:00:14 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Apr 2017 20:00:14 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491940814.76.0.311446125381.issue29870@psf.upfronthosting.co.za> Christian Heimes added the comment: Antoine, you might find multissl.py helpful. I wrote a script to automate testing with multiple versions of OpenSSL and libressl. The first time it takes about half an hour to download, compile and install all versions locally. https://github.com/tiran/multissl/blob/master/multissl.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 16:28:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 11 Apr 2017 20:28:24 +0000 Subject: [issue30045] Bad parameter name in re.escape() Message-ID: <1491942504.65.0.615945582018.issue30045@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Currently re.escape() parameter has a name "pattern", but in the documentation the name of the parameter is "string". The name "pattern" is not correct, and maybe even misleading. The argument of escape() is not a pattern, it is an arbitrary string, and escape() makes a pattern from it by escaping special characters. It is unlikely that the argument is passed to re.escape() by keyword. Therefore renaming it to "string" shouldn't break existing code. ---------- components: Regular Expressions messages: 291514 nosy: ezio.melotti, mrabarnett, r.david.murray, serhiy.storchaka priority: normal severity: normal status: open title: Bad parameter name in re.escape() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 16:40:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 11 Apr 2017 20:40:51 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1491943251.34.0.748662840027.issue30030@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Merged in f50354adaaafebe95ad09d09b825804a686ea843. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 16:41:55 2017 From: report at bugs.python.org (Thomas Lotze) Date: Tue, 11 Apr 2017 20:41:55 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC Message-ID: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> New submission from Thomas Lotze: A csv.writer with quoting=csv.QUOTE_NONNUMERIC does not quote boolean values, which makes a csv.reader with the same quoting behaviour fail on that value: -------- csv.py ---------- import csv import io f = io.StringIO() writer = csv.writer(f, quoting=csv.QUOTE_NONNUMERIC) writer.writerow(['asdf', 1, True]) f.seek(0) reader = csv.reader(f, quoting=csv.QUOTE_NONNUMERIC) for row in reader: print(row) ---------------------- $ python3 csvbug.py Traceback (most recent call last): File "csvbug.py", line 12, in for row in reader: ValueError: could not convert string to float: 'True' ---------------------- I'd consider this inconsistency a bug, but in any case something that needs documenting. ---------- components: Library (Lib) messages: 291516 nosy: tlotze priority: normal severity: normal status: open title: csv: Inconsistency re QUOTE_NONNUMERIC type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 17:23:34 2017 From: report at bugs.python.org (Simon Percivall) Date: Tue, 11 Apr 2017 21:23:34 +0000 Subject: [issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs In-Reply-To: <1491214874.69.0.0315417893192.issue29966@psf.upfronthosting.co.za> Message-ID: <1491945814.03.0.202540956309.issue29966@psf.upfronthosting.co.za> Simon Percivall added the comment: It think it's important to document this caveat in `get_type_hints`, that there is virtually _no_ way to use it safely with a class, and that there will always be a high risk of getting an exception unless using this function in a highly controlled setting. This also, as a consequence, means that there is no "best-effort" support for collecting type hints from a class hierarchy, and every instance of trying to use this function with classes, or traversing __annotations__ "manually", will need to be solved ad-hoc and from scratch by the user (until someone publishes a "typing-utils" package on PyPI). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 18:07:02 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 11 Apr 2017 22:07:02 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1491948422.49.0.0933460481549.issue29870@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Antoine, you might find multissl.py helpful. Very nice, thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 18:38:10 2017 From: report at bugs.python.org (Steve Dower) Date: Tue, 11 Apr 2017 22:38:10 +0000 Subject: [issue29994] site.USER_SITE is None for Windows embeddable Python 3.6 In-Reply-To: <1491388582.7.0.185144058431.issue29994@psf.upfronthosting.co.za> Message-ID: <1491950290.16.0.532151819638.issue29994@psf.upfronthosting.co.za> Steve Dower added the comment: This is by design - the embeddable Python is meant to exclude anything relating to the current user by default. If you're looking for a lightweight Python install that you can use for things like building or managing packages, you may be interested in the Nuget packages - see https://www.nuget.org/packages?q=publisher%3A%22Python+Software+Foundation%22 ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 19:22:47 2017 From: report at bugs.python.org (OSAMU NAKAMURA) Date: Tue, 11 Apr 2017 23:22:47 +0000 Subject: [issue30047] Typos in Doc/library/select.rst Message-ID: <1491952967.06.0.143723768718.issue30047@psf.upfronthosting.co.za> New submission from OSAMU NAKAMURA: In 18.3.2. Edge and Level Trigger Polling (epoll) Objects, there is duplicated 'on' in description of `EPOLLEXCLUSIVE`. Wake only ... objects polling on on a fd. ^^^^^ ---------- assignee: docs at python components: Documentation messages: 291520 nosy: OSAMU.NAKAMURA, docs at python priority: normal severity: normal status: open title: Typos in Doc/library/select.rst versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 19:27:13 2017 From: report at bugs.python.org (OSAMU NAKAMURA) Date: Tue, 11 Apr 2017 23:27:13 +0000 Subject: [issue30047] Typos in Doc/library/select.rst In-Reply-To: <1491952967.06.0.143723768718.issue30047@psf.upfronthosting.co.za> Message-ID: <1491953233.19.0.719454234495.issue30047@psf.upfronthosting.co.za> Changes by OSAMU NAKAMURA : ---------- pull_requests: +1230 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 20:06:48 2017 From: report at bugs.python.org (INADA Naoki) Date: Wed, 12 Apr 2017 00:06:48 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1491955608.2.0.598746051041.issue30040@psf.upfronthosting.co.za> INADA Naoki added the comment: > I mean creating a solo empty dict doesn't seem to make much sense. Although it saves memory, but when it's populated, it's resized and the memory occupation comes back. But sometimes it's not populated. class A: def __init__(self, **kwargs): self._extra = kwargs xa = [A() for _ in range(1000)] So problem is (a) how many empty dicts, and (b) how much memory this patch saves. > And this makes PyDict_New() hard to understand. :-( Yes, but it is not new complexity because it's same to d.clear(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 20:11:24 2017 From: report at bugs.python.org (Evgeny Kapun) Date: Wed, 12 Apr 2017 00:11:24 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored Message-ID: <1491955884.31.0.0746508313156.issue30048@psf.upfronthosting.co.za> New submission from Evgeny Kapun: If I run this code: import asyncio as a @a.coroutine def coro1(): yield from a.ensure_future(coro2()) print("Still here") yield from a.sleep(1) print("Still here 2") @a.coroutine def coro2(): yield from a.sleep(1) res = task.cancel() print("Canceled task:", res) loop = a.get_event_loop() task = a.ensure_future(coro1()) loop.run_until_complete(task) I expect the task to stop shortly after a call to cancel(). It should surely stop when I try to sleep(). But it doesn't. On my machine this prints: Canceled task: True Still here Still here 2 So, cancel() returns True, but the task doesn't seem to be canceled. ---------- components: asyncio messages: 291522 nosy: abacabadabacaba, yselivanov priority: normal severity: normal status: open title: If a task is canceled at the right moment, the cancellation is ignored type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 20:47:18 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 12 Apr 2017 00:47:18 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored In-Reply-To: <1491955884.31.0.0746508313156.issue30048@psf.upfronthosting.co.za> Message-ID: <1491958038.04.0.293406998685.issue30048@psf.upfronthosting.co.za> Yury Selivanov added the comment: Interesting. It doesn't work for both C and Python versions of the Task. I'll take a look in detail when I return from vacation. ---------- assignee: -> yselivanov nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 21:31:35 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 Apr 2017 01:31:35 +0000 Subject: [issue30045] Bad parameter name in re.escape() In-Reply-To: <1491942504.65.0.615945582018.issue30045@psf.upfronthosting.co.za> Message-ID: <1491960695.92.0.355131823773.issue30045@psf.upfronthosting.co.za> Raymond Hettinger added the comment: "Pattern" seems right to me. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 21:34:38 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 12 Apr 2017 01:34:38 +0000 Subject: [issue29933] asyncio: set_write_buffer_limits() doc doesn't specify unit of the parameters In-Reply-To: <1490707139.27.0.838851028066.issue29933@psf.upfronthosting.co.za> Message-ID: <1491960878.64.0.355953806603.issue29933@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- assignee: docs at python -> Mariatta nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 21:34:47 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 12 Apr 2017 01:34:47 +0000 Subject: [issue29933] asyncio: set_write_buffer_limits() doc doesn't specify unit of the parameters In-Reply-To: <1490707139.27.0.838851028066.issue29933@psf.upfronthosting.co.za> Message-ID: <1491960887.73.0.755488815292.issue29933@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 22:13:39 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Wed, 12 Apr 2017 02:13:39 +0000 Subject: [issue30038] Race condition in how trip_signal writes to wakeup fd In-Reply-To: <1491901883.05.0.966298195873.issue30038@psf.upfronthosting.co.za> Message-ID: <1491963219.18.0.714511806327.issue30038@psf.upfronthosting.co.za> Nathaniel Smith added the comment: The attached script wakeup-fd-racer.py fails consistently for me using cpython 3.6.0 on my windows 10 vm: > python wakeup-fd-racer.py Attempt 0: start Attempt 0: FAILED, took 10.016000000000076 seconds select_calls = 2 (It may help that the VM only has 1 CPU? But the same test passes on Linux even when I use taskset to restrict it to 1 cpu. Maybe Windows has some scheduling heuristic where one thread writing to a socket when another thread is blocked on it triggers an immediate context switch.) ---------- Added file: http://bugs.python.org/file46797/wakeup-fd-racer.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 11 23:52:33 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 12 Apr 2017 03:52:33 +0000 Subject: [issue26985] Information about CodeType in inspect documentation is outdated In-Reply-To: <1462803102.24.0.542356144335.issue26985@psf.upfronthosting.co.za> Message-ID: <1491969153.55.0.0976712999548.issue26985@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- type: behavior -> versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 00:02:31 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 12 Apr 2017 04:02:31 +0000 Subject: [issue29642] Why does unittest.TestLoader.discover still rely on existence of __init__.py files? In-Reply-To: <1487954925.89.0.910316575912.issue29642@psf.upfronthosting.co.za> Message-ID: <1491969751.67.0.70507134387.issue29642@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 03:45:33 2017 From: report at bugs.python.org (Brecht Machiels) Date: Wed, 12 Apr 2017 07:45:33 +0000 Subject: [issue29994] site.USER_SITE is None for Windows embeddable Python 3.6 In-Reply-To: <1491388582.7.0.185144058431.issue29994@psf.upfronthosting.co.za> Message-ID: <1491983133.93.0.135938436908.issue29994@psf.upfronthosting.co.za> Brecht Machiels added the comment: I see. In that case I think pip should be able to handle the case when site.USER_SITE is None. I have created a ticket here: https://github.com/pypa/pip/issues/4437. I am using the embeddable Python what's it intended for, to make a self-contained distribution of my application (using pynsist). I'm using pip to install optional resources (fonts). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 04:06:22 2017 From: report at bugs.python.org (Frank Blankenburg) Date: Wed, 12 Apr 2017 08:06:22 +0000 Subject: [issue27400] Datetime NoneType after calling Py_Finalize and Py_Initialize In-Reply-To: <1467035358.55.0.678180807375.issue27400@psf.upfronthosting.co.za> Message-ID: <1491984382.81.0.131611958591.issue27400@psf.upfronthosting.co.za> Changes by Frank Blankenburg : ---------- nosy: +FrankBlabu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 04:16:22 2017 From: report at bugs.python.org (Armin Rigo) Date: Wed, 12 Apr 2017 08:16:22 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1491984982.84.0.0599660512541.issue29694@psf.upfronthosting.co.za> Armin Rigo added the comment: Update: a review didn't show any other similar problems (pathlib.py is a thin layer after all). Applied the fix and test (x2.diff) inside PyPy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 04:18:02 2017 From: report at bugs.python.org (INADA Naoki) Date: Wed, 12 Apr 2017 08:18:02 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored In-Reply-To: <1491955884.31.0.0746508313156.issue30048@psf.upfronthosting.co.za> Message-ID: <1491985082.51.0.591586853825.issue30048@psf.upfronthosting.co.za> INADA Naoki added the comment: When task.cancel() called, CancelledError is thrown to coro2. But coro2 doesn't call `yield from` after task.cancel(). So the exception is never raised. If you add `yield from` after `task.cancel()`, the script runs expected. --- $ cat at.py import asyncio as a @a.coroutine def coro1(): yield from a.ensure_future(coro2()) print("Still here") yield from a.sleep(.1) print("Still here 2") @a.coroutine def coro2(): yield from a.sleep(.1) res = task.cancel() print("Canceled task:", res) yield from a.sleep(.1) # !!! added this line loop = a.get_event_loop() task = a.ensure_future(coro1()) loop.run_until_complete(task) $ ./python.exe at.py Canceled task: True Traceback (most recent call last): File "at.py", line 19, in loop.run_until_complete(task) File "/Users/inada-n/work/python/cpython/Lib/asyncio/base_events.py", line 465, in run_until_complete return future.result() concurrent.futures._base.CancelledError ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 04:29:49 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 12 Apr 2017 08:29:49 +0000 Subject: [issue13285] signal module ignores external signal changes In-Reply-To: <1319801278.56.0.946220269602.issue13285@psf.upfronthosting.co.za> Message-ID: <1491985789.97.0.994253305875.issue13285@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: Ping? I'll try to implement this in cysignals (which is more difficult than doing it in CPython because I cannot access all internals of the Python signal module). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 04:39:23 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 08:39:23 +0000 Subject: [issue30049] Don't cache tp_iternext Message-ID: <1491986363.23.0.567694316296.issue30049@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Some operations cache the value of the tp_iternext slot and call it in a loop. But calling tp_iternext can run arbitrary code, release GIL and change the tp_iternext slot in the same or other thread. This can leads to visible behavior difference, such as different iterated values, different raised exceptions or infinite loop. In the past this even could cause a crash (see issue3720), but seems now this is impossible. Examples (list constructor caches tp_iternext, tuple constructor doesn't): >>> def make_iter(): ... class Iterator: ... def __iter__(self): ... return self ... def __next__(self): ... del Iterator.__next__ ... return 1 ... return Iterator() ... >>> tuple(make_iter()) Traceback (most recent call last): File "", line 1, in TypeError: 'Iterator' object is not iterable >>> list(make_iter()) Traceback (most recent call last): File "", line 1, in AttributeError: __next__ >>> >>> def make_iter2(): ... it2 = iter((2,)) ... def subiter(): ... Iterator.__next__ = Iterator.next2 ... yield 1 ... class Iterator(filter): ... def next2(self): ... return next(it2) ... return Iterator(lambda x: True, subiter()) ... >>> tuple(make_iter2()) (1, 2) >>> list(make_iter2()) [1] The tp_iternext is cached for performance, and removing the caching can cause performance regression. But actually the difference is very small. I found a measurable difference (up to 5%) only in following artificial examples in which tp_iternext is called in very tight and long loops: $ ./python -m perf timeit --compare-to ./python-orig -s 'a = [0]*1000000+[1]' -- 'next(filter(None, a))'python-orig: ..................... 47.2 ms +- 0.2 ms python: ..................... 49.7 ms +- 0.3 ms Mean +- std dev: [python-orig] 47.2 ms +- 0.2 ms -> [python] 49.7 ms +- 0.3 ms: 1.05x slower (+5%) $ ./python -m perf timeit --compare-to ./python-orig -s 'from itertools import repeat, islice' -- 'next(islice(repeat(1), 1000000, None))' python-orig: ..................... 15.4 ms +- 0.1 ms python: ..................... 16.0 ms +- 0.2 ms Mean +- std dev: [python-orig] 15.4 ms +- 0.1 ms -> [python] 16.0 ms +- 0.2 ms: 1.04x slower (+4%) $ ./python -m perf timeit --compare-to ./python-orig -s 'from itertools import repeat; from collections import deque' -- 'deque(repeat(1, 1000000), 0)' python-orig: ..................... 14.2 ms +- 0.1 ms python: ..................... 14.8 ms +- 0.2 ms Mean +- std dev: [python-orig] 14.2 ms +- 0.1 ms -> [python] 14.8 ms +- 0.2 ms: 1.05x slower (+5%) In all other other cases, when involved creation of a collection (list, bytearray, deque (with maxlen != 0) constructors, ''.join), or calling other code (builtins all, max, map, itertools functions), or for shorter loops the difference is hardly distinguished from the random noise. $ ./python -m perf timeit --compare-to ./python-orig -s 'a = [0]*1000' -- 'list(iter(a))' python-orig: ..................... 31.8 us +- 0.3 us python: ..................... 31.8 us +- 0.4 us Mean +- std dev: [python-orig] 31.8 us +- 0.3 us -> [python] 31.8 us +- 0.4 us: 1.00x faster (-0%) Not significant! $ ./python -m perf timeit --compare-to ./python-orig -s 'a = [1]*1000' -- 'all(a)' python-orig: ..................... 47.4 us +- 0.2 us python: ..................... 48.0 us +- 0.3 us Mean +- std dev: [python-orig] 47.4 us +- 0.2 us -> [python] 48.0 us +- 0.3 us: 1.01x slower (+1%) $ ./python -m perf timeit --compare-to ./python-orig -s 'a = [1]*1000' -- 'max(a)' python-orig: ..................... 108 us +- 1 us python: ..................... 108 us +- 1 us Mean +- std dev: [python-orig] 108 us +- 1 us -> [python] 108 us +- 1 us: 1.00x faster (-0%) Not significant! $ ./python -m perf timeit --compare-to ./python-orig -s 'a = [0]*1000000+[1]' -- 'next(filter(lambda x: x, a))' python-orig: ..................... 527 ms +- 8 ms python: ..................... 528 ms +- 2 ms Mean +- std dev: [python-orig] 527 ms +- 8 ms -> [python] 528 ms +- 2 ms: 1.00x slower (+0%) Not significant! $ ./python -m perf timeit --compare-to ./python-orig -s 'from itertools import repeat, islice' -- 'next(islice(repeat(1), 100, None))' python-orig: ..................... 4.72 us +- 0.05 us python: ..................... 4.72 us +- 0.04 us Mean +- std dev: [python-orig] 4.72 us +- 0.05 us -> [python] 4.72 us +- 0.04 us: 1.00x faster (-0%) Not significant! $ ./python -m perf timeit --compare-to ./python-orig -s 'from itertools import repeat; from collections import deque' -- 'deque(repeat(1, 100), 0)' python-orig: ..................... 4.16 us +- 0.11 us python: ..................... 4.11 us +- 0.05 us Mean +- std dev: [python-orig] 4.16 us +- 0.11 us -> [python] 4.11 us +- 0.05 us: 1.01x faster (-1%) ---------- components: Extension Modules, Interpreter Core messages: 291530 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Don't cache tp_iternext type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 04:46:32 2017 From: report at bugs.python.org (INADA Naoki) Date: Wed, 12 Apr 2017 08:46:32 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored In-Reply-To: <1491955884.31.0.0746508313156.issue30048@psf.upfronthosting.co.za> Message-ID: <1491986792.0.0.939317017155.issue30048@psf.upfronthosting.co.za> INADA Naoki added the comment: This behavior is documented as: https://docs.python.org/3.6/library/asyncio-task.html#asyncio.Task.cancel > Unlike Future.cancel(), this does not guarantee that the task will be cancelled: the exception might be caught and acted upon, delaying cancellation of the task or preventing cancellation completely. The task may also return a value or raise a different exception. > > Immediately after this method is called, cancelled() will not return True (unless the task was already cancelled). A task will be marked as cancelled when the wrapped coroutine terminates with a CancelledError exception (even if cancel() was not called). I agree that this behavior is somewhat surprising. But I don't know how can I fix the behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 04:47:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 08:47:13 +0000 Subject: [issue30049] Don't cache tp_iternext In-Reply-To: <1491986363.23.0.567694316296.issue30049@psf.upfronthosting.co.za> Message-ID: <1491986833.39.0.811296367849.issue30049@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1231 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 04:54:33 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Wed, 12 Apr 2017 08:54:33 +0000 Subject: [issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows Message-ID: <1491987273.45.0.570112423464.issue30050@psf.upfronthosting.co.za> New submission from Nathaniel Smith: When a wakeup fd is registered via signal.set_wakeup_fd, then the C level signal handler writes a byte to the wakeup fd on each signal received. If this write fails, then it prints an error message to the console. Some projects use the wakeup fd as a way to see which signals have occurred (asyncio, curio). Others use it only as a toggle for "a wake up is needed", and transmit the actual data out-of-line (twisted, tornado, trio ? I guess it has something to do with the letter "t"). One way that writing to the wakeup fd can fail is if the pipe or socket's buffer is already full, in which case we get EWOULDBLOCK or WSAEWOULDBLOCK. For asyncio/curio, this is a problem: it indicates a lost signal! Printing to the console isn't a great solution, but it's better than letting the error pass silently. For twisted/tornado/trio, this is a normal and expected thing ? the semantics we want are that after a signal is received then the fd will be readable, and if its buffer is full then it's certainly readable! So for them, EWOULDBLOCK/WSAEWOULDBLOCK are *success* conditions. Yet currently, the signal module insists on printing a scary message to the console whenever we succeed in this way. It would be nice if there were a way to disable this; perhaps something like: signal.set_wakeup_fd(fd, warn_on_full_buffer=False) This is particularly annoying for trio, because I try to minimize the size of the wakeup fd's send buffer to avoid wasting non-swappable kernel memory on what's essentially an overgrown bool. This ends up meaning that on Linux the buffer is 6 bytes, and on MacOS it's 1 byte. So currently I don't use the wakeup fd on Linux/MacOS, which is *mostly* OK but it would be better if we could use it. Trio bug with a few more details: https://github.com/python-trio/trio/issues/109 ---------- messages: 291532 nosy: haypo, njs priority: normal severity: normal status: open title: Please provide a way to disable the warning printed if the signal module's wakeup fd overflows versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:12:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 09:12:54 +0000 Subject: [issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows In-Reply-To: <1491987273.45.0.570112423464.issue30050@psf.upfronthosting.co.za> Message-ID: <1491988374.15.0.108733852924.issue30050@psf.upfronthosting.co.za> STINNER Victor added the comment: > One way that writing to the wakeup fd can fail is if the pipe or socket's buffer is already full, in which case we get EWOULDBLOCK or WSAEWOULDBLOCK. Is it a theorical question or did you notice the error in the wild? I mean: without sending a signal in a loop. Right now, we write the signal number into the pipe each time a signal is received. Do you need to get N bytes if the signal is received N times? Maybe we can use a flag and only write the byte once by signal number? > Printing to the console isn't a great solution, but it's better than letting the error pass silently. If the pipe becomes full, you loose signals: it's an hard error. I decided to log an error into fd 2 because in a signal handler, the number of allowed functions is very limited. I suggest to have a flag to remind if the pipe overflowed, and in that case: schedule a Python callback. The callback can be a new parameter to set_wakeup_fd()? A pipe seems limited to 64 KB, limit hardcoded in Linux kernel code. Is it the case if we use a socket pair, as we already do on Windows? Or is it possible to increase the socket buffer size? > This is particularly annoying for trio, because I try to minimize the size of the wakeup fd's send buffer to avoid wasting non-swappable kernel memory on what's essentially an overgrown bool. asyncio uses wakeup fd to get signal numbers: it's not only a bool. See the issue #21645 for the rationale of using the FD to get signal numbers in asyncio. It was a bool on Python 2 which only writes NUL bytes into the FD. Related question: does asyncio support signals on Windows? I added support for set_wakeup_fd() to Windows for asyncio, but then I forgot this TODO item :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:24:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 09:24:49 +0000 Subject: [issue30051] Document that the random module doesn't support fork Message-ID: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> New submission from STINNER Victor: When reviewing the issue #30030, it reminded me that the random module "doesn't support fork": after fork, the parent and the child produce the same "random" number sequence. I suggest to add a quick note about that: not a warning, just a note, as a reminder. There is an exception: SystemRandom produces a different sequence after fork, since it uses os.urandom() (which runs in the kernel). I am tempted to propose a solution in the note like using SystemRandom, but I'm not sure that it's a good idea. Some users may misunderstood the note and always use SystemRandom where random.Random is just fine for their needs. Proposed note: The random module doesn't support fork: the parent and the child process will produce the same number sequence. Proposed solution: If your code uses os.fork(), a workaround is to check if os.getpid() changes and in that case, create a new Random instance or reseed the RNG in the child process. -- The tempfile module reminds the pid and instanciates a new RNG on fork. Another option is to not add a note, but implement the workaround directly into the random module. But I don't think that it's worth it. Forking is a rare usecase, and calling os.getpid() may slowdown the random module. (I don't recall if os.getpid() requires a syscall or not, I'm quite sure that it's optimized at least on Linux to avoid a real syscall.) ---------- messages: 291534 nosy: haypo priority: normal severity: normal status: open title: Document that the random module doesn't support fork versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:25:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 09:25:27 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1491989127.89.0.48532128513.issue30030@psf.upfronthosting.co.za> STINNER Victor added the comment: After reviewing the change, I created the issue #30051: "Document that the random module doesn't support fork". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:26:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 09:26:23 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> Message-ID: <1491989183.31.0.959185022856.issue30051@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:28:27 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Wed, 12 Apr 2017 09:28:27 +0000 Subject: [issue30050] Please provide a way to disable the warning printed if the signal module's wakeup fd overflows In-Reply-To: <1491987273.45.0.570112423464.issue30050@psf.upfronthosting.co.za> Message-ID: <1491989307.2.0.926721461335.issue30050@psf.upfronthosting.co.za> Nathaniel Smith added the comment: I haven't noticed the error in the wild because I don't use set_wakeup_fd on Linux/MacOS, because of this issue :-). But on MacOS literally all it would take is to receive two signals in quick succession, or to receive one signal at a moment when someone has recently scheduled a callback from a thread (which also writes to the wakeup fd). In principle it can also happen on Windows, but on Windows apparently the smallest buffer you get for a socketpair is like 500 kilobytes, so it doesn't come up except in rather artificial situations. And yes, a possible workaround is to use an artificially large buffer on Linux/MacOS as well. I'm not saying this is a huge showstopper. But it's silly for downstream libraries to carry around workarounds for issues in CPython when we could just fix CPython. > If the pipe becomes full, you loose signals: it's an hard error. I decided to log an error into fd 2 because in a signal handler, the number of allowed functions is very limited. This makes sense for asyncio, but not for most other async libraries in Python, because they *don't* lose signals when the pipe becomes full. That's why I'm suggesting that the signal module should have an option to let users decide whether they want the warning or not. (It might also make sense to switch asyncio to stop using the fd as a communications channel. Theoretically this would be the ideal solution, but I understand why it's not a priority.) > Related question: does asyncio support signals on Windows? I added support for set_wakeup_fd() to Windows for asyncio, but then I forgot this TODO item :-) No, asyncio doesn't use set_wakeup_fd on Windows, so code like 'loop.run_until_complete(asyncio.sleep(99999))' can't be interrupted. I'd appreciate if you could wait a few days to fix this though, because the blog post that I'm almost finished writing about signal handling currently uses this as an example of how trio is more awesome than asyncio ;-). (This is a joke. Well, I mean, mostly. My draft does literally have that sleep example in it, but I won't be grumpy if you fix it first. Or at least, not *very* grumpy :-).) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:30:03 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 12 Apr 2017 09:30:03 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> Message-ID: <1491989403.01.0.571368120939.issue30051@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'm not sure that's necessary. fork() is a low-level primitive, people can/should use multiprocessing.Process instead, which does re-seed the PRNG. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:31:51 2017 From: report at bugs.python.org (INADA Naoki) Date: Wed, 12 Apr 2017 09:31:51 +0000 Subject: [issue29178] Adding bytes.frombuffer(byteslike) constructor In-Reply-To: <1483701377.3.0.893514886442.issue29178@psf.upfronthosting.co.za> Message-ID: <1491989511.93.0.0170703770214.issue29178@psf.upfronthosting.co.za> INADA Naoki added the comment: FYI, Tornado 4.5b switched buffer implementation from deque-of-bytes to bytearray like asyncio. I sent PR for fixing "unreleased memoryview". https://github.com/tornadoweb/tornado/pull/2008 This is common pitfall when implementing buffer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:40:59 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 12 Apr 2017 09:40:59 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1491990059.72.0.751756404272.issue29694@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1232 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:48:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 09:48:16 +0000 Subject: [issue29995] re.escape() escapes too much In-Reply-To: <1491401871.1.0.717928370576.issue29995@psf.upfronthosting.co.za> Message-ID: <1491990496.84.0.748136125916.issue29995@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka dependencies: +Add examples for re.escape() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:48:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 09:48:32 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1491990512.81.0.112237990392.issue30021@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: docs at python -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 05:48:43 2017 From: report at bugs.python.org (Armin Rigo) Date: Wed, 12 Apr 2017 09:48:43 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1491990523.11.0.990287080679.issue29694@psf.upfronthosting.co.za> Armin Rigo added the comment: https://github.com/python/cpython/pull/1089 (I fixed the problem with my CLA check. Now https://cpython-devguide.readthedocs.io/pullrequest.html#licensing says "you can ask for the CLA check to be run again" but doesn't tell how to do that, so as far as I can tell, I have to ask e.g. here.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 06:02:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 10:02:53 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989403.01.0.571368120939.issue30051@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > I'm not sure that's necessary. Do you mean that adding a note is not necessary? Or proposing a solution in the note? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 06:04:48 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 12 Apr 2017 10:04:48 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> Message-ID: <1491991488.06.0.0116776069287.issue30051@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I mean mentioning fork(), which people usually don't call directly, is not necessary, so, indeed, a note isn't necessary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 06:10:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 10:10:17 +0000 Subject: [issue29881] Add a new private API clear private variables, which are initialized once, at Python shutdown In-Reply-To: <1490201009.64.0.544065179107.issue29881@psf.upfronthosting.co.za> Message-ID: <1491991817.23.0.0672526348149.issue29881@psf.upfronthosting.co.za> STINNER Victor added the comment: I dislike _Py_SET_FINALIZED and _Py_SET_ONCE name. I prefer to mention an "initialization" because it's a common pattern in programming and it is known that it only requires to be done once. _PY_ONCEVAR_INIT() macro is unusual: it only evaluate the second parameter parameter, a C expression, if the variable is not initialized yet. Py_SETREF() is different because it always evaluates its second argument, and in most cases, the second argument is an existing variable and not an expression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 06:16:47 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 12 Apr 2017 10:16:47 +0000 Subject: [issue26985] Information about CodeType in inspect documentation is outdated In-Reply-To: <1462803102.24.0.542356144335.issue26985@psf.upfronthosting.co.za> Message-ID: <1491992207.65.0.434771341455.issue26985@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1233 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 06:30:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 10:30:42 +0000 Subject: [issue30047] Typos in Doc/library/select.rst In-Reply-To: <1491952967.06.0.143723768718.issue30047@psf.upfronthosting.co.za> Message-ID: <1491993042.65.0.922183431552.issue30047@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3e0f1fc4e0ffcfcc706015fa3d67c262948ef171 by Serhiy Storchaka (NAKAMURA Osamu) in branch 'master': bpo-30047: Fix a typo in Doc/library/select.rst (#1086) https://github.com/python/cpython/commit/3e0f1fc4e0ffcfcc706015fa3d67c262948ef171 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 06:36:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 10:36:32 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> Message-ID: <1491993392.11.0.681781373499.issue30051@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think it is worth documenting. Even if multiprocessing reseeds the module-global random generator, it doesn't reseed other instances of Random. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 06:42:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 10:42:12 +0000 Subject: [issue29881] Add a new private API clear private variables, which are initialized once, at Python shutdown In-Reply-To: <1490201009.64.0.544065179107.issue29881@psf.upfronthosting.co.za> Message-ID: <1491993732.9.0.368132649848.issue29881@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What if use the term "singleton"? It includes "initialize once" and "finalize at shutdown" meanings. _Py_INIT_SINGLETON() or _Py_SET_SINGLETON()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 07:07:10 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 12 Apr 2017 11:07:10 +0000 Subject: [issue30049] Don't cache tp_iternext In-Reply-To: <1491986363.23.0.567694316296.issue30049@psf.upfronthosting.co.za> Message-ID: <1491995230.47.0.585758132913.issue30049@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 08:49:34 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 12 Apr 2017 12:49:34 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion Message-ID: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> New submission from Cheryl Sabella: On the URL Quoting page, the following line: `string may be either a str or a bytes.` Has the `str` link to: https://docs.python.org/3/library/stdtypes.html#str But the `bytes` link to: https://docs.python.org/3/library/functions.html#bytes Should the `bytes` link to? https://docs.python.org/3/library/stdtypes.html#bytes ---------- assignee: docs at python components: Documentation messages: 291546 nosy: csabella, docs at python priority: normal severity: normal status: open title: URL Quoting page links to function Bytes instead of defintion versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 08:50:48 2017 From: report at bugs.python.org (Brecht Machiels) Date: Wed, 12 Apr 2017 12:50:48 +0000 Subject: [issue30053] Problems building with --enable-profiling on macOS Message-ID: <1492001446.82.0.198717177169.issue30053@psf.upfronthosting.co.za> New submission from Brecht Machiels: The python.exe produced during the build process is somehow broken: $ ./python.exe -S Killed: 9 Strangely, it works when run from gdb: $ gdb -args ./python.exe -S GNU gdb (GDB) 7.12.1 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-apple-darwin16.3.0". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./python.exe...done. (gdb) start Temporary breakpoint 1 at 0x10000109c: file ../Programs/python.c, line 28. Starting program: /Users/brechtm/Documents/Code/cpython/profile/python.exe -S [New Thread 0x1403 of process 62753] warning: unhandled dyld version (15) Thread 2 hit Temporary breakpoint 1, main (argc=2, argv=0x7fff5bfff460) at ../Programs/python.c:28 28 (void)_PyMem_SetupAllocators("malloc"); (gdb) c Continuing. Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Python 3.7.0a0 (heads/master:3e0f1fc4e0, Apr 12 2017, 14:39:47) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.41)] on darwin Module readline not available. >>> ^D [Inferior 1 (process 62753) exited normally] (gdb) q I'm running macOS Sierra 10.12.4 (16E195) and XCode 8.3.1. $ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.41) Target: x86_64-apple-darwin16.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin Forcing the use of the Homebrew-provided GCC by invoking "make CC=gcc-6 CXX=g++-6" has the same result. $ gcc-6 --version gcc-6 (Homebrew GCC 6.3.0_1) 6.3.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The build is fine when --enable-profiling is not specified. ---------- components: macOS files: configure.txt messages: 291547 nosy: brechtm, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Problems building with --enable-profiling on macOS type: compile error versions: Python 3.7 Added file: http://bugs.python.org/file46798/configure.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 08:50:48 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 12 Apr 2017 12:50:48 +0000 Subject: [issue13285] signal module ignores external signal changes In-Reply-To: <1319801278.56.0.946220269602.issue13285@psf.upfronthosting.co.za> Message-ID: <1492001448.94.0.843482243651.issue13285@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: I have a preliminary implementation (in the cysignals package) at https://github.com/sagemath/cysignals/pull/53 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 08:51:16 2017 From: report at bugs.python.org (Brecht Machiels) Date: Wed, 12 Apr 2017 12:51:16 +0000 Subject: [issue30053] Problems building with --enable-profiling on macOS In-Reply-To: <1492001446.82.0.198717177169.issue30053@psf.upfronthosting.co.za> Message-ID: <1492001476.88.0.32500437843.issue30053@psf.upfronthosting.co.za> Changes by Brecht Machiels : Added file: http://bugs.python.org/file46799/make.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 08:51:35 2017 From: report at bugs.python.org (Brecht Machiels) Date: Wed, 12 Apr 2017 12:51:35 +0000 Subject: [issue30053] Problems building with --enable-profiling on macOS In-Reply-To: <1492001446.82.0.198717177169.issue30053@psf.upfronthosting.co.za> Message-ID: <1492001495.09.0.337928711892.issue30053@psf.upfronthosting.co.za> Changes by Brecht Machiels : Added file: http://bugs.python.org/file46800/make_gcc.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:00:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 13:00:16 +0000 Subject: [issue30027] test_xml_etree and test_xml_etree_c fail due to AssertionError: unhandled warning DeprecationWarning In-Reply-To: <1491766618.38.0.276477637378.issue30027@psf.upfronthosting.co.za> Message-ID: <1492002016.89.0.320365169303.issue30027@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 65c5b096ac2c6608d296f1603cd4792086108c95 by Serhiy Storchaka in branch '2.7': bpo-30027: Fix Py3k warnings in test_xml_etree. (#1065) https://github.com/python/cpython/commit/65c5b096ac2c6608d296f1603cd4792086108c95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:01:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 13:01:33 +0000 Subject: [issue30027] test_xml_etree and test_xml_etree_c fail due to AssertionError: unhandled warning DeprecationWarning In-Reply-To: <1491766618.38.0.276477637378.issue30027@psf.upfronthosting.co.za> Message-ID: <1492002093.45.0.685536720658.issue30027@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:03:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 13:03:25 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1492002205.98.0.622429349821.issue30017@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 4c0d9ea995da595e90e08813b89510de59907802 by Serhiy Storchaka in branch 'master': bpo-30017: Allowed calling the close() method of the zip entry writer object (#1041) https://github.com/python/cpython/commit/4c0d9ea995da595e90e08813b89510de59907802 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:11:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 13:11:39 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1492002699.41.0.936507078775.issue30017@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1234 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:28:18 2017 From: report at bugs.python.org (Julian Taylor) Date: Wed, 12 Apr 2017 13:28:18 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1492003698.91.0.115899380341.issue26530@psf.upfronthosting.co.za> Julian Taylor added the comment: The api looks good to me. Works fine in numpy. ---------- nosy: +jtaylor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:29:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 13:29:39 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1492003779.27.0.240016070595.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: Julian Taylor: "The api looks good to me. Works fine in numpy." Cool! Should it be made public in that case? (Remove _ prefix and document it.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:38:55 2017 From: report at bugs.python.org (Julian Taylor) Date: Wed, 12 Apr 2017 13:38:55 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1492004335.4.0.783088033268.issue26530@psf.upfronthosting.co.za> Julian Taylor added the comment: I don't see any reason why not to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:42:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 13:42:25 +0000 Subject: [issue30054] Expose tracemalloc C API to track/untrack memory blocks Message-ID: <1492004545.36.0.222275200226.issue30054@psf.upfronthosting.co.za> New submission from STINNER Victor: The issue #26530 added a private C API to manually track/untrack memory blocks in tracemalloc. I was just validated by Julian Taylor who confirms that the API works as expected: http://bugs.python.org/issue26530#msg291551 So I propose to make the 3 newly added functions public and document them: * _PyTraceMalloc_Track() * _PyTraceMalloc_Untrack() * _PyTraceMalloc_GetTraceback() ---------- messages: 291554 nosy: haypo, jtaylor priority: normal severity: normal status: open title: Expose tracemalloc C API to track/untrack memory blocks type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:42:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 13:42:47 +0000 Subject: [issue26530] tracemalloc: add C API to manually track/untrack memory allocations In-Reply-To: <1457619430.68.0.0968942184372.issue26530@psf.upfronthosting.co.za> Message-ID: <1492004567.86.0.458075092834.issue26530@psf.upfronthosting.co.za> STINNER Victor added the comment: "I don't see any reason why not to.": Ok, I created the issue #30054. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:48:46 2017 From: report at bugs.python.org (Julian Taylor) Date: Wed, 12 Apr 2017 13:48:46 +0000 Subject: [issue30054] Expose tracemalloc C API to track/untrack memory blocks In-Reply-To: <1492004545.36.0.222275200226.issue30054@psf.upfronthosting.co.za> Message-ID: <1492004926.9.0.112888337863.issue30054@psf.upfronthosting.co.za> Julian Taylor added the comment: I am not sure if _PyTraceMalloc_GetTraceback really needs to be a public function. Exposing the tracing information should probably just go over python interfaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:59:26 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 12 Apr 2017 13:59:26 +0000 Subject: [issue29791] print documentation: flush is also a keyword argument In-Reply-To: <1489179993.27.0.31165504732.issue29791@psf.upfronthosting.co.za> Message-ID: <1492005566.72.0.835380268986.issue29791@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- pull_requests: +1235 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 09:59:58 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 12 Apr 2017 13:59:58 +0000 Subject: [issue29791] print documentation: flush is also a keyword argument In-Reply-To: <1489179993.27.0.31165504732.issue29791@psf.upfronthosting.co.za> Message-ID: <1492005598.9.0.589661996684.issue29791@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +berker.peksag stage: -> patch review type: enhancement -> behavior versions: +Python 3.5, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 10:11:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Apr 2017 14:11:10 +0000 Subject: [issue30054] Expose tracemalloc C API to track/untrack memory blocks In-Reply-To: <1492004545.36.0.222275200226.issue30054@psf.upfronthosting.co.za> Message-ID: <1492006270.75.0.399644010809.issue30054@psf.upfronthosting.co.za> STINNER Victor added the comment: What's the status in numpy? Is the current numpy release able to use CPython 3.6 tracemalloc private functions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 10:14:29 2017 From: report at bugs.python.org (Julian Taylor) Date: Wed, 12 Apr 2017 14:14:29 +0000 Subject: [issue30054] Expose tracemalloc C API to track/untrack memory blocks In-Reply-To: <1492004545.36.0.222275200226.issue30054@psf.upfronthosting.co.za> Message-ID: <1492006469.87.0.557855141298.issue30054@psf.upfronthosting.co.za> Julian Taylor added the comment: With this changeset it would: https://github.com/numpy/numpy/pull/8885 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 10:59:31 2017 From: report at bugs.python.org (Marco Buttu) Date: Wed, 12 Apr 2017 14:59:31 +0000 Subject: [issue30055] Missed testcleanup in decimal.rst Message-ID: <1492009171.7.0.643211980228.issue30055@psf.upfronthosting.co.za> New submission from Marco Buttu: The testsetup in Doc/library/decimal.rst is not enough for isolating the tests in respect to the other rst files. Currently we have the following testsetup, without a testcleanup: .. testsetup:: * import decimal import math from decimal import * # make sure each group gets a fresh context setcontext(Context()) Without a testcleanup, the changes on the context will affect the other files that use the context (like Doc/library/statistics.rst). We should better isolate the tests adding also a testcleanup: .. testcleanup:: * # make sure other tests (outside this file) get a fresh context setcontext(Context()) I am opening a PR. ---------- assignee: docs at python components: Documentation messages: 291559 nosy: docs at python, marco.buttu, skrah priority: normal severity: normal status: open title: Missed testcleanup in decimal.rst type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 11:11:52 2017 From: report at bugs.python.org (Marco Buttu) Date: Wed, 12 Apr 2017 15:11:52 +0000 Subject: [issue30055] Missed testcleanup in decimal.rst In-Reply-To: <1492009171.7.0.643211980228.issue30055@psf.upfronthosting.co.za> Message-ID: <1492009912.78.0.689556055751.issue30055@psf.upfronthosting.co.za> Changes by Marco Buttu : ---------- pull_requests: +1236 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 11:21:35 2017 From: report at bugs.python.org (Amy) Date: Wed, 12 Apr 2017 15:21:35 +0000 Subject: [issue30056] RuntimeWarning: invalid value encountered in maximum/minimum Message-ID: <1492010494.99.0.888369337557.issue30056@psf.upfronthosting.co.za> New submission from Amy: I just updated to numpy 1.12.1 and am getting this Runtime Warning when using numpy.minimum or numpy.maximum: RuntimeWarning: invalid value encountered in maximum Prior to updating, I was using numpy 1.10.x and had no issues running numpy.minimum or numpy.maximum ---------- messages: 291560 nosy: aching priority: normal severity: normal status: open title: RuntimeWarning: invalid value encountered in maximum/minimum type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 11:52:29 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 12 Apr 2017 15:52:29 +0000 Subject: [issue30057] signal.signal should check tripped signals Message-ID: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> New submission from Jeroen Demeyer: There is a race condition in calling signal.signal() if the signal arrives while (or right before) signal.signal() is being executed: the function signal.signal(sig, action) marks the signal "sig" as not tripped. Because of this, signals can get lost. Instead, it would be better to call PyErr_CheckSignals() to check for pending signals. ---------- components: Interpreter Core messages: 291561 nosy: jdemeyer priority: normal severity: normal status: open title: signal.signal should check tripped signals versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 12:34:03 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 12 Apr 2017 16:34:03 +0000 Subject: [issue30056] RuntimeWarning: invalid value encountered in maximum/minimum In-Reply-To: <1492010494.99.0.888369337557.issue30056@psf.upfronthosting.co.za> Message-ID: <1492014843.2.0.451529285817.issue30056@psf.upfronthosting.co.za> R. David Murray added the comment: Numpy is not part of the python standard library. You should report this issue to the numpy bug tracker, which appears to be here: https://github.com/numpy/numpy/issues. Or perhaps first ask the numpy community if this is really a bug: the new version might have fixed a bug in minimum/maximum that is now detecting a problem with your code that wasn't detected previously. ---------- nosy: +r.david.murray resolution: -> third party stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 12:54:05 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 12 Apr 2017 16:54:05 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1492016045.52.0.427304210094.issue30057@psf.upfronthosting.co.za> Changes by Jeroen Demeyer : ---------- keywords: +patch Added file: http://bugs.python.org/file46801/fix30057-py2.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 12:54:17 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 12 Apr 2017 16:54:17 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1492016057.47.0.369800274163.issue30057@psf.upfronthosting.co.za> Changes by Jeroen Demeyer : Added file: http://bugs.python.org/file46802/fix30057-py3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 13:13:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 17:13:38 +0000 Subject: [issue30058] Buffer overflow in kqueue.control() Message-ID: <1492017218.53.0.767201958064.issue30058@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The first parameter of kqueue.control() is documented as an iterable. But actually it should have a length. kqueue.control() uses PyObject_Size() for allocating an array and PyObject_GetIter()+PyIter_Next() for iterating kevent objects and filling the array. If the length and the iterator are not consistent this can lead to writing past the end of the array. ---------- components: Extension Modules, FreeBSD messages: 291563 nosy: koobs, serhiy.storchaka priority: normal severity: normal status: open title: Buffer overflow in kqueue.control() type: crash versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 13:13:44 2017 From: report at bugs.python.org (Steve Dower) Date: Wed, 12 Apr 2017 17:13:44 +0000 Subject: [issue29994] site.USER_SITE is None for Windows embeddable Python 3.6 In-Reply-To: <1491388582.7.0.185144058431.issue29994@psf.upfronthosting.co.za> Message-ID: <1492017224.91.0.49944878626.issue29994@psf.upfronthosting.co.za> Steve Dower added the comment: Yes, fixing pip in this case is the right approach. Since you're going to be including a copy of pip with your application, you can also just patch that yourself to get going while the pip team decides how to go from here. Or you could add a sitecustomize.py file (which will only be imported if you have "import site" in your ._pth file) that sets site.USER_SITE to something so that pip does not crash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 13:20:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 17:20:05 +0000 Subject: [issue30058] Buffer overflow in kqueue.control() In-Reply-To: <1492017218.53.0.767201958064.issue30058@psf.upfronthosting.co.za> Message-ID: <1492017605.55.0.20956558374.issue30058@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1237 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 13:21:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 17:21:44 +0000 Subject: [issue30058] Buffer overflow in kqueue.control() In-Reply-To: <1492017218.53.0.767201958064.issue30058@psf.upfronthosting.co.za> Message-ID: <1492017704.66.0.352361981787.issue30058@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Proposed patch presumably fixes the issue. But since this is *BSD specific I can't even check that it is compiled. ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 13:22:52 2017 From: report at bugs.python.org (Steve Dower) Date: Wed, 12 Apr 2017 17:22:52 +0000 Subject: [issue29994] site.USER_SITE is None for Windows embeddable Python 3.6 In-Reply-To: <1491388582.7.0.185144058431.issue29994@psf.upfronthosting.co.za> Message-ID: <1492017772.68.0.572414977992.issue29994@psf.upfronthosting.co.za> Steve Dower added the comment: Actually, I suspect you're not importing site on startup at all (which is great for performance), but that means that site.main() is not being run. I'll post more details on the pip bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 13:25:17 2017 From: report at bugs.python.org (Michael Seifert) Date: Wed, 12 Apr 2017 17:25:17 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis Message-ID: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> New submission from Michael Seifert: The "Py_Ellipsis" object is part of the public C-API but it isn't documented anywhere. It is defined in "sliceobject.o/.h" so I created a PR and added it to the "slice" documentation. ---------- assignee: docs at python components: Documentation messages: 291567 nosy: MSeifert, docs at python priority: normal pull_requests: 1238 severity: normal status: open title: No documentation for C type Py_Ellipsis type: enhancement versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 14:01:11 2017 From: report at bugs.python.org (Stephen Kelly) Date: Wed, 12 Apr 2017 18:01:11 +0000 Subject: [issue30060] Crash on Py_Finalize if Py_NoSiteFlag is used Message-ID: <1492020071.31.0.759008537591.issue30060@psf.upfronthosting.co.za> New submission from Stephen Kelly: When attempting to use PyImport_ImportModule("os") (or to import many other libraries), there is a crash on Py_Finalize if Py_NoSiteFlag is set. The issue appears to be the use of frozenset() as a result of importing the module. I reproduced this on Windows after building 2.7.13 with VS 2015 by applying the following patch: Python changes. --- Include\\fileobject.h +++ Include\\fileobject.h @@ -70,7 +70,7 @@ */ int _PyFile_SanitizeMode(char *mode); -#if defined _MSC_VER && _MSC_VER >= 1400 +#if defined _MSC_VER && _MSC_VER >= 1400 && _MSC_VER < 1900 /* A routine to check if a file descriptor is valid on Windows. Returns 0 * and sets errno to EBADF if it isn't. This is to avoid Assertions * from various functions in the Windows CRT beginning with --- Modules\\posixmodule.c +++ Modules\\posixmodule.c @@ -529,7 +529,7 @@ #endif -#if defined _MSC_VER && _MSC_VER >= 1400 +#if defined _MSC_VER && _MSC_VER >= 1400 && _MSC_VER < 1900 /* Microsoft CRT in VS2005 and higher will verify that a filehandle is * valid and raise an assertion if it isn't. * Normally, an invalid fd is likely to be a C program error and therefore --- Modules\\timemodule.c +++ Modules\\timemodule.c @@ -68,6 +70,9 @@ #if defined(MS_WINDOWS) && !defined(__BORLANDC__) /* Win32 has better clock replacement; we have our own version below. */ #undef HAVE_CLOCK +#define timezone _timezone +#define tzname _tzname +#define daylight _daylight #endif /* MS_WINDOWS && !defined(__BORLANDC__) */ #if defined(PYOS_OS2) Backtrace: KernelBase.dll!00007ff963466142() Unknown > python27_d.dll!Py_FatalError(const char * msg) Line 1700 C python27_d.dll!PyThreadState_Get() Line 332 C python27_d.dll!set_dealloc(_setobject * so) Line 553 C python27_d.dll!_Py_Dealloc(_object * op) Line 2263 C python27_d.dll!PySet_Fini() Line 1084 C python27_d.dll!Py_Finalize() Line 526 C mn.exe!main(int argc, char * * argv) Line 40 C [External Code] Reproducing code: #include int main(int argc, char** argv) { // http://www.awasu.com/weblog/embedding-python/threads // #### Comment this to avoid crash Py_NoSiteFlag = 1; Py_Initialize(); PyEval_InitThreads(); // nb: creates and locks the GIL // NOTE: We save the current thread state, and restore it when we unload, // so that we can clean up properly. PyThreadState* pMainThreadState = PyEval_SaveThread(); // nb: this also releases the GIL PyEval_AcquireLock(); // nb: get the GIL PyThreadState* pThreadState = Py_NewInterpreter(); assert(pThreadState != NULL); PyEval_ReleaseThread(pThreadState); // nb: this also releases the GIL PyEval_AcquireThread(pThreadState); // Can reproduce by importing the os module, but the issue actually appears // because of the use of frozenset, so simplify to that. #if 0 PyObject* osModule = PyImport_ImportModule("os"); Py_DECREF(osModule); #endif // As in abc.py ABCMeta class PyRun_SimpleString("abstractmethods = frozenset(set())"); PyEval_ReleaseThread(pThreadState); // release the interpreter PyEval_AcquireThread(pThreadState); // nb: this also locks the GIL Py_EndInterpreter(pThreadState); PyEval_ReleaseLock(); // nb: release the GIL // clean up PyEval_RestoreThread(pMainThreadState); // nb: this also locks the GIL Py_Finalize(); } ---------- components: Interpreter Core messages: 291568 nosy: steveire priority: normal severity: normal status: open title: Crash on Py_Finalize if Py_NoSiteFlag is used type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 14:48:44 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 12 Apr 2017 18:48:44 +0000 Subject: [issue30047] Typos in Doc/library/select.rst In-Reply-To: <1491952967.06.0.143723768718.issue30047@psf.upfronthosting.co.za> Message-ID: <1492022924.37.0.770233490075.issue30047@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: This needs backport, which I will do later today. Thanks. ---------- assignee: docs at python -> Mariatta nosy: +Mariatta stage: -> backport needed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 15:01:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 19:01:37 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492023697.21.0.723711036449.issue30059@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm wondering if it is worth to add a separate section for Ellipsis at the same level as "Slice Objects", but in the same file. See for example "Instance Method Objects" and "Method Objects" in method.rst. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 15:29:25 2017 From: report at bugs.python.org (Michael Seifert) Date: Wed, 12 Apr 2017 19:29:25 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492025365.84.0.349522597521.issue30059@psf.upfronthosting.co.za> Michael Seifert added the comment: > I'm wondering if it is worth to add a separate section for Ellipsis at the same level as "Slice Objects", but in the same file. I'm not sure either. There seems to be no precedent in the documentation, for example "Py_NotImplemented" is also just another (but mentioned first) point in the Object protocol [https://docs.python.org/3/c-api/object.html#object-protocol] and "Py_None" even has a complete page [https://docs.python.org/3/c-api/none.html]. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 16:58:41 2017 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 12 Apr 2017 20:58:41 +0000 Subject: [issue23894] lib2to3 doesn't recognize rb'...' and f'...' in Python 3.6 In-Reply-To: <1428585495.21.0.103830054834.issue23894@psf.upfronthosting.co.za> Message-ID: <1492030721.61.0.13000737151.issue23894@psf.upfronthosting.co.za> ?ukasz Langa added the comment: No Serhiy, I need a new patch with tests, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 16:58:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 20:58:52 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error Message-ID: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: PyObject_Size(), PySequence_Size() and PyMapping_Size() can raise an exception. But not always this is checked after using them. This can lead to a crash. For example: >>> import io >>> class R(io.IOBase): ... def readline(self): return None ... >>> next(R()) Fatal Python error: a function returned a result with an error set TypeError: object of type 'NoneType' has no len() The above exception was the direct cause of the following exception: SystemError: returned a result with an error set Current thread 0xb749c700 (most recent call first): File "", line 1 in ---------- components: Extension Modules, IO, Interpreter Core messages: 291573 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Check if PyObject_Size() raised an error type: crash versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 17:14:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 21:14:54 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492031694.43.0.625572423738.issue30061@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1239 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 17:15:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Apr 2017 21:15:17 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492031717.2.0.21077361913.issue30061@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 17:43:42 2017 From: report at bugs.python.org (Adam Williamson) Date: Wed, 12 Apr 2017 21:43:42 +0000 Subject: [issue30062] datetime in Python 3.6+ no longer respects 'TZ' environment variable Message-ID: <1492033422.46.0.101980038958.issue30062@psf.upfronthosting.co.za> New submission from Adam Williamson: I can't figure out yet why this is, but it's very easy to demonstrate: [adamw at adam anaconda (time-log %)]$ python35 Python 3.5.2 (default, Feb 11 2017, 18:09:24) [GCC 7.0.1 20170209 (Red Hat 7.0.1-0.7)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> import datetime >>> os.environ['TZ'] = 'America/Winnipeg' >>> datetime.datetime.fromtimestamp(0) datetime.datetime(1969, 12, 31, 18, 0) >>> os.environ['TZ'] = 'Europe/London' >>> datetime.datetime.fromtimestamp(0) datetime.datetime(1970, 1, 1, 1, 0) >>> [adamw at adam anaconda (time-log %)]$ python3 Python 3.6.0 (default, Mar 21 2017, 17:30:34) [GCC 7.0.1 20170225 (Red Hat 7.0.1-0.10)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> import datetime >>> os.environ['TZ'] = 'America/Winnipeg' >>> datetime.datetime.fromtimestamp(0) datetime.datetime(1969, 12, 31, 16, 0) >>> os.environ['TZ'] = 'Europe/London' >>> datetime.datetime.fromtimestamp(0) datetime.datetime(1969, 12, 31, 16, 0) >>> That is, when deciding what timezone to use for operations that involve one, if the 'TZ' environment variable was set, Python 3.5 would use the timezone it was set to. Python 3.6 does not, it ignores it. As you can see, if I twiddle the 'TZ' setting and call `datetime.datetime.fromtimestamp(0)` repeatedly under Python 3.5, I get different results - each one is the wall clock time at the epoch (timestamp 0) in the timezone specified as 'TZ'. If I do the same on Python 3.6, the 'TZ' setting is ignored and I always get the same result (the wall clock time of 'the epoch' in Vancouver, which is my real timezone, and which I guess is being picked up from /etc/localtime or whatever). This wound up causing a problem in the Fedora / Red Hat installer, anaconda: https://bugzilla.redhat.com/show_bug.cgi?id=1433560 The 'current time zone' can be changed in anaconda. Shortly after it starts up, it automatically tries to guess the correct time zone via geolocation, and the user can also explicitly choose a timezone in the installer interface (or set one in a kickstart). Whenever the timezone is set in this way, an underlying library (libtimezonemap - https://launchpad.net/timezonemap) sets 'TZ' to the chosen timezone. It turns out other code in anaconda relies on Python respecting that setting, which Python 3.6 does not do. As a consequence, anaconda with Python 3.6 winds up setting the system time incorrectly. Also, the timestamps on all its log files are different now, and there may well be other consequences I didn't figure out yet. The same applies to, e.g., `datetime.datetime.now()`: you can perform the same experiment with Python 3.5 and 3.6. If you change the 'TZ' env var while calling `datetime.datetime.now()` after each change, on Python 3.5, the naive datetime object it returns is the current time *in that timezone*. On Python 3.6, regardless of what 'TZ' is set to, it always gives you the same time. Is this an intended and/or desired change that we should adjust to somehow? Is there another way a running Python process can change what "the current" timezone is, for the purposes of datetime calculations like this? ---------- components: Library (Lib) messages: 291574 nosy: adamwill priority: normal severity: normal status: open title: datetime in Python 3.6+ no longer respects 'TZ' environment variable versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 17:45:41 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 12 Apr 2017 21:45:41 +0000 Subject: [issue30062] datetime in Python 3.6+ no longer respects 'TZ' environment variable In-Reply-To: <1492033422.46.0.101980038958.issue30062@psf.upfronthosting.co.za> Message-ID: <1492033541.93.0.301826665039.issue30062@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 18:14:50 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 12 Apr 2017 22:14:50 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1492035290.4.0.75807937675.issue30052@psf.upfronthosting.co.za> Cheryl Sabella added the comment: I've looked into this a little more and it seems that, in all instances, the :class:`bytes` and :class:`bytearray` mark-up link to the Built-In Functions page instead of the Built-In Types page. It also looks like the Built-In Functions page has specific code for many types (dict, frozenset, memoryview, list, tuple, str, etc) so that it wouldn't link to this (the functions) page. However, bytes and bytearray aren't part of that list. I don't know if they were excluded on purpose or if their links should behave like the other types. Please let me know if this should change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 18:37:09 2017 From: report at bugs.python.org (Adam Williamson) Date: Wed, 12 Apr 2017 22:37:09 +0000 Subject: [issue30062] datetime in Python 3.6+ no longer respects 'TZ' environment variable In-Reply-To: <1492033422.46.0.101980038958.issue30062@psf.upfronthosting.co.za> Message-ID: <1492036629.62.0.572843375776.issue30062@psf.upfronthosting.co.za> Adam Williamson added the comment: Hmm, after a bit more poking I found this: https://docs.python.org/3/library/time.html#time.tzset "Note Although in many cases, changing the TZ environment variable may affect the output of functions like localtime() without calling tzset(), this behavior should not be relied on." It seems like that's kinda what we're dealing with here. If I extend my tests to change TZ, call the test function, then call `time.tzset()` and call the test function again, the *second* call to the test function gives the different result, i.e. the `time.tzset()` call does what it claims and changes Python's conception of the 'current' timezone. So while that note has been there all along, it seems like the behaviour actually changed between 3.5 and 3.6, and a change to 'TZ' is now less likely to be respected without a `tzset()` call. But given the doc note, perhaps that can't be considered a bug. anaconda doesn't call `time.tzset()` anywhere at present. It's also multi-threaded, so making sure all the threads call `time.tzset()` after any thread has changed what the 'current' timezone is will be lots of fun to implement, I guess :/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 19:11:14 2017 From: report at bugs.python.org (Evgeny Kapun) Date: Wed, 12 Apr 2017 23:11:14 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored In-Reply-To: <1491955884.31.0.0746508313156.issue30048@psf.upfronthosting.co.za> Message-ID: <1492038674.39.0.255054279756.issue30048@psf.upfronthosting.co.za> Evgeny Kapun added the comment: The problem is that the task doesn't catch CancelledError, yet it disappears. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 20:19:13 2017 From: report at bugs.python.org (INADA Naoki) Date: Thu, 13 Apr 2017 00:19:13 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored In-Reply-To: <1491955884.31.0.0746508313156.issue30048@psf.upfronthosting.co.za> Message-ID: <1492042753.82.0.420596114718.issue30048@psf.upfronthosting.co.za> INADA Naoki added the comment: > The problem is that the task doesn't catch CancelledError, yet it disappears. The problem is CancelledError is not raised, even it's thrown. Task can't catch exception not raised. See below example which demonstrates how task works. --- from asyncio import CancelledError cancelled = False def coro(): global cancelled print(1) yield (1,) print("cancel") cancelled = True #print(2) #yield (2,) # uncomment this line makes cancel success. c = coro() while True: try: if cancelled: r = c.throw(CancelledError) else: r = c.send(None) except StopIteration: print("end") break except CancelledError: print("cancelled") break ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 20:44:56 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 13 Apr 2017 00:44:56 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored In-Reply-To: <1492042753.82.0.420596114718.issue30048@psf.upfronthosting.co.za> Message-ID: Yury Selivanov added the comment: In Evgeny's example the 'task' is 'coro1' (not 'coro2'). It has plenty of yield points after being cancelled. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 21:07:37 2017 From: report at bugs.python.org (INADA Naoki) Date: Thu, 13 Apr 2017 01:07:37 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored In-Reply-To: <1491955884.31.0.0746508313156.issue30048@psf.upfronthosting.co.za> Message-ID: <1492045657.31.0.468188454334.issue30048@psf.upfronthosting.co.za> INADA Naoki added the comment: > In Evgeny's example the 'task' is 'coro1' (not 'coro2'). It has plenty of yield points after being cancelled. Since coro1 waiting coro2 when cancelling, Task(coro1).cancel() redirect to Task(coro2).cancel(). But I was wrong about "CancelledError is thrown to coro2." Task(coro2) is cancelled in last step. CancelledError is not thrown to coro2 actually. So there is chance to detect it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 21:26:41 2017 From: report at bugs.python.org (INADA Naoki) Date: Thu, 13 Apr 2017 01:26:41 +0000 Subject: [issue30048] If a task is canceled at the right moment, the cancellation is ignored In-Reply-To: <1491955884.31.0.0746508313156.issue30048@psf.upfronthosting.co.za> Message-ID: <1492046801.54.0.677001553547.issue30048@psf.upfronthosting.co.za> Changes by INADA Naoki : ---------- pull_requests: +1240 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 22:38:31 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 13 Apr 2017 02:38:31 +0000 Subject: [issue26985] Information about CodeType in inspect documentation is outdated In-Reply-To: <1462803102.24.0.542356144335.issue26985@psf.upfronthosting.co.za> Message-ID: <1492051110.99.0.186320616665.issue26985@psf.upfronthosting.co.za> Xiang Zhang added the comment: New changeset a6902e662c18dc837d40664eaafe50a44aae6366 by Xiang Zhang in branch 'master': bpo-26985: Add missing info of code object in inspect documentation (GH-1090) https://github.com/python/cpython/commit/a6902e662c18dc837d40664eaafe50a44aae6366 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 22:40:26 2017 From: report at bugs.python.org (Paul Durack) Date: Thu, 13 Apr 2017 02:40:26 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py Message-ID: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> New submission from Paul Durack: I have started receiving the following warnings which are starting to prevent an ipython session from functioning: /home/user/anaconda2/envs/cdatcmornclnco/lib/python2.7/json/encoder.py:207: DeprecationWarning: Interpreting naive datetime as local 2017-04-12 17:15:36.235571. Please add timezone info to timestamps. chunks = self.iterencode(o, _one_shot=True) /home/user/anaconda2/envs/cdatcmornclnco/lib/python2.7/json/encoder.py:207: DeprecationWarning: Interpreting naive datetime as local 2017-04-12 17:15:36.267401. Please add timezone info to timestamps. chunks = self.iterencode(o, _one_shot=True) The only way I can continue is to terminate the ipython shell and open a new instance. Can someone tell me what I need to do to solve the issue? Is there a json import somewhere that requires some new arguments? ---------- components: Library (Lib) messages: 291582 nosy: Paul Durack priority: normal severity: normal status: open title: DeprecationWarning in json/encoder.py versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 22:46:41 2017 From: report at bugs.python.org (Paul Durack) Date: Thu, 13 Apr 2017 02:46:41 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492051601.57.0.313134221281.issue30063@psf.upfronthosting.co.za> Paul Durack added the comment: I have attempted to quieten these using: In [2]: import warnings ...: warnings.filterwarnings('ignore', category=DeprecationWarning) In [3]: import vcs /home/user/anaconda2/envs/cdatcmornclnco/lib/python2.7/json/encoder.py:207: DeprecationWarning: Interpreting naive datetime as local 2017-04-12 19:45:31.251897. Please add timezone info to timestamps. chunks = self.iterencode(o, _one_shot=True) However, this doesn't seem to be working ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 22:52:13 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 02:52:13 +0000 Subject: [issue30047] Typos in Doc/library/select.rst In-Reply-To: <1491952967.06.0.143723768718.issue30047@psf.upfronthosting.co.za> Message-ID: <1492051933.51.0.357386777746.issue30047@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1241 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 22:53:13 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 13 Apr 2017 02:53:13 +0000 Subject: [issue26985] Information about CodeType in inspect documentation is outdated In-Reply-To: <1462803102.24.0.542356144335.issue26985@psf.upfronthosting.co.za> Message-ID: <1492051993.26.0.658112805663.issue26985@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1242 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 22:53:55 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 13 Apr 2017 02:53:55 +0000 Subject: [issue26985] Information about CodeType in inspect documentation is outdated In-Reply-To: <1462803102.24.0.542356144335.issue26985@psf.upfronthosting.co.za> Message-ID: <1492052035.16.0.575915113909.issue26985@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1243 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 23:02:23 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 03:02:23 +0000 Subject: [issue30047] Typos in Doc/library/select.rst In-Reply-To: <1491952967.06.0.143723768718.issue30047@psf.upfronthosting.co.za> Message-ID: <1492052543.73.0.437813839447.issue30047@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset f0c416799b33742af36d7c6608b9a422615fb3d2 by Mariatta in branch '3.6': [3.6] bpo-30047: Fix a typo in Doc/library/select.rst (GH-1086) (GH-1098) https://github.com/python/cpython/commit/f0c416799b33742af36d7c6608b9a422615fb3d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 23:03:28 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 03:03:28 +0000 Subject: [issue30047] Typos in Doc/library/select.rst In-Reply-To: <1491952967.06.0.143723768718.issue30047@psf.upfronthosting.co.za> Message-ID: <1492052608.96.0.709021707416.issue30047@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Backported to 3.6. Closing this now. Thanks all :) ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 23:14:19 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 13 Apr 2017 03:14:19 +0000 Subject: [issue26985] Information about CodeType in inspect documentation is outdated In-Reply-To: <1462803102.24.0.542356144335.issue26985@psf.upfronthosting.co.za> Message-ID: <1492053259.35.0.679093126113.issue26985@psf.upfronthosting.co.za> Xiang Zhang added the comment: New changeset 14944c62300f741488c2f28cb91ad1e3fef7343b by Xiang Zhang in branch '3.6': bpo-26985: Add missing info of code object in inspect documentation (GH-1090) (GH-1099) https://github.com/python/cpython/commit/14944c62300f741488c2f28cb91ad1e3fef7343b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 23:25:10 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 13 Apr 2017 03:25:10 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492053910.12.0.858756772977.issue29861@psf.upfronthosting.co.za> Xiang Zhang added the comment: Hi, Antoine, after this change, I sometimes see tests fail for 3.5 branch, for example http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.5/builds/194/steps/test/logs/stdio. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 23:37:40 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 13 Apr 2017 03:37:40 +0000 Subject: [issue26985] Information about CodeType in inspect documentation is outdated In-Reply-To: <1462803102.24.0.542356144335.issue26985@psf.upfronthosting.co.za> Message-ID: <1492054660.4.0.22701103384.issue26985@psf.upfronthosting.co.za> Xiang Zhang added the comment: New changeset 72b1d419ac5f7cd9ef82ffd2ffe21aa9b34e21d2 by Xiang Zhang in branch '3.5': bpo-26985: Add missing info of code object in inspect documentation (GH-1090) (GH-1100) https://github.com/python/cpython/commit/72b1d419ac5f7cd9ef82ffd2ffe21aa9b34e21d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 23:38:14 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 13 Apr 2017 03:38:14 +0000 Subject: [issue26985] Information about CodeType in inspect documentation is outdated In-Reply-To: <1462803102.24.0.542356144335.issue26985@psf.upfronthosting.co.za> Message-ID: <1492054694.91.0.619974689659.issue26985@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 12 23:55:16 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 03:55:16 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1492055716.6.0.751712572287.issue29692@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1244 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 00:34:45 2017 From: report at bugs.python.org (Mandeep Bhutani) Date: Thu, 13 Apr 2017 04:34:45 +0000 Subject: [issue30045] Bad parameter name in re.escape() In-Reply-To: <1491942504.65.0.615945582018.issue30045@psf.upfronthosting.co.za> Message-ID: <1492058085.92.0.654772014084.issue30045@psf.upfronthosting.co.za> Mandeep Bhutani added the comment: I agree that pattern seems right. However I think that the parameter in the docs should be changed from string to pattern for consistency purposes. ---------- nosy: +mandeepb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 03:27:02 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 13 Apr 2017 07:27:02 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC In-Reply-To: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> Message-ID: <1492068422.34.0.72415750819.issue30046@psf.upfronthosting.co.za> Xiang Zhang added the comment: boolean is not quoted since in Python it's a subclass of int so True and False are numeric. This is also the case with numeric objects defining __int__ or __float__ but doesn't get a corresponding string representation. Since QUOTE_NONNUMERIC will converts data to float when reading, I think we may force the converting even when writing so the inconsistency would disappear. Or document this limitation. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 03:34:18 2017 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 13 Apr 2017 07:34: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: <1492068858.1.0.179931651512.issue22117@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- pull_requests: +1245 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 03:44:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 07:44:50 +0000 Subject: [issue30045] Bad parameter name in re.escape() In-Reply-To: <1491942504.65.0.615945582018.issue30045@psf.upfronthosting.co.za> Message-ID: <1492069490.87.0.30473488929.issue30045@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This looked not correct to me but if you say "pattern" seems right I'm closing this issue. I'll update the parameter name in PR 1048. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 04:33:29 2017 From: report at bugs.python.org (Stephen Kelly) Date: Thu, 13 Apr 2017 08:33:29 +0000 Subject: [issue30060] Crash on Py_Finalize if Py_NoSiteFlag is used In-Reply-To: <1492020071.31.0.759008537591.issue30060@psf.upfronthosting.co.za> Message-ID: <1492072409.18.0.248133409218.issue30060@psf.upfronthosting.co.za> Stephen Kelly added the comment: I found that if I build and run this code with Python 3, then I get a very different backtrace. KernelBase.dll!00007ff963466142() Unknown python36_d.dll!Py_FatalError(const char * msg) Line 1457 C python36_d.dll!PyEval_AcquireLock() Line 253 C mn.exe!main(int argc, char * * argv) Line 22 C [External Code] The failure is Py_FatalError("PyEval_AcquireLock: current thread state is NULL"); So, it is not clear to me what is incorrect about this code, but presumably I have done something incorrect here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 04:47:41 2017 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 13 Apr 2017 08:47:41 +0000 Subject: [issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function In-Reply-To: <1367269025.02.0.400879045482.issue17870@psf.upfronthosting.co.za> Message-ID: <1492073261.89.0.262149324651.issue17870@psf.upfronthosting.co.za> Changes by Benjamin Peterson : ---------- pull_requests: +1246 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 04:55:09 2017 From: report at bugs.python.org (Evgeny Kapun) Date: Thu, 13 Apr 2017 08:55:09 +0000 Subject: [issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled Message-ID: <1492073709.93.0.33740565749.issue30064@psf.upfronthosting.co.za> New submission from Evgeny Kapun: Code: import asyncio as a import socket as s @a.coroutine def coro(): s1, s2 = s.socketpair() s1.setblocking(False) s2.setblocking(False) try: yield from a.wait_for(loop.sock_recv(s2, 1), 1) except a.TimeoutError: pass yield from loop.sock_sendall(s1, b'\x00') yield s1.close() s2.close() loop = a.get_event_loop() loop.run_until_complete(coro()) Result: Exception in callback BaseSelectorEventLoop._sock_recv(, True, , 1) handle: , True, , 1)> Traceback (most recent call last): File "/usr/lib/python3.6/asyncio/events.py", line 127, in _run self._callback(*self._args) File "/usr/lib/python3.6/asyncio/selector_events.py", line 378, in _sock_recv self.remove_reader(fd) File "/usr/lib/python3.6/asyncio/selector_events.py", line 342, in remove_reader return self._remove_reader(fd) File "/usr/lib/python3.6/asyncio/selector_events.py", line 279, in _remove_reader key = self._selector.get_key(fd) File "/usr/lib/python3.6/selectors.py", line 189, in get_key return mapping[fileobj] File "/usr/lib/python3.6/selectors.py", line 70, in __getitem__ fd = self._selector._fileobj_lookup(fileobj) File "/usr/lib/python3.6/selectors.py", line 224, in _fileobj_lookup return _fileobj_to_fd(fileobj) File "/usr/lib/python3.6/selectors.py", line 41, in _fileobj_to_fd raise ValueError("Invalid file descriptor: {}".format(fd)) ValueError: Invalid file descriptor: -1 ---------- components: asyncio messages: 291593 nosy: abacabadabacaba, yselivanov priority: normal severity: normal status: open title: BaseSelectorEventLoop.sock_{recv,sendall}() don't remove their callbacks when canceled type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 05:50:23 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 09:50:23 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1492077023.92.0.638441748654.issue29692@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 9b409ff41ceb2d7ea7e8d25a7bbf5eb7d46625f3 by Mariatta in branch '3.6': [3.6] bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError (GH-949) (#1105) https://github.com/python/cpython/commit/9b409ff41ceb2d7ea7e8d25a7bbf5eb7d46625f3 ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 05:53:56 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 09:53:56 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1492077236.38.0.445192163962.issue29692@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1247 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:02:14 2017 From: report at bugs.python.org (Aviv Palivoda) Date: Thu, 13 Apr 2017 10:02:14 +0000 Subject: [issue16379] SQLite error code not exposed to python In-Reply-To: <1351764878.68.0.13361347428.issue16379@psf.upfronthosting.co.za> Message-ID: <1492077734.38.0.093777073366.issue16379@psf.upfronthosting.co.za> Changes by Aviv Palivoda : ---------- pull_requests: +1248 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:02:14 2017 From: report at bugs.python.org (Aviv Palivoda) Date: Thu, 13 Apr 2017 10:02:14 +0000 Subject: [issue24139] Use sqlite3 extended error codes In-Reply-To: <1430990375.51.0.367829317248.issue24139@psf.upfronthosting.co.za> Message-ID: <1492077734.49.0.822824510102.issue24139@psf.upfronthosting.co.za> Changes by Aviv Palivoda : ---------- pull_requests: +1249 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:14:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 10:14:01 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() Message-ID: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: _posixsubprocess.fork_exec() takes a sequence of file descriptors. It first validates it, and since the validation is passed uses it without checking for errors. But since __len__, __getitem__ and __int__ can execute user code and release GIL, errors can occur after the validation. This can cause a crash. Proposed patch fixes this by the simplest way -- it restricts the type of a sequence to tuple and types of elements to int. Since _posixsubprocess is private module this shouldn't break third-party code. Other issue with _posixsubprocess.fork_exec() was that it converts args to a tuple or a list and iterate it without checking if the size is changed. ---------- components: Extension Modules messages: 291595 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Insufficient validation in _posixsubprocess.fork_exec() type: crash versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:14:55 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 10:14:55 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1492078495.81.0.0527508514734.issue29692@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 4d015a40a7b9c3c1b8cfbe81453187d700a43163 by Mariatta in branch '3.5': [3.5] bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError (GH-949) (#1107) https://github.com/python/cpython/commit/4d015a40a7b9c3c1b8cfbe81453187d700a43163 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:17:40 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 10:17:40 +0000 Subject: [issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError In-Reply-To: <1488449495.24.0.0941910154043.issue29692@psf.upfronthosting.co.za> Message-ID: <1492078660.3.0.147984924931.issue29692@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: PR has been backported into 3.5 and 3.6. Thanks all :) ---------- stage: backport needed -> resolved status: open -> closed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:21:07 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 10:21:07 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492078867.49.0.183659708877.issue29869@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 97a40b7a5b2979fb17e1751c139fd4ba1ebd5276 by Mariatta (Nevada Sanchez) in branch '3.6': bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-752) https://github.com/python/cpython/commit/97a40b7a5b2979fb17e1751c139fd4ba1ebd5276 ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:25:02 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 10:25:02 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492079102.9.0.33776599117.issue29869@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1250 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:54:46 2017 From: report at bugs.python.org (Stephen Kelly) Date: Thu, 13 Apr 2017 10:54:46 +0000 Subject: [issue30060] Crash on Py_Finalize if Py_NoSiteFlag is used In-Reply-To: <1492020071.31.0.759008537591.issue30060@psf.upfronthosting.co.za> Message-ID: <1492080886.69.0.842979683291.issue30060@psf.upfronthosting.co.za> Stephen Kelly added the comment: The issue http://bugs.python.org/issue17978 has a quite similar backtrace and there is discussion in http://bugs.python.org/issue17703#msg241412 about changing the TRASHCAN macro to access the _PyThreadState_Current directly instead of calling PyThreadState_Get (which is fatal for a nullptr). The very next thing the TRASHCAN macro does is check if the thread state is nullptr in a non-fatal way. Is there a reason not to apply that patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 06:54:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 10:54:54 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492080894.48.0.275782888378.issue30065@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1251 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 07:03:18 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 11:03:18 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492081398.55.0.660282186166.issue29869@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 84c2d75489a84174d8993aea292828662e35a50f by Mariatta in branch '3.6': Revert "bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-752)" (GH-1109) https://github.com/python/cpython/commit/84c2d75489a84174d8993aea292828662e35a50f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 07:30:27 2017 From: report at bugs.python.org (Stefan Krah) Date: Thu, 13 Apr 2017 11:30:27 +0000 Subject: [issue30055] Missed testcleanup in decimal.rst In-Reply-To: <1492009171.7.0.643211980228.issue30055@psf.upfronthosting.co.za> Message-ID: <1492083027.47.0.250679529514.issue30055@psf.upfronthosting.co.za> Stefan Krah added the comment: New changeset 2c0b5c664ba7d36dc09788d3778d5b33e3fa1bd0 by Stefan Krah (Marco Buttu) in branch 'master': bpo-30055: add testcleanup to leave a fresh context (#1094) https://github.com/python/cpython/commit/2c0b5c664ba7d36dc09788d3778d5b33e3fa1bd0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 07:35:20 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 11:35:20 +0000 Subject: [issue30036] The bugs website doesn't use httpS by default In-Reply-To: <1491896741.65.0.130091825674.issue30036@psf.upfronthosting.co.za> Message-ID: <1492083320.09.0.366024822118.issue30036@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Thanks for the report. Issue with the footer of python.org website can be filed at https://github.com/python/pythondotorg Regarding the fact that bugs.python.org does not use https by default, it is being tracked here http://psf.upfronthosting.co.za/roundup/meta/issue463 I'm closing this and marking as duplicate. Thanks :) ---------- nosy: +Mariatta resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 07:35:49 2017 From: report at bugs.python.org (Stefan Krah) Date: Thu, 13 Apr 2017 11:35:49 +0000 Subject: [issue30055] Missed testcleanup in decimal.rst In-Reply-To: <1492009171.7.0.643211980228.issue30055@psf.upfronthosting.co.za> Message-ID: <1492083349.15.0.867659523673.issue30055@psf.upfronthosting.co.za> Stefan Krah added the comment: Thanks, looks good. (I hope GitHub runs the doctests at Travis CI, locally most of them failed so I didn't bother to run the tests for this one.) ---------- assignee: docs at python -> skrah resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 07:50:16 2017 From: report at bugs.python.org (Marco Buttu) Date: Thu, 13 Apr 2017 11:50:16 +0000 Subject: [issue30055] Missed testcleanup in decimal.rst In-Reply-To: <1492009171.7.0.643211980228.issue30055@psf.upfronthosting.co.za> Message-ID: <1492084216.05.0.684421544563.issue30055@psf.upfronthosting.co.za> Marco Buttu added the comment: We are not executing the doctests on Travis CI, but I executed them locally. That's why I realized there was a missed testcleanup. The issue27200 wants to fix all doctests, and I actually completed the job, but three PRs are still opened, and I am waiting for review approval. If you want to contribute to the reviews, look for 'bpo-27200' on the GitHub PRs. I hope the doctest will be run on Travis as soon as possible. Thanks, Marco ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 08:17:56 2017 From: report at bugs.python.org (John Taylor) Date: Thu, 13 Apr 2017 12:17:56 +0000 Subject: [issue29284] Include thread_name_prefix in the concurrent.futures.ThreadPoolExecutor example 17.4.2.1 In-Reply-To: <1484584964.59.0.239435362381.issue29284@psf.upfronthosting.co.za> Message-ID: <1492085876.94.0.670999893526.issue29284@psf.upfronthosting.co.za> John Taylor added the comment: Can this be added to Python 3.7? https://docs.python.org/3.7/library/concurrent.futures.html#threadpoolexecutor-example Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 08:23:50 2017 From: report at bugs.python.org (Stefan Krah) Date: Thu, 13 Apr 2017 12:23:50 +0000 Subject: [issue30055] Missed testcleanup in decimal.rst In-Reply-To: <1492084216.05.0.684421544563.issue30055@psf.upfronthosting.co.za> Message-ID: <20170413122340.GA12572@bytereef.org> Stefan Krah added the comment: Ok great, maybe I'll take a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 08:31:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 12:31:36 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492086696.37.0.393914429888.issue30059@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There are precedences in tuple.rst and method.rst. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 08:48:20 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 12:48:20 +0000 Subject: [issue29791] print documentation: flush is also a keyword argument In-Reply-To: <1489179993.27.0.31165504732.issue29791@psf.upfronthosting.co.za> Message-ID: <1492087700.15.0.678335787342.issue29791@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 61b9ac93712df8092a25223cd56fa6528359792b by Berker Peksag in branch 'master': bpo-29791: Clarify that flush is keyword-only argument (#1093) https://github.com/python/cpython/commit/61b9ac93712df8092a25223cd56fa6528359792b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 08:51:59 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 12:51:59 +0000 Subject: [issue29791] print documentation: flush is also a keyword argument In-Reply-To: <1489179993.27.0.31165504732.issue29791@psf.upfronthosting.co.za> Message-ID: <1492087919.56.0.95973808331.issue29791@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- pull_requests: +1252 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 08:54:41 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 13 Apr 2017 12:54:41 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492088081.46.0.49346634165.issue30063@psf.upfronthosting.co.za> R. David Murray added the comment: If a warning is causing iPython to hang, there is something seriously wrong with iPython. A warning is just a message written to stderr, it doesn't affect the execution of the program. The json module does not natively support datetime, so whatever is happening, it is being triggered by non-stdlib code (probably a json subclass in the vcs package you are working with). I suggest you pursue this with the community that originated the vcs package. ---------- nosy: +r.david.murray resolution: -> third party stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 08:54:48 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 12:54:48 +0000 Subject: [issue29791] print documentation: flush is also a keyword argument In-Reply-To: <1489179993.27.0.31165504732.issue29791@psf.upfronthosting.co.za> Message-ID: <1492088088.52.0.307247661259.issue29791@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- pull_requests: +1253 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 08:56:18 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 13 Apr 2017 12:56:18 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492088178.94.0.293670467529.issue30063@psf.upfronthosting.co.za> R. David Murray added the comment: In case it wasn't clear: I seriously doubt that iPython is hanging due to the warning, I think something else must be happening and the warning is a red herring. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 09:09:16 2017 From: report at bugs.python.org (leopoldo) Date: Thu, 13 Apr 2017 13:09:16 +0000 Subject: [issue30066] anaconda3::traitsu::NotImplementedError Message-ID: <1492088956.84.0.603775450991.issue30066@psf.upfronthosting.co.za> New submission from leopoldo: the code below crash when run on anaconda3 import traits.api as trapi import traitsui.api as trui from traits.api import HasTraits, Str, Range, Enum class Person(HasTraits): name = Str('Jane Doe') age = Range(low=0) gender = Enum('female', 'male') person = Person(age=30) from traitsui.api import Item, RangeEditor, View person_view = View( Item('name'), Item('gender'), Item('age', editor=RangeEditor(mode='spinner')), buttons=['OK', 'Cancel'], resizable=True, ) person.configure_traits(view=person_view) --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) in () ----> 1 person.configure_traits(view=person_view) /home/leopoldo/anaconda3/lib/python3.6/site-packages/traits/has_traits.py in configure_traits(self, filename, view, kind, edit, context, handler, id, scrollable, **args) 2169 context = self 2170 rc = toolkit().view_application( context, self.trait_view( view ), -> 2171 kind, handler, id, scrollable, args ) 2172 if rc and (filename is not None): 2173 fd = None /home/leopoldo/anaconda3/lib/python3.6/site-packages/traitsui/toolkit.py in view_application(self, context, view, kind, handler, id, scrollable, args) 289 290 """ --> 291 raise NotImplementedError 292 293 #--------------------------------------------------------------------------- NotImplementedError: ---------- messages: 291611 nosy: leopoldotosi priority: normal severity: normal status: open title: anaconda3::traitsu::NotImplementedError type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 09:16:32 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 13:16:32 +0000 Subject: [issue29791] print documentation: flush is also a keyword argument In-Reply-To: <1489179993.27.0.31165504732.issue29791@psf.upfronthosting.co.za> Message-ID: <1492089392.19.0.875492746142.issue29791@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset df9783720e40773e7854d2f4e4cfc93f0a2c08b8 by Berker Peksag in branch '3.5': bpo-29791: Clarify that flush is keyword-only argument (GH-1093) https://github.com/python/cpython/commit/df9783720e40773e7854d2f4e4cfc93f0a2c08b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 09:17:03 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 13:17:03 +0000 Subject: [issue29791] print documentation: flush is also a keyword argument In-Reply-To: <1489179993.27.0.31165504732.issue29791@psf.upfronthosting.co.za> Message-ID: <1492089423.94.0.589534657351.issue29791@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 119d94ad37a99ecb0b8329467d04cd9d909e310e by Berker Peksag in branch '3.6': bpo-29791: Clarify that flush is keyword-only argument (GH-1093) https://github.com/python/cpython/commit/119d94ad37a99ecb0b8329467d04cd9d909e310e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 09:17:49 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 13:17:49 +0000 Subject: [issue29791] print documentation: flush is also a keyword argument In-Reply-To: <1489179993.27.0.31165504732.issue29791@psf.upfronthosting.co.za> Message-ID: <1492089469.29.0.198621419341.issue29791@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the report! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 09:38:25 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 13:38:25 +0000 Subject: [issue30066] anaconda3::traitsu::NotImplementedError In-Reply-To: <1492088956.84.0.603775450991.issue30066@psf.upfronthosting.co.za> Message-ID: <1492090705.69.0.0920943109396.issue30066@psf.upfronthosting.co.za> Berker Peksag added the comment: Please report this to either traits or traitsui developers. This issue tracker is for issues with CPython and its standard library, not for third-party modules on PyPI. ---------- nosy: +berker.peksag resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 09:57:39 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 13:57:39 +0000 Subject: [issue30036] The bugs website doesn't use httpS by default In-Reply-To: <1491896741.65.0.130091825674.issue30036@psf.upfronthosting.co.za> Message-ID: <1492091859.68.0.446335891173.issue30036@psf.upfronthosting.co.za> Berker Peksag added the comment: I've changed the bugs.p.o link to use HTTPS at python.org. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 10:18:01 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 14:18:01 +0000 Subject: [issue27200] make doctest in CPython has failures In-Reply-To: <1464988408.0.0.840317371896.issue27200@psf.upfronthosting.co.za> Message-ID: <1492093081.69.0.964445370625.issue27200@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 7b2491a6aa5cdc1f8f9e3fd9df91f29ee69aa982 by Berker Peksag (Marco Buttu) in branch 'master': bpo-27200: Fix pathlib, ssl, turtle and weakref doctests (GH-616) https://github.com/python/cpython/commit/7b2491a6aa5cdc1f8f9e3fd9df91f29ee69aa982 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 11:31:17 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 15:31:17 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492097477.14.0.527023496163.issue29869@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Nevada Sanchez, please create your PR against the master branch. Once that is merged, we will backport it to the 3.6 branch. Thanks :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:17:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 16:17:38 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1492100258.97.0.581479680452.issue30021@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8fc7bc2b7631ee819ee614e47b6f44bacebe1574 by Serhiy Storchaka in branch 'master': bpo-30021: Add examples for re.escape(). (#1048) https://github.com/python/cpython/commit/8fc7bc2b7631ee819ee614e47b6f44bacebe1574 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:25:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 16:25:05 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1492100705.48.0.563625228156.issue30021@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1254 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:31:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 16:31:25 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1492101085.28.0.316133145534.issue30021@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:37:03 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 13 Apr 2017 16:37:03 +0000 Subject: [issue21301] pathlib missing Path.expandvars(env=os.environ) In-Reply-To: <1397849465.53.0.177138390921.issue21301@psf.upfronthosting.co.za> Message-ID: <1492101423.71.0.0504274066384.issue21301@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:41:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 16:41:04 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1492101664.02.0.701959240528.issue30021@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1256 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:41:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 16:41:21 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1492101681.26.0.063885001244.issue30021@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 936633282220768a6fec9bd6bb53ee9e3ec354df by Serhiy Storchaka in branch '3.6': bpo-30021: Add examples for re.escape(). (#1048) (#1115) https://github.com/python/cpython/commit/936633282220768a6fec9bd6bb53ee9e3ec354df ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:41:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 16:41:28 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1492101688.5.0.776873787678.issue30021@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e2cf9a918439006fb27f67c1939d0370886650e7 by Serhiy Storchaka in branch '3.5': bpo-30021: Add examples for re.escape(). (#1048) (#1116) https://github.com/python/cpython/commit/e2cf9a918439006fb27f67c1939d0370886650e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:47:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 16:47:20 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1492102040.54.0.622115549802.issue30021@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 53ad68434ce914defcc1b734cce4b9b4d79ca3fc by Serhiy Storchaka in branch '2.7': bpo-30021: Add examples for re.escape(). (#1048) (#1118) https://github.com/python/cpython/commit/53ad68434ce914defcc1b734cce4b9b4d79ca3fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 12:57:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 16:57:40 +0000 Subject: [issue30021] Add examples for re.escape() In-Reply-To: <1491639174.85.0.00703016878323.issue30021@psf.upfronthosting.co.za> Message-ID: <1492102660.39.0.792770545201.issue30021@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 13:19:11 2017 From: report at bugs.python.org (Nevada Sanchez) Date: Thu, 13 Apr 2017 17:19:11 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492103951.78.0.19547768325.issue29869@psf.upfronthosting.co.za> Changes by Nevada Sanchez : ---------- pull_requests: +1257 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 13:32:56 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 17:32:56 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492104776.56.0.0224586385688.issue29869@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset a6e395dffadf8c5124903c01ad69fefa36b1a935 by Mariatta (Nevada Sanchez) in branch 'master': bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-1119) https://github.com/python/cpython/commit/a6e395dffadf8c5124903c01ad69fefa36b1a935 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 14:06:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 18:06:45 +0000 Subject: [issue29995] re.escape() escapes too much In-Reply-To: <1491401871.1.0.717928370576.issue29995@psf.upfronthosting.co.za> Message-ID: <1492106805.75.0.497759539824.issue29995@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 5908300e4b0891fc5ab8bd24fba8fac72012eaa7 by Serhiy Storchaka in branch 'master': bpo-29995: re.escape() now escapes only special characters. (#1007) https://github.com/python/cpython/commit/5908300e4b0891fc5ab8bd24fba8fac72012eaa7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 14:08:17 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 18:08:17 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1492106897.44.0.91886679101.issue29694@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 22a594a0047d7706537ff2ac676cdc0f1dcb329c by Mariatta (Armin Rigo) in branch 'master': bpo-29694: race condition in pathlib mkdir with flags parents=True (GH-1089) https://github.com/python/cpython/commit/22a594a0047d7706537ff2ac676cdc0f1dcb329c ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 14:14:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 18:14:26 +0000 Subject: [issue29995] re.escape() escapes too much In-Reply-To: <1491401871.1.0.717928370576.issue29995@psf.upfronthosting.co.za> Message-ID: <1492107266.73.0.910553831742.issue29995@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 14:37:30 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 13 Apr 2017 18:37:30 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492108650.53.0.767581839741.issue30065@psf.upfronthosting.co.za> Gregory P. Smith added the comment: nice find. did anyone's code actually run into this issue? ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 14:56:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 18:56:32 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492109792.08.0.371711743582.issue30065@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It is hard to reproduce (especially the second issue) since in all cases in the stdlib a list passed to fork_exec() is just created by sorted() and doesn't have other references. But if someone is so insane that passes int-like objects with non-idempotent __int__ as file descriptors his can get a crash in debug build (or mystical bugs in release build). Added tests utilizes this, but this unlikely happens in real code. I have found this issue during analyzing usages of PyObject_Size(), PySequence_Size() and PyMapping_Size() in issue30061. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 14:58:04 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 18:58:04 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1492109884.64.0.956691852888.issue29694@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: test needed -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 15:00:53 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 19:00:53 +0000 Subject: [issue16379] SQLite error code not exposed to python In-Reply-To: <1351764878.68.0.13361347428.issue16379@psf.upfronthosting.co.za> Message-ID: <1492110053.55.0.527337154878.issue16379@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 15:03:31 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 Apr 2017 19:03:31 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492110211.63.0.207072324425.issue29861@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I can't reproduce here, on Ubuntu 16.04, after running the test 500 times. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 15:12:41 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 Apr 2017 19:12:41 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492110761.33.0.0932930775242.issue29861@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, I can reproduce now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 15:13:20 2017 From: report at bugs.python.org (Daniel Himmelstein) Date: Thu, 13 Apr 2017 19:13:20 +0000 Subject: [issue29636] Specifying indent in the json.tool command In-Reply-To: <1487880356.98.0.87296874253.issue29636@psf.upfronthosting.co.za> Message-ID: <1492110800.32.0.728212317132.issue29636@psf.upfronthosting.co.za> Daniel Himmelstein added the comment: @bob.ippolito thanks for pointing to jq as a reference implementation. I updated the pull request (https://git.io/vS9o8) to implement all of the relevant options. Currently, the PR supports the following mutually exclusive arguments: --indent --no-indent --tab --compact These additions took 16 new lines of code in tool.py and 41 new lines of tests. However, I am happy to refactor the tests to be less repetitive if we choose to go forward with these changes. @serhiy.storchaka I took a maximalist approach with respect to adding indentation options to GH #345. Although I know not all of the options may get merged, I thought we might as well work backwards. However, the more I think about it, I do think every option above is a unique and valuable addition. I think that even with the changes, json.tool remains a lightweight wrapper json.load + json.dump. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 15:37:13 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 Apr 2017 19:37:13 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492112233.26.0.0230975281302.issue29861@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- pull_requests: +1258 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 16:04:13 2017 From: report at bugs.python.org (Jakub Wilk) Date: Thu, 13 Apr 2017 20:04:13 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() Message-ID: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> New submission from Jakub Wilk: Lib/_osx_support.py contains the following line: flags = re.sub(r'-arch\s+\w+\s', ' ', flags, re.ASCII) But the 4th re.sub() argument is the maximum number of substitutions, so this is equivalent to: flags = re.sub(r'-arch\s+\w+\s', ' ', flags, count=256) It was probably meant to be: flags = re.sub(r'-arch\s+\w+\s', ' ', flags, flags=re.ASCII) This bug was found using pydiatra: http://jwilk.net/software/pydiatra ---------- components: Library (Lib) messages: 291631 nosy: jwilk priority: normal severity: normal status: open title: _osx_support.py: misplaced flags in re.sub() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 16:14:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 20:14:32 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492114472.87.0.8887715411.issue30067@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- keywords: +easy stage: -> needs patch type: -> behavior versions: +Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 17:14:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 21:14:50 +0000 Subject: [issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex In-Reply-To: <1479743857.98.0.418828964214.issue28765@psf.upfronthosting.co.za> Message-ID: <1492118090.9.0.999250620635.issue28765@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since _sre.compile is not a public API, and is called only with exact list/dict/tuple types in the stdlib, I prefer to ignore possible differences between base classes and subclasses. This makes the code cleaner. Searching on GitHub shows that usages of _sre.compile() in third-party code are not compatible with current _sre.compile() since all arguments now are mandatory and indexgroup must be a tuple, not None. ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 17:24:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Apr 2017 21:24:25 +0000 Subject: [issue29999] repr() of ImportError misses keyword arguments name and path In-Reply-To: <1491431351.79.0.0513888316468.issue29999@psf.upfronthosting.co.za> Message-ID: <1492118665.15.0.574043072706.issue29999@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The patch also changes the repr of BaseException with a single argument. It no longer contains a trailing comma. ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 19:17:39 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 23:17:39 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492125459.21.0.841256708535.issue29869@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1259 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 19:54:51 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 13 Apr 2017 23:54:51 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492127691.5.0.810501901106.issue29869@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 2cdf087d1fd48f7d0f95b5a0b31b9a624fa84751 by Mariatta in branch '3.6': [3.6] bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-1119) (GH-1122) https://github.com/python/cpython/commit/2cdf087d1fd48f7d0f95b5a0b31b9a624fa84751 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 21:25:41 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 01:25:41 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492133141.38.0.24432454171.issue29869@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1260 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 21:30:44 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 01:30:44 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492133444.96.0.169302392735.issue29869@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 947629916a5ecb1f6f6792e9b9234e084c5bf274 by Mariatta in branch 'master': bpo-29869: Add Nevada Sanchez to Misc/ACKS (GH-1125) https://github.com/python/cpython/commit/947629916a5ecb1f6f6792e9b9234e084c5bf274 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 21:31:11 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 01:31:11 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492133471.47.0.699925083855.issue29869@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: PR has been merged and backported to 3.6. I also added Nevada Sanchez to Misc/ACKS. Thanks all :) ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 21:31:24 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 01:31:24 +0000 Subject: [issue29869] Underscores in numeric literals not supported in lib2to3. In-Reply-To: <1490141545.37.0.710126019998.issue29869@psf.upfronthosting.co.za> Message-ID: <1492133484.47.0.770973554519.issue29869@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 22:02:33 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 02:02:33 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1492135353.47.0.114387021588.issue29694@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1261 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 22:03:58 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 02:03:58 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1492135438.42.0.970875470798.issue29694@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1262 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 22:05:10 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 14 Apr 2017 02:05:10 +0000 Subject: [issue29880] python3.6 install readline ,and then cpython exit In-Reply-To: <1490196867.91.0.906821746268.issue29880@psf.upfronthosting.co.za> Message-ID: <1492135510.51.0.667697617406.issue29880@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 22:26:18 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 02:26:18 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1492136778.66.0.606392282005.issue29694@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset cbc46afa59dcc43c2c8c90ae7a0a0dc404325a89 by Mariatta in branch '3.6': [3.6] bpo-29694: race condition in pathlib mkdir with flags parents=True (GH-1089). (GH-1126) https://github.com/python/cpython/commit/cbc46afa59dcc43c2c8c90ae7a0a0dc404325a89 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 22:26:26 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 02:26:26 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1492136786.98.0.508355807922.issue29694@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset d7abeb7024b9755c291c29bdc8c4494246e975ad by Mariatta in branch '3.5': [3.5] bpo-29694: race condition in pathlib mkdir with flags parents=True (GH-1089). (GH-1127) https://github.com/python/cpython/commit/d7abeb7024b9755c291c29bdc8c4494246e975ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 13 22:27:57 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 02:27:57 +0000 Subject: [issue29694] race condition in pathlib mkdir with flags parents=True In-Reply-To: <1488462813.87.0.464471853988.issue29694@psf.upfronthosting.co.za> Message-ID: <1492136877.38.0.700861943583.issue29694@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: I merged Armin's PR and backported tp 3.5 and 3.6. Closing this now. Thanks all :) ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 01:07:23 2017 From: report at bugs.python.org (Howie Benefiel) Date: Fri, 14 Apr 2017 05:07:23 +0000 Subject: [issue29651] Inconsistent/undocumented urlsplit/urlparse behavior on invalid inputs In-Reply-To: <1488051927.22.0.367579438822.issue29651@psf.upfronthosting.co.za> Message-ID: <1492146443.69.0.73245566665.issue29651@psf.upfronthosting.co.za> Howie Benefiel added the comment: I'm going to make a note in the documentation. I should have a PR for it in about 1 day. ---------- nosy: +Howie Benefiel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 01:38:02 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Apr 2017 05:38:02 +0000 Subject: [issue29651] Inconsistent/undocumented urlsplit/urlparse behavior on invalid inputs In-Reply-To: <1488051927.22.0.367579438822.issue29651@psf.upfronthosting.co.za> Message-ID: <1492148282.54.0.516260335694.issue29651@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1263 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 01:54:23 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 14 Apr 2017 05:54:23 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492149263.38.0.195222510098.issue30061@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 02:45:24 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 14 Apr 2017 06:45:24 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines Message-ID: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> New submission from Xiang Zhang: In _io._IOBase.readlines, it straightly uses PyIter_Next(self). But iter(_io._IOBase) does more work than just returning itself. >>> import _io >>> f = _io._IOBase() >>> f.close() >>> f.readlines() Traceback (most recent call last): File "", line 1, in ValueError: I/O operation on closed file. >>> f.readlines(10) Traceback (most recent call last): File "", line 1, in AttributeError: '_io._IOBase' object has no attribute 'read' ---------- components: IO messages: 291641 nosy: xiang.zhang priority: normal severity: normal stage: patch review status: open title: missing iter(self) in _io._IOBase.readlines type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 02:54:11 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 14 Apr 2017 06:54:11 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492152851.92.0.0749210308757.issue30068@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 03:36:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 07:36:29 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492155389.97.0.996505245009.issue30061@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Raymond, could you please look at the change in Objects/setobject.c? It makes the code slightly faster (by avoiding few function calls: PyObject_Size(), PySequence_Size()/PyMapping_Size() and sq_length/mp_length), but the main purpose is making clear that no error check is needed after calling PyObject_Size(). I'm not going to include this change in backports. Xiang suggests larger change that allows to gets rid of one PyDict_CheckExact(). What do you prefer? ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 03:43:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 07:43:22 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492155802.04.0.321372550408.issue30068@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +benjamin.peterson, serhiy.storchaka, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 05:00:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Apr 2017 09:00:28 +0000 Subject: [issue11913] sdist refuses README.rst In-Reply-To: <1303613322.81.0.629577121535.issue11913@psf.upfronthosting.co.za> Message-ID: <1492160428.69.0.297683880913.issue11913@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f9f87f0934ca570293ba7194bed3448a7f9bf39c by Victor Stinner (Ryan Gonzalez) in branch 'master': bpo-11913: Add README.rst to the distutils standard READMEs list (#563) https://github.com/python/cpython/commit/f9f87f0934ca570293ba7194bed3448a7f9bf39c ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 06:09:49 2017 From: report at bugs.python.org (sylgar) Date: Fri, 14 Apr 2017 10:09:49 +0000 Subject: [issue30069] External library behave differently when loaded by Python (maybe thread issue) Message-ID: <1492164589.43.0.483719892275.issue30069@psf.upfronthosting.co.za> New submission from sylgar: Hello, I have libsylvain.so which has just one function (sylvain_display()) which displays an hello world windows through QT libraries. I have this one program `sylvain' which is a single line program which calls sylvain_display from libsylvain.so. When I run `sylvain', I have some debug output from QT on the console, and the hello world window is displayed on my TV (I am running this on a Raspberry Pi with FreeBSD). Now, when I run python2.7 or python3.6, and load libsylvain.so either through the ctypes module or through a C extension module, and call the sylvain_display() function from python, I have the console log output from QT as with the `sylvain' program, but I don't have the window on my TV! I guess the rendering to the TV is done on a separate thread and this one is not called or locked? I came up with this simple test program to isolate the issue because both PyQT and PySide now don't work as expected, I have console log but no actual TV output. This used to work one year ago, I don't know what has changed in Python. Hope you guys will figure this out. libsylvain.cpp: http://dev.sylvaingarrigues.com/libsylvain.cpp sylvain.cpp (test program for libsylvain): http://dev.sylvaingarrigues.com/sylvain.cpp sylvain-ctypes.py (load libsylvain): http://dev.sylvaingarrigues.com/sylvain-ctypes.py Also tried with a C extension to rule out ctypes bug, same issue: sylvainmodule.cpp (python module wrapper): http://dev.sylvaingarrigues.com/sylvainmodule.cpp sylvain-next.pu (load sylvainmodule and sylvain_display): http://dev.sylvaingarrigues.com/sylvain-cext.py build script: http://dev.sylvaingarrigues.com/build.sh ---------- components: Extension Modules, FreeBSD, ctypes messages: 291644 nosy: koobs, sylgar priority: normal severity: normal status: open title: External library behave differently when loaded by Python (maybe thread issue) versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:07:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 11:07:11 +0000 Subject: [issue30070] Fix errors handling in the parser module Message-ID: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch fixes miscellaneous errors in errors handling in the parser module. This errors can cause leaking references, raising wrong exceptions, and even crashing. ---------- components: Extension Modules messages: 291645 nosy: benjamin.peterson, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Fix errors handling in the parser module type: crash versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:10:02 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 14 Apr 2017 11:10:02 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492168202.13.0.361791498752.issue29861@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 685cdb9acc3fca04a9897d88b89771ddfd50e772 by Antoine Pitrou in branch 'master': Relax test timing (bpo-29861) to avoid sporadic failures (#1120) https://github.com/python/cpython/commit/685cdb9acc3fca04a9897d88b89771ddfd50e772 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:10:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 11:10:27 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492168227.7.0.471916726955.issue30070@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1265 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:18:21 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 14 Apr 2017 11:18:21 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492168701.24.0.86048848467.issue29861@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- pull_requests: +1266 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:21:01 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 14 Apr 2017 11:21:01 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492168861.94.0.726724305414.issue29861@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- pull_requests: +1267 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:23:20 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 14 Apr 2017 11:23:20 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492169000.18.0.993039924353.issue30067@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:34:54 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 14 Apr 2017 11:34:54 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() Message-ID: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> New submission from Jeroen Demeyer: Python is supposed to encourage duck-typing, but the "inspect" module doesn't follow this advice. A particular problem is that Cython functions are not recognized by the inspect module to be functions: http://cython.readthedocs.io/en/latest/src/userguide/limitations.html#inspect-support ---------- components: Library (Lib) messages: 291647 nosy: jdemeyer, scoder priority: normal severity: normal status: open title: Duck-typing inspect.isfunction() versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:37:48 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 14 Apr 2017 11:37:48 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492169868.04.0.103806236001.issue29861@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 413a8913aee255d0635e4ddbb9c343d9e5e76fea by Antoine Pitrou in branch '3.6': Relax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1132) https://github.com/python/cpython/commit/413a8913aee255d0635e4ddbb9c343d9e5e76fea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:40:36 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 14 Apr 2017 11:40:36 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492170036.86.0.418806915818.issue30071@psf.upfronthosting.co.za> Changes by Jeroen Demeyer : ---------- keywords: +patch Added file: http://bugs.python.org/file46803/isfunction.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:45:29 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 14 Apr 2017 11:45:29 +0000 Subject: [issue29861] multiprocessing Pool keeps objects (tasks, args, results) alive too long In-Reply-To: <1490033654.49.0.302428807584.issue29861@psf.upfronthosting.co.za> Message-ID: <1492170329.83.0.39786755022.issue29861@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 47f24a018f6a9c3ed996d2b83a7ebd0d1f905827 by Antoine Pitrou in branch '3.5': Relax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1133) https://github.com/python/cpython/commit/47f24a018f6a9c3ed996d2b83a7ebd0d1f905827 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 07:56:15 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Apr 2017 11:56:15 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492170975.88.0.746772519709.issue30067@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1268 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:33:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 12:33:22 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492173202.28.0.624786732499.issue30067@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: needs patch -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:36:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Apr 2017 12:36:04 +0000 Subject: [issue30072] re function: convert count and flags parameters to keyword-only? Message-ID: <1492173364.71.0.473594285494.issue30072@psf.upfronthosting.co.za> New submission from STINNER Victor: The re API seems commonly misused. Example passing a re flag to re.sub(): >>> re.sub("A", "B", "ahah", re.I) 'ahah' No error, no warning, but it doesn't work. Oh, sub has 5 paramters, no 4... I suggest to convert count and flags to keyword-only parameters. To not break the world, especially legit code passing the count parameter as a position argument, an option is to have a deprecation period if these two parameters are passed a positional-only parameter. -- Another option would be to rely on the fact that re flags are now enums instead of raw integers, and so add basic type check... Is there are risk of applications using re flags serialized by pickle from Pyhon < 3.6 and so getting integers? Maybe the check should only be done if flags are passing as positional-only argument... but the implementation of such check seems may be overkill for such simple and performance-critical function, no? See issue #30067 for a recent bug in the Python stdlib! ---------- components: Library (Lib) messages: 291650 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: re function: convert count and flags parameters to keyword-only? versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:36:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Apr 2017 12:36:28 +0000 Subject: [issue30072] re functions: convert count and flags parameters to keyword-only? In-Reply-To: <1492173364.71.0.473594285494.issue30072@psf.upfronthosting.co.za> Message-ID: <1492173388.08.0.224306889761.issue30072@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: re function: convert count and flags parameters to keyword-only? -> re functions: convert count and flags parameters to keyword-only? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:36:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Apr 2017 12:36:33 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492173393.23.0.551379437826.issue30067@psf.upfronthosting.co.za> STINNER Victor added the comment: I created the issue #30072: "re functions: convert count and flags parameters to keyword-only?". ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:39:15 2017 From: report at bugs.python.org (Jack McCracken) Date: Fri, 14 Apr 2017 12:39:15 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492173555.36.0.47583780335.issue30067@psf.upfronthosting.co.za> Jack McCracken added the comment: Resolved in GitHub https://github.com/python/cpython/pull/1134. In 2.7, the flag re.ASCII is not passed due to 2.7's default ASCII strings. Backporting to 3.5 and 3.6. ---------- nosy: +Jack.McCracken _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:43:40 2017 From: report at bugs.python.org (Jack McCracken) Date: Fri, 14 Apr 2017 12:43:40 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492173820.11.0.360824027295.issue30067@psf.upfronthosting.co.za> Changes by Jack McCracken : ---------- pull_requests: +1269 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:44:20 2017 From: report at bugs.python.org (Jack McCracken) Date: Fri, 14 Apr 2017 12:44:20 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492173860.11.0.766619465516.issue30067@psf.upfronthosting.co.za> Changes by Jack McCracken : ---------- pull_requests: +1270 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:45:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 12:45:06 +0000 Subject: [issue30072] re functions: convert count and flags parameters to keyword-only? In-Reply-To: <1492173364.71.0.473594285494.issue30072@psf.upfronthosting.co.za> Message-ID: <1492173906.54.0.191700308534.issue30072@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a duplicate of issue11957. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> re.sub confusion between count and flags args _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:46:25 2017 From: report at bugs.python.org (Jack McCracken) Date: Fri, 14 Apr 2017 12:46:25 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492173985.83.0.129646116821.issue30067@psf.upfronthosting.co.za> Changes by Jack McCracken : ---------- pull_requests: +1271 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:47:23 2017 From: report at bugs.python.org (Jack McCracken) Date: Fri, 14 Apr 2017 12:47:23 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492174043.2.0.638408765075.issue30067@psf.upfronthosting.co.za> Jack McCracken added the comment: https://github.com/python/cpython/pull/1135 and https://github.com/python/cpython/pull/1137 backport it to 3.5 and 3.6, respectively. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:50:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Apr 2017 12:50:46 +0000 Subject: [issue11957] re.sub confusion between count and flags args In-Reply-To: <1304101630.86.0.175815070517.issue11957@psf.upfronthosting.co.za> Message-ID: <1492174246.86.0.394574699581.issue11957@psf.upfronthosting.co.za> STINNER Victor added the comment: My issue #30072 has been marked as a duplicate of this one. Copy of my msg291650: The re API seems commonly misused. Example passing a re flag to re.sub(): >>> re.sub("A", "B", "ahah", re.I) 'ahah' No error, no warning, but it doesn't work. Oh, sub has 5 paramters, no 4... I suggest to convert count and flags to keyword-only parameters. To not break the world, especially legit code passing the count parameter as a position argument, an option is to have a deprecation period if these two parameters are passed a positional-only parameter. -- Another option would be to rely on the fact that re flags are now enums instead of raw integers, and so add basic type check... Is there are risk of applications using re flags serialized by pickle from Pyhon < 3.6 and so getting integers? Maybe the check should only be done if flags are passing as positional-only argument... but the implementation of such check seems may be overkill for such simple and performance-critical function, no? See issue #30067 for a recent bug in the Python stdlib! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:51:15 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 14 Apr 2017 12:51:15 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492174275.81.0.0804785087901.issue30067@psf.upfronthosting.co.za> Xiang Zhang added the comment: My fault. ---------- nosy: +xiang.zhang versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 08:52:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Apr 2017 12:52:46 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492174366.92.0.643624292944.issue30030@psf.upfronthosting.co.za> STINNER Victor added the comment: The following builbot failure is probably related: http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.x/builds/623/steps/test/logs/stdio ====================================================================== FAIL: test_main (test.test_threadedtempfile.ThreadedTempFileTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", line 58, in test_main self.assertEqual(errors, [], msg) AssertionError: Lists differ: ['Thread-813Traceback (most recent call la[2133 chars]g\n'] != [] First list contains 4 additional elements. First extra element 0: 'Thread-813Traceback (most recent call last):\n File "D:\\buildarea\\3.x.ware-win81-release\\build\\lib\\test\\test_threadedtempfile.py", line 38, in run\n f = tempfile.TemporaryFile("w+b")\n File "D:\\buildarea\\3.x.ware-win81-release\\build\\lib\\tempfile.py", line 538, in NamedTemporaryFile\n (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)\n File "D:\\buildarea\\3.x.ware-win81-release\\build\\lib\\tempfile.py", line 246, in _mkstemp_inner\n name = next(names)\nValueError: generator already executing\n' Diff is 2461 characters long. Set self.maxDiff to None to see it. : Errors: errors 4 ok 996 Thread-813Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", line 38, in run f = tempfile.TemporaryFile("w+b") File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 538, in NamedTemporaryFile (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type) File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 246, in _mkstemp_inner name = next(names) ValueError: generator already executing Thread-814Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", line 38, in run f = tempfile.TemporaryFile("w+b") File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 538, in NamedTemporaryFile (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type) File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 246, in _mkstemp_inner name = next(names) ValueError: generator already executing Thread-819Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", line 38, in run f = tempfile.TemporaryFile("w+b") File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 538, in NamedTemporaryFile (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type) File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 246, in _mkstemp_inner name = next(names) ValueError: generator already executing Thread-823Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_threadedtempfile.py", line 38, in run f = tempfile.TemporaryFile("w+b") File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 538, in NamedTemporaryFile (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type) File "D:\buildarea\3.x.ware-win81-release\build\lib\tempfile.py", line 246, in _mkstemp_inner name = next(names) ValueError: generator already executing ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 09:26:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 13:26:49 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492176409.86.0.263627760731.issue30030@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, it is related. :( If there is no easy way to make a generator working in multithread environment we need to revert this change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 09:30:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 13:30:36 +0000 Subject: [issue11957] re.sub confusion between count and flags args In-Reply-To: <1304101630.86.0.175815070517.issue11957@psf.upfronthosting.co.za> Message-ID: <1492176636.23.0.97711888443.issue11957@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Victor, I borrowed Guido's time machine and wrote patches implementing both your suggestions a half year ago. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 09:30:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Apr 2017 13:30:51 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492176651.14.0.528587077142.issue30030@psf.upfronthosting.co.za> STINNER Victor added the comment: Why does _get_candidate_names() need a lock? Can't we produce enough entropy to reduce the risk of duplicate names in two threads? Maybe we should use SystemRandom instead, which would also avoid the need to testing if the pid changed. With one generator per thread, it would prevent the bug no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 10:18:56 2017 From: report at bugs.python.org (Julian Taylor) Date: Fri, 14 Apr 2017 14:18:56 +0000 Subject: [issue30073] binary compressed file reading corrupts newlines (lzma, gzip, bz2) Message-ID: <1492179536.71.0.785460457662.issue30073@psf.upfronthosting.co.za> New submission from Julian Taylor: Probably a case of 'don't do that' but reading lines in a compressed files in binary mode produces bytes with invalid newlines in encodings that where '\n' is encoded as something else: with lzma.open("test.xz", "wt", encoding="UTF-32-LE") as f: f.write('0 1 2\n3 4 5'); lzma.open("test.xz", "rb").readlines()[0].decode('UTF-32-LE') Fails with: UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x0a in position 20: truncated data as readlines() produces: b'0\x00\x00\x00 \x00\x00\x001\x00\x00\x00 \x00\x00\x002\x00\x00\x00\n' The last newline should be '\n'.encode('UTF-32-LE') == b'\n\x00\x00\x00' ---------- components: Library (Lib) messages: 291661 nosy: jtaylor priority: normal severity: normal status: open title: binary compressed file reading corrupts newlines (lzma, gzip, bz2) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 10:25:44 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 14 Apr 2017 14:25:44 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492179944.38.0.630206457082.issue30071@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Duck typing is not something that "Python" does, it is a style of programming done by Python programmers. You wouldn't expect isinstance() to try to "duck type", and likewise the inspect module should be precise about what it is inspecting. If inspect reports something is a duck, it should be an actual duck, not just something that quacks. I'm not sure that the CPython inspect module should care about Cython objects. I don't think that Cython functions should count as Python functions, I think they are different kinds of callables. But even if we decide that Cython function should be recognised by inspect.isfunction(), I don't think your patch is the right way to deal with it. Not every object with a __code__ attribute is a function. py> from types import SimpleNamespace py> x = SimpleNamespace(__code__=1, spam=2) py> '__code__' in dir(x) True Your patch would wrongly detect x as a function when it isn't even callable. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 10:27:46 2017 From: report at bugs.python.org (Julian Taylor) Date: Fri, 14 Apr 2017 14:27:46 +0000 Subject: [issue30073] binary compressed file reading corrupts newlines (lzma, gzip, bz2) In-Reply-To: <1492179536.71.0.785460457662.issue30073@psf.upfronthosting.co.za> Message-ID: <1492180066.64.0.941643774097.issue30073@psf.upfronthosting.co.za> Julian Taylor added the comment: on second though not really worth an issue as it is a general problem of readline on binary streams. Sorry for the noise. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 10:28:43 2017 From: report at bugs.python.org (Julian Taylor) Date: Fri, 14 Apr 2017 14:28:43 +0000 Subject: [issue30073] binary compressed file reading corrupts newlines (lzma, gzip, bz2) In-Reply-To: <1492179536.71.0.785460457662.issue30073@psf.upfronthosting.co.za> Message-ID: <1492180123.08.0.881539969927.issue30073@psf.upfronthosting.co.za> Julian Taylor added the comment: see also http://bugs.python.org/issue17083 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 10:42:56 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 14 Apr 2017 14:42:56 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492180976.81.0.269048673882.issue30071@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > If inspect reports something is a duck, it should be an actual duck, not just something that quacks. The problem is that some Python packages (Sphinx and IPython for example) really need to know whether it quacks. And the only tool they have is inspect.isfunction(), so they use that. It's silly that every single package using inspect.isfunction() should be fixed. Better just fix inspect.isfunction(). >>> from types import SimpleNamespace >>> x = SimpleNamespace(__code__=1, spam=2) >>> '__code__' in dir(x) Of course, you can always break stuff. User code is not supposed to invent new __dunder__ special names. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 10:48:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 14:48:14 +0000 Subject: [issue30067] _osx_support.py: misplaced flags in re.sub() In-Reply-To: <1492113853.22.0.518696650539.issue30067@psf.upfronthosting.co.za> Message-ID: <1492181294.3.0.498208057159.issue30067@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 10:50:55 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Apr 2017 14:50:55 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492181455.26.0.234290892987.issue30071@psf.upfronthosting.co.za> R. David Murray added the comment: The python standard library makes extensive use of duck typing. Duck typing is a pretty fundamental part of the design of Python, IMO. Even the ABC module does a bunch of duck typing, rather than requiring strict subclassing or registration. I think the request is valid, and it is mostly a matter of agreeing on the best way to identify function ducks. (I agree that Steven's example is intentionally trying to quack like a duck and so is not, IMO, a valid counter argument against using __code__). I doubt we would make such a change in anything except a feature release, though. Let's see what other devs besides Steven and I think. ---------- nosy: +r.david.murray type: -> enhancement versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 11:01:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 15:01:47 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492182107.01.0.311572994887.issue30071@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: __code__ is not enough for quacking as a function. Different code can expect other function attributes (for example __name__, __qualname__ and __module__). See also issue8488. inspect.isroutine() and inspect.ismethoddescriptor() return True for some descriptors, but they don't quack good enough for pydoc. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 11:03:39 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 14 Apr 2017 15:03:39 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492182219.16.0.851558219957.issue30071@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: At the very least, the inspect module should use more duck-typing internally. For example, consider this code from "getfile": if ismethod(object): object = object.__func__ if isfunction(object): object = object.__code__ if istraceback(object): object = object.tb_frame if isframe(object): object = object.f_code if iscode(object): return object.co_filename ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 11:26:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 15:26:20 +0000 Subject: [issue22702] to improve documentation for join() (str method) In-Reply-To: <1414017441.98.0.187335340973.issue22702@psf.upfronthosting.co.za> Message-ID: <1492183580.73.0.711569618649.issue22702@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: A reference to the iterable term was added in issue7116 when str.join() started accepting arbitrary iterables rather than just sequences. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 11:36:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 15:36:07 +0000 Subject: [issue25794] __setattr__ does not always overload operators In-Reply-To: <1449219157.0.0.30103039285.issue25794@psf.upfronthosting.co.za> Message-ID: <1492184167.16.0.510462759528.issue25794@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 11:56:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 15:56:11 +0000 Subject: [issue23787] sum() function docstring lists arguments incorrectly In-Reply-To: <1427455446.97.0.658394608092.issue23787@psf.upfronthosting.co.za> Message-ID: <1492185371.01.0.432482445806.issue23787@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Raymond, could you open a pull request? ---------- keywords: +easy nosy: +serhiy.storchaka priority: normal -> low status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 12:45:50 2017 From: report at bugs.python.org (Paul Durack) Date: Fri, 14 Apr 2017 16:45:50 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492188350.46.0.344462136637.issue30063@psf.upfronthosting.co.za> Paul Durack added the comment: @r.david.murray, rather than just closing this issue (which appears to be occurring intermittently for other users), is there a doc that you can point to that describes why there is a DeprecationWarning being printed - and what change has occurred (and when) that has led to my issue. It seems that jupyter notebooks are suffering the same problem, so I agree it's a non-standard lib issue, however some further assistance in resolving this issue by suggesting where to look would be helpful ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 12:48:25 2017 From: report at bugs.python.org (Paul Durack) Date: Fri, 14 Apr 2017 16:48:25 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492188505.82.0.701487262195.issue30063@psf.upfronthosting.co.za> Paul Durack added the comment: I also wonder whether the fact that the warnings library doesn't seems to be catching these errors when In [2]: import warnings ...: warnings.filterwarnings('ignore', category=DeprecationWarning) In [3]: import vcs /home/user/anaconda2/envs/cdatcmornclnco/lib/python2.7/json/encoder.py:207: DeprecationWarning: Interpreting naive datetime as local 2017-04-12 19:45:31.251897. Please add timezone info to timestamps. chunks = self.iterencode(o, _one_shot=True) Is being used is a similar issue - it seems something is falling through the cracks here ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:03:48 2017 From: report at bugs.python.org (Louie Lu) Date: Fri, 14 Apr 2017 17:03:48 +0000 Subject: [issue25794] __setattr__ does not always overload operators In-Reply-To: <1449219157.0.0.30103039285.issue25794@psf.upfronthosting.co.za> Message-ID: <1492189428.57.0.758561810688.issue25794@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:21:39 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 14 Apr 2017 17:21:39 +0000 Subject: [issue29990] Range checking in GB18030 decoder In-Reply-To: <1491364203.61.0.947006759836.issue29990@psf.upfronthosting.co.za> Message-ID: <1492190499.56.0.943583317646.issue29990@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:23:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 17:23:12 +0000 Subject: [issue30018] multiprocessing.Pool garbles call stack for __new__ In-Reply-To: <1491585919.25.0.878478189526.issue30018@psf.upfronthosting.co.za> Message-ID: <1492190592.73.0.839931085766.issue30018@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:26:11 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Apr 2017 17:26:11 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492190771.15.0.306463280304.issue30063@psf.upfronthosting.co.za> R. David Murray added the comment: I don't believe that warning message is generated by the python standard library. I can't find it in the codebase, and I can't think of any context in which we'd have a reason to generate that message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:29:07 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Apr 2017 17:29:07 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492190947.25.0.768933708101.issue30063@psf.upfronthosting.co.za> R. David Murray added the comment: As for the filterwarnings, If you can come up with a demonstration of a problem that does not involve third party code, please open a new issue with the reproducer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:33:08 2017 From: report at bugs.python.org (Paul Durack) Date: Fri, 14 Apr 2017 17:33:08 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492191188.56.0.82234255378.issue30063@psf.upfronthosting.co.za> Paul Durack added the comment: @r.david.murray, is this not the stdlib? https://github.com/python/cpython/blob/master/Lib/json/encoder.py#L182-L202 The error message appears to be pointing back to this, how (and why) it gets there (and what has changed recently so that this DeprecationWarning is being triggered) is the question that I am seeking answers.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:44:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 17:44:29 +0000 Subject: [issue30011] HTMLParser class is not thread safe In-Reply-To: <1491553597.55.0.784750933175.issue30011@psf.upfronthosting.co.za> Message-ID: <1492191869.17.0.766322101231.issue30011@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1272 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:56:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 17:56:22 +0000 Subject: [issue30035] [RFC] PyMemberDef.name should be const char * In-Reply-To: <1491885285.14.0.166738608305.issue30035@psf.upfronthosting.co.za> Message-ID: <1492192582.3.0.332334104813.issue30035@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PyMemberDef.name already is "const char *" in 3.7 (see issue28761). Adding the const qualifier in other branches can break existing code that assigns PyMemberDef.name to a variable of type "char *". This is not appropriate for bugfix releases. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 13:59:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 17:59:26 +0000 Subject: [issue30044] shutil.copystat should (allow to) copy ownership, and other attributes In-Reply-To: <1491925353.8.0.782070431072.issue30044@psf.upfronthosting.co.za> Message-ID: <1492192766.06.0.288225293685.issue30044@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- versions: -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 14:43:08 2017 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 14 Apr 2017 18:43:08 +0000 Subject: [issue11957] re.sub confusion between count and flags args In-Reply-To: <1304101630.86.0.175815070517.issue11957@psf.upfronthosting.co.za> Message-ID: <1492195388.66.0.913704723497.issue11957@psf.upfronthosting.co.za> Changes by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 14:55:29 2017 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 14 Apr 2017 18:55:29 +0000 Subject: [issue11957] re.sub confusion between count and flags args In-Reply-To: <1304101630.86.0.175815070517.issue11957@psf.upfronthosting.co.za> Message-ID: <1492196129.2.0.651189982565.issue11957@psf.upfronthosting.co.za> Jakub Wilk added the comment: + raise TypeError("sub() takes from 2 to 4 positional arguments " + "but %d were given" % (4 + len(args))) It's actually 3 to 5 for sub() and subn(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 15:18:04 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Apr 2017 19:18:04 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492197484.99.0.606260403251.issue30063@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, but the way deprecation warnings work is that there is a stacklevel specified, and the line reported in the error is that number of steps back up the call stack from where the warning was actually issued. The json module doesn't natively handle datetime, so there *must* be third party code that is doing the datetime encoding. It is that code that is triggering the Deprecation warning, and the stacklevel on that deprecation warning must skip the third party code and go up another level to land in the encode.py file. (self.iterencode can result in a call out to user code.) This may or may not be a bug in the third party DeprecationWarning...it is sometimes hard to get stacklevel right for all cases, especially if the code in question is usually called from a nested function inside the library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 15:18:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 19:18:37 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492197517.51.0.789544642526.issue30059@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 0dc5c3169dcd4853612d11ed8c92b12fa210c07f by Serhiy Storchaka (Michael Seifert) in branch 'master': bpo-30059: Include Py_Ellipsis in C API documentation (#1018) https://github.com/python/cpython/commit/0dc5c3169dcd4853612d11ed8c92b12fa210c07f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 15:23:01 2017 From: report at bugs.python.org (Paul Durack) Date: Fri, 14 Apr 2017 19:23:01 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492197781.1.0.164689167479.issue30063@psf.upfronthosting.co.za> Paul Durack added the comment: @r.david.murray fair enough, so it's an external lib that is the problem.. It does appear that similar issues have been appearing fairly recently across the github-o-sphere, some of these instances are listed at https://github.com/jupyter/jupyter/issues/253#issue-221849527 I've managed to solve my usability problem by commenting out a `#warnings.simplefilter('default')` line in the vcs package, which gets me back up and working, but still seems like there is a tangle up somewhere.. Thanks for taking the time to educate me ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 15:32:14 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Apr 2017 19:32:14 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492198334.35.0.526690574154.issue30063@psf.upfronthosting.co.za> R. David Murray added the comment: I thought something like that might be the problem with your attempt to suppress the warnings. A library really should not call a global state function such as filterwarnings, that should be done only by the application. You might want to file a bug report with them about that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 15:33:57 2017 From: report at bugs.python.org (Paul Durack) Date: Fri, 14 Apr 2017 19:33:57 +0000 Subject: [issue30063] DeprecationWarning in json/encoder.py In-Reply-To: <1492051226.05.0.41504745507.issue30063@psf.upfronthosting.co.za> Message-ID: <1492198437.7.0.962839909466.issue30063@psf.upfronthosting.co.za> Paul Durack added the comment: @r.david.murray, yep one step ahead of your last comment https://github.com/UV-CDAT/vcs/issues/170#issuecomment-294219991 feel free to chime in if you think something else would be useful to highlight ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 15:41:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 19:41:48 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1492198908.13.0.340291759361.issue30040@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I got following result: $ ./python.patched -m perf timeit --compare-to=./python.default --duplicate=100 -- '{}' python.default: ..................... 203 ns +- 5 ns python.patched: ..................... 97.1 ns +- 0.7 ns Mean +- std dev: [python.default] 203 ns +- 5 ns -> [python.patched] 97.1 ns +- 0.7 ns: 2.09x faster (-52%) $ ./python.patched -m perf timeit --compare-to=./python.default --duplicate=100 -- 'x={}; x[1]=1' python.default: ..................... 494 ns +- 5 ns python.patched: ..................... 592 ns +- 7 ns Mean +- std dev: [python.default] 494 ns +- 5 ns -> [python.patched] 592 ns +- 7 ns: 1.20x slower (+20%) Seems something is wrong with resizing an empty dict. It shouldn't take such much time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 15:42:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Apr 2017 19:42:35 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492198955.44.0.0478336048769.issue30059@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 20:17:00 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 15 Apr 2017 00:17:00 +0000 Subject: [issue29931] ipaddress.ip_interface __lt__ check seems to be broken In-Reply-To: <1490697440.73.0.104969617886.issue29931@psf.upfronthosting.co.za> Message-ID: <1492215420.93.0.175545689927.issue29931@psf.upfronthosting.co.za> Berker Peksag added the comment: I think we should backport this to at least 3.6. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 20:23:13 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 15 Apr 2017 00:23:13 +0000 Subject: [issue29651] Inconsistent/undocumented urlsplit/urlparse behavior on invalid inputs In-Reply-To: <1488051927.22.0.367579438822.issue29651@psf.upfronthosting.co.za> Message-ID: <1492215793.1.0.771838213653.issue29651@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- stage: needs patch -> patch review versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:06:09 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:06:09 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492218369.78.0.0450735999496.issue29738@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 2849cc34a8db93d448a62d69c462402347b50dcb by Mariatta (Olivier Vielpeau) in branch 'master': bpo-29738: Fix memory leak in _get_crl_dp (GH-526) https://github.com/python/cpython/commit/2849cc34a8db93d448a62d69c462402347b50dcb ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:07:01 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:07:01 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492218421.84.0.289171528195.issue29738@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1273 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:07:10 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:07:10 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492218430.85.0.905205303485.issue29738@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1274 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:07:18 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:07:18 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492218438.45.0.752693195252.issue29738@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1275 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:16:17 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 15 Apr 2017 01:16:17 +0000 Subject: [issue10379] locale.format() input regression In-Reply-To: <1289345606.99.0.972407204822.issue10379@psf.upfronthosting.co.za> Message-ID: <1492218977.02.0.21940534806.issue10379@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- pull_requests: +1276 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:18:44 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 15 Apr 2017 01:18:44 +0000 Subject: [issue10379] locale.format() input regression In-Reply-To: <1289345606.99.0.972407204822.issue10379@psf.upfronthosting.co.za> Message-ID: <1492219124.98.0.0720178346153.issue10379@psf.upfronthosting.co.za> Berker Peksag added the comment: I think the solution in PR 259 is great, but I still find the documentation a little bit vague. I've just opened PR 1145 to add some examples specifiers. ---------- nosy: +berker.peksag stage: needs patch -> patch review versions: +Python 3.7 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:24:24 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:24:24 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492219464.12.0.109642123477.issue29738@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset b2b00e039ce71e69148e5f479e2154c1c7b712ca by Mariatta in branch '2.7': [2.7] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1144) https://github.com/python/cpython/commit/b2b00e039ce71e69148e5f479e2154c1c7b712ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:27:23 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:27:23 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492219643.66.0.191064106576.issue29738@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1277 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:33:50 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:33:50 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492220030.83.0.359931204211.issue29738@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 39f5956ffbcc4fe83cee59eed1d18845a5b25dd2 by Mariatta in branch 'master': bpo-29738: Add Olivier Vielpeau to Misc/ACKS (GH-1146) https://github.com/python/cpython/commit/39f5956ffbcc4fe83cee59eed1d18845a5b25dd2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:34:13 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:34:13 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492220053.31.0.612774988669.issue29738@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 8e7201342dc6eef201bfa4f533ad89a8144fd693 by Mariatta in branch '3.6': [3.6] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1142) https://github.com/python/cpython/commit/8e7201342dc6eef201bfa4f533ad89a8144fd693 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:36:13 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:36:13 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492220173.47.0.854613388081.issue29738@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset c40740cf06470a774e98f84537801cd8b7176938 by Mariatta in branch '3.5': [3.5] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1143) https://github.com/python/cpython/commit/c40740cf06470a774e98f84537801cd8b7176938 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:38:26 2017 From: report at bugs.python.org (Michael Seifert) Date: Sat, 15 Apr 2017 01:38:26 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492220306.16.0.0522622098493.issue30059@psf.upfronthosting.co.za> Changes by Michael Seifert : ---------- pull_requests: +1278 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:38:28 2017 From: report at bugs.python.org (Michael Seifert) Date: Sat, 15 Apr 2017 01:38:28 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492220308.67.0.316988405061.issue30059@psf.upfronthosting.co.za> Changes by Michael Seifert : ---------- pull_requests: +1279 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:38:50 2017 From: report at bugs.python.org (Michael Seifert) Date: Sat, 15 Apr 2017 01:38:50 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492220330.01.0.433107464779.issue30059@psf.upfronthosting.co.za> Changes by Michael Seifert : ---------- pull_requests: +1280 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:39:44 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:39:44 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492220384.86.0.858286011867.issue29738@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: I merged Olivier's PR, and backported into 3.6, 3.5, and 2.7. I also added Olivier Vielpeau to misc/ACKS. Thanks :) ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 21:44:09 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 01:44:09 +0000 Subject: [issue29870] ssl socket leak In-Reply-To: <1490145031.23.0.122177607626.issue29870@psf.upfronthosting.co.za> Message-ID: <1492220649.78.0.280412341716.issue29870@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: I believe this was fixed in https://bugs.python.org/issue29738, so I'm closing this. Thanks :) ---------- nosy: +Mariatta resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 22:01:52 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 15 Apr 2017 02:01:52 +0000 Subject: [issue22708] httplib/http.client in method _tunnel used HTTP/1.0 CONNECT method In-Reply-To: <1414045283.61.0.401738994501.issue22708@psf.upfronthosting.co.za> Message-ID: <1492221712.94.0.717375633439.issue22708@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +berker.peksag versions: +Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 22:03:44 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 02:03:44 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492221824.17.0.652454896073.issue30059@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 05bfbcd233b2f5ba0d0634a380092d6ead6b35e1 by Mariatta (Michael Seifert) in branch '3.6': [3.6] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1149) https://github.com/python/cpython/commit/05bfbcd233b2f5ba0d0634a380092d6ead6b35e1 ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 22:04:24 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 02:04:24 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492221864.16.0.210346498149.issue30059@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 0b46fcf45afe32402b34240770e01be9b5da3031 by Mariatta (Michael Seifert) in branch '2.7': [2.7] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1147) https://github.com/python/cpython/commit/0b46fcf45afe32402b34240770e01be9b5da3031 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 22:05:02 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 02:05:02 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492221902.4.0.647640520436.issue30059@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset f40e72dbe60038eae69bc72e207ac47851d96752 by Mariatta (Michael Seifert) in branch '3.5': [3.5] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1148) https://github.com/python/cpython/commit/f40e72dbe60038eae69bc72e207ac47851d96752 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 22:05:54 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 15 Apr 2017 02:05:54 +0000 Subject: [issue30059] No documentation for C type Py_Ellipsis In-Reply-To: <1492017917.83.0.872522904102.issue30059@psf.upfronthosting.co.za> Message-ID: <1492221954.88.0.1804890279.issue30059@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 14 22:06:04 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 15 Apr 2017 02:06:04 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1492221964.69.0.918410361659.issue19225@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset eaeda64c2fd2abd33e59b03298f9cdc9e8efef89 by Berker Peksag (cocoatomo) in branch 'master': bpo-19225: Remove duplicated description for standard warning categories (GH-1068) https://github.com/python/cpython/commit/eaeda64c2fd2abd33e59b03298f9cdc9e8efef89 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 00:15:13 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Apr 2017 04:15:13 +0000 Subject: [issue30022] Get rid of using EnvironmentError and IOError In-Reply-To: <1491645939.23.0.623640815202.issue30022@psf.upfronthosting.co.za> Message-ID: <1492229713.57.0.375556997951.issue30022@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I checked the patch and it appears to be a clean search/replace. I assume that the aliases have the same diff in C as in Python. The only idlelib replacement is in run.py, where I (mistakenly) added IOError in 3.3 and 3.4 as well as in 2.7. This must have been after a previous global replacement. I would like this change backported to 3.6 to keep the files identical. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 00:22:57 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Apr 2017 04:22:57 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1492230177.1.0.480143214892.issue30031@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I prefer use of argparse. Patch *looks* good reading it, but I cannot test yet. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 00:47:30 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 04:47:30 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492231650.77.0.280654306177.issue30068@psf.upfronthosting.co.za> Xiang Zhang added the comment: New changeset 026435ce49419a3366171416c68114dd8a1144c7 by Xiang Zhang in branch 'master': bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130) https://github.com/python/cpython/commit/026435ce49419a3366171416c68114dd8a1144c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 00:56:19 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 04:56:19 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492232179.21.0.661717107417.issue30068@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1281 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 00:57:45 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 04:57:45 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492232265.2.0.632654982884.issue30068@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1282 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 01:03:49 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 05:03:49 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492232629.81.0.817564358483.issue30068@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1283 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 01:05:51 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Apr 2017 05:05:51 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1492232751.38.0.302314601127.issue30034@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Keith, while I sympathize with the request, I am going to agree with the others and close this. As I see it, csv exists to solve a particular problem. We want a printable file of records and text fields with visible field and record separators, but we may want to use those separators within fields. So we add a quote character as an auxiliary delimiter and ignore separators within quotes. Files with mismatched quotes are broken. You are willing to append a quote, even though that may be the wrong thing to do. Alternatives include: skip the line, perhaps after logging it; delete the last quote to make the count even; provide a more sophisticated auto-editing function; or display a GUI entry box initialized to the bad line and request the user to edit until quotes are matched. I don't think we should pick any of these. ---------- nosy: +terry.reedy resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 01:18:24 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 05:18:24 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492233504.72.0.615226101448.issue30068@psf.upfronthosting.co.za> Xiang Zhang added the comment: New changeset 5fbdfc36f397ad46f4057d527855dfacb77242ce by Xiang Zhang in branch '2.7': bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1152) https://github.com/python/cpython/commit/5fbdfc36f397ad46f4057d527855dfacb77242ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 01:25:17 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 05:25:17 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492233917.09.0.356173410596.issue30068@psf.upfronthosting.co.za> Xiang Zhang added the comment: New changeset d5fa5f3ce7d9003bbd3975d1bf634043305ae18f by Xiang Zhang in branch '3.6': bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130) (#1150) https://github.com/python/cpython/commit/d5fa5f3ce7d9003bbd3975d1bf634043305ae18f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 01:28:10 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 05:28:10 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492234090.07.0.649972286546.issue30068@psf.upfronthosting.co.za> Xiang Zhang added the comment: New changeset 4f43f87b6246e13e0eefc793a2c5415c915723c3 by Xiang Zhang in branch '3.5': bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130) (#1151) https://github.com/python/cpython/commit/4f43f87b6246e13e0eefc793a2c5415c915723c3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 01:28:43 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 05:28:43 +0000 Subject: [issue30068] missing iter(self) in _io._IOBase.readlines In-Reply-To: <1492152323.97.0.555088221985.issue30068@psf.upfronthosting.co.za> Message-ID: <1492234123.14.0.557006844914.issue30068@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 01:46:47 2017 From: report at bugs.python.org (Alessandro Vesely) Date: Sat, 15 Apr 2017 05:46:47 +0000 Subject: [issue30011] HTMLParser class is not thread safe In-Reply-To: <1492191869.2.0.451850637937.issue30011@psf.upfronthosting.co.za> Message-ID: <6b4f0011-63a0-762f-2eaf-cdb241c86771@tana.it> Alessandro Vesely added the comment: On Fri 14/Apr/2017 19:44:29 +0200 Serhiy Storchaka wrote: > > Changes by Serhiy Storchaka : > > > ---------- > pull_requests: +1272 Thank you for your fix, Serhiy. It makes the class behave consistently. However, busy processes are going to concurrently build multiple temporary entitydefs objects before one of them wins, which is probably worse than the greedy starting that such lazy initialization tries to avoid in the first place. Doesn't that design deserve a comment in the code, at least? Greetings Ale ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 02:06:47 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Apr 2017 06:06:47 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492236407.5.0.55179820167.issue30071@psf.upfronthosting.co.za> Terry J. Reedy added the comment: inspect.isfunction(object) is documented to Return true if the object is a Python function, which includes functions created by a lambda expression. This is currently implemented as "isinstance(object, types.FunctionType)". The docs usually regard a 'Python function' as the result of a def statement or lambda expression. The inspect doc says that a function includes a particular set of attributes. One of them is a code object with its own fairly extensive set of attributes. Some of them are derived from the Python code. But others, in particular co_code, are specific to the current CPython bytecode version. (And co_code is intentionally writable.) To me, the main purpose of checking that something is a function, as opposed to just being callable, is to know whether one can dependably access the attributes. Given that some are inherently CPython specific, including objects compiled by third-party software seems dubious. (There is also the issue of not being able to test with 3rd party objects.) The referenced cython doc says """While it is quite possible to emulate the interface of functions in Cython?s own function type, and recent Cython releases have seen several improvements here,""" To me, this implies to me that Cython function (compiled from Cython's extended def statements) do not yet perfectly emulate (fulfill) 'Python functions'. As indicated above, perfect emulation seems impossible for Cython or any other external compiler that does not use the same bytecode. """the ?inspect? module does not consider a Cython implemented function a ?function?, because it tests the object type explicitly instead of comparing an abstract interface or an abstract base class. This has a negative impact on code that uses inspect to inspect function objects, but would require a change to Python itself.""" Where the current situation would be annoying is if working code uses isfunction and then Cython is used to speed up the code. But Cython could supply, if it does not now, expanded functions along with the list of cyfunction attributes and an indication of which are compatible with CPython function attributes. Cython is not the only 3rd party compiler, and not the only one that might ever be linkable to CPython. So any change to CPython should not be limited to Cython. If it were possible for Cython to makes its CythonFunction class a subclass of FunctionType, the issue would be 'solved', though the incompatibilities would remain. ---------- nosy: +terry.reedy stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 02:12:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 06:12:21 +0000 Subject: [issue30011] HTMLParser class is not thread safe In-Reply-To: <1491553597.55.0.784750933175.issue30011@psf.upfronthosting.co.za> Message-ID: <1492236741.36.0.0135431478162.issue30011@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is nothing wrong with building entitydefs multiple times since the result is same. An alternative is using locking, but this is more cumbersome solution. And building entitydefs is much faster than importing the threading module. $ ./python -m timeit -s 'from HTMLParser import HTMLParser; p = HTMLParser()' -- 'HTMLParser.entitydefs = None; p.unescape("&")' 1000 loops, best of 3: 412 usec per loop $ ./python -m timeit -s 'import sys; m = sys.modules.copy()' -- 'import threading; sys.modules.clear(); sys.modules.update(m)' 100 loops, best of 3: 5.43 msec per loop Current solution is faster in single-thread case, correct likely fast enough in multi-thread case. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 03:03:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 07:03:40 +0000 Subject: [issue25632] Document BUILD_*_UNPACK opcodes In-Reply-To: <1447654337.27.0.0979674663638.issue25632@psf.upfronthosting.co.za> Message-ID: <1492239820.44.0.37934282431.issue25632@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: They were documented in issue26213. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Document BUILD_*_UNPACK opcodes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 03:06:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 07:06:10 +0000 Subject: [issue19184] dis module has incorrect docs for RAISE_VARARGS In-Reply-To: <1381078012.05.0.236677780468.issue19184@psf.upfronthosting.co.za> Message-ID: <1492239970.69.0.989739989195.issue19184@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> needs patch versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 03:46:43 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 15 Apr 2017 07:46:43 +0000 Subject: [issue30074] compile warnings of _PySlice_Unpack in 2.7 Message-ID: <1492242403.66.0.870885326202.issue30074@psf.upfronthosting.co.za> New submission from Xiang Zhang: Compile 2.7 now get many warning about _PySlice_Unpack, not in 3.x. See an example: http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%202.7/builds/109/steps/compile/logs/warnings%20%2822%29. ---------- messages: 291708 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: compile warnings of _PySlice_Unpack in 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 04:21:05 2017 From: report at bugs.python.org (Alessandro Vesely) Date: Sat, 15 Apr 2017 08:21:05 +0000 Subject: [issue30011] HTMLParser class is not thread safe In-Reply-To: <1492236741.36.0.0135431478162.issue30011@psf.upfronthosting.co.za> Message-ID: <1643e354-bf50-dff0-85c5-930d864fc16d@tana.it> Alessandro Vesely added the comment: Serhiy's analysis is correct. If anything more than a comment is going to make its way to the code, I'd suggest to move dictionary building to its own function, so that it can be called either on first use --like now-- or before threading if the user is concerned. I agree there is nothing wrong with multiple builds. My point is just a minor, bearable inefficiency. It can be neglected. Its most annoying case is probably with test suites, which are more likely to shoot up a bunch of new threads all at once. Greetings Ale ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 04:34:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 08:34:59 +0000 Subject: [issue22352] Ensure opcode names and args fit in disassembly output In-Reply-To: <1410065891.58.0.12430207232.issue22352@psf.upfronthosting.co.za> Message-ID: <1492245299.92.0.0151595159603.issue22352@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1284 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 04:38:31 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 08:38:31 +0000 Subject: [issue22352] Ensure opcode names and args fit in disassembly output In-Reply-To: <1410065891.58.0.12430207232.issue22352@psf.upfronthosting.co.za> Message-ID: <1492245511.42.0.0728302073408.issue22352@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Proposed patch adjusts column widths of the output of dis.dis() for large line numbers and instruction offsets and adds tests for widths of opcode names. Unfortunately this test is failed for two new opcodes: BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL (26 and 28 characters respectively). ---------- nosy: +serhiy.storchaka stage: -> patch review type: behavior -> enhancement versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 05:53:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 09:53:08 +0000 Subject: [issue30074] compile warnings of _PySlice_Unpack in 2.7 In-Reply-To: <1492242403.66.0.870885326202.issue30074@psf.upfronthosting.co.za> Message-ID: <1492249988.36.0.789882545351.issue30074@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1285 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 07:02:27 2017 From: report at bugs.python.org (Kaeptm Blaubaer) Date: Sat, 15 Apr 2017 11:02:27 +0000 Subject: [issue29378] Invalid example in documentation for PyErr_Fetch In-Reply-To: <1485447904.37.0.693014852804.issue29378@psf.upfronthosting.co.za> Message-ID: <1492254147.53.0.742656652684.issue29378@psf.upfronthosting.co.za> Kaeptm Blaubaer added the comment: Please don't close the bug until it is fixed in the python 3.5 documentation! ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 07:35:47 2017 From: report at bugs.python.org (Kaeptm Blaubaer) Date: Sat, 15 Apr 2017 11:35:47 +0000 Subject: [issue29378] Invalid example in documentation for PyErr_Fetch In-Reply-To: <1485447904.37.0.693014852804.issue29378@psf.upfronthosting.co.za> Message-ID: <1492256147.81.0.436830658268.issue29378@psf.upfronthosting.co.za> Kaeptm Blaubaer added the comment: The error is fixed in Python 3.5.3 documentation. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 07:36:59 2017 From: report at bugs.python.org (Kaeptm Blaubaer) Date: Sat, 15 Apr 2017 11:36:59 +0000 Subject: [issue27727] Update Tools/freeze to use .vcxproj files In-Reply-To: <1470839867.79.0.0217135468923.issue27727@psf.upfronthosting.co.za> Message-ID: <1492256219.65.0.413338311364.issue27727@psf.upfronthosting.co.za> Changes by Kaeptm Blaubaer : ---------- resolution: -> duplicate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 08:49:03 2017 From: report at bugs.python.org (Cornelius Diekmann) Date: Sat, 15 Apr 2017 12:49:03 +0000 Subject: [issue29070] Integration tests for pty.spawn on Linux and all other platforms In-Reply-To: <1482684225.17.0.467768789806.issue29070@psf.upfronthosting.co.za> Message-ID: <1492260543.12.0.940183121693.issue29070@psf.upfronthosting.co.za> Cornelius Diekmann added the comment: Thank you Martin for your comments in the code review tool. I prepared a new patch for the code review tool. The github changelog from patch v4 (Feb 2017) to my HEAD (currently patch v5, Apr 2017) is at: https://github.com/python/cpython/compare/master...diekmann:wip-issue-29070?expand=1 I hope that having several micro commits instead of one huge patch is helpful. In the end, it will be squashed anyway. Do you prefer to continue with bpo patches or have a github pull request? ---------- Added file: http://bugs.python.org/file46804/pty.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 09:24:14 2017 From: report at bugs.python.org (Keith Erskine) Date: Sat, 15 Apr 2017 13:24:14 +0000 Subject: [issue30034] csv reader chokes on bad quoting in large files In-Reply-To: <1491861025.06.0.741376367599.issue30034@psf.upfronthosting.co.za> Message-ID: <1492262654.44.0.863395039662.issue30034@psf.upfronthosting.co.za> Keith Erskine added the comment: OK Terry. Thank you everybody for your thoughts and suggestions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 10:22:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 14:22:00 +0000 Subject: [issue11822] Improve disassembly to show embedded code objects In-Reply-To: <1302467152.39.0.854888976189.issue11822@psf.upfronthosting.co.za> Message-ID: <1492266120.34.0.637192448841.issue11822@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1286 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 10:30:46 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 14:30:46 +0000 Subject: [issue11822] Improve disassembly to show embedded code objects In-Reply-To: <1302467152.39.0.854888976189.issue11822@psf.upfronthosting.co.za> Message-ID: <1492266646.15.0.944662741492.issue11822@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The issue was open 6 years ago. The feature could be added in 3.3. But it still not implemented. Since there are problems with outputting the disassembly of internal code objects expanded in-line, proposed patch just outputs them after the disassembly of the main code object (similar to original Raymond's proposition). This is simpler and doesn't make the output too wide. ---------- versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 11:06:26 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Sat, 15 Apr 2017 15:06:26 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492268786.85.0.904799903552.issue30071@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > As indicated above, perfect emulation seems impossible for Cython or any other external compiler that does not use the same bytecode. True, Cython functions are not implemented using Python bytecode, so perfect emulation is impossible. The use case I care most about is getargspec(), which is fully supported by Cython functions. > If it were possible for Cython to makes its CythonFunction class a subclass of FunctionType, the issue would be 'solved', though the incompatibilities would remain. That's an interesting idea. Currently, that is simply impossible because >>> from types import FunctionType >>> class X(FunctionType): pass Traceback (most recent call last): File "", line 1, in TypeError: type 'function' is not an acceptable base type Still, one could argue to change the implementation of FunctionType. If you do that, it would be best to define a BaseFunctionType and then have Cython functions and Python functions inherit from that. Personally, I think that's an even better but much more involved solution (I guess it would require a PEP). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 11:35:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 15:35:48 +0000 Subject: [issue30011] HTMLParser class is not thread safe In-Reply-To: <1491553597.55.0.784750933175.issue30011@psf.upfronthosting.co.za> Message-ID: <1492270548.34.0.0554087247673.issue30011@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 50f948edda0e6465e194ecc50b85fa2646039b8d by Serhiy Storchaka in branch '2.7': bpo-30011: Fixed race condition in HTMLParser.unescape(). (#1140) https://github.com/python/cpython/commit/50f948edda0e6465e194ecc50b85fa2646039b8d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 11:50:09 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 15 Apr 2017 15:50:09 +0000 Subject: [issue11822] Improve disassembly to show embedded code objects In-Reply-To: <1302467152.39.0.854888976189.issue11822@psf.upfronthosting.co.za> Message-ID: <1492271409.93.0.443029802862.issue11822@psf.upfronthosting.co.za> Nick Coghlan added the comment: +1 for listing the nested code objects after the original one. In reviewing Serhiy's patch, the core technical implementation looks OK to me, but I think we may want to go with a "depth" argument rather than a simple "recursive" flag. My rationale for that relates to directly disassembling module and class source code: - dis(module_source, depth=1) # Module, class bodies, function bodies - dis(class_source, depth=1) # Class and method bodies (with the default depth being 0, to disable recursive descent entirely) Only if you set a higher depth than 1 would you start seeing things like closures, comprehension bodies, and nested classes. With a simple all-or-nothing flag, I think module level recursive disassembly would be too noisy to be useful. The bounded depth approach would also avoid a problem with invalid bytecode manipulations that manage to create a loop between two bytecode objects. While the *compiler* won't do that, there's no guarantee that the disassembler is being fed valid bytecode, so we should avoid exposing ourselves to any infinite loops in the display code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 12:01:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 16:01:18 +0000 Subject: [issue30011] HTMLParser class is not thread safe In-Reply-To: <1491553597.55.0.784750933175.issue30011@psf.upfronthosting.co.za> Message-ID: <1492272078.42.0.687967895615.issue30011@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 12:21:00 2017 From: report at bugs.python.org (Tithen Firion) Date: Sat, 15 Apr 2017 16:21:00 +0000 Subject: [issue30075] Printing ANSI Escape Sequences on Windows 10 Message-ID: <1492273260.15.0.200357892895.issue30075@psf.upfronthosting.co.za> New submission from Tithen Firion: Windows 10 supports ANSI Escape Sequences ( http://stackoverflow.com/a/38617204/2428152 https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx ) but Python just prints escape character. Adding `subprocess.call('', shell=True)` before printing solved the issue. Test code: import subprocess print('\033[0;31mTEST\033[0m') subprocess.call('', shell=True) print('\033[0;31mTEST\033[0m') output in attachment. Haven't tested it on other Python versions but it probably occurs on them too. ---------- components: IO files: example.png messages: 291719 nosy: Tithen Firion priority: normal severity: normal status: open title: Printing ANSI Escape Sequences on Windows 10 type: behavior versions: Python 2.7, Python 3.6 Added file: http://bugs.python.org/file46805/example.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 12:36:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 16:36:04 +0000 Subject: [issue11822] Improve disassembly to show embedded code objects In-Reply-To: <1302467152.39.0.854888976189.issue11822@psf.upfronthosting.co.za> Message-ID: <1492274164.22.0.655135181474.issue11822@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The problem with the *depth* parameter is that it adds a burden of choosing the value for the end user. "Oh, there are more deeper code objects, I must increase the depth and rerun dis()!" I think in most cases when that parameter is specified it would be set to some large value like 999 because you don't want to set it too small. Compare for example with the usage of the attribute maxDiff in unittests. The single depth parameter doesn't adds too much control. You can't enable disassembling functions and method bodies but disable disassembling comprehensions in functions. If you need more control, you should use non-recursive dis() and manually walk the tree of code objects. How much output adds unlimited recursion in comparison with the recursion limited by the first level? As for supporting invalid bytecode, currently the dis module doesn't support it (see issue26694). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 13:02:03 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 15 Apr 2017 17:02:03 +0000 Subject: [issue11822] Improve disassembly to show embedded code objects In-Reply-To: <1302467152.39.0.854888976189.issue11822@psf.upfronthosting.co.za> Message-ID: <1492275723.79.0.0795349547505.issue11822@psf.upfronthosting.co.za> Nick Coghlan added the comment: The problem I see is that we have conflicting requirements for the default behaviour: - if we modify dis() instead of adding a new function, then the default behaviour needs to be non-recursive for backwards compatibility reasons - if we allow the depth to be configurable, then we'd like the default behaviour to be to show everything One potential resolution to that would be to define this as a new function, `distree`, rather than modifying `dis` and `disassemble` to natively support recursion. Then the new function could accept a `depth` argument (addressing my concerns), but have `depth=None` as the default (addressing your concerns). If we wanted to allow even more control than that, then I think os.walk provides a useful precedent, where we'd add a new `dis.walk` helper that just looked at `co_consts` to find nested code objects without doing any of the other disassembly work. The dis.walk() helper would produce an iterable of (depth, code, nested) 3-tuples, where: - the first item is the current depth in the compile tree - the second is the code object itself - the third is a list of nested code objects Similar to os.walk(), editing the list of nested objects in place would let you control whether or not any further recursion took place. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 13:11:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 17:11:14 +0000 Subject: [issue30074] compile warnings of _PySlice_Unpack in 2.7 In-Reply-To: <1492242403.66.0.870885326202.issue30074@psf.upfronthosting.co.za> Message-ID: <1492276274.35.0.423105187396.issue30074@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 5e79321742cb3af2184d22e2148c6756cade1864 by Serhiy Storchaka in branch '2.7': bpo-30074: Fix compile warnings of _PySlice_Unpack and convert missed (#1154) https://github.com/python/cpython/commit/5e79321742cb3af2184d22e2148c6756cade1864 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 13:12:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 17:12:20 +0000 Subject: [issue30074] compile warnings of _PySlice_Unpack in 2.7 In-Reply-To: <1492242403.66.0.870885326202.issue30074@psf.upfronthosting.co.za> Message-ID: <1492276340.53.0.0349689743527.issue30074@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for pointing on this and for your review Xiang! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 13:24:53 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Sat, 15 Apr 2017 17:24:53 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492277093.52.0.935469640427.issue30071@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: For the record: the __code__ attribute of a Cython function is a real "code" object (the same type as the __code__ attribute of a Python function). Of course not all fields are relevant, for example co_code is empty. So I think it's clear that Cython tries really hard to be compatible with Python functions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 13:27:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Apr 2017 17:27:19 +0000 Subject: [issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long Message-ID: <1492277239.5.0.348724747458.issue30076@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Two new opcodes BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL (added in 3.5 and 3.6) have too long names (26 and 28 characters). This exceeds the width of the opcode names in the dis module (20 characters). Increasing the width of the column will make opcode arguments too distant from opcode names, that will decrease readability. The better solution would be renaming these two opcodes. They are used for merging iterables and mappings of positional and keyword arguments when used var-positional (*args) and var-keyword (**kwargs) arguments. Maybe new names should reflect this. >>> dis.dis('f(a, b, *args, x=x, y=y, **kw)') 1 0 LOAD_NAME 0 (f) 2 LOAD_NAME 1 (a) 4 LOAD_NAME 2 (b) 6 BUILD_TUPLE 2 8 LOAD_NAME 3 (args) 10 BUILD_TUPLE_UNPACK_WITH_CALL 2 12 LOAD_NAME 4 (x) 14 LOAD_NAME 5 (y) 16 LOAD_CONST 0 (('x', 'y')) 18 BUILD_CONST_KEY_MAP 2 20 LOAD_NAME 6 (kw) 22 BUILD_MAP_UNPACK_WITH_CALL 2 24 CALL_FUNCTION_EX 1 26 RETURN_VALUE ---------- messages: 291725 nosy: ncoghlan, serhiy.storchaka priority: normal severity: normal status: open title: Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 14:18:47 2017 From: report at bugs.python.org (Aviv Palivoda) Date: Sat, 15 Apr 2017 18:18:47 +0000 Subject: [issue29021] Custom functions in sqlite receive None on invalid UTF-8 In-Reply-To: <1482225891.27.0.11020777474.issue29021@psf.upfronthosting.co.za> Message-ID: <1492280327.44.0.755888047822.issue29021@psf.upfronthosting.co.za> Aviv Palivoda added the comment: In my patch I use sqlite3_create_function_v2 which was added in sqlite 3.7.3 (2010-10-08). There were a few problems after adding sqlite3_stmt_readonly in 284676cf2ac8 as can be seen in issue #29355. sqlite3_stmt_readonly was added in 3.7.4 (2010-12-07) so I guess using sqlite3_create_function_v2 will cause the same problems. Do you think I should find another way to fix this issue? I can follow all the user functions and free on my own but that will make the code more complex. On the other hand I can add this fix in ifdef and the behavior will be different when using sqlite in versions smaller then 3.7.3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 14:44:39 2017 From: report at bugs.python.org (Toby Thurston) Date: Sat, 15 Apr 2017 18:44:39 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py Message-ID: <1492281879.16.0.0196863971193.issue30077@psf.upfronthosting.co.za> New submission from Toby Thurston: aifc.py fails to open AIFF files containing the compression type "sowt" in the COMM chunk with an "unsupported compression type" error. This compression type is an Apple specific extension that signals that the data is not actually compressed but is stored uncompressed in little Endian order. Supporting it would require a trivial change to allow the compression type as a byte-string and to add a do-nothing _convert routine. This would allow aifc.py to be used with AIFF files on Apple macOS. ---------- components: Extension Modules messages: 291727 nosy: thruston priority: normal severity: normal status: open title: Support Apple AIFF-C pseudo compression in aifc.py type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 14:46:28 2017 From: report at bugs.python.org (Toby Thurston) Date: Sat, 15 Apr 2017 18:46:28 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py In-Reply-To: <1492281879.16.0.0196863971193.issue30077@psf.upfronthosting.co.za> Message-ID: <1492281988.51.0.924751746189.issue30077@psf.upfronthosting.co.za> Changes by Toby Thurston : ---------- pull_requests: +1287 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 16:04:44 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Apr 2017 20:04:44 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492286684.13.0.44465761658.issue30071@psf.upfronthosting.co.za> Terry J. Reedy added the comment: inspect.getargspec is deprecated in favor of .getfullargspec and .signature and is implemented in with .getfullargspec. This, in turn, calls ._signature_from_callable which ultimately looks for (perhaps after recursive unwrap calls) obj.__signature__. So I expect that the case you 'care most about' already works. True? It appears that .signature is intended to work for cython functions via the following helper function. Its code is somewhat awkward and tests that the object has needed attributes with needed types. def _signature_is_functionlike(obj): """Private helper to test if `obj` is a duck type of FunctionType. A good example of such objects are functions compiled with Cython, which have all attributes that a pure Python function would have, but have their code statically compiled. """ That does leave cases like the inspect.getfile code you quoted. It could be fixed with some fiddly code, but there would still be .getclosurevariables and a couple of other uses of isfunction to review. I reviewed the function and code attributes listed in https://docs.python.org/3/library/inspect.html#types-and-members and I think the necessary differences a function compiled by CPython and anything else are limited to the code object. Proposal: for a cleaner solution, define a 'mincode' base class that lacks, for instance, co_code, co_consts, co_flags, co_lnotab, and co_stacksize. Make code a subclass of this. Define 'minfunction' as a function whose __code__ is a mincode. Make function a subclass of this. Define 'isminfunction' and replace 'isfunction' where a mincode is sufficient. This might allow, for instance, _signature_is_functionlike to be removed. Details should perhaps be specified in a relatively short PEP. Discussion could maybe continue on python-ideas. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 16:49:45 2017 From: report at bugs.python.org (Ilya Kazakevich) Date: Sat, 15 Apr 2017 20:49:45 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection Message-ID: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> New submission from Ilya Kazakevich: In Py3 it is possible to run test filelike "python -m unittest tests/test_something.py" (it is *not* possible in Py2!) Here is doc: https://docs.python.org/3/library/unittest.html But "--help" seems to be simply copied from Py2 because it does not have information nor examples about such execution. Please add it to "examples" section at least because this type of usage is very useful. ---------- assignee: docs at python components: Documentation messages: 291729 nosy: Ilya Kazakevich, docs at python priority: normal severity: normal status: open title: "-m unittest --help" says nothing about direct script exection versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 17:09:19 2017 From: report at bugs.python.org (R. David Murray) Date: Sat, 15 Apr 2017 21:09:19 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492290559.53.0.0141650097226.issue30078@psf.upfronthosting.co.za> R. David Murray added the comment: Agreed that it looks like another example line should be added to the help for this case. ---------- nosy: +r.david.murray stage: -> needs patch versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 18:50:43 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 15 Apr 2017 22:50:43 +0000 Subject: [issue30075] Printing ANSI Escape Sequences on Windows 10 In-Reply-To: <1492273260.15.0.200357892895.issue30075@psf.upfronthosting.co.za> Message-ID: <1492296643.63.0.0790333723428.issue30075@psf.upfronthosting.co.za> Martin Panter added the comment: Maybe this is related to Issue 29059. If so, there seems to be resistance to enabling the feature by default, and preference to use existing APIs rather than adding a new API that enables it. ---------- components: +Windows nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware superseder: -> Windows: Python not using ANSI compatible console _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 22:38:21 2017 From: report at bugs.python.org (Eryk Sun) Date: Sun, 16 Apr 2017 02:38:21 +0000 Subject: [issue30075] Printing ANSI Escape Sequences on Windows 10 In-Reply-To: <1492273260.15.0.200357892895.issue30075@psf.upfronthosting.co.za> Message-ID: <1492310301.73.0.194578361512.issue30075@psf.upfronthosting.co.za> Eryk Sun added the comment: cmd.exe enables virtual terminal mode, but only for itself. It disables VT mode before starting other programs, and also at shutdown. It appears you've found a bug in the case of "cmd.exe /c ...". You can get the same result via os.system(''). It's failing to disable VT mode after it exits. Enabling VT mode by default is potentially a problem because a console buffer's mode is shared, inherited state. Adding a set_console_mode method on console files would be a useful convenience to manage this state. There could also be a couple IntFlag enums for the available input and output mode values. Here's some code to enable VT mode in Windows 10 -- assuming you're not using the legacy console. If you're using an older version of Windows, or the legacy console in Windows 10, then enabling VT mode will fail as an invalid parameter. This is handled by raising NotImplementedError. On success, it returns the previous console mode, which can be restored by calling set_conout_mode(mode). Depending on your needs, that could done in an atexit function. import os import msvcrt import ctypes from ctypes import wintypes kernel32 = ctypes.WinDLL('kernel32', use_last_error=True) ERROR_INVALID_PARAMETER = 0x0057 ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 def _check_bool(result, func, args): if not result: raise ctypes.WinError(ctypes.get_last_error()) return args LPDWORD = ctypes.POINTER(wintypes.DWORD) kernel32.GetConsoleMode.errcheck = _check_bool kernel32.GetConsoleMode.argtypes = (wintypes.HANDLE, LPDWORD) kernel32.SetConsoleMode.errcheck = _check_bool kernel32.SetConsoleMode.argtypes = (wintypes.HANDLE, wintypes.DWORD) def set_conout_mode(new_mode, mask=0xffffffff): # don't assume StandardOutput is a console. # open CONOUT$ instead fdout = os.open('CONOUT$', os.O_RDWR) try: hout = msvcrt.get_osfhandle(fdout) old_mode = wintypes.DWORD() kernel32.GetConsoleMode(hout, ctypes.byref(old_mode)) mode = (new_mode & mask) | (old_mode.value & ~mask) kernel32.SetConsoleMode(hout, mode) return old_mode.value finally: os.close(fdout) def enable_vt_mode(): mode = mask = ENABLE_VIRTUAL_TERMINAL_PROCESSING try: return set_conout_mode(mode, mask) except WindowsError as e: if e.winerror == ERROR_INVALID_PARAMETER: raise NotImplementedError raise Please don't use the code in issue 29059. It's simpler, but there are several problems with it. (1) There's no error handling. (2) It passes handles incorrectly as 32-bit int values, for which ctypes in 64-bit Python 2 may corrupt the high DWORD (if it works, it's only by accident; ctypes doesn't zero the stack in ffi_prep_args). (3) It assumes the StandardOutput handle is a console output buffer, but maybe it's a pipe or file, and the program has manually opened CONOUT$ to write debug text in color. (4) It uses windll, which causes problems when multiple libraries contend for the same functions (e.g. some library may have set incompatible argtypes, restype, or errcheck values on windll.kernel32.GetConsoleMode). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 15 23:10:04 2017 From: report at bugs.python.org (Philip Lee) Date: Sun, 16 Apr 2017 03:10:04 +0000 Subject: [issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True Message-ID: <1492312204.85.0.288489442565.issue30079@psf.upfronthosting.co.za> New submission from Philip Lee: The doc here https://docs.python.org/3/library/subprocess.html#subprocess.Popen says : "If shell is True, it is recommended to pass args as a string rather than as a sequence." but without explain why ? Please add the explanation ! while in https://docs.python.org/3/library/subprocess.html#frequently-used-arguments says: "args is required for all calls and should be a string, or a sequence of program arguments. Providing a sequence of arguments is generally preferred, as it allows the module to take care of any required escaping and quoting of arguments (e.g. to permit spaces in file names). If passing a single string, either shell must be True (see below) or else the string must simply name the program to be executed without specifying any arguments." In the case of shell =True , I found providing a sequence of arguments rather than a string argument can take the advantage of auto escaping and quoting of arguments (e.g. to permit spaces in file names) , so what is the advantage of pass args as a string rather than as a sequence as says in the doc when shell is True? ---------- assignee: docs at python components: Documentation messages: 291733 nosy: docs at python, iMath priority: normal severity: normal status: open title: Explain why it is recommended to pass args as a string rather than as a sequence If shell is True type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 00:19:45 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 16 Apr 2017 04:19:45 +0000 Subject: [issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True In-Reply-To: <1492312204.85.0.288489442565.issue30079@psf.upfronthosting.co.za> Message-ID: <1492316385.74.0.948135662162.issue30079@psf.upfronthosting.co.za> R. David Murray added the comment: Because passing a sequence to shell=True won't work on unix. It only works more-or-less by accident on windows, even though the current docs kind of encourage it. Yes, I think it would be good if these sentences were clarified. See also issue 7839. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 00:29:43 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 16 Apr 2017 04:29:43 +0000 Subject: [issue19184] dis module has incorrect docs for RAISE_VARARGS In-Reply-To: <1381078012.05.0.236677780468.issue19184@psf.upfronthosting.co.za> Message-ID: <1492316983.71.0.865024219375.issue19184@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1288 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 01:14:03 2017 From: report at bugs.python.org (Eryk Sun) Date: Sun, 16 Apr 2017 05:14:03 +0000 Subject: [issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True In-Reply-To: <1492312204.85.0.288489442565.issue30079@psf.upfronthosting.co.za> Message-ID: <1492319643.32.0.769540885822.issue30079@psf.upfronthosting.co.za> Eryk Sun added the comment: In Unix, passing an args list with shell=True makes the first element the -c command. The remaining elements are arguments for the shell itself, which makes them $N variables. For example: >>> subprocess.call(['echo $0, $1', 'spam', 'eggs'], shell=True) spam, eggs In Windows, subprocess.list2cmdline assumes VC++ rules for creating a command line from a list. cmd's parsing rules are very different -- e.g. '^' is the escape character, and double quotes also escape special characters, except not '%'. (Shockingly there is no way to escape '%' on the cmd.exe command line -- only in batch files by doubling it. If you think '^' escapes it, you're wrong. cmd looks for an environment variable containing the '^' character. By luck it's usually not found.) cmd's parsing is convoluted, to say the least. Now combine that with having to pass command lines for external programs in way that they survive cmd's parsing without also breaking how the external program parses its command line. This problem is intractable. Just use a string. For anything complicated you may have to experiment a few times to figure out some permutation that works. The best option is to not use the shell at all. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 01:56:14 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 16 Apr 2017 05:56:14 +0000 Subject: [issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example In-Reply-To: <1479230636.43.0.863548306007.issue28698@psf.upfronthosting.co.za> Message-ID: <1492322174.38.0.691216594896.issue28698@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1289 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 02:12:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 06:12:44 +0000 Subject: [issue30080] Add the --duplicate option for timeit Message-ID: <1492323164.81.0.971695586502.issue30080@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: One of the most used by me option of the "perf timeit" subcommand is --duplicate. It duplicates statements to reduce the overhead of the loop. This is necessary when measure the time of very fast statements. Proposed patch adds this option for CLI of the timeit module. Similar feature already was proposed in issue21988, but it automatically duplicated statements if they executed too fast. This patch does this only on explicit request. And it affects only command-line interface. You need to duplicate statements manually when use programming interface. ---------- components: Demos and Tools, Library (Lib) messages: 291736 nosy: Guido.van.Rossum, alex, arigo, georg.brandl, gvanrossum, haypo, haypo, pitrou, r.david.murray, rhettinger, serhiy.storchaka, steven.daprano, tim.peters priority: normal severity: normal stage: patch review status: open title: Add the --duplicate option for timeit type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 02:15:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 06:15:52 +0000 Subject: [issue30080] Add the --duplicate option for timeit In-Reply-To: <1492323164.81.0.971695586502.issue30080@psf.upfronthosting.co.za> Message-ID: <1492323352.27.0.608703659543.issue30080@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1290 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 02:21:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 06:21:45 +0000 Subject: [issue29838] Check that sq_length and mq_length return non-negative result In-Reply-To: <1489779592.24.0.829471920216.issue29838@psf.upfronthosting.co.za> Message-ID: <1492323705.98.0.395808361071.issue29838@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 813f943c592cf225871b99cffc99304c8cbbee40 by Serhiy Storchaka in branch 'master': bpo-29838: Add asserts for checking results of sq_length and mq_length slots. (#700) https://github.com/python/cpython/commit/813f943c592cf225871b99cffc99304c8cbbee40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 02:24:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 06:24:35 +0000 Subject: [issue22319] mailbox.MH chokes on directories without .mh_sequences In-Reply-To: <1409532286.19.0.0096423454666.issue22319@psf.upfronthosting.co.za> Message-ID: <1492323875.15.0.224419143046.issue22319@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ping. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 02:34:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 06:34:24 +0000 Subject: [issue29902] copy breaks staticmethod In-Reply-To: <1490447804.79.0.661284691694.issue29902@psf.upfronthosting.co.za> Message-ID: <1492324464.03.0.864460847275.issue29902@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What are your thoughts Barry? staticmethod, classmethod and property objects are incorrectly pickled in 2.7 and 3.5 (they are not pickleable in 3.6+). Making them not pickleable in 2.7 and 3.5 can help to catch programming errors. But this can break the code that "just works" (actually works incorrectly) if it pickles or deepcopies complex objects containing staticmethod, classmethod or property objects, but never use it. Similar situation happened in issue22995 with Cython objects. Maybe emitting a warning rather than an exception would be safer? But deprecation warnings are ignored by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 02:37:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 06:37:20 +0000 Subject: [issue29839] Avoid raising OverflowError in len() when __len__() returns negative large value In-Reply-To: <1489780334.51.0.943711507872.issue29839@psf.upfronthosting.co.za> Message-ID: <1492324640.68.0.46677382466.issue29839@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset baf9f29811dba9c06e76b8e220bd77260202f299 by Serhiy Storchaka in branch 'master': bpo-29839: Raise ValueError rather than OverflowError in len() for negative values. (#701) https://github.com/python/cpython/commit/baf9f29811dba9c06e76b8e220bd77260202f299 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 02:39:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 06:39:32 +0000 Subject: [issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex In-Reply-To: <1479743857.98.0.418828964214.issue28765@psf.upfronthosting.co.za> Message-ID: <1492324772.13.0.857037362733.issue28765@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset cd85d0b90b39310c8ca7329bd35e82c2c1c8f4ad by Serhiy Storchaka in branch 'master': bpo-28765: Use concrete types API in _sre.c. (#1009) https://github.com/python/cpython/commit/cd85d0b90b39310c8ca7329bd35e82c2c1c8f4ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 03:05:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 07:05:36 +0000 Subject: [issue29839] Avoid raising OverflowError in len() when __len__() returns negative large value In-Reply-To: <1489780334.51.0.943711507872.issue29839@psf.upfronthosting.co.za> Message-ID: <1492326336.45.0.761441180966.issue29839@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > The doc does not specify that 'length' cannot be non-negative. It does. https://docs.python.org/3/reference/datamodel.html#object.__len__ .. method:: object.__len__(self) Called to implement the built-in function :func:`len`. Should return the length of the object, an integer ``>=`` 0. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 03:06:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 07:06:52 +0000 Subject: [issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex In-Reply-To: <1479743857.98.0.418828964214.issue28765@psf.upfronthosting.co.za> Message-ID: <1492326412.73.0.568603430712.issue28765@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 03:07:23 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 07:07:23 +0000 Subject: [issue29838] Check that sq_length and mq_length return non-negative result In-Reply-To: <1489779592.24.0.829471920216.issue29838@psf.upfronthosting.co.za> Message-ID: <1492326443.68.0.993530645756.issue29838@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 03:08:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 07:08:49 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1492326529.39.0.433292241741.issue29943@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 89f9eb5b192b875c017d37cac16bd514aad9a801 by Serhiy Storchaka in branch '2.7': bpo-29943: Remove the PySlice_GetIndicesEx() macro. (#1050) https://github.com/python/cpython/commit/89f9eb5b192b875c017d37cac16bd514aad9a801 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 03:16:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 07:16:05 +0000 Subject: [issue10076] Regex objects became uncopyable in 2.5 In-Reply-To: <1286916324.24.0.772801528988.issue10076@psf.upfronthosting.co.za> Message-ID: <1492326965.49.0.596713909907.issue10076@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset fdbd01151dbd5feea3e4c0316d102db3d2a2a412 by Serhiy Storchaka in branch 'master': bpo-10076: Compiled regular expression and match objects now are copyable. (#1000) https://github.com/python/cpython/commit/fdbd01151dbd5feea3e4c0316d102db3d2a2a412 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 03:17:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 07:17:05 +0000 Subject: [issue10076] Regex objects became uncopyable in 2.5 In-Reply-To: <1286916324.24.0.772801528988.issue10076@psf.upfronthosting.co.za> Message-ID: <1492327025.01.0.121241232746.issue10076@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 03:46:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 07:46:40 +0000 Subject: [issue30022] Get rid of using EnvironmentError and IOError In-Reply-To: <1491645939.23.0.623640815202.issue30022@psf.upfronthosting.co.za> Message-ID: <1492328800.23.0.545840471918.issue30022@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 by Serhiy Storchaka in branch 'master': bpo-30022: Get rid of using EnvironmentError and IOError (except test? (#1051) https://github.com/python/cpython/commit/55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 03:47:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 07:47:56 +0000 Subject: [issue30022] Get rid of using EnvironmentError and IOError In-Reply-To: <1491645939.23.0.623640815202.issue30022@psf.upfronthosting.co.za> Message-ID: <1492328876.86.0.260863621911.issue30022@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 05:03:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 09:03:54 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1492333434.02.0.386927718763.issue29943@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 49a905958ffc2fcd5d1d1a293ae453d45deeb884 by Serhiy Storchaka in branch '3.5': [3.5] bpo-29943: Do not replace the function PySlice_GetIndicesEx() with a macro (#1049) https://github.com/python/cpython/commit/49a905958ffc2fcd5d1d1a293ae453d45deeb884 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 05:04:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 09:04:47 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1492333487.38.0.210093242278.issue30017@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8e5b52a8da07e781bda50ba0a7065b1058495a37 by Serhiy Storchaka in branch '3.6': bpo-30017: Allowed calling the close() method of the zip entry writer object (#1041) (#1092) https://github.com/python/cpython/commit/8e5b52a8da07e781bda50ba0a7065b1058495a37 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 05:05:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 09:05:55 +0000 Subject: [issue30017] zlib.error: Error -2 while flushing: inconsistent stream state In-Reply-To: <1491574866.61.0.594608147469.issue30017@psf.upfronthosting.co.za> Message-ID: <1492333555.0.0.436888543497.issue30017@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 05:08:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 09:08:50 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492333730.3.0.46832918333.issue30065@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 05:10:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 09:10:49 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492333849.51.0.959372072259.issue30070@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 08:08:45 2017 From: report at bugs.python.org (Armin Rigo) Date: Sun, 16 Apr 2017 12:08:45 +0000 Subject: [issue30080] Add the --duplicate option for timeit In-Reply-To: <1492323164.81.0.971695586502.issue30080@psf.upfronthosting.co.za> Message-ID: <1492344525.11.0.557570139511.issue30080@psf.upfronthosting.co.za> Changes by Armin Rigo : ---------- nosy: -arigo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 11:12:48 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 16 Apr 2017 15:12:48 +0000 Subject: [issue29902] copy breaks staticmethod In-Reply-To: <1490447804.79.0.661284691694.issue29902@psf.upfronthosting.co.za> Message-ID: <1492355568.52.0.385012864151.issue29902@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I'd be very hesitant to add anything to 2.7 that changes (even broken) behavior here. It might make more sense to backport the more strict checks to 3.5. OTOH, we can save people from all programming errors, and if warnings are basically ignored (plus, adding warnings *can* break things), then perhaps we should only document the limitations. There's already some description of copy()'s limitations, so either add another warning there, or in the static method objects description in section 3.2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 11:55:27 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 16 Apr 2017 15:55:27 +0000 Subject: [issue22319] mailbox.MH chokes on directories without .mh_sequences In-Reply-To: <1409532286.19.0.0096423454666.issue22319@psf.upfronthosting.co.za> Message-ID: <1492358127.91.0.069019513911.issue22319@psf.upfronthosting.co.za> R. David Murray added the comment: Honestly, given the open questions my inclination would be to reject this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:22:37 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 16 Apr 2017 16:22:37 +0000 Subject: [issue30081] Inconsistent handling of failure of PyModule_AddObject Message-ID: <1492359757.88.0.168735973244.issue30081@psf.upfronthosting.co.za> New submission from Xiang Zhang: The doc of PyModule_AddObject()[1] states it steals a reference to *value*. But this is only the case when it succeed. On failure the reference is not stolen. The usages of it across the code base are inconsistent. Some realizes this situation and depends on it: [2]. Some doesn't realize: [3]. Most just assume it always succeeds: [4]. BTW, it seems many modules doesn't release memories well in failure situations in their PyMOD_INIT. Maybe I miss some post-handling procedures? [1] https://docs.python.org/3/c-api/module.html#c.PyModule_AddObject [2] https://github.com/python/cpython/blob/master/Python/modsupport.c#L644 [3] https://github.com/python/cpython/blob/master/Modules/gcmodule.c#L1590 [4] https://github.com/python/cpython/blob/master/Modules/_datetimemodule.c#L5799 ---------- messages: 291750 nosy: xiang.zhang priority: normal severity: normal status: open title: Inconsistent handling of failure of PyModule_AddObject type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:33:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 16:33:37 +0000 Subject: [issue30081] Inconsistent handling of failure of PyModule_AddObject In-Reply-To: <1492359757.88.0.168735973244.issue30081@psf.upfronthosting.co.za> Message-ID: <1492360417.67.0.99145112399.issue30081@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a duplicate of issue26868 and issue26871. There is also a thread on Python-Dev. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:42:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 16:42:32 +0000 Subject: [issue29902] copy breaks staticmethod In-Reply-To: <1490447804.79.0.661284691694.issue29902@psf.upfronthosting.co.za> Message-ID: <1492360952.09.0.00871444624748.issue29902@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If add just warnings we are free to add any warnings in 2.7 in Py3k compatible mode (option -3). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:44:28 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 16 Apr 2017 16:44:28 +0000 Subject: [issue30081] Inconsistent handling of failure of PyModule_AddObject In-Reply-To: <1492359757.88.0.168735973244.issue30081@psf.upfronthosting.co.za> Message-ID: <1492361068.1.0.0516141067393.issue30081@psf.upfronthosting.co.za> Xiang Zhang added the comment: Ohh, I am not alone. :-) ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Change weird behavior of PyModule_AddObject() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:48:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 16:48:44 +0000 Subject: [issue22319] mailbox.MH chokes on directories without .mh_sequences In-Reply-To: <1409532286.19.0.0096423454666.issue22319@psf.upfronthosting.co.za> Message-ID: <1492361324.46.0.0707633741717.issue22319@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Do you mean rejecting the support of Claws Mail IMAP-cache folder or just the patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:49:50 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 16 Apr 2017 16:49:50 +0000 Subject: [issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True In-Reply-To: <1492312204.85.0.288489442565.issue30079@psf.upfronthosting.co.za> Message-ID: <1492361390.81.0.515305960715.issue30079@psf.upfronthosting.co.za> R. David Murray added the comment: Note the subtlety here on unix: rdmurray at pydev:~/python/p36[3.6]>cat temp.sh #!/bin/bash echo $0 echo $1 >>> subprocess.call(['./temp.sh', 'spam', 'eggs'], shell=True) ./temp.sh 0 >>> subprocess.call(['./temp.sh $0 $1', 'spam', 'eggs'], shell=True) ./temp.sh spam eggs 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:51:02 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 16 Apr 2017 16:51:02 +0000 Subject: [issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True In-Reply-To: <1492312204.85.0.288489442565.issue30079@psf.upfronthosting.co.za> Message-ID: <1492361462.88.0.313821994356.issue30079@psf.upfronthosting.co.za> R. David Murray added the comment: Woops, cut and paste error, there should have been an "echo $2" line in that script as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:56:06 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 16 Apr 2017 16:56:06 +0000 Subject: [issue22319] mailbox.MH chokes on directories without .mh_sequences In-Reply-To: <1409532286.19.0.0096423454666.issue22319@psf.upfronthosting.co.za> Message-ID: <1492361766.1.0.506131097203.issue22319@psf.upfronthosting.co.za> R. David Murray added the comment: The support. ClawsMail is broken, IMO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:57:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 16:57:52 +0000 Subject: [issue19184] dis module has incorrect docs for RAISE_VARARGS In-Reply-To: <1381078012.05.0.236677780468.issue19184@psf.upfronthosting.co.za> Message-ID: <1492361872.8.0.457929457604.issue19184@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: May be just provide Python statements that correspond different numbers of parameters? 0 -- ``raise``, 1 -- ``raise TOS``, 2 -- ``raise TOS1 from TOS``. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 12:58:40 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 16 Apr 2017 16:58:40 +0000 Subject: [issue22319] mailbox.MH chokes on directories without .mh_sequences In-Reply-To: <1409532286.19.0.0096423454666.issue22319@psf.upfronthosting.co.za> Message-ID: <1492361920.23.0.684677608517.issue22319@psf.upfronthosting.co.za> R. David Murray added the comment: If there is a way to resolve the lock issue we can consider it. But (without looking at the code again) I suspect the locking is too deeply embedded in the mbox logic for this to be a safe change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 13:26:26 2017 From: report at bugs.python.org (Philip Lee) Date: Sun, 16 Apr 2017 17:26:26 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows Message-ID: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> New submission from Philip Lee: First, It is nearly useless for the command prompt to pop up during the running time of subprocess.Popen with shell=False. Second, the popping up command prompt would interrupt users and do bad to user experience of GUI applications. Third, I found QProcess within Qt won't pop up the command prompt in using. It would be convenient to add an argument to suppress the command prompt from popping up when using subprocess.Popen with shell=False on Windows, many users are missing the feature and these are many similar feature request questions like the following http://stackoverflow.com/questions/7006238/how-do-i-hide-the-console-when-i-use-os-system-or-subprocess-call http://stackoverflow.com/questions/1765078/how-to-avoid-console-window-with-pyw-file-containing-os-system-call/12964900#12964900 http://stackoverflow.com/questions/1016384/cross-platform-subprocess-with-hidden-window ---------- components: Library (Lib) messages: 291760 nosy: iMath priority: normal severity: normal status: open title: hide command prompt when using subprocess.Popen with shell=False on Windows type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 13:26:51 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 16 Apr 2017 17:26:51 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py In-Reply-To: <1492281879.16.0.0196863971193.issue30077@psf.upfronthosting.co.za> Message-ID: <1492363611.14.0.205684684476.issue30077@psf.upfronthosting.co.za> Xiang Zhang added the comment: Anyway, such a function addition could only get into 3.7. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 13:27:10 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 16 Apr 2017 17:27:10 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py In-Reply-To: <1492281879.16.0.0196863971193.issue30077@psf.upfronthosting.co.za> Message-ID: <1492363630.22.0.0594578046155.issue30077@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- components: +Library (Lib) -Extension Modules versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 13:29:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 16 Apr 2017 17:29:15 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py In-Reply-To: <1492281879.16.0.0196863971193.issue30077@psf.upfronthosting.co.za> Message-ID: <1492363755.2.0.578221433155.issue30077@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Seems the "sowt" compression is not just a no-op operation. Perhaps it should change a byte order. Needed tests and test files for the new compression. ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 14:18:42 2017 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sun, 16 Apr 2017 18:18:42 +0000 Subject: [issue30083] Asyncio: GeneratorExit + strange exception Message-ID: <1492366722.76.0.0689582979435.issue30083@psf.upfronthosting.co.za> New submission from ???? ?????????: How to reproduce: Run the following program: ========================= import asyncio async def handle_connection(reader, writer): try: await reader.readexactly(42) except BaseException as err: print('Interesting: %r.' % err) raise finally: writer.close() loop = asyncio.get_event_loop() coro = asyncio.start_server(handle_connection, '127.0.0.1', 8888) server = loop.run_until_complete(coro) try: loop.run_forever() except KeyboardInterrupt: print('KeyboardInterrupt catched.') server.close() loop.run_until_complete(server.wait_closed()) loop.close() ========================= 0. Python 3.5.2 1. Connect using telnet to localhost and port 888, type one short line and press Enter. 2. Type Ctrl+C in terminal where programw is running. 3. You will see the following output: ========================= ^CKeyboardInterrupt catched. Interesting: GeneratorExit(). Exception ignored in: Traceback (most recent call last): File "bug.py", line 12, in handle_connection writer.close() File "/usr/lib/python3.5/asyncio/streams.py", line 306, in close return self._transport.close() File "/usr/lib/python3.5/asyncio/selector_events.py", line 591, in close self._loop.call_soon(self._call_connection_lost, None) File "/usr/lib/python3.5/asyncio/base_events.py", line 567, in call_soon handle = self._call_soon(callback, args) File "/usr/lib/python3.5/asyncio/base_events.py", line 576, in _call_soon self._check_closed() File "/usr/lib/python3.5/asyncio/base_events.py", line 356, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed Task was destroyed but it is pending! task: wait_for=> ========================= This is almost canonical example of asyncio usage. So I have two questions: 1. Why coroutine is interrupted with GeneratorExit instead of CancelledError ? 2. Why something happend AFTER io loop is closed ? 3. How to code all that right ? I want to close connection on any error. Example provided is simplified code. In real code it looks like: ===== try: await asyncio.wait_for(self._handle_connection(reader, writer), 60) except asyncio.TimeoutError: writer.transport.abort() except asyncio.CancelledError: writer.transport.abort() except Exception: writer.transport.abort() finally: writer.close() ===== ---------- messages: 291763 nosy: socketpair priority: normal severity: normal status: open title: Asyncio: GeneratorExit + strange exception _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 14:19:43 2017 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Sun, 16 Apr 2017 18:19:43 +0000 Subject: [issue30083] Asyncio: GeneratorExit + strange exception In-Reply-To: <1492366722.76.0.0689582979435.issue30083@psf.upfronthosting.co.za> Message-ID: <1492366783.1.0.829937727591.issue30083@psf.upfronthosting.co.za> Changes by ???? ????????? : ---------- components: +asyncio nosy: +yselivanov versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 16:44:34 2017 From: report at bugs.python.org (Itamar Turner-Trauring) Date: Sun, 16 Apr 2017 20:44:34 +0000 Subject: [issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks In-Reply-To: <1338540186.86.0.989988943379.issue14976@psf.upfronthosting.co.za> Message-ID: <1492375474.06.0.519938564593.issue14976@psf.upfronthosting.co.za> Itamar Turner-Trauring added the comment: This bug was closed on the basis that signals + threads don't interact well. Which is a good point. Unfortunately this bug can happen in cases that have nothing to do with signals. If you look at the title and some of the comments it also happens as a result of garbage collection: in `__del__` methods and weakref callbacks. Specifically, garbage collection can happen on any bytecode boundary and cause reentrancy problems with Queue. The attached file is an attempt to demonstrate this: it runs and runs until GC happens and then deadlocks for me (on Python 3.6). I.e. it prints GC! and after that no further output is printed and no CPU usage reported. Please re-open this bug: if you don't want to fix signal case that's fine, but the GC case is still an issue. ---------- versions: +Python 3.5, Python 3.6 Added file: http://bugs.python.org/file46806/queuebug2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 17:22:06 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Apr 2017 21:22:06 +0000 Subject: [issue11822] Improve disassembly to show embedded code objects In-Reply-To: <1302467152.39.0.854888976189.issue11822@psf.upfronthosting.co.za> Message-ID: <1492377726.86.0.0633227267039.issue11822@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > if we modify dis() instead of adding a new function, then > the default behaviour needs to be non-recursive for > backwards compatibility reasons I don't see how we have any backward compatibility issues. The dis() function is purely informational like help(). The problem is it doesn't show important information, list comprehensions are now effectively hidden from everyone who isn't clever and persistent. I use dis() as a teaching aid in my Python courses and as a debugging tool when doing consulting. From my point of view, it is effectively broken in Python 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 17:50:03 2017 From: report at bugs.python.org (Toby Thurston) Date: Sun, 16 Apr 2017 21:50:03 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py In-Reply-To: <1492281879.16.0.0196863971193.issue30077@psf.upfronthosting.co.za> Message-ID: <1492379403.77.0.536849794266.issue30077@psf.upfronthosting.co.za> Toby Thurston added the comment: I think it's probably better as a no-op. Currently in my patch I just put return data You could do return data[::-1] to reverse the sample, so that it came out as big endian, but if you leave it as a no-op then the data is returned in the native format for Intel Mac OS, which is the whole point of the "sowt" encoding. Either way, the user can easily reverse the data in a `unpack` format if they want to, but in my own testing it seemed easier and simpler just to leave it in the native format. Then basically "it just works". The patch as I've proposed it works fine on my MacOS boxes, but I have only tested it with AIFF-C files from one source. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 18:02:12 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Apr 2017 22:02:12 +0000 Subject: [issue23787] sum() function docstring lists arguments incorrectly In-Reply-To: <1427455446.97.0.658394608092.issue23787@psf.upfronthosting.co.za> Message-ID: <1492380132.67.0.828317642079.issue23787@psf.upfronthosting.co.za> Raymond Hettinger added the comment: [Serhiy] > Raymond, could you open a pull request? Perhaps you could do it for me. I still haven't had time to wrestle with the github switchover, so I'm effectively crippled for a while. [Valentine] > Seems like mentioning string was really a bad idea .... that's > why I considered the docstring [subtly] wrong. Not really wrong in a way that confuses typical users. That docstring has been successfully communicating the basic API for over a decade. Over time, the docs have slowly converted the old "sequence" references to "iterable". The docs were never really wrong; instead, we just got more precise by what we meant by sequence versus iterable (i.e. before the ABCs were introduced, the term "sequence" was used in a somewhat generic way to mean "a succession of data values"). Also note, it is an interesting paradox that docstrings that are the most helpful to most people most of the time are brief and little loose with terminology. In general, they reward those who are doing quick lookups for API reminders, but do not reward pedantic close readings. We'll go ahead and change "sequence" to "iterable" for sum(), but I think that is only a minor win. The change makes it more technically correct but less friendly to some users (i.e. people need to be taught what "iterable" means while they tend to get the notion of "sequence of values" without any training). As far as the exclusion of string goes, there were plenty of debate about whether to allow them or to more broadly disallow many data types where summing works quadratically. The final decision was made by the BDFL and it seems to have been the right decision for just about everyone. You can take issue with his decision, but that would be pointless. ---------- nosy: +rhettinger status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 18:16:16 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Apr 2017 22:16:16 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1492380976.99.0.56624859515.issue26828@psf.upfronthosting.co.za> Raymond Hettinger added the comment: [STINNER Victor] > Oh, there is no slot for __length_hint__(). > Maybe we should also try to add a new slot for it? +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 18:39:03 2017 From: report at bugs.python.org (umedoblock) Date: Sun, 16 Apr 2017 22:39:03 +0000 Subject: [issue30084] about starred expression Message-ID: <1492382343.67.0.768693808659.issue30084@psf.upfronthosting.co.za> New submission from umedoblock: Hi, all. First of all, my python environment is below. Python 3.5.2+ (default, Sep 22 2016, 12:18:14) [GCC 6.2.0 20160927] on linux = differ evaluation order about starred expression I get below result then I run x.py ====================================================== File "/home/umedoblock/x.py", line 4 (*(1, 2)) ^ SyntaxError: can't use starred expression here ====================================================== Next, I comment out line 4 and run Python3. I got below result. And I feel strange behavior above result. Because I think that Python should return same result above and below. ====================================================== Traceback (most recent call last): File "/home/umedoblock/x.py", line 1, in list(*(1, 2)) TypeError: list() takes at most 1 argument (2 given) ====================================================== = pass or not about starred expression. list expression pass starred expression, the other hand tuple expression cannot pass starred expression. I hope to pass starred expression about list and tuple. >>> [*(1, 2)] [1, 2] >>> (*(1, 2)) File "", line 1 SyntaxError: can't use starred expression here ---------- components: Regular Expressions files: x.py messages: 291769 nosy: ezio.melotti, mrabarnett, umedoblock priority: normal severity: normal status: open title: about starred expression type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file46807/x.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 19:39:06 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 16 Apr 2017 23:39:06 +0000 Subject: [issue23787] sum() function docstring lists arguments incorrectly In-Reply-To: <1427455446.97.0.658394608092.issue23787@psf.upfronthosting.co.za> Message-ID: <1492385946.27.0.205918724963.issue23787@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- assignee: docs at python -> Mariatta nosy: +Mariatta versions: +Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 20:01:11 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 17 Apr 2017 00:01:11 +0000 Subject: [issue30084] starred tuple expression vs list display and function call In-Reply-To: <1492382343.67.0.768693808659.issue30084@psf.upfronthosting.co.za> Message-ID: <1492387271.82.0.104071890693.issue30084@psf.upfronthosting.co.za> Martin Panter added the comment: This doesn?t seem like a bug to me. At least it is consistent with the rule for making a tuple when there are commas versus returning the direct expression when there are no commas: >>> x = (1); type(x) >>> x = (1,); type(x) I don?t think it is worth changing the syntax again just to pack a single starred expression into a tuple without a comma. If you really want to do that, it would be clearer to write expression = (1, 2) tuple_1 = (*expression,) # Brackets and comma suggest a tuple tuple_2 = tuple(expression) # Tuple constructor even more obvious Allowing tuple packing without a comma would add a new inconsistency with function calls. It would conflict with your list(*(1, 2)) case: list(*(1, 2)) # Currently equivalent to list(1, 2) list( (*(1, 2)) ) # Would be equivalent to list( (1, 2) ) The root problem IMO is that round brackets and commas have too many inconsistent special cases in Python (simple expressions vs tuples, tuples with zero, one or more items, function calls and signatures, generator expressions, unpacking assignments, etc). But it may be too hard to change any of this. ---------- components: +Interpreter Core -Regular Expressions nosy: +martin.panter title: about starred expression -> starred tuple expression vs list display and function call _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 20:47:21 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 00:47:21 +0000 Subject: [issue30080] Add the --duplicate option for timeit In-Reply-To: <1492323164.81.0.971695586502.issue30080@psf.upfronthosting.co.za> Message-ID: <1492390041.49.0.500202019292.issue30080@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 I've long used this technique when timing fast statements. See https://code.activestate.com/recipes/577834 for an example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 21:12:49 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 17 Apr 2017 01:12:49 +0000 Subject: [issue30084] starred tuple expression vs list display and function call In-Reply-To: <1492382343.67.0.768693808659.issue30084@psf.upfronthosting.co.za> Message-ID: <1492391569.4.0.422129051388.issue30084@psf.upfronthosting.co.za> Steven D'Aprano added the comment: > list expression pass starred expression, the other hand > tuple expression cannot pass starred expression. You are misinterpreting what you are seeing. ( ) is not a tuple expression (except for the special case of empty brackets, which makes an empty tuple). It's just grouping an expression. So (*x) is equivalent to just bare *x. To make a tuple, you need a comma. Apart from the empty tuple, the brackets are just for grouping. Put a comma after the starred expression and it will work: py> t = 1, 2 py> t (1, 2) py> (*t,) (1, 2) The trailing comma is allowed in lists as well: py> [*t,] [1, 2] I agree with Martin: there's no bug here, the behaviour is consistent with the way tuples and lists are normally created, and there's no need to make (*t) yet another special case. If you really want to argue in favour of this change, I suggest you discuss it on the Python-Ideas mailing list and see if you can get community consensus for it. *If* you get agreement that this is a good idea, then you can re-open this. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 21:41:53 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 01:41:53 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> Message-ID: <1492393313.12.0.684006573945.issue30051@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 22:04:36 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 02:04:36 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> Message-ID: <1492394676.93.0.154269220331.issue30051@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Several thoughts: * AFAICT, in entire the history of this module, no user has ever reported this as being a source of confusion, so I don't think there is a real documentation issue here. * Regarding, "after fork, the parent and the child produce the same "random" number sequence", this is the expected behavior of a PRNG. If it did something thing different, THAT would be a bug. * There random module is likely the wrong place for a note. It is more properly a topic about forking itself. Perhaps there is room for a FAQ entry about forking elaborating on the broad range of state that is shared across forks (lock and file descriptors, etc). * For those who need it, the API already supports reseeding and a way to make new instances of Random. Both of those are the standard ways of doing it for people who need independent generators in different threads. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 22:27:09 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 17 Apr 2017 02:27:09 +0000 Subject: [issue30085] Discourage operator.__dunder__ functions Message-ID: <1492396029.61.0.720198059802.issue30085@psf.upfronthosting.co.za> New submission from Steven D'Aprano: As discussed on the Python-Ideas mailing list, it is time to discourage the use of operator.__dunder__ functions. Not to remove them or deprecate them, just change the documentation to make it clear that the dunderless versions are preferred. Guido +1'ed this suggestion, and there were no objections: https://mail.python.org/pipermail/python-ideas/2017-April/045424.html ---------- assignee: docs at python components: Documentation messages: 291774 nosy: docs at python, ncoghlan, steven.daprano, terry.reedy priority: normal severity: normal status: open title: Discourage operator.__dunder__ functions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 22:47:45 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 17 Apr 2017 02:47:45 +0000 Subject: [issue30080] Add the --duplicate option for timeit In-Reply-To: <1492323164.81.0.971695586502.issue30080@psf.upfronthosting.co.za> Message-ID: <1492397265.61.0.382412201999.issue30080@psf.upfronthosting.co.za> Changes by Guido van Rossum : ---------- nosy: -Guido.van.Rossum, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 23:08:24 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 03:08:24 +0000 Subject: [issue23787] sum() function docstring lists arguments incorrectly In-Reply-To: <1427455446.97.0.658394608092.issue23787@psf.upfronthosting.co.za> Message-ID: <1492398504.75.0.838476448746.issue23787@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I believe this is just a 2.7 issue. ---------- versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 23:13:36 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 17 Apr 2017 03:13:36 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1492398816.26.0.843499412714.issue30040@psf.upfronthosting.co.za> Louie Lu added the comment: Inada's patch version act different inside `PyObject_SetItem`, when running this code: 'x = {}; x['a'] = 123' at PyObject_SetItem, patch version goes to this line: >?179 if (m && m->mp_ass_subscript) ?180 return m->mp_ass_subscript(o, key, value); but original version goes to: >?182 if (o->ob_type->tp_as_sequence) { ?183 if (PyIndex_Check(key)) { I think that's why the performance issue came out, still digging why this happened. ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 16 23:22:45 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 17 Apr 2017 03:22:45 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1492399365.35.0.731249264253.issue30040@psf.upfronthosting.co.za> Louie Lu added the comment: forgive my words, I trace the wrong code, sorry about that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 00:32:28 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 17 Apr 2017 04:32:28 +0000 Subject: [issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long In-Reply-To: <1492277239.5.0.348724747458.issue30076@psf.upfronthosting.co.za> Message-ID: <1492403548.47.0.69219567691.issue30076@psf.upfronthosting.co.za> Nick Coghlan added the comment: If we used the names from inspect.Parameter.kind (https://docs.python.org/3/library/inspect.html#inspect.Parameter.kind) these would become: * BUILD_VAR_POSITIONAL * BUILD_VAR_KEYWORD which would be 20 and 17 letters long, respectively. I think that would also make the disassembled bytecode more self-explanatory: >>> dis.dis('f(a, b, *args, x=x, y=y, **kw)') 1 0 LOAD_NAME 0 (f) 2 LOAD_NAME 1 (a) 4 LOAD_NAME 2 (b) 6 BUILD_TUPLE 2 8 LOAD_NAME 3 (args) 10 BUILD_VAR_POSITIONAL 2 12 LOAD_NAME 4 (x) 14 LOAD_NAME 5 (y) 16 LOAD_CONST 0 (('x', 'y')) 18 BUILD_CONST_KEY_MAP 2 20 LOAD_NAME 6 (kw) 22 BUILD_VAR_KEYWORD 2 24 CALL_FUNCTION_EX 1 26 RETURN_VALUE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 00:39:31 2017 From: report at bugs.python.org (umedoblock) Date: Mon, 17 Apr 2017 04:39:31 +0000 Subject: [issue30084] starred tuple expression vs list display and function call In-Reply-To: <1492382343.67.0.768693808659.issue30084@psf.upfronthosting.co.za> Message-ID: <1492403971.44.0.457417997496.issue30084@psf.upfronthosting.co.za> umedoblock added the comment: Sorry and thanks to Martin and Steven. I agree with your post about first my post. I understand "(*x) is equivalent to just bare *x." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 00:42:59 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 17 Apr 2017 04:42:59 +0000 Subject: [issue11822] Improve disassembly to show embedded code objects In-Reply-To: <1302467152.39.0.854888976189.issue11822@psf.upfronthosting.co.za> Message-ID: <1492404179.5.0.765148883519.issue11822@psf.upfronthosting.co.za> Nick Coghlan added the comment: Yeah, I was mixing this up with getargspec (et al), which get used by IDEs and similar tools. While third party tools do use the disassembler, they typically won't use its display logic directly unless they're just dumping the output to a terminal equivalent. Given that, a "depth=None" parameter on `dis` and `disassemble` would provide the default behaviour of rendering the entire compilation tree, while still allowing turning off recursion entirely ("depth=0"), or limiting it to a desired number of levels ("depth=1", etc). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 00:43:18 2017 From: report at bugs.python.org (umedoblock) Date: Mon, 17 Apr 2017 04:43:18 +0000 Subject: [issue30086] type() and len() recognize "abc", expression as "abc" string. Message-ID: <1492404198.27.0.60955199982.issue30086@psf.upfronthosting.co.za> New submission from umedoblock: But I found a real bug to use a tuple with a comma. Python3 recognized "abc", expression as tuple of one element. But type() and len() recognize "abc", expression as "abc" string. So now, I found a real bug. I'll show you below sentences. >>> "abc", ('abc',) >>> obj = "abc", >>> obj ('abc',) >>> type(obj) >>> len(("abc",)) 1 >>> len(obj) 1 >>> type("abc",) >>> len("abc",) 3 ---------- components: Regular Expressions messages: 291781 nosy: ezio.melotti, mrabarnett, umedoblock priority: normal severity: normal status: open title: type() and len() recognize "abc", expression as "abc" string. type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 00:55:21 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 04:55:21 +0000 Subject: [issue30086] type() and len() recognize "abc", expression as "abc" string. In-Reply-To: <1492404198.27.0.60955199982.issue30086@psf.upfronthosting.co.za> Message-ID: <1492404921.65.0.998749061407.issue30086@psf.upfronthosting.co.za> Raymond Hettinger added the comment: What you're seeing is a feature of the grammar. Function allow an optional trailing comma in the argument list: >>> pow(2, 5) 32 >>> pow(2, 5,) 32 So, to create a tuple inside in an argument list, you need the extra layer of parentheses. Sorry, this isn't a real bug. It is just a conflict resolution between use of a comma to separate arguments in a function call and use of a comma to create a tuple. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 01:02:51 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 05:02:51 +0000 Subject: [issue25794] __setattr__ does not always overload operators In-Reply-To: <1449219157.0.0.30103039285.issue25794@psf.upfronthosting.co.za> Message-ID: <1492405371.98.0.718299468034.issue25794@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 01:38:40 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Apr 2017 05:38:40 +0000 Subject: [issue23174] shelve.open fails with error "anydbm.error: db type could not be determined" In-Reply-To: <1420502722.34.0.451688646321.issue23174@psf.upfronthosting.co.za> Message-ID: <1492407520.92.0.424031330005.issue23174@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1291 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 01:38:58 2017 From: report at bugs.python.org (Anand Reddy Pandikunta) Date: Mon, 17 Apr 2017 05:38:58 +0000 Subject: [issue23174] shelve.open fails with error "anydbm.error: db type could not be determined" In-Reply-To: <1420502722.34.0.451688646321.issue23174@psf.upfronthosting.co.za> Message-ID: <1492407538.88.0.787355519964.issue23174@psf.upfronthosting.co.za> Anand Reddy Pandikunta added the comment: dbm.whichdb mentions that it returns empty string ('') if the file?s format can?t be guessed. Enhancing exception message should suffice. ---------- nosy: +ChillarAnand _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 01:48:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Apr 2017 05:48:13 +0000 Subject: [issue23174] shelve.open fails with error "anydbm.error: db type could not be determined" In-Reply-To: <1420502722.34.0.451688646321.issue23174@psf.upfronthosting.co.za> Message-ID: <1492408093.26.0.804423890452.issue23174@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Proposed error message isn't correct. The file extension is not the only method for determining db type. Current error message looks good to me and I don't see how it can be enhanced. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 02:15:46 2017 From: report at bugs.python.org (Christoph Zimmermann) Date: Mon, 17 Apr 2017 06:15:46 +0000 Subject: [issue30087] pdb issue with type conversion Message-ID: <1492409746.73.0.239584999276.issue30087@psf.upfronthosting.co.za> New submission from Christoph Zimmermann: Types cannot be converted properly while running under pdb control: python >>> t=(1,2,3) >>> list(t) [1, 2, 3] python pdb.py (Pdb) t=(1,2,3) (Pdb) list(t) *** Error in argument: '(t)' ---------- components: Extension Modules messages: 291786 nosy: Christoph Zimmermann priority: normal severity: normal status: open title: pdb issue with type conversion versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 02:37:29 2017 From: report at bugs.python.org (Cuong Manh Le) Date: Mon, 17 Apr 2017 06:37:29 +0000 Subject: [issue30087] pdb issue with type conversion In-Reply-To: <1492409746.73.0.239584999276.issue30087@psf.upfronthosting.co.za> Message-ID: <1492411049.05.0.259228025437.issue30087@psf.upfronthosting.co.za> Cuong Manh Le added the comment: list is a pdb command, not the builtin list when you called it in pdb ---------- nosy: +Cuong Manh Le _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 03:36:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Apr 2017 07:36:49 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> Message-ID: <1492414609.74.0.877353433262.issue30051@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: os.fork() documentation contains a warning that refers to ssl documentation where the use of OpenSSL?s internal random number generator in forked processes is documented more detailed. I think the same should be added for the random module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 03:47:54 2017 From: report at bugs.python.org (Sviatoslav Sydorenko) Date: Mon, 17 Apr 2017 07:47:54 +0000 Subject: [issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists Message-ID: <1492415274.72.0.826528835648.issue30088@psf.upfronthosting.co.za> New submission from Sviatoslav Sydorenko: Hi, I've faced an issue w/ `mailbox.Maildir()`. The case is following: 1. I create a folder with `tempfile.TemporaryDirectory()`, so it's empty 2. I pass that folder path as an argument when instantiating `mailbox.Maildir()` 3. Then I receive an exception happening because "there's no such file or directory" (namely `cur`, `tmp` or `new`) during interaction with Maildir **Expected result:** subdirs are created during `Maildir()` instance creation. **Actual result:** subdirs are assumed as existing which leads to exceptions during use. **Workaround:** remove the actual dir before passing the path to `Maildir()`. It will be created automatically with all subdirs needed. **Fix:** PR linked. Basically it adds creation of subdirs regardless of whether the base dir existed before. ---------- components: Library (Lib) messages: 291789 nosy: webknjaz priority: normal pull_requests: 1293 severity: normal status: open title: mailbox.Maildir doesn't create subdir structure when create=True and base dir exists type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 04:11:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Apr 2017 08:11:55 +0000 Subject: [issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists In-Reply-To: <1492415274.72.0.826528835648.issue30088@psf.upfronthosting.co.za> Message-ID: <1492416715.37.0.695501096206.issue30088@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- components: +email nosy: +barry, r.david.murray stage: -> patch review versions: -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 04:28:44 2017 From: report at bugs.python.org (Christoph Zimmermann) Date: Mon, 17 Apr 2017 08:28:44 +0000 Subject: [issue30087] pdb issue with type conversion In-Reply-To: <1492409746.73.0.239584999276.issue30087@psf.upfronthosting.co.za> Message-ID: <1492417724.23.0.0108762371636.issue30087@psf.upfronthosting.co.za> Christoph Zimmermann added the comment: Thanks for the hint! ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 04:41:52 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 17 Apr 2017 08:41:52 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1492418512.59.0.328066017596.issue30040@psf.upfronthosting.co.za> Louie Lu added the comment: I'm testing[1] that if we make a fast path that detect if keys is `empty_keys_struct` inside `dictresize`. It can be faster than original patch, but still slower than default (unpatch) in most case. ? cpython git:(compact_empty_dict) ? ./python.default -m perf compare_to -G --min-speed=1 default.json lpatch.json Slower (14): - pickle_dict: 91.1 us +- 2.2 us -> 98.0 us +- 3.3 us: 1.08x slower (+8%) - xml_etree_parse: 534 ms +- 29 ms -> 565 ms +- 27 ms: 1.06x slower (+6%) - crypto_pyaes: 679 ms +- 22 ms -> 708 ms +- 22 ms: 1.04x slower (+4%) - regex_effbot: 12.1 ms +- 0.2 ms -> 12.6 ms +- 0.2 ms: 1.04x slower (+4%) - tornado_http: 678 ms +- 21 ms -> 704 ms +- 31 ms: 1.04x slower (+4%) - pidigits: 432 ms +- 7 ms -> 447 ms +- 18 ms: 1.03x slower (+3%) - spectral_norm: 869 ms +- 21 ms -> 898 ms +- 22 ms: 1.03x slower (+3%) - unpickle_list: 20.6 us +- 0.6 us -> 21.2 us +- 0.8 us: 1.03x slower (+3%) - pathlib: 87.9 ms +- 3.0 ms -> 90.6 ms +- 3.5 ms: 1.03x slower (+3%) - pickle_list: 13.0 us +- 0.3 us -> 13.3 us +- 0.4 us: 1.03x slower (+3%) - meteor_contest: 367 ms +- 13 ms -> 378 ms +- 14 ms: 1.03x slower (+3%) - scimark_sor: 991 ms +- 28 ms -> 1.02 sec +- 0.03 sec: 1.03x slower (+3%) - sympy_expand: 1.73 sec +- 0.05 sec -> 1.77 sec +- 0.04 sec: 1.02x slower (+2%) - python_startup: 29.5 ms +- 1.1 ms -> 30.1 ms +- 1.9 ms: 1.02x slower (+2%) Faster (8): - sympy_integrate: 84.3 ms +- 8.3 ms -> 78.3 ms +- 5.0 ms: 1.08x faster (-7%) - call_simple: 30.6 ms +- 1.7 ms -> 29.0 ms +- 1.4 ms: 1.06x faster (-5%) - pickle: 43.2 us +- 3.2 us -> 41.1 us +- 1.9 us: 1.05x faster (-5%) - call_method_unknown: 36.4 ms +- 1.6 ms -> 35.0 ms +- 1.5 ms: 1.04x faster (-4%) - scimark_lu: 781 ms +- 42 ms -> 752 ms +- 34 ms: 1.04x faster (-4%) - sympy_sum: 385 ms +- 21 ms -> 372 ms +- 17 ms: 1.03x faster (-3%) - logging_silent: 1.30 us +- 0.04 us -> 1.26 us +- 0.04 us: 1.03x faster (-3%) - django_template: 665 ms +- 20 ms -> 643 ms +- 18 ms: 1.03x faster (-3%) Benchmark hidden because not significant (42) [1]: https://github.com/lulouie/cpython/blob/compact_empty_dict/Objects/dictobject.c#L1247 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 04:44:07 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Mon, 17 Apr 2017 08:44:07 +0000 Subject: [issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long In-Reply-To: <1492277239.5.0.348724747458.issue30076@psf.upfronthosting.co.za> Message-ID: <1492418647.07.0.285645459406.issue30076@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- nosy: +Jim Fasarakis-Hilliard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 05:15:31 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Apr 2017 09:15:31 +0000 Subject: [issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long In-Reply-To: <1492277239.5.0.348724747458.issue30076@psf.upfronthosting.co.za> Message-ID: <1492420531.43.0.614339268501.issue30076@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I like the names BUILD_VAR_POSITIONAL and BUILD_VAR_KEYWORD. The downside is that this breaks relations between them and very similar opcodes BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK. The only differences between BUILD_*_UNPACK and BUILD_*_UNPACK_WITH_CALL opcodes is that the latter takes a function name from the stack for error message and BUILD_MAP_UNPACK_WITH_CALL doesn't allow key duplications in contrary to BUILD_MAP_UNPACK. But the names BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK doesn't look very good too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 05:26:11 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 17 Apr 2017 09:26:11 +0000 Subject: [issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists In-Reply-To: <1492415274.72.0.826528835648.issue30088@psf.upfronthosting.co.za> Message-ID: <1492421171.67.0.390414114496.issue30088@psf.upfronthosting.co.za> Louie Lu added the comment: I think this patch make the behavior changed. Documentation wrote that: "If create is True, the mailbox is created if it does not exist.", the current version did that exactly, it won't create subdir (tmp, new, and cur) when dir exists. The situation face here is that TemporaryDirectory() create a valid dir without Maildir structure subdir (tmp, new, and cur), and the `create` parameter won't create subdir (because the dir is exist!). Not sure if this behavior change is worth or not. I'll also upload an PoC for this. ---------- nosy: +louielu Added file: http://bugs.python.org/file46808/poc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 05:56:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Apr 2017 09:56:09 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492422969.57.0.276084749275.issue30061@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1294 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 06:27:00 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Apr 2017 10:27:00 +0000 Subject: [issue30087] pdb issue with type conversion In-Reply-To: <1492409746.73.0.239584999276.issue30087@psf.upfronthosting.co.za> Message-ID: <1492424820.36.0.821917909273.issue30087@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 06:30:35 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Apr 2017 10:30:35 +0000 Subject: [issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists In-Reply-To: <1492415274.72.0.826528835648.issue30088@psf.upfronthosting.co.za> Message-ID: <1492425035.97.0.142651420779.issue30088@psf.upfronthosting.co.za> R. David Murray added the comment: Just create a subdirectory inside the tempdir to hold your Maildir folder. I think it is not worth complicating the API for this use case, since it does have a simple solution. ---------- versions: -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 07:12:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Apr 2017 11:12:28 +0000 Subject: [issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists In-Reply-To: <1492415274.72.0.826528835648.issue30088@psf.upfronthosting.co.za> Message-ID: <1492427548.05.0.431770822725.issue30088@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I concur with David. Rather than using a temporary directory as a Maildir folder: with tempfile.TemporaryDirectory() as tmpdir: with mailbox.Maildir(tmpdir, create=True) as box: ... create a Maildir folder in a temporary directory: with tempfile.TemporaryDirectory() as tmpdir: with mailbox.Maildir(os.path.join(tmpdir, 'mail'), create=True) as box: ... ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 07:44:53 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 11:44:53 +0000 Subject: [issue23174] shelve.open fails with error "anydbm.error: db type could not be determined" In-Reply-To: <1420502722.34.0.451688646321.issue23174@psf.upfronthosting.co.za> Message-ID: <1492429493.89.0.158520390159.issue23174@psf.upfronthosting.co.za> Raymond Hettinger added the comment: [Serhiy] > Current error message looks good to me and I don't see how > it can be enhanced. I concur with Serhiy and David. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 07:46:37 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 11:46:37 +0000 Subject: [issue30051] Document that the random module doesn't support fork In-Reply-To: <1491989089.77.0.552733144958.issue30051@psf.upfronthosting.co.za> Message-ID: <1492429597.59.0.648426769235.issue30051@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > os.fork() documentation contains a warning that refers to ssl > documentation where the use of OpenSSL?s internal random number > generator in forked processes is documented more detailed. > I think the same should be added for the random module. +1 It is reasonable to extend the docs for os.fork(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 10:18:15 2017 From: report at bugs.python.org (Chinh Nguyen) Date: Mon, 17 Apr 2017 14:18:15 +0000 Subject: [issue30089] Automatic Unload of Dynamic Library Cause Segfault Message-ID: <1492438695.51.0.289749789728.issue30089@psf.upfronthosting.co.za> New submission from Chinh Nguyen: I'm using ctypes to access the PAM library to change a user's password. That is, using the function pam_chauthtok. This is occurring inside a python celery worker in FreeBSD. This will work the first time, the second time generates a segfault and crashes the worker. On attaching gdb to the worker process, I observe the following: * Crash occurs in function login_setcryptfmt * Setting a breakpoint there, I see the following after the first successful password change "warning: Temporarily disabling breakpoints for unloaded shared library "/lib/libcrypt.so.5" * When there is segfault on the second password change, the location of the segfault cannot be disassemble * It doesn't look like libcrypt is a direct dependency of libpam. So it looks like what is happening is this: * libcrypt is loaded (by python/system?) to invoke some password-related functions, it is then unloaded (by python/system?) * When the same function is invoked again, somehow libcrypt does not get loaded. This results in a function call to the same function address which is now invalid. My current work-around is to include libcrypto explicitly by binding to it though I don't use it directly. For example, libcrypt = CDLL(find_library("crypt")). Other notes: * This does not occur if I launch celery worker all running in the same process via the celery "green threads" module eventlet * This only happens if the celery worker is a python child process. I don't know how celery spawns child processes. ---------- components: ctypes messages: 291798 nosy: Chinh Nguyen priority: normal severity: normal status: open title: Automatic Unload of Dynamic Library Cause Segfault type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 11:43:55 2017 From: report at bugs.python.org (Olivier Vielpeau) Date: Mon, 17 Apr 2017 15:43:55 +0000 Subject: [issue29738] Fix memory leak in SSLSocket.getpeercert() In-Reply-To: <1488831011.78.0.556870534746.issue29738@psf.upfronthosting.co.za> Message-ID: <1492443835.56.0.702956356755.issue29738@psf.upfronthosting.co.za> Olivier Vielpeau added the comment: Thnaks for the reviews and the merge! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 12:27:57 2017 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 17 Apr 2017 16:27:57 +0000 Subject: [issue30090] Failed to build these modules: _ctypes Message-ID: <1492446477.68.0.86749049176.issue30090@psf.upfronthosting.co.za> New submission from Emmanuel Arias: Hello everybody, I am working with the code. I clone the repo, and make a pull upstream of github's cpython repository (master branch), and when I make: ./configure --with-pydebug && make -j build correctly but finished with this message: Failed to build these modules: _ctypes But the Test Result is: SUCCESS Regards ---------- components: Interpreter Core messages: 291800 nosy: eamanu priority: normal severity: normal status: open title: Failed to build these modules: _ctypes type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 12:36:32 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 17 Apr 2017 16:36:32 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1492446992.98.0.248243416778.issue30031@psf.upfronthosting.co.za> Louie Lu added the comment: I make some review at GitHub. Do David and Terry suggest to also fix the problem about PEP8 coding style, since this demo have many places didn't fit PEP8. ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 12:39:42 2017 From: report at bugs.python.org (Zachary Ware) Date: Mon, 17 Apr 2017 16:39:42 +0000 Subject: [issue29041] Reference leaks on Windows In-Reply-To: <1482359321.76.0.526806281889.issue29041@psf.upfronthosting.co.za> Message-ID: <1492447182.84.0.125776451283.issue29041@psf.upfronthosting.co.za> Zachary Ware added the comment: Here's an updated refleak run, on master as of last Thursday: test_atexit leaked [12, 12, 12] references, sum=36 test_atexit leaked [4, 6, 6] memory blocks, sum=16 test_capi leaked [6, 6, 6] references, sum=18 test_capi leaked [2, 4, 4] memory blocks, sum=10 test_asyncio leaked [4, 1, 1] memory blocks, sum=6 test_concurrent_futures leaked [822, 807, 810] references, sum=2439 test_concurrent_futures leaked [274, 271, 272] memory blocks, sum=817 test_import leaked [-2, 2, 0] references, sum=0 test_import leaked [-2, 4, 2] memory blocks, sum=4 test_logging leaked [-21, 1, 1] memory blocks, sum=-19 test_os leaked [6, 7, 7] memory blocks, sum=20 test_platform leaked [12, 12, 12] references, sum=36 test_platform leaked [4, 6, 6] memory blocks, sum=16 test_sys leaked [9, 9, 9] references, sum=27 test_sys leaked [3, 5, 5] memory blocks, sum=13 test_threading leaked [12, 12, 12] references, sum=36 test_threading leaked [4, 6, 6] memory blocks, sum=16 test_xml_etree_c leaked [6, -6, 0] references, sum=0 test_xml_etree_c leaked [1, 1, 2] memory blocks, sum=4 test_multiprocessing_spawn leaked [159, 180, 162] references, sum=501 test_multiprocessing_spawn leaked [54, 62, 55] memory blocks, sum=171 I ran this one with `-j0` which may have affected the results slightly, but shaved 40 minutes off the run time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 12:42:50 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 17 Apr 2017 16:42:50 +0000 Subject: [issue30090] Failed to build these modules: _ctypes In-Reply-To: <1492446477.68.0.86749049176.issue30090@psf.upfronthosting.co.za> Message-ID: <1492447370.09.0.740224996191.issue30090@psf.upfronthosting.co.za> Louie Lu added the comment: Are you using Ubuntu or other Linux distribution? This problem is because you didn't install the dependency package. You may first try to use the instruction at devguide: http://cpython-devguide.readthedocs.io/setup.html#build-dependencies Or, assume you have install build-essential and python3-dev ...etc., maybe you lost to install libffi-dev, just simply `apt-get install libffi-dev` and rebuild to solve this problem. ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 12:45:51 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 17 Apr 2017 16:45:51 +0000 Subject: [issue30090] Failed to build these modules: _ctypes In-Reply-To: <1492446477.68.0.86749049176.issue30090@psf.upfronthosting.co.za> Message-ID: <1492447551.58.0.278146132211.issue30090@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- components: +Build -Interpreter Core type: compile error -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 13:16:15 2017 From: report at bugs.python.org (Pavlo Kapyshin) Date: Mon, 17 Apr 2017 17:16:15 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1492449375.17.0.533293200136.issue30031@psf.upfronthosting.co.za> Pavlo Kapyshin added the comment: Louie Lu, thank you for the review. Different quotes were already used in file, so someone should decide which ones must be used: single or double. Regarding the -n option, I tried to be backwards compatible. Again, a decision is needed. The only place where I had a choice to not do something related to PEP 8 was adding a line between Queens class and main function. I decided to mention that fact in pull request. In other places I had to follow contribution guide (therefore add code that follows style guide). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 13:19:05 2017 From: report at bugs.python.org (Jon Dufresne) Date: Mon, 17 Apr 2017 17:19:05 +0000 Subject: [issue30091] DeprecationWarning: invalid escape sequence: Only appears on first run Message-ID: <1492449545.72.0.587764680133.issue30091@psf.upfronthosting.co.za> New submission from Jon Dufresne: After upgrading to Python 3.6, I'm working towards cleaning up "DeprecationWarning: invalid escape sequence". I've noticed that the Deprecation warning only appears on the first run. It looks like once the code is compiled to `__pycache__`, the deprecation warning does not show. This makes debugging more difficult as I need clean out `__pycache__` directories for the runs to be reproducible. Example script: foo.py ``` import bar ``` bar.py ``` s = '\.' ``` First run ``` $ python36 -Wall foo.py .../test/bar.py:1: DeprecationWarning: invalid escape sequence \. s = '\.' ``` Second run (no DeprecationWarning) ``` $ python36 -Wall foo.py ``` Third run after cleaning ``` $ rm -rf __pycache__ $ python36 -Wall foo.py .../test/bar.py:1: DeprecationWarning: invalid escape sequence \. s = '\.' ``` I expect the deprecation warning to output on every run. ---------- components: Interpreter Core messages: 291805 nosy: jdufresne priority: normal severity: normal status: open title: DeprecationWarning: invalid escape sequence: Only appears on first run type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 13:41:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Apr 2017 17:41:28 +0000 Subject: [issue30091] DeprecationWarning: invalid escape sequence: Only appears on first run In-Reply-To: <1492449545.72.0.587764680133.issue30091@psf.upfronthosting.co.za> Message-ID: <1492450888.2.0.749067868941.issue30091@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This warning is emitted by the compiler when it compiles string literals with invalid escape sequences. Once the source is compiled to the bytecode and saved to the .pyc file the compiler no longer involved. You can disable writing compiled bytecode by calling python with option -B. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 13:46:23 2017 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 17 Apr 2017 17:46:23 +0000 Subject: [issue30090] Failed to build these modules: _ctypes In-Reply-To: <1492446477.68.0.86749049176.issue30090@psf.upfronthosting.co.za> Message-ID: <1492451183.13.0.984896119754.issue30090@psf.upfronthosting.co.za> Emmanuel Arias added the comment: The problem was solution making: apt-get install libffi-dev Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 13:55:43 2017 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 17 Apr 2017 17:55:43 +0000 Subject: [issue30090] Failed to build these modules: _ctypes In-Reply-To: <1492446477.68.0.86749049176.issue30090@psf.upfronthosting.co.za> Message-ID: <1492451743.73.0.415651505444.issue30090@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 14:35:46 2017 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 17 Apr 2017 18:35:46 +0000 Subject: [issue29514] Add a test case that prevents magic number changes in minor releases In-Reply-To: <1486654210.44.0.116789566768.issue29514@psf.upfronthosting.co.za> Message-ID: <1492454146.34.0.503895298598.issue29514@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset d6d344d8330a5975fc102e8f275d47044294f1d1 by ?ukasz Langa (Eric Appelt) in branch 'master': bpo-29514: Check magic number for bugfix release (#54) https://github.com/python/cpython/commit/d6d344d8330a5975fc102e8f275d47044294f1d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 15:42:22 2017 From: report at bugs.python.org (Jon Dufresne) Date: Mon, 17 Apr 2017 19:42:22 +0000 Subject: [issue30091] DeprecationWarning: invalid escape sequence: Only appears on first run In-Reply-To: <1492449545.72.0.587764680133.issue30091@psf.upfronthosting.co.za> Message-ID: <1492458142.63.0.162831684457.issue30091@psf.upfronthosting.co.za> Jon Dufresne added the comment: I see. I think if the goal is for developers to see and fix these DeprecationWarnings, it would help if the warnings were reproducible without taking steps different from normal Python development. TBH, this is the first time I've ever used the -B CLI argument. For an example of where developers saw different sets of warnings which lead to confusion, see https://github.com/dateutil/dateutil/pull/358. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 15:45:47 2017 From: report at bugs.python.org (Sviatoslav Sydorenko) Date: Mon, 17 Apr 2017 19:45:47 +0000 Subject: [issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists In-Reply-To: <1492415274.72.0.826528835648.issue30088@psf.upfronthosting.co.za> Message-ID: <1492458347.02.0.489065854648.issue30088@psf.upfronthosting.co.za> Sviatoslav Sydorenko added the comment: > create a Maildir folder in a temporary directory: > > with tempfile.TemporaryDirectory() as tmpdir: > with mailbox.Maildir(os.path.join(tmpdir, 'mail'), create=True) as box: > ... Yeah, I came up with the same solution. It just seems weird to me. The doc says "If create is True, the mailbox is created if it does not exist.". So it operates the term mailbox, not a folder. I would assume that a valid mailbox [1] is the whole **valid** directory structure with subfolders. If the corresponding subdirs are missing the folder should not be considered as a valid maildir, right? Given above, I think the documentation doesn't clearly promise the same behavior that the code does. Shouldn't this be fixed? (Either docs, or code) [1] http://www.qmail.org/man/man5/maildir.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 15:58:17 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Apr 2017 19:58:17 +0000 Subject: [issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists In-Reply-To: <1492415274.72.0.826528835648.issue30088@psf.upfronthosting.co.za> Message-ID: <1492459097.13.0.308439008175.issue30088@psf.upfronthosting.co.za> R. David Murray added the comment: Right. Which is why you get an error if you try to use an empty directory as if it was a maildir :) create=True creates the *directory* and initializes it. That seems clear to me, and exactly what I would expect. "The mailbox" is the directory. If it already exists, it should be a Maildir folder. I wouldn't want a program messing with an existing directory if it was invalid...it might trash my data :) I don't think even a doc change is needed here, but if you want to propose something we can evaluate it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 16:04:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 17 Apr 2017 20:04:13 +0000 Subject: [issue30091] DeprecationWarning: invalid escape sequence: Only appears on first run In-Reply-To: <1492449545.72.0.587764680133.issue30091@psf.upfronthosting.co.za> Message-ID: <1492459453.19.0.30488914962.issue30091@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is how Python works. This can't be changed without changing the compiler, the format of .pyc files (for saving warnings) and importing system. And this may slow down normal compilation due to generating warnings for saving them in .pyc files. I don't think this is worth. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 17:47:35 2017 From: report at bugs.python.org (Jon Dufresne) Date: Mon, 17 Apr 2017 21:47:35 +0000 Subject: [issue30091] DeprecationWarning: invalid escape sequence: Only appears on first run In-Reply-To: <1492449545.72.0.587764680133.issue30091@psf.upfronthosting.co.za> Message-ID: <1492465655.78.0.664264468959.issue30091@psf.upfronthosting.co.za> Jon Dufresne added the comment: Understood. Thanks for the response. I'll have to keep this in mind as I debug these warnings in the future. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 19:34:02 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 17 Apr 2017 23:34:02 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1492472042.57.0.752906081902.issue30031@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Please focus on the task at hand and don't worry about PEP-8ing the existing code. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 19:40:37 2017 From: report at bugs.python.org (Eryk Sun) Date: Mon, 17 Apr 2017 23:40:37 +0000 Subject: [issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows In-Reply-To: <1492363586.51.0.498152844874.issue30082@psf.upfronthosting.co.za> Message-ID: <1492472437.24.0.158332597238.issue30082@psf.upfronthosting.co.za> Eryk Sun added the comment: Hiding the console is required often enough that a keyword-only parameter for this would be useful. Other platforms could simply ignore it, in contrast to writing platform-dependent code that passes startupinfo. Note that this option would also hide the window of GUI programs that do not (intentionally) ignore SW_HIDE, such as notepad. ---------- components: +Windows keywords: +easy nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware stage: -> needs patch versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 21:14:58 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 01:14:58 +0000 Subject: [issue29950] Rename SlotWrapperType to WrapperDescriptorType In-Reply-To: <1490913155.68.0.921075997719.issue29950@psf.upfronthosting.co.za> Message-ID: <1492478098.61.0.384656238031.issue29950@psf.upfronthosting.co.za> Dong-hee Na added the comment: I am a newcomer who is interesting with contributing CPython project. This issue looks easy to solve. Can I proceed this issue? ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 21:44:38 2017 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 18 Apr 2017 01:44:38 +0000 Subject: [issue30040] new empty dict can be more small In-Reply-To: <1491903560.12.0.959603376514.issue30040@psf.upfronthosting.co.za> Message-ID: <1492479878.06.0.231847604447.issue30040@psf.upfronthosting.co.za> Josh Rosenberg added the comment: For the record, legitimate case when many empty dicts are created, and few are populated, is the collections-free approach to defaultdict(dict): mydict.setdefault(key1, {})[key2] = val For, say, 100 unique key1s, and 10,000 total key1/key2 pairs, you'd create 10,000 empty dicts, discarding 9,900 of them. Granted, collections.defaultdict(dict) is even better (avoids the 9,900 unused dicts entirely), but I see the setdefault pattern enough, usually with list or dict, that it's not totally unreasonable to account for it. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 22:13:33 2017 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 18 Apr 2017 02:13:33 +0000 Subject: [issue30049] Don't cache tp_iternext In-Reply-To: <1491986363.23.0.567694316296.issue30049@psf.upfronthosting.co.za> Message-ID: <1492481613.71.0.884010963186.issue30049@psf.upfronthosting.co.za> Josh Rosenberg added the comment: I'm having a hard time thinking of legitimate cases where replacing __next__ mid-iteration is a thing. Doing so retroactively on the class (so it changes all outstanding iterators, no matter what state they're in) seems dubious at best, and it wouldn't be thread-safe if many different ways if iterators of said type are being used in multiple threads. Is the dynamic type lookup on every iteration necessary too? Would failing to do so cause crashes if evil iterator reassigns self.__class__ or something? I feel like if segfaults aren't a possibility (I haven't been able to cause one on Py 3.5 by reassigning the class's __next__ or the instance's __class__), it's not our job to fix intentionally broken code at the expense of all other code. Raymond okayed the previous issue because it was a segfaulting bug, but it seems like this is just a "broken code is broken" bug. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 22:58:32 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 18 Apr 2017 02:58:32 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1492484312.73.0.671679145624.issue30031@psf.upfronthosting.co.za> Louie Lu added the comment: Pavlo, you are right, making the argument have backward compatible is good. String quote I'll prefer `'` more than `"`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 17 23:57:09 2017 From: report at bugs.python.org (Jim DeLaHunt) Date: Tue, 18 Apr 2017 03:57:09 +0000 Subject: [issue29428] Doctest documentation unclear about multi-line fixtures In-Reply-To: <1486103112.9.0.326343032946.issue29428@psf.upfronthosting.co.za> Message-ID: <1492487829.71.0.939465254125.issue29428@psf.upfronthosting.co.za> Jim DeLaHunt added the comment: Bump. Could I get a few more eyes looking at the current state of https://github.com/python/cpython/pull/45/ ? * @bitdancer made some suggestions. I accepted some, and replied to others where I think we should keep looking for common ground. I'd like to see replies. * I've made changes in response to other comments. I think pull/45 represents a targeted set of changes to those parts of the module documentation which are particularly unclear. It is not a wholesale re-write; that's a task for a different time. I believe it is responsive to comments so far. I'd appreciate more eyes to help arrive at consensus on those improvements where we can. Thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 01:10:26 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 05:10:26 +0000 Subject: [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1492492226.79.0.1650744573.issue12414@psf.upfronthosting.co.za> Dong-hee Na added the comment: I am a newcomer who is interesting with contributing CPython project. This issue could be the first challenging issue for me. It looks like we need to multiply the number of co_extra and return the result. This approach is right and can I proceed this issue? ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 01:37:34 2017 From: report at bugs.python.org (larsonreever) Date: Tue, 18 Apr 2017 05:37:34 +0000 Subject: [issue15873] datetime: add ability to parse RFC 3339 dates and times In-Reply-To: <1346965730.56.0.810546720554.issue15873@psf.upfronthosting.co.za> Message-ID: <1492493854.95.0.0909395537193.issue15873@psf.upfronthosting.co.za> larsonreever added the comment: Otherwise, py8601 (https://bitbucket.org/micktwomey/pyiso8601/) looks pretty popular and well maintained (various committers, started in 2012, last commit in 2016). I don't think that we should add the iso8601 module to the stdlib, but merge iso8601 "features" into the datetime module. The iso8601 module supports Python 2.7 and so has to implement its own timezone classes. The datetime module now has datetime.timezone since Python 3.2 for fixed timezone. To me it's the finest, the most elegant, and no other one can claim to be more robust since it's probably the #1 iso parsing functions used in python. Have a look at https://docs.djangoproject.com/en/1.9/_modules/django/utils/dateparse/#parse_datetime. ---------- nosy: +larsonreever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 02:51:59 2017 From: report at bugs.python.org (Marc Schlaich) Date: Tue, 18 Apr 2017 06:51:59 +0000 Subject: [issue29533] urllib2 works slowly with proxy on windows In-Reply-To: <1486802607.23.0.387912582288.issue29533@psf.upfronthosting.co.za> Message-ID: <1492498319.58.0.756374391592.issue29533@psf.upfronthosting.co.za> Marc Schlaich added the comment: Julia, could you please add other major browsers/HTTP clients (Firefox, Chrome, curl, ...) to your comparison (compare_ie_urllib.txt). I would expect that Python/urllib is the only implementation doing DNS requests for proxy bypass handling. Please note that curl uses the `no_proxy` environment variable, so the syntax is slightly different. For anyone who doesn't fully grasp the details of this issue, there might be a better explanation at https://github.com/kennethreitz/requests/issues/2988. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:01:18 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 07:01:18 +0000 Subject: [issue30092] Replace sys.version to sys.version_info in sysconfig.py Message-ID: <1492498878.43.0.141309360868.issue30092@psf.upfronthosting.co.za> New submission from Dong-hee Na: Not to rely on sys.version here, its format is an implementation detail of CPython, use sys.version_info or sys.hexversion ---------- components: Library (Lib) messages: 291824 nosy: corona10 priority: normal severity: normal status: open title: Replace sys.version to sys.version_info in sysconfig.py versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:03:14 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 07:03:14 +0000 Subject: [issue30092] Replace sys.version to sys.version_info in sysconfig.py In-Reply-To: <1492498878.43.0.141309360868.issue30092@psf.upfronthosting.co.za> Message-ID: <1492498994.27.0.765542514436.issue30092@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1295 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:14:22 2017 From: report at bugs.python.org (larsonreever) Date: Tue, 18 Apr 2017 07:14:22 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1492499662.29.0.47345004412.issue25782@psf.upfronthosting.co.za> larsonreever added the comment: My patch works for your example too. Since it checks for loops in __context__ setter, you shouldn't be able to create complicated loops. However, since PyException_SetContext and PyException_SetCause are public APIs, and their return type is 'void', I can't raise an error when a C code introduces a cycle, in that case, the exc->cause/exc->context will be set to NULL.(I came to this bug via the ExitStack + subprocess issue27122 which merely has a suggested workaround patch as a band aid that might help until this is fixed) Thanks: http://driverwhiz.com/device-drivers ---------- nosy: +larsonreever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:22:04 2017 From: report at bugs.python.org (Larry Hastings) Date: Tue, 18 Apr 2017 07:22:04 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1492500124.29.0.83110061595.issue25782@psf.upfronthosting.co.za> Larry Hastings added the comment: Why is this still open? GPS: didn't your checkin last June fix this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:22:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Apr 2017 07:22:14 +0000 Subject: [issue30092] Replace sys.version to sys.version_info in sysconfig.py In-Reply-To: <1492498878.43.0.141309360868.issue30092@psf.upfronthosting.co.za> Message-ID: <1492500134.48.0.0305958683691.issue30092@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The patch contains too much unrelated changes. As for changing the definition of sysconfig.get_config_vars('py_version') I'm not sure it is worth to do bacause this loss an information. This is a duplicate issue24916. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> In sysconfig, don't rely on sys.version format _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:30:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Apr 2017 07:30:58 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1492500658.3.0.667900242352.issue25782@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Because we have two alternate solutions, issue25782_5.patch and set_context_reordering2.patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:32:35 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 07:32:35 +0000 Subject: [issue29950] Rename SlotWrapperType to WrapperDescriptorType In-Reply-To: <1490913155.68.0.921075997719.issue29950@psf.upfronthosting.co.za> Message-ID: <1492500755.95.0.88805408066.issue29950@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1296 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:38:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Apr 2017 07:38:59 +0000 Subject: [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1492501139.33.0.33781794091.issue12414@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is easy issue. The only tricky part is testing. AFAIK we have no control on co_extra from Python. Therefore we can't create a new test. But existing test perhaps should be weaken for the case when it is ran on the interpreter that sets co_extra. ---------- keywords: +easy (C) stage: -> needs patch versions: +Python 3.6, Python 3.7 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 03:39:14 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 18 Apr 2017 07:39:14 +0000 Subject: [issue26434] multiprocessing cannot spawn grandchild from a Windows service In-Reply-To: <1456394207.49.0.123218861266.issue26434@psf.upfronthosting.co.za> Message-ID: <1492501154.8.0.292811617533.issue26434@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1297 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 04:47:26 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 08:47:26 +0000 Subject: [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1492505246.84.0.201187720894.issue12414@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1298 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 05:22:26 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 18 Apr 2017 09:22:26 +0000 Subject: [issue29950] Rename SlotWrapperType to WrapperDescriptorType In-Reply-To: <1490913155.68.0.921075997719.issue29950@psf.upfronthosting.co.za> Message-ID: <1492507346.22.0.653481333617.issue29950@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- pull_requests: +1299 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 05:23:40 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 18 Apr 2017 09:23:40 +0000 Subject: [issue29950] Rename SlotWrapperType to WrapperDescriptorType In-Reply-To: <1490913155.68.0.921075997719.issue29950@psf.upfronthosting.co.za> Message-ID: <1492507420.18.0.137500578994.issue29950@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: Dong-hee, I apologize. I had made a silly mistake in the title of my PR and, as such, it didn't appear here on bpo. Thanks for the PR, though! :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 05:42:06 2017 From: report at bugs.python.org (=?utf-8?q?Anders_Hovm=C3=B6ller?=) Date: Tue, 18 Apr 2017 09:42:06 +0000 Subject: [issue15873] datetime: add ability to parse RFC 3339 dates and times In-Reply-To: <1346965730.56.0.810546720554.issue15873@psf.upfronthosting.co.za> Message-ID: <1492508526.31.0.76266945809.issue15873@psf.upfronthosting.co.za> Anders Hovm?ller added the comment: @larsonreever That lib is pretty limited, in that it doesn't handle dates or deltas. Again: my lib that is linked above does and has comprehensive tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 07:58:59 2017 From: report at bugs.python.org (Tomer Chachamu) Date: Tue, 18 Apr 2017 11:58:59 +0000 Subject: [issue24160] Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1492516739.69.0.086029490559.issue24160@psf.upfronthosting.co.za> Changes by Tomer Chachamu : ---------- nosy: +Tomer Chachamu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 08:35:37 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 18 Apr 2017 12:35:37 +0000 Subject: [issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long In-Reply-To: <1492277239.5.0.348724747458.issue30076@psf.upfronthosting.co.za> Message-ID: <1492518937.45.0.820321548207.issue30076@psf.upfronthosting.co.za> Nick Coghlan added the comment: I think it should be sufficient connection to describe the link in the documentation as: * BUILD_VAR_POSITIONAL: a variant of BUILD_TUPLE_UNPACK tailored specifically for use in function calls * BUILD_VAR_KEYWORD: a variant of BUILD_MAP_UNPACK tailored specifically for use in function calls The BUILD_*_UNPACK documentation could also point to their relevant function call counterpart: "Note: function calls do not use this opcode, they use the specialized BUILD_VAR_". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 09:11:45 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 13:11:45 +0000 Subject: [issue30093] Unicode eq operation with hash. Message-ID: <1492521105.55.0.00251223678903.issue30093@psf.upfronthosting.co.za> New submission from Dong-hee Na: If the Unicode compare operation is done by comparing the hashes, it is likely to be efficient because memory comparison is not necessary. If this idea is approved I could upload my PR right now. :-) (I already checked local unit test is passed.) ---------- components: Unicode messages: 291833 nosy: corona10, ezio.melotti, haypo priority: normal severity: normal status: open title: Unicode eq operation with hash. type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 09:15:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 18 Apr 2017 13:15:37 +0000 Subject: [issue30093] Unicode eq operation with hash. In-Reply-To: <1492521105.55.0.00251223678903.issue30093@psf.upfronthosting.co.za> Message-ID: <1492521337.14.0.0952368043821.issue30093@psf.upfronthosting.co.za> STINNER Victor added the comment: My previous attempt which ended with "Raymond Hettinger: I don't think it is worth it." http://bugs.python.org/issue16286#msg216654 Most string comparisons are comparisons of strings of less than 20 characters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 09:19:31 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 13:19:31 +0000 Subject: [issue30093] Unicode eq operation with hash. In-Reply-To: <1492521105.55.0.00251223678903.issue30093@psf.upfronthosting.co.za> Message-ID: <1492521571.49.0.398385366967.issue30093@psf.upfronthosting.co.za> Dong-hee Na added the comment: Thanks for the reply. I did not know it was already discussed. The conclusion of the thread looks reasonable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 09:19:44 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 18 Apr 2017 13:19:44 +0000 Subject: [issue30093] Unicode eq operation with hash. In-Reply-To: <1492521105.55.0.00251223678903.issue30093@psf.upfronthosting.co.za> Message-ID: <1492521584.28.0.189657858464.issue30093@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 10:19:03 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 18 Apr 2017 14:19:03 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492525143.36.0.366845410512.issue14102@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1300 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 10:28:06 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 18 Apr 2017 14:28:06 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492525686.96.0.424548624973.issue14102@psf.upfronthosting.co.za> Louie Lu added the comment: Hi all, I've created a PR for this, please help for code review. I found that previous method from Oz had a problem, that man page and general help page will share a Formatter, that cause an unexpected behavior that help page will generate with troff format (Unix man page used this format). I switch to another method that creates a Manpage class and a private _ManpageFormatter, we just need to put parser into this Manpage, the __str__ method will generate the man page that we want. This approach prevents help page format affect by ManpageFormatter, and the user can happily switching formatter_class to RawDescriptionHelpForatter, RawTextHelpForatter and others, since the Manpage class is separate from HelpFormatter, and _ManpageFormatter will used the formatter provide from parser. The attach file is a dummy argparser file, you can try it by this: ./python poc.py > poc.1 && man ./poc.1 ---------- nosy: +louielu Added file: http://bugs.python.org/file46809/poc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 10:36:48 2017 From: report at bugs.python.org (Gerrit Holl) Date: Tue, 18 Apr 2017 14:36:48 +0000 Subject: [issue4180] warnings.simplefilter("always") does not make warnings always show up In-Reply-To: <1224712172.47.0.998538899646.issue4180@psf.upfronthosting.co.za> Message-ID: <1492526208.18.0.635525547552.issue4180@psf.upfronthosting.co.za> Gerrit Holl added the comment: I believe this fix causes this bug: http://bugs.python.org/issue29672 ---------- nosy: +Gerrit.Holl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 10:57:59 2017 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 18 Apr 2017 14:57:59 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1492527479.44.0.371947404695.issue25782@psf.upfronthosting.co.za> Changes by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 12:42:16 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Apr 2017 16:42:16 +0000 Subject: [issue30031] Improve queens demo (use argparse and singular form) In-Reply-To: <1491829597.98.0.553566597714.issue30031@psf.upfronthosting.co.za> Message-ID: <1492533736.85.0.745305861765.issue30031@psf.upfronthosting.co.za> Raymond Hettinger added the comment: After more thought on the subject, I think the n-queens demo should be left as is. The demo is principally about the class and not about being a command-line tool. Also, it is reasonable and appropriate to use sys.argv directly for such a simple API. How to do so is a legitimate example itself. Not all uses of sys.argv need argparse. In other words, I don't think the proposed changes makes anyone's life better and in the some ways makes the example less approachable for teaching purposes (my area of expertise). The example works fine as-is. Changing it seems like unnecessary code churn and already eating some of our time. Thank you for the idea. It never hurts to look around for ways to improve code. Though I don't think there was a new win in this case, don't let that discourage you. Please continue to look for improvements :-) ---------- assignee: -> rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 14:32:39 2017 From: report at bugs.python.org (Erik Zoltan) Date: Tue, 18 Apr 2017 18:32:39 +0000 Subject: [issue30094] PDB enhancement Message-ID: <1492540356.16.0.824353037867.issue30094@psf.upfronthosting.co.za> New submission from Erik Zoltan: I have created a pdb enhancement that allows me to query an object's internals more gracefully. It is incredibly useful and it would be very easy to include this logic in the distribution version of pdb. I created my own modification of pdb called zdebug (attached as zdebug.py) that implements a new ppp debugging command. This command prints a formatted output of an object's internals. It could be smoother, and doesn't fully obey the programming conventions used with in pdb, and I'm not proposing to submit it as a patch. However the ppp command is pretty simple and incredibly useful. Here's a tiny example. I can drill into an object, see its internals, and interactively explore its property chain. (The zdebug.zbreak() call is equivalent to pdb.set_trace()). $ python3 >>> from datetime import date >>> today = date.today() >>> import zdebug >>> zdebug.zbreak() --Return-- > (1)()->None zdebug> p today datetime.date(2017, 4, 18) zdebug> ppp today ctime = day = 18 fromordinal = fromtimestamp = isocalendar = isoformat = isoweekday = max = 9999-12-31 min = 0001-01-01 month = 4 replace = resolution = 1 day, 0:00:00 strftime = timetuple = today = toordinal = weekday = year = 2017 zdebug> p today.day 18 zdebug> p today.year 2017 ---------- components: Library (Lib) files: zdebug.py messages: 291839 nosy: Erik Zoltan priority: normal severity: normal status: open title: PDB enhancement type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file46810/zdebug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 15:30:58 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Tue, 18 Apr 2017 19:30:58 +0000 Subject: [issue30094] PDB enhancement In-Reply-To: <1492540356.16.0.824353037867.issue30094@psf.upfronthosting.co.za> Message-ID: <1492543858.65.0.572056493951.issue30094@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: Dunno, if I wanted to see a nice formatted output of the internals I'd run `pp vars(obj)`. That, though, suffers a bit from the fact that `vars` is not the most known of the builtins. ---------- nosy: +Jim Fasarakis-Hilliard versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 15:37:57 2017 From: report at bugs.python.org (Oz Tiram) Date: Tue, 18 Apr 2017 19:37:57 +0000 Subject: [issue30095] HTMLCalendar allow custom classes Message-ID: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> New submission from Oz Tiram: At the moment methods like HTMLCalendar.formatmonthname and HTMLCalendar.formatmonth have hard coded name 'month'. This class is pretty helpful as a good start, but if you want to customize the styles it's not helpful. I think it would be helpful for others too, if this would have be customize able. Would you accept a PR for such thing? ---------- components: Library (Lib) messages: 291841 nosy: Oz.Tiram priority: normal severity: normal status: open title: HTMLCalendar allow custom classes type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 15:45:51 2017 From: report at bugs.python.org (Sanket Dasgupta) Date: Tue, 18 Apr 2017 19:45:51 +0000 Subject: [issue30085] Discourage operator.__dunder__ functions In-Reply-To: <1492396029.61.0.720198059802.issue30085@psf.upfronthosting.co.za> Message-ID: <1492544751.14.0.18810464847.issue30085@psf.upfronthosting.co.za> Changes by Sanket Dasgupta : ---------- pull_requests: +1301 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 15:51:38 2017 From: report at bugs.python.org (Brett Cannon) Date: Tue, 18 Apr 2017 19:51:38 +0000 Subject: [issue30096] Update examples in abc documentation to use abc.ABC Message-ID: <1492545098.58.0.705598301268.issue30096@psf.upfronthosting.co.za> New submission from Brett Cannon: I noticed that the documentation for the abc module (https://docs.python.org/3/library/abc.html) has all example classes use ABCMeta instead of ABC which is what most people probably want. To keep things simple the docs should probably be updated to inherit from abc.ABC. ---------- assignee: docs at python components: Documentation messages: 291842 nosy: brett.cannon, docs at python priority: normal severity: normal stage: needs patch status: open title: Update examples in abc documentation to use abc.ABC type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 17:28:05 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Apr 2017 21:28:05 +0000 Subject: [issue30096] Update examples in abc documentation to use abc.ABC In-Reply-To: <1492545098.58.0.705598301268.issue30096@psf.upfronthosting.co.za> Message-ID: <1492550885.47.0.521379696174.issue30096@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 It would be nice to have the examples show the usual best practices. That said, in the doc for abc.ABC itself, it would be nice to show an brief example both ways (much like we do for the property() docstring) to show the relationship between the two. In other words, I want people to inherit from ABC but don't want the knowledge of ABCMeta to be lost. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 18:11:52 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Apr 2017 22:11:52 +0000 Subject: [issue30097] Command-line option to suppress "from None" for debugging Message-ID: <1492553512.25.0.992335940269.issue30097@psf.upfronthosting.co.za> New submission from Raymond Hettinger: Filing this feature request on behalf of an engineering team that I work with. This team creates Python tools for use by other departments. Accordingly, their best practice is to use "raise CleanException from None" to give the cleanest error messages to their users while hiding the noise of implementation details and internal logic. The exposed exceptions are a documented, guaranteed part of the API that users can reliably catch and handle. This has worked well for them; however, when they are debugging the library itself it would be nice to have a way to suppress all the "from None" code and see fuller stack traces that indicate root causes. One way to do this would be to have a command-line switch such as "python -C testcode.py". Where the "-C" option means "Always show the cause of exceptions even when 'from None' is present. ---------- components: Interpreter Core messages: 291844 nosy: rhettinger priority: normal severity: normal status: open title: Command-line option to suppress "from None" for debugging type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 18:13:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Apr 2017 22:13:20 +0000 Subject: [issue30094] PDB enhancement In-Reply-To: <1492540356.16.0.824353037867.issue30094@psf.upfronthosting.co.za> Message-ID: <1492553600.6.0.551341423179.issue30094@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 18:24:34 2017 From: report at bugs.python.org (crenwick) Date: Tue, 18 Apr 2017 22:24:34 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future Message-ID: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> New submission from crenwick: Despite the shy mention in the docs, it was not clear to me that the future returned from asyncio.run_coroutine_threadsafe is not compatible with asyncio.ensure_future (and other asyncio functions), and it took me a fair amount of frustration and source-code-digging to figure out what was going on. To avoid this confusion for other users, I think that a verbose TypeError warning when a concurrent.futures.Future object is passed into asyncio.ensure_future would be very helpful. ---------- components: asyncio messages: 291845 nosy: crenwick, yselivanov priority: normal pull_requests: 1302 severity: normal status: open title: Verbose TypeError for asyncio.ensure_future type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 18:51:58 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 18 Apr 2017 22:51:58 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492555918.49.0.793264198628.issue30098@psf.upfronthosting.co.za> Yury Selivanov added the comment: `asyncio.run_coroutine_threadsafe` was't designed to be compatible with `asyncio.ensure_future`. It should be used to run a coroutine in an event loop from another thread. You shouldn't need to await on the future it returns. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 18:59:19 2017 From: report at bugs.python.org (crenwick) Date: Tue, 18 Apr 2017 22:59:19 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492556359.54.0.641183541895.issue30098@psf.upfronthosting.co.za> crenwick added the comment: Totally. But this wasn't immediately clear to me when using the API. A verbose error like this one would have made this behavior more clear to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 19:07:00 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 18 Apr 2017 23:07:00 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492556820.01.0.212910589034.issue30098@psf.upfronthosting.co.za> Yury Selivanov added the comment: > A verbose error like this one would have made this behavior more clear to me. Well, it already raises a TypeError with a clear message -- this is how we tell the user that the argument type is not supported in Python. I don't think we need to specialize this code any further. Instead I'd suggest to try to improve asyncio documentation for `ensure_future` and `run_coroutine_threadsafe`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 19:20:53 2017 From: report at bugs.python.org (crenwick) Date: Tue, 18 Apr 2017 23:20:53 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492557653.68.0.65386597588.issue30098@psf.upfronthosting.co.za> crenwick added the comment: > it already raises a TypeError with a clear message This is more to my point: I found the TypeError message not clear at all. >From my prospective, I was using a future object returned from an asyncio function to call another asyncio function, yet that function was telling me it could only use a future with it. Though I eventually figured out what was going on, I think that a more clear message at that moment would have been very helpful to me. And I think other users who benefit from this was well. A better warning/wording for the API would be helpful as well, but I don't think it fully suffices the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 19:35:59 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 18 Apr 2017 23:35:59 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492558559.71.0.21223994078.issue30098@psf.upfronthosting.co.za> Yury Selivanov added the comment: > This is more to my point: I found the TypeError message not clear at all. > From my prospective, I was using a future object returned from an asyncio function to call another asyncio function, yet that function was telling me it could only use a future with it. I understand, but this is the first time I see somebody tries to use `ensure_future` on `run_coroutine_threadsafe` result, which suggests that it's not a common problem. Specializing error messages makes code more complex and adds to maintenance overhead, so we can't afford to make changes on first request. In cases like this we usually put the issue on hold to see if more people complain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 19:45:45 2017 From: report at bugs.python.org (crenwick) Date: Tue, 18 Apr 2017 23:45:45 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492559145.11.0.288123202077.issue30098@psf.upfronthosting.co.za> crenwick added the comment: Totally understandable. Some final thoughts: > this is the first time I see somebody tries to use `ensure_future` on `run_coroutine_threadsafe` result, which suggests that it's not a common problem. - I wonder how much self-reporting will be done here. - I also considered making the existing error message more verbose (I think that still could be effective). However, I decided to open this PR as a separate TypeError to not muddle the language of the probably more common TypeError. Thanks for your time and insight, Yury! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 19:50:22 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 18 Apr 2017 23:50:22 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492559422.75.0.353147440404.issue30098@psf.upfronthosting.co.za> Yury Selivanov added the comment: > - I wonder how much self-reporting will be done here. Yeah, I don't think we see enough reporting on bugs.python.org. I hope people will become more vocal :) I try to monitor what people say about asyncio on SO, Twitter and /r/python to get a better picture. > - I also considered making the existing error message more verbose (I think that still could be effective). Feel free to suggest a better wording. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 19:58:00 2017 From: report at bugs.python.org (Jake Merdich) Date: Tue, 18 Apr 2017 23:58:00 +0000 Subject: [issue30099] Lib2to3 fails with unreadable pickle file Message-ID: <1492559879.72.0.671474641555.issue30099@psf.upfronthosting.co.za> New submission from Jake Merdich: There seem to have been a few issues in the past with creating the lib2to3 pickle files with the right permissions due to umask behavior (#15890). While I'm unaware of the status installer-level fixes have given, it seems prudent that the installed python should always function, given there is an obvious and trivial fallback (regenerating the grammar tables at runtime). The current codebase will throw a PermissionDenied exception if the pickle file is unreadable, rather than fall back to generating the grammar tables. To reproduce: Install python2.6+, 3.0+ chmod o-r $PYTHON_INSTALL/lib/pythonX.Y/lib2to3/*.pickle pythonX.Y -c "import lib2to3.pygram" Notably, this sort of borked installation is quite hard to detect.... unless a user without root tries to run setuptools (*whistles*). ---------- components: 2to3 (2.x to 3.x conversion tool) files: 0001-Fallback-to-regenerating-2to3-grammars-on-read-fail.patch keywords: patch messages: 291853 nosy: Jake Merdich priority: normal severity: normal status: open title: Lib2to3 fails with unreadable pickle file type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46811/0001-Fallback-to-regenerating-2to3-grammars-on-read-fail.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 20:41:26 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 19 Apr 2017 00:41:26 +0000 Subject: [issue30049] Don't cache tp_iternext In-Reply-To: <1491986363.23.0.567694316296.issue30049@psf.upfronthosting.co.za> Message-ID: <1492562486.39.0.402683571777.issue30049@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > it seems like this is just a "broken code is broken" bug I agree. Unless there were a crasher of some sort, I prefer to keep the existing code, some of which has been deployed successfully for well over a decade. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 20:47:07 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 19 Apr 2017 00:47:07 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492562827.72.0.353706302869.issue30070@psf.upfronthosting.co.za> Raymond Hettinger added the comment: LGTM ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 18 22:22:03 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 19 Apr 2017 02:22:03 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492568523.54.0.370028434129.issue30098@psf.upfronthosting.co.za> R. David Murray added the comment: I don't think your specialized error message adds anything. The the most common mistake, IMO, is going to be not realizing that run_coroutine_threadsafe don't return one of the acceptable types. So being told that concurrent.future.Future is not acceptable will add zero additional information. I think the only change that needs to be made is to make the existing message say 'asyncio.Future' instead of just 'Future'. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 00:06:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 04:06:52 +0000 Subject: [issue30097] Command-line option to suppress "from None" for debugging In-Reply-To: <1492553512.25.0.992335940269.issue30097@psf.upfronthosting.co.za> Message-ID: <1492574812.68.0.423767412651.issue30097@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The initial exception still is linked as __context__. You can write own implementation of traceback.print_exception() that ignores __suppress_context__. Alternatively you can just set __suppress_context__ to False. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 00:39:15 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 19 Apr 2017 04:39:15 +0000 Subject: [issue30097] Command-line option to suppress "from None" for debugging In-Reply-To: <1492553512.25.0.992335940269.issue30097@psf.upfronthosting.co.za> Message-ID: <1492576755.51.0.535563791356.issue30097@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 00:45:11 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 19 Apr 2017 04:45:11 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1492577111.53.0.620900906651.issue30095@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Can't you override the `.month` css class and customize the style that way? ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 00:49:32 2017 From: report at bugs.python.org (Oz Tiram) Date: Wed, 19 Apr 2017 04:49:32 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1492577372.86.0.647902807304.issue30095@psf.upfronthosting.co.za> Oz Tiram added the comment: Of course I can, but I can't add multiple css classes, and I forced to have the same class for both the title of the month and the body of the month. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 00:50:28 2017 From: report at bugs.python.org (Mark A. Ziesemer) Date: Wed, 19 Apr 2017 04:50:28 +0000 Subject: [issue20493] select module: loop if the timeout is too large (OverflowError "timeout is too large") In-Reply-To: <1391387871.01.0.754074352669.issue20493@psf.upfronthosting.co.za> Message-ID: <1492577428.89.0.726911402185.issue20493@psf.upfronthosting.co.za> Mark A. Ziesemer added the comment: Not sure what may have changed here over the past 3 years, but some current findings: For _UnixSelectorEventLoop, "/usr/lib/python3.5/selectors.py", line 445, in select, fd_event_list = self._epoll.poll(timeout, max_ev), Python 3.5.3 (or 3.6.1), Linux 4.10.0-19 x86_64 (or Cygwin 2.8.0): 2,147,483 is acceptable, 2,147,484 is not. (Either side of 2**31/1000.) With the seconds/milliseconds conversions, I suppose the previous testing here just didn't get this specific - but this is only 24.86 days, just ever so slightly above half of the "48 days" figure mentioned below. So no, not even the "maximum timeout of 30 days" previously proposed would be sufficient - though the currently documented "one day" maximum is. So if intending to use this as a serious scheduler, what to do? I considered checking for values more than 86,400 (1 day) before scheduling - and if in excess, instead scheduling a proxy that would repeatedly reschedule the next interval as needed in < 1 day increments. However, this would require some special handling of the asyncio.Handle's that are returned to cancel the callback - as a new handle would be required for each renewal. It would seem that a better and simpler approach could simply be to ensure that a recurring "dummy" task (or heartbeat) is scheduled to run every 1 day or less. As long as a another task is scheduled in the queue ahead of any tasks with "excessively long" delays, the longer delay will never be passed to poll() until it is reduced to within the smaller threshold. I can do this within my own code - but this could maybe also be further considered to happen automagically within asyncio. Am I missing any further considerations or gotchas here? (See also: http://stackoverflow.com/questions/27129037/why-is-there-a-limit-on-delayed-calls-like-asyncio-call-later-to-not-exceed-one) ---------- nosy: +ziesemer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 01:07:38 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 19 Apr 2017 05:07:38 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC In-Reply-To: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> Message-ID: <1492578458.42.0.476606094284.issue30046@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 01:18:07 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 Apr 2017 05:18:07 +0000 Subject: [issue29991] http client marks valid multipart headers with defects. In-Reply-To: <1491379482.82.0.913101246746.issue29991@psf.upfronthosting.co.za> Message-ID: <1492579087.82.0.868176358555.issue29991@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 01:20:30 2017 From: report at bugs.python.org (donkopotamus) Date: Wed, 19 Apr 2017 05:20:30 +0000 Subject: [issue30100] WeakSet should all discard and remove on items that can have weak references Message-ID: <1492579230.86.0.379456919312.issue30100@psf.upfronthosting.co.za> New submission from donkopotamus: Currently WeakSet().discard([]) will raise a TypeError as we cannot take a weak reference to a list. However, that means a list can never be in a WeakSet, so WeakSet().discard([]) could instead be a no-op. Similarly WeakSet().remove([]) could be a KeyError. ---------- messages: 291861 nosy: donkopotamus priority: normal pull_requests: 1304 severity: normal status: open title: WeakSet should all discard and remove on items that can have weak references _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 01:46:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 05:46:33 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC In-Reply-To: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> Message-ID: <1492580793.89.0.173918152377.issue30046@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This issue is not easy, it needs a thoughtful design before starting coding. I agree with Xiang's analysis and proposed solutions. But if just convert numbers to float we can get an overflow for large integers or lost precision in case of Decimal. The consumer of the CSV file may be not Python and it may support larger precision than Python float. And it is not clear what would be better solution for enums. Should they be serialized by name or by value? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 01:48:04 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 Apr 2017 05:48:04 +0000 Subject: [issue28837] 2to3 does not wrap zip correctly In-Reply-To: <1480503898.29.0.0471565347052.issue28837@psf.upfronthosting.co.za> Message-ID: <1492580884.61.0.876600150504.issue28837@psf.upfronthosting.co.za> Berker Peksag added the comment: I think this at least needs to be backported to 3.6 (or can we close the issue now?) ---------- nosy: +berker.peksag stage: -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 01:54:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 05:54:29 +0000 Subject: [issue30100] WeakSet should all discard and remove on items that can have weak references In-Reply-To: <1492579230.86.0.379456919312.issue30100@psf.upfronthosting.co.za> Message-ID: <1492581269.69.0.666256134514.issue30100@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +fdrake, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 01:56:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 05:56:01 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1492581361.98.0.074510027698.issue30095@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 02:38:04 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 19 Apr 2017 06:38:04 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC In-Reply-To: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> Message-ID: <1492583884.77.0.95314542184.issue30046@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1305 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 03:08:42 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 19 Apr 2017 07:08:42 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC In-Reply-To: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> Message-ID: <1492585722.85.0.111726497554.issue30046@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: -1303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 03:08:52 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 19 Apr 2017 07:08:52 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC In-Reply-To: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> Message-ID: <1492585732.65.0.936953334745.issue30046@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: -1305 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 03:09:27 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 19 Apr 2017 07:09:27 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC In-Reply-To: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> Message-ID: <1492585767.0.0.202839967111.issue30046@psf.upfronthosting.co.za> Dong-hee Na added the comment: I would like to solve this issue. Is there any other way than casting specifically for the bool object? (e.g For general ways?) ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 03:11:22 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 19 Apr 2017 07:11:22 +0000 Subject: [issue30046] csv: Inconsistency re QUOTE_NONNUMERIC In-Reply-To: <1491943315.79.0.569209717832.issue30046@psf.upfronthosting.co.za> Message-ID: <1492585882.03.0.669265750872.issue30046@psf.upfronthosting.co.za> Dong-hee Na added the comment: Oh, I read the Serhiy Storchaka 's comment just right now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 04:02:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 08:02:19 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492588939.58.0.424506507072.issue14102@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: How to use this feature? argparse is executed every time when the end user runs the program. But generating a man page is the action that should be executed at develop or build stage. The end user gets a generated man page, he doesn't need the option to generate a man page on a fly. The developer needs the ability to generate a man page rather than running the program for its main purpose. What should be the structure of the program that uses argparse for parsing arguments and for generating a man page? How generating a man page should be invoked? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 04:30:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 08:30:53 +0000 Subject: [issue30100] WeakSet should all discard and remove on items that can have weak references In-Reply-To: <1492579230.86.0.379456919312.issue30100@psf.upfronthosting.co.za> Message-ID: <1492590653.65.0.763316100783.issue30100@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What about difference_update(), issubset(), issuperset(), __eq__()? Raising TypeError looks reasonable to me. Operations with ordinal sets can raise TypeError for unhashable values. >>> [] in set() Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' >>> set().remove([]) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' >>> set().discard([]) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' Unlike to set.__contains__ WeakSet.__contains__ returns False for unsupported types: >>> [] in weakref.WeakSet() False Shouldn't set.__contains__ be changed to return False for unhashable values? Or may be make WeakSet.__contains__ raising TypeError for values that can't have weak references? ---------- components: +Library (Lib) nosy: +rhettinger, serhiy.storchaka, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 05:41:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 09:41:08 +0000 Subject: [issue30100] WeakSet should all discard and remove on items that can have weak references In-Reply-To: <1492579230.86.0.379456919312.issue30100@psf.upfronthosting.co.za> Message-ID: <1492594868.33.0.660593340663.issue30100@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: dict.pop() supports unhashable values, but dict.__contains__() and dict.get() don't: >>> [] in {} Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' >>> {}.get([], 42) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' >>> {}.pop([], 42) 42 OrderedDict.pop() also doesn't support unhashable values: >>> collections.OrderedDict().pop([], 42) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 05:49:20 2017 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Wed, 19 Apr 2017 09:49:20 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1492595360.97.0.285843562754.issue30095@psf.upfronthosting.co.za> Walter D?rwald added the comment: IMHO this could all be done by overwriting the relevant methods. But this might be overkill. I think a solution might be to move the CSS classes into class attributes of HTMLCalendar. Customizing the CSS classes would then be done by subclassing HTMLCalendar and overwriting the appropriate class attributes. Is this what you had in mind? ---------- nosy: +doerwalter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 06:13:26 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 19 Apr 2017 10:13:26 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492596806.79.0.23712655097.issue14102@psf.upfronthosting.co.za> Louie Lu added the comment: > How to use this feature? > argparse is executed every time when the end user runs the program. > But generating a man page is the action that should be executed at > develop or build stage. > ... > How generating a man page should be invoked? For now, man page will only be generated by using `print_manpage` function, and argparse won't add a shortcut like help page (-h). Developer can use `parser.add_manpage_section` to add custom manpage section, e.g. copyright, report bugs. The only thing that will affect it that `add_manpage_section` will be adding at runtime, but user won't used it. > The end user gets a generated man page, he doesn't need the option to generate a man page on a fly. The developer needs the ability to generate a man page rather than running the program for its main purpose. Yes, this patch will only offer the ability to generate man page, but if developer want to build with `setup.py`, it still need to combine them. > What should be the structure of the program that uses argparse for parsing arguments and for generating a man page? It won't need additional change, just used current method and it will work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 06:44:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 10:44:00 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492598640.86.0.529097155589.issue14102@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: But how to use print_manpage()? Can you provide a new template of a program that uses argparse? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 06:47:13 2017 From: report at bugs.python.org (Oz Tiram) Date: Wed, 19 Apr 2017 10:47:13 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1492598833.34.0.668885750766.issue30095@psf.upfronthosting.co.za> Oz Tiram added the comment: @doerwalter, exactly. I found myself overwriting the relevant methods too many times. I usually did something like this: class WorkCalendar(HTMLCalendar): def formatmonthname(self, theyear, themonth, withyear=True, style=r'class="month-head"'): """ Return a month name as a table row. """ monthname = super().formatmonthname(theyear, themonth, withyear) regex = r'class\="month"' return re.sub(regex, style, monthname, 1) Using class attributes would nice, also considering that the days CSS classes are defined as class attributes. My intention was a few more class attributes (for the month header, and month) and also change the existing code such that each day can have multiple CSS classes and not just one. I am willing to work on a PR for that if that sounds good and there is someone who would be willing to merge it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 06:48:11 2017 From: report at bugs.python.org (Oz Tiram) Date: Wed, 19 Apr 2017 10:48:11 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1492598891.73.0.8400646914.issue30095@psf.upfronthosting.co.za> Oz Tiram added the comment: ... Using class attributes would nice, also considering that the days CSS classes are defined as class attributes. I meant to write : Using class attributes would be nicer, also considering that the days CSS classes are defined as class attributes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 06:50:49 2017 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Wed, 19 Apr 2017 10:50:49 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1492599049.12.0.436048455746.issue30095@psf.upfronthosting.co.za> Walter D?rwald added the comment: OK, go ahead. I'm looking forward to what you come up with. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 07:01:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 11:01:06 +0000 Subject: [issue29925] test_uuid fails on OS X Tiger In-Reply-To: <1490648746.25.0.479483160976.issue29925@psf.upfronthosting.co.za> Message-ID: <1492599666.23.0.482898662463.issue29925@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c209b70d610da50a844a3c10f37d6183bade3446 by Victor Stinner in branch 'master': bpo-29925: Skip test_uuid1_safe() on OS X Tiger (#971) https://github.com/python/cpython/commit/c209b70d610da50a844a3c10f37d6183bade3446 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 07:02:33 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 19 Apr 2017 11:02:33 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492599753.51.0.315449203557.issue14102@psf.upfronthosting.co.za> Louie Lu added the comment: Attachment is the poc of generating man page via `print_manpage`: $ ./python poc_2.py > output && man ./output ---------- Added file: http://bugs.python.org/file46812/poc_2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 07:04:03 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 19 Apr 2017 11:04:03 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492599843.41.0.35909946226.issue14102@psf.upfronthosting.co.za> Louie Lu added the comment: Also, `print_manpage` use the same infra as `print_help` and `print_usage`, so it can use the parameter `file` to output to different stream or file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 07:07:42 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 19 Apr 2017 11:07:42 +0000 Subject: [issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example In-Reply-To: <1479230636.43.0.863548306007.issue28698@psf.upfronthosting.co.za> Message-ID: <1492600062.34.0.536577868914.issue28698@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 07:17:31 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 19 Apr 2017 11:17:31 +0000 Subject: [issue30100] WeakSet should all discard and remove on items that can have weak references In-Reply-To: <1492579230.86.0.379456919312.issue30100@psf.upfronthosting.co.za> Message-ID: <1492600651.35.0.0435804392451.issue30100@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > Raising TypeError looks reasonable to me. > Operations with ordinal sets can raise TypeError > for unhashable values. I agree. TypeError looks the right exception in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 07:21:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 11:21:13 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492600873.56.0.666819863658.issue14102@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Your example just prints a man page. It doesn't do anything useful besides this. I'm asking how argparse can do two incompatible things: provide a command-line interface for an end user and generate a man page in a build script. Do you mean that the programmer should create a separate script for generating a man page and copy a part of the code from the main program? This workflow should be documented, with examples. And it is not applicable for simple one-file scripts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 07:48:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 11:48:27 +0000 Subject: [issue30100] WeakSet should all discard and remove on items that can have weak references In-Reply-To: <1492579230.86.0.379456919312.issue30100@psf.upfronthosting.co.za> Message-ID: <1492602507.74.0.326267243134.issue30100@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The argument for not raising TypeError for unsupported types: This is just from the definition of a set. If the set can't contain the value of specific type, then checking if this value is contained in the set should return False, and discarding it from the set should be no-op. The argument for raising TypeError for unsupported types: Using a value of unsuitable type is likely a programming error. Silencing TypeError can hide an error. Since raising and catching an exception is costly (but it is cheaper in C than in Python), this also can lead to performance degradation which is hard to catch. If the first argument is stronger then the second argument then we should change a number of set, dict, dict views and OrderedDict methods and make them returning a reasonable result rather than raising TypeError. If the second argument is stronger then the first argument then we should change just WeakSet.__contains__() and dict.pop(). Since this is a behavior change that can break third-party code they should first emit deprecation warnings for one or two releases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 07:59:40 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 19 Apr 2017 11:59:40 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1492603180.29.0.583349043585.issue30071@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > So I expect that the case you 'care most about' already works. Yes, it works. That's the most ironic part of this issue: getfullargspec(func) works but packages like Sphinx will not call getfullargspec(func) because they do not detect that "func" is actually a function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 08:29:12 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 19 Apr 2017 12:29:12 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492604952.22.0.423958783405.issue14102@psf.upfronthosting.co.za> Louie Lu added the comment: Sorry that I didn't figure out what you said in the previous msg. > provide a command-line interface for an end user I add a parameter that developer can switch command line option for man page, if the option is on, user can do this: ./python foo.py --manpage and open the manpage, but I think this isn't a good approach, since normal user will simply use `man foo.py`. > generate a man page in a build script. > Do you mean that the programmer should create a separate script for generating a man page and copy a part of the code from the main program? This workflow should be documented, with examples. And it is not applicable for simple one-file scripts. I not sure if argparse need to provide a setuptools command, if need, the approach that Oz provide can be used, and developer only need to do like this in setup.py from argparser import build_manpage cmdclass={'build_manpage': build_manpage} then at the command line, developer can build manpage as `./python setup.py build_manpage --output=foo.1 --parser=foo.parser` If provide this is function too far for argparse, then as you said, a well-documented workflow should be provided. ---- Even if argparse provide this function, end-user still can't easily do the trick `man foo.py` or `man foo` if script point is provide in setup.py. If need to approach things like `man foo`, it may need to integrate with setuptools to put the man page file to the correct path (e.g. /usr/share/man/man1) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 08:35:40 2017 From: report at bugs.python.org (=?utf-8?q?Zbyszek_J=C4=99drzejewski-Szmek?=) Date: Wed, 19 Apr 2017 12:35:40 +0000 Subject: [issue14102] argparse: add ability to create a man page In-Reply-To: <1330031760.56.0.8938390885.issue14102@psf.upfronthosting.co.za> Message-ID: <1492605340.78.0.302725453867.issue14102@psf.upfronthosting.co.za> Zbyszek J?drzejewski-Szmek added the comment: If you can import the module that defines the parser, and get at the generated parser, this should be trivial to integrate with the build system. Something like: PYTHONPATH=. python3 -c 'import mymodule; p=mymodule.make_parser(); p.print_manpage(file="mymodule.1")' This operation could either be done automatically during build always, or it could just be done by the developers and the man page put under version control. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 09:22:09 2017 From: report at bugs.python.org (Julia Dolgova) Date: Wed, 19 Apr 2017 13:22:09 +0000 Subject: [issue29533] urllib2 works slowly with proxy on windows In-Reply-To: <1486802607.23.0.387912582288.issue29533@psf.upfronthosting.co.za> Message-ID: <1492608129.94.0.0873321333056.issue29533@psf.upfronthosting.co.za> Julia Dolgova added the comment: I compared the behaviour of urllib with these browsers: Firefox("use system proxy" selected), Google Chrome, Yandex. And also Skype (requests to login.live.com). All of them are not doing DNS requests for proxy bypass handling as Marc expects. The result is attached: compare_urllib_progs.png ---------- Added file: http://bugs.python.org/file46813/compare_urllib_progs.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 09:28:37 2017 From: report at bugs.python.org (crenwick) Date: Wed, 19 Apr 2017 13:28:37 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492608517.75.0.926860898492.issue30098@psf.upfronthosting.co.za> crenwick added the comment: > Feel free to suggest a better wording. > I think the only change that needs to be made is to make the existing message say 'asyncio.Future' instead of just 'Future'. I hear ya. New commit in the PR reverts the TypeError I added, and changes the original TypeError language to simply read "An asyncio.Future ..." instead of just "A Future ...". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 10:16:41 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 19 Apr 2017 14:16:41 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492611401.06.0.912396534396.issue30078@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1306 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 10:17:19 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 19 Apr 2017 14:17:19 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492611439.39.0.747537755901.issue30078@psf.upfronthosting.co.za> Louie Lu added the comment: Add a simple line to `MAIN_EXAMPLES`: "%(prog)s path/to/test_file.py - run tests from test_file.py" ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 11:09:51 2017 From: report at bugs.python.org (Kaeptm Blaubaer) Date: Wed, 19 Apr 2017 15:09:51 +0000 Subject: [issue27727] Update Tools/freeze to use .vcxproj files In-Reply-To: <1470839867.79.0.0217135468923.issue27727@psf.upfronthosting.co.za> Message-ID: <1492614591.54.0.827137749067.issue27727@psf.upfronthosting.co.za> Changes by Kaeptm Blaubaer : ---------- resolution: duplicate -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 11:46:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 15:46:55 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492616815.76.0.670994273198.issue30061@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 12:32:35 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 19 Apr 2017 16:32:35 +0000 Subject: [issue21150] Add quick links table to argparse docs In-Reply-To: <1396558035.28.0.485991636726.issue21150@psf.upfronthosting.co.za> Message-ID: <1492619555.82.0.411239617779.issue21150@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 12:43:44 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 19 Apr 2017 16:43:44 +0000 Subject: [issue21150] Add quick links table to argparse docs In-Reply-To: <1396558035.28.0.485991636726.issue21150@psf.upfronthosting.co.za> Message-ID: <1492620224.31.0.447346026689.issue21150@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Gaurav, overall this looks nice. I would drop the example column because it will make the row too wide for viewing. Alternatively, put the examples in a separate table (as was done for the combinatoric functions in the itertools docs: https://docs.python.org/3/library/itertools.html#module-itertools ). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 12:44:07 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 19 Apr 2017 16:44:07 +0000 Subject: [issue21150] Add quick links table to argparse docs In-Reply-To: <1396558035.28.0.485991636726.issue21150@psf.upfronthosting.co.za> Message-ID: <1492620247.9.0.981934383417.issue21150@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- nosy: +bethard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 13:03:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 17:03:54 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492621434.7.0.827531486778.issue30061@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset bf623ae8843dc30b28c574bec8d29fc14be59d86 by Serhiy Storchaka in branch 'master': bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096) https://github.com/python/cpython/commit/bf623ae8843dc30b28c574bec8d29fc14be59d86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 13:18:46 2017 From: report at bugs.python.org (Eijebong) Date: Wed, 19 Apr 2017 17:18:46 +0000 Subject: [issue30101] Add support for ncurses A_ITALIC Message-ID: <1492622326.37.0.880167470539.issue30101@psf.upfronthosting.co.za> Changes by Eijebong : ---------- components: Library (Lib) nosy: Eijebong priority: normal pull_requests: 1307 severity: normal status: open title: Add support for ncurses A_ITALIC versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 13:34:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 17:34:01 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492623241.95.0.240719576331.issue30061@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1308 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 13:36:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 17:36:34 +0000 Subject: [issue22352] Ensure opcode names and args fit in disassembly output In-Reply-To: <1410065891.58.0.12430207232.issue22352@psf.upfronthosting.co.za> Message-ID: <1492623394.1.0.227519257624.issue22352@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d90045f319e2ea9772b9fbd62a05fdf34af96b6c by Serhiy Storchaka in branch 'master': bpo-22352: Adjust widths in the output of dis.dis() for large line numbers and (#1153) https://github.com/python/cpython/commit/d90045f319e2ea9772b9fbd62a05fdf34af96b6c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 13:43:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 17:43:19 +0000 Subject: [issue22352] Ensure opcode names and args fit in disassembly output In-Reply-To: <1410065891.58.0.12430207232.issue22352@psf.upfronthosting.co.za> Message-ID: <1492623799.21.0.367753945978.issue22352@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:09:23 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 18:09:23 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492625363.72.0.190545831115.issue30070@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a79f4c219531c05fc8f670c1e4bbf12c081935d3 by Serhiy Storchaka in branch 'master': bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (#1131) https://github.com/python/cpython/commit/a79f4c219531c05fc8f670c1e4bbf12c081935d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:12:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 18:12:48 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492625568.23.0.92322487681.issue30065@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 66bffd1663489d080349debbf1b472d432351038 by Serhiy Storchaka in branch 'master': bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (#1110) https://github.com/python/cpython/commit/66bffd1663489d080349debbf1b472d432351038 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:16:08 2017 From: report at bugs.python.org (Gustavo Serra Scalet) Date: Wed, 19 Apr 2017 18:16:08 +0000 Subject: [issue30102] improve performance of libSSL usage on hashing Message-ID: <1492625768.04.0.0441991699383.issue30102@psf.upfronthosting.co.za> New submission from Gustavo Serra Scalet: To correctly pick the best algorithm for the current architecture, libssl needs to have OPENSSL_config(NULL) called as described on: https://wiki.openssl.org/index.php/Libcrypto_API This short change lead to a speedup of 50% on POWER8 when using hashlib.sha256 digest functionality as it now uses a SIMD approach that was already existing but not used by cpython. ---------- assignee: christian.heimes components: SSL messages: 291892 nosy: christian.heimes, gut priority: normal severity: normal status: open title: improve performance of libSSL usage on hashing type: enhancement versions: Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:17:35 2017 From: report at bugs.python.org (Gustavo Serra Scalet) Date: Wed, 19 Apr 2017 18:17:35 +0000 Subject: [issue30102] improve performance of libSSL usage on hashing In-Reply-To: <1492625768.04.0.0441991699383.issue30102@psf.upfronthosting.co.za> Message-ID: <1492625855.95.0.776436296549.issue30102@psf.upfronthosting.co.za> Changes by Gustavo Serra Scalet : ---------- pull_requests: +1309 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:21:58 2017 From: report at bugs.python.org (Brett Cannon) Date: Wed, 19 Apr 2017 18:21:58 +0000 Subject: [issue27869] test failures under Bash on Windows / WSL In-Reply-To: <1472236837.41.0.811658562373.issue27869@psf.upfronthosting.co.za> Message-ID: <1492626118.23.0.759708899298.issue27869@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- title: test failures under Bash on Windows -> test failures under Bash on Windows / WSL _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:22:20 2017 From: report at bugs.python.org (Kyle Glowacki) Date: Wed, 19 Apr 2017 18:22:20 +0000 Subject: [issue30103] uu package uses old encoding Message-ID: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> New submission from Kyle Glowacki: Looking in the man pages for the uuencode and uudecode (http://www.manpagez.com/man/5/uuencode/), I see that the encoding used to go from ascii 32 to 95 but that 32 is deprecated and generally newer releases go from 33-96 (with 96 being used in place of 32). This replaces the " " in the encoding with "`". For example, the newest version of busybox only accepts the new encoding. The uu package has no way to specify to use this new encoding making it a pain to integrate. Oddly, the uu.decode function does properly decode files encoded using "`", but encode is unable to create them. ---------- components: Extension Modules messages: 291893 nosy: LawfulEvil priority: normal severity: normal status: open title: uu package uses old encoding type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:22:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 18:22:51 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492626171.69.0.55532252212.issue30061@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 680fea4067537a9b9c79aadd44a3a19e83cd2dbf by Serhiy Storchaka in branch '3.6': bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096) (#1180) https://github.com/python/cpython/commit/680fea4067537a9b9c79aadd44a3a19e83cd2dbf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:30:04 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 19 Apr 2017 18:30:04 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1492626604.77.0.948577843441.issue30103@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- type: behavior -> enhancement versions: +Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:30:17 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 19 Apr 2017 18:30:17 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1492626617.68.0.112662324457.issue30103@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- components: +Library (Lib) -Extension Modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:34:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 18:34:45 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492626885.49.0.790202087825.issue30061@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1311 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 14:48:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 18:48:32 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492627712.57.0.696945982381.issue30061@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1312 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 15:08:41 2017 From: report at bugs.python.org (Christian Heimes) Date: Wed, 19 Apr 2017 19:08:41 +0000 Subject: [issue30102] improve performance of libSSL usage on hashing In-Reply-To: <1492625768.04.0.0441991699383.issue30102@psf.upfronthosting.co.za> Message-ID: <1492628921.71.0.209840976128.issue30102@psf.upfronthosting.co.za> Christian Heimes added the comment: This small change also changes behavior of OpenSSL dramatically. What are your Python and OpenSSL versions? How did you profile the performance of the hashing functions? If OpenSSL_config() really improves performance on relevant platforms, then we should be consistent and call it in _ssl.c, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 15:09:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 19:09:58 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492628998.25.0.182577595746.issue30061@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e63af29c87b44bb7ada5783cd0ff6ee6d4f9c17c by Serhiy Storchaka in branch '3.5': [3.5] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (GH-1096) (GH-1180) (#1182) https://github.com/python/cpython/commit/e63af29c87b44bb7ada5783cd0ff6ee6d4f9c17c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 15:22:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 19:22:24 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492629744.1.0.0126282198623.issue30070@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1313 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 15:27:41 2017 From: report at bugs.python.org (Gustavo Serra Scalet) Date: Wed, 19 Apr 2017 19:27:41 +0000 Subject: [issue30102] improve performance of libSSL usage on hashing In-Reply-To: <1492628921.71.0.209840976128.issue30102@psf.upfronthosting.co.za> Message-ID: Gustavo Serra Scalet added the comment: > Christian Heimes added the comment: > > This small change also changes behavior of OpenSSL dramatically. What > are your Python and OpenSSL versions? I tested by compiling my own python3 (8aaf499) against its parent (d6d344d) For python2, I made the same by compiling the 2.7.13 as a baseline and results were consistent with the python I have on Ubuntu 17.10 (3.5.3 and 2.7.13). > How did you profile the > performance of the hashing functions? I compared the timings between my patched vs patchless python versions by using a 630MB file to calculate sha256 as: perf stat -r 10 Python-2.7.13/python -c "import hashlib; print(hashlib.sha256(open('ubuntu-16.10-server-ppc64el.iso','rb').read()).hexdigest())" The speedup of ~50% is given due to patchless taking 3.082156387s and patched taking 2.027484800s (errors are less than 1%) I also noticed what changed on a code level by checking with gdb what is being executed on the sha loop. After my patch I see altivec (SIMD) functions being used on SHA main loop. > If OpenSSL_config() really improves performance on relevant platforms, > then we should be consistent and call it in _ssl.c, too. I'll check that then. Thanks for the hint. Ps: please note this behavior is noticed on a POWER8 machine. I'm not an OpenSSL expert so I don't know if there are now more optimizations enabled on other architectures as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 15:35:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 19:35:01 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492630501.05.0.427371972792.issue30061@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 64aa4df8502ca5d0a8ffb767ff97f625625c758c by Serhiy Storchaka in branch '2.7': [2.7] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (GH-1096) (GH-1180) (#1183) https://github.com/python/cpython/commit/64aa4df8502ca5d0a8ffb767ff97f625625c758c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 15:36:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 19:36:45 +0000 Subject: [issue30061] Check if PyObject_Size() raised an error In-Reply-To: <1492030732.95.0.492946948296.issue30061@psf.upfronthosting.co.za> Message-ID: <1492630605.38.0.811334270141.issue30061@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:21:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 20:21:52 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492633312.51.0.497390681176.issue30070@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1314 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:22:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 20:22:21 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492633341.79.0.883961112818.issue30070@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 39dedb6e1a18069ce8f5c8e6076e9d9ef9d6d515 by Serhiy Storchaka in branch '3.6': [3.6] bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (GH-1131). (#1184) https://github.com/python/cpython/commit/39dedb6e1a18069ce8f5c8e6076e9d9ef9d6d515 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:23:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 20:23:51 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492633431.98.0.16937734552.issue30065@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1315 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:27:26 2017 From: report at bugs.python.org (Eryk Sun) Date: Wed, 19 Apr 2017 20:27:26 +0000 Subject: [issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista In-Reply-To: <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za> Message-ID: <1492633646.14.0.599940141712.issue19764@psf.upfronthosting.co.za> Eryk Sun added the comment: In case you didn't get notified by Rietveld, I made a couple suggestions on your latest patch. Also, if you wouldn't mind, please update the patch to apply cleanly to 3.7 -- especially since STARTUPINFO now has an __init__ method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:31:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 20:31:41 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492633901.54.0.686668873382.issue30030@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1316 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:39:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 20:39:22 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot Message-ID: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> New submission from STINNER Victor: Since the build 154, many tests fail on the AMD64 FreeBSD CURRENT Debug 3.x buildbot slave because of float rounding errors. Failing tests: * test_cmath * test_float * test_json * test_marshal * test_math * test_statistics * test_strtod http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/154/steps/test/logs/stdio Problem: none of build 154 changes are related to floats * commit f9f87f0934ca570293ba7194bed3448a7f9bf39c * commit 947629916a5ecb1f6f6792e9b9234e084c5bf274 It looks more like a libc change of the FreeBSD CURRENT slave. Example of errors: ====================================================================== FAIL: test_specific_values (test.test_cmath.CMathTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_cmath.py", line 420, in test_specific_values msg=error_message) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_cmath.py", line 149, in rAssertAlmostEqual '{!r} and {!r} are not sufficiently close'.format(a, b)) AssertionError: acos0036: acos(complex(-1.0009999999999992, 0.0)) Expected: complex(3.141592653589793, -0.04471763360830684) Received: complex(3.141592653589793, -0.04471763360829195) Received value insufficiently close to expected value. ====================================================================== FAIL: test_floats (test.test_json.test_float.TestPyFloat) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_json/test_float.py", line 8, in test_floats self.assertEqual(float(self.dumps(num)), num) AssertionError: 1.9275814160560202e-50 != 1.9275814160560204e-50 FAIL: test_bigcomp (test.test_strtod.StrtodTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_strtod.py", line 213, in test_bigcomp self.check_strtod(s) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_strtod.py", line 104, in check_strtod "expected {}, got {}".format(s, expected, got)) AssertionError: '0x1.8265ea9f864bcp+579' != '0x1.8265ea9f864bdp+579' - 0x1.8265ea9f864bcp+579 ? ^ + 0x1.8265ea9f864bdp+579 ? ^ : Incorrectly rounded str->float conversion for 29865e170: expected 0x1.8265ea9f864bcp+579, got 0x1.8265ea9f864bdp+579 ---------- messages: 291901 nosy: haypo, koobs priority: normal severity: normal status: open title: Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:39:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 20:39:39 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492634379.31.0.657665590961.issue30104@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- components: +Interpreter Core, Tests nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:41:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 20:41:18 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492634478.5.0.776824449275.issue30030@psf.upfronthosting.co.za> STINNER Victor added the comment: Until a solution is found, I proposed to revert the change to "repair" buildbots. See also the python-ideas thread: [Python-ideas] Thread-safe generators https://mail.python.org/pipermail/python-ideas/2017-April/045427.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:44:46 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 20:44:46 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492634686.02.0.292244230867.issue30070@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 952a05e4e2cf082b74a1676a2804f1f43a9b7702 by Serhiy Storchaka in branch '3.5': [3.5] bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (GH-1131). (#1185) https://github.com/python/cpython/commit/952a05e4e2cf082b74a1676a2804f1f43a9b7702 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:59:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 20:59:04 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492635544.31.0.471093187351.issue30065@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e2546172622dd52692cf0e26c2b931f942f345b6 by Serhiy Storchaka in branch '3.6': [3.6] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (GH-1110) (#1186) https://github.com/python/cpython/commit/e2546172622dd52692cf0e26c2b931f942f345b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 16:59:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 20:59:54 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492635594.12.0.422620066629.issue30030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 1e62bf145b4865d03a29a5720a4eb84c321a9829 by Victor Stinner in branch 'master': bpo-30030: Revert f50354ad (tempfile) (#1187) https://github.com/python/cpython/commit/1e62bf145b4865d03a29a5720a4eb84c321a9829 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:02:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 21:02:35 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492635755.74.0.804037793482.issue30030@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Victor. I was going to do this but was unable to do this because I was out of my developing environment. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:19:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 21:19:36 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492636776.0.0.485895151031.issue30070@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1317 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:21:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 21:21:24 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492636884.96.0.584699929624.issue30065@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1318 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:40:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 21:40:01 +0000 Subject: [issue28533] Replace asyncore In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za> Message-ID: <1492638001.52.0.74664383774.issue28533@psf.upfronthosting.co.za> STINNER Victor added the comment: > asyncore is still used in several tests and should be replaced. Here is the list of Python files using asyncore: haypo at selma$ grep -l asyncore $(find -name "*.py") ./Lib/asyncore.py ./Lib/asynchat.py ./Lib/test/test_smtpd.py ./Lib/test/test_asyncore.py ./Lib/test/test_smtplib.py ./Lib/test/test_os.py ./Lib/test/test_ssl.py ./Lib/test/test_logging.py ./Lib/test/libregrtest/save_env.py ./Lib/test/test_asynchat.py ./Lib/test/test_pyclbr.py ./Lib/test/test_support.py ./Lib/test/test_poplib.py ./Lib/test/test_ftplib.py ./Lib/smtpd.py smtpd has been rewritten with asyncio: http://aiosmtpd.readthedocs.io/ The documentation of the smtpd module already points to aiosmtpd. libregrtest/save_env.py only checks that asyncore.socket_map is not modified, we can keep it until asyncore is really removed. test_support.py only tests that it's possible to have a "clean" import of asyncore, it can be easily be replaced later. The list can reduced to: ./Lib/test/test_smtplib.py ./Lib/test/test_os.py ./Lib/test/test_ssl.py ./Lib/test/test_logging.py ./Lib/test/test_pyclbr.py ./Lib/test/test_poplib.py ./Lib/test/test_ftplib.py ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:41:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 21:41:40 +0000 Subject: [issue28533] Replace asyncore In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za> Message-ID: <1492638100.29.0.312013930937.issue28533@psf.upfronthosting.co.za> STINNER Victor added the comment: asyncore was modified to emit a DeprecationWarning: http://bugs.python.org/issue25002#msg279417 But then a lot of code starts with to fail -Werror. Copy of Martin Panter's msg279469: I normally run the tests with -Werror, and the failures I get are: * test_ssl, test_smtplib, test_poplib, test_logging, test_ftplib, test_support: tests use asyncore * test_os: test uses asynchat (When you import asynchat, the first error complains about importing asyncore, there are actually two warnings) * test_all: This seems to ignore DeprecationWarning; perhaps an exception for PendingDeprecationWarning should also be added? * test_asyncore and test_asynchat: Obviously these have to still test the modules, so they should anticipate the warnings, perhaps using Serhiy?s code * test_smtpd: smtpd module itself uses asyncore; see Issue 25008 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:42:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 21:42:34 +0000 Subject: [issue25002] Deprecate asyncore/asynchat In-Reply-To: <1441399683.85.0.786847810998.issue25002@psf.upfronthosting.co.za> Message-ID: <1492638154.53.0.655007531089.issue25002@psf.upfronthosting.co.za> STINNER Victor added the comment: I suggest to close this issue and instead work on the the issue #28533: modify code using asyncore to use something else. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:48:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 21:48:59 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492638539.87.0.394977383832.issue30070@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 2a1bf0633cd0c55662df7875ee2b1654251adf6b by Serhiy Storchaka in branch '2.7': [2.7] [3.5] bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (GH-1131). (GH-1185) (#1189) https://github.com/python/cpython/commit/2a1bf0633cd0c55662df7875ee2b1654251adf6b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:50:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 21:50:22 +0000 Subject: [issue30070] Fix errors handling in the parser module In-Reply-To: <1492168031.64.0.372265650167.issue30070@psf.upfronthosting.co.za> Message-ID: <1492638622.33.0.187115675075.issue30070@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:51:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 21:51:07 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492638667.54.0.438603669282.issue30065@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset c97c1914f401359f2a7e6c8e0364e71ad9fb5bc8 by Serhiy Storchaka in branch '3.5': [3.5] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (GH-1110) (#1190) https://github.com/python/cpython/commit/c97c1914f401359f2a7e6c8e0364e71ad9fb5bc8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:52:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 21:52:48 +0000 Subject: [issue30065] Insufficient validation in _posixsubprocess.fork_exec() In-Reply-To: <1492078441.09.0.999748140134.issue30065@psf.upfronthosting.co.za> Message-ID: <1492638768.83.0.931398670963.issue30065@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:55:22 2017 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 19 Apr 2017 21:55:22 +0000 Subject: [issue25002] Deprecate asyncore/asynchat In-Reply-To: <1441399683.85.0.786847810998.issue25002@psf.upfronthosting.co.za> Message-ID: <1492638922.05.0.440445958933.issue25002@psf.upfronthosting.co.za> Guido van Rossum added the comment: Sounds good. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 17:58:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 21:58:35 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492639115.19.0.862925944214.issue30078@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +ezio.melotti, michael.foord, rbcollins stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:00:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 22:00:02 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492639202.07.0.561780422508.issue30030@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1319 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:02:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 22:02:09 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492639329.2.0.753831605564.issue30030@psf.upfronthosting.co.za> STINNER Victor added the comment: I reopen the issue to propose a different approach: https://github.com/python/cpython/pull/1191 replaces Random with SystemRandom and drops get_candidate_names(). @Serhiy: I hesitated to add you as a co-author, but I'm not sure that you like my approach :-) Tell me what do you think. At least, I reused your docstring and your updated unit test! ---------- resolution: rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:07:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 22:07:28 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492639648.69.0.843095179335.issue30030@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This isn't a different approach and this doesn't work because generators are not thread-safe. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:08:24 2017 From: report at bugs.python.org (Segev Finer) Date: Wed, 19 Apr 2017 22:08:24 +0000 Subject: [issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista In-Reply-To: <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za> Message-ID: <1492639704.37.0.285253588358.issue19764@psf.upfronthosting.co.za> Segev Finer added the comment: Added the 4th version after review by eryksun (In rietveld). ---------- Added file: http://bugs.python.org/file46814/windows-subprocess-close-fds-v4.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:11:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 22:11:20 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492639880.48.0.675304833844.issue30030@psf.upfronthosting.co.za> STINNER Victor added the comment: > Remoe _get_candidate_names() and the global _name_sequence I understood the rationale behind _get_candidate_names() is to prevent generating the same name when _RandomNameSequence() uses random.Random. Since my change uses random.SystemRandom, I consider that it's now ok to create multiple generators in paralle. Is that rationale correct? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:15:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 19 Apr 2017 22:15:53 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492640153.58.0.22922001143.issue30030@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: test_threadedtempfile passed on Linux, but randomly failed on Windows. :( And _RandomNameSequence is used not only in tempfile. I suggest to wait until add a wrapper that makes generators thread-safe. Since it added we could restore the generator implementation of _RandomNameSequence. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:18:59 2017 From: report at bugs.python.org (donkopotamus) Date: Wed, 19 Apr 2017 22:18:59 +0000 Subject: [issue30100] WeakSet should all discard and remove on items that can have weak references In-Reply-To: <1492579230.86.0.379456919312.issue30100@psf.upfronthosting.co.za> Message-ID: <1492640339.38.0.196613895691.issue30100@psf.upfronthosting.co.za> donkopotamus added the comment: Just to add, I framed this slightly wrongly by using a list [] as an example, whereas my original motivating case was objects that are hashable but not weakly referenceable. (eg () ). So there are two cases to consider ... what to do in discard/remove etc when the value is (i) not weakly referenceable, and (ii) when the value is not hashable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:36:46 2017 From: report at bugs.python.org (kyuupichan) Date: Wed, 19 Apr 2017 22:36:46 +0000 Subject: [issue30105] Duplicated connection_made() call for some SSL connections Message-ID: <1492641406.9.0.0965010091679.issue30105@psf.upfronthosting.co.za> New submission from kyuupichan: An asyncio SSL server frequently sees duplicated connection_made() calls for an incoming SSL connection. It does not happen to all SSL connections; perhaps 10-25% of them. It never happens to TCP connections. Here are some examples of logs from one I run. I see this on MacOSX and DragonflyBSD, others have reported the same on Linux, so I believe it's a quirk in asyncio and not O/S specific. I assume it is a bug in the wrapping of the raw TCP transport with an SSL one. 2017-04-20 07:22:44.676180500 INFO:ElectrumX:[14755] SSL 218.185.137.81:52844, 256 total 2017-04-20 07:22:45.666747500 INFO:ElectrumX:[14756] SSL 218.185.137.81:52847, 256 total The log is output on a connection_made() callback to a protocol, and not from the protocol's constructor. They are very close together, from the same IP address and ports that are close together. The first connection was closed with connection_lost() before the 2nd connection_made() because the total session count (here 256) did not increase. Here is another section of my log with 2 more examples. Totals are not monotonic because of course disconnections (not logged) happen all the time. 2017-04-20 07:30:31.529671500 INFO:ElectrumX:[14796] SSL 193.90.12.86:42262, 259 total 2017-04-20 07:31:04.434559500 INFO:ElectrumX:[14797] SSL 70.199.157.209:10851, 259 total 2017-04-20 07:31:05.765178500 INFO:ElectrumX:[14798] SSL 70.199.157.209:10877, 259 total 2017-04-20 07:31:32.305260500 INFO:ElectrumX:[14799] SSL 64.113.32.29:35025, 256 total 2017-04-20 07:31:44.731859500 INFO:ElectrumX:[14800] SSL 188.107.123.236:60867, 255 total 2017-04-20 07:31:45.504245500 INFO:ElectrumX:[14801] SSL 188.107.123.236:60868, 255 total 2017-04-20 07:31:48.943430500 INFO:ElectrumX:[14802] SSL 136.24.49.122:54987, 255 total 2017-04-20 07:31:59.967676500 INFO:ElectrumX:[14803] TCP 113.161.81.136:2559, 256 total 2017-04-20 07:32:03.249780500 INFO:ElectrumX:[14804] SSL 69.121.8.201:63409, 256 total Another reason I believe this is an asyncio issue on the server side is that someone else's server software that doesn't use asyncio logs in a similar way and does not see duplicated incoming "connections". ---------- components: asyncio messages: 291919 nosy: kyuupichan, yselivanov priority: normal severity: normal status: open title: Duplicated connection_made() call for some SSL connections type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:54:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 22:54:22 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() Message-ID: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> New submission from STINNER Victor: On the AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot, test_handle_write() of test_asyncore now fails on calling asyncore.close_all() in tearDown(). Moreover, since my commit 7b9619ae249ed637924d1c76687b411061753e5a, the following test_quick_connect() now fails on self.fail("join() timed out"). I guess that asyncore.socket_map still contains unwanted sockets from test_handle_write() which failed. Attached PR should fix the test_handle_write() failure by calling asyncore.close_all() with ignore_all=True. http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/174/steps/test/logs/stdio ====================================================================== ERROR: test_handle_write (test.test_asyncore.TestAPI_UseIPv6Poll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_asyncore.py", line 505, in tearDown asyncore.close_all() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncore.py", line 561, in close_all x.close() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncore.py", line 397, in close self.socket.close() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/socket.py", line 417, in close self._real_close() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/socket.py", line 411, in _real_close _ss.close(self) ConnectionResetError: [Errno 54] Connection reset by peer ====================================================================== FAIL: test_quick_connect (test.test_asyncore.TestAPI_UseIPv6Poll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/support/__init__.py", line 2042, in decorator return func(*args) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_asyncore.py", line 800, in test_quick_connect self.fail("join() timed out") AssertionError: join() timed out ---------- components: Tests messages: 291920 nosy: haypo priority: normal severity: normal status: open title: test_asyncore: test_handle_write() fails in tearDown() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 18:56:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 22:56:02 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1492642562.44.0.7954163422.issue30106@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1320 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 19:22:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Apr 2017 23:22:57 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot Message-ID: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> New submission from STINNER Victor: Example of buildbot build which created a python.core file. Tests crashing Python on purpose should use test.support.SuppressCrashReport. I don't see which test can crash in the following list. http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/175/steps/test/logs/stdio 0:04:54 [132/404/6] test_raise passed -- running: test_subprocess (61 sec) 0:04:54 [133/404/6] test_dict passed -- running: test_subprocess (62 sec) 0:04:54 [134/404/6] test_telnetlib passed -- running: test_subprocess (62 sec) 0:04:55 [135/404/6] test_robotparser passed -- running: test_subprocess (63 sec) 0:04:56 [136/404/6] test_py_compile passed -- running: test_subprocess (64 sec) 0:04:56 [137/404/6] test_listcomps passed -- running: test_subprocess (64 sec) 0:04:56 [138/404/6] test_pty passed -- running: test_subprocess (64 sec) 0:04:56 [139/404/6] test_defaultdict passed -- running: test_subprocess (64 sec) running: test_io (30 sec), test_subprocess (94 sec) 0:05:27 [140/404/6] test_subprocess passed (94 sec) -- running: test_io (31 sec) 0:05:27 [141/404/6] test_unpack passed -- running: test_io (31 sec) 0:05:28 [142/404/6] test_bytes passed -- running: test_io (33 sec) 0:05:29 [143/404/6] test_weakset passed -- running: test_io (33 sec) 0:05:36 [144/404/6] test_eintr passed -- running: test_io (40 sec) 0:05:37 [145/404/6] test_userstring passed -- running: test_io (41 sec) 0:05:37 [146/404/6] test_support passed -- running: test_io (41 sec) 0:05:37 [147/404/6] test_ioctl skipped -- running: test_io (42 sec) test_ioctl skipped -- Unable to open /dev/tty 0:05:40 [148/404/6] test_cmd_line passed -- running: test_io (44 sec) 0:05:41 [149/404/6] test_turtle skipped -- running: test_io (45 sec) test_turtle skipped -- No module named '_tkinter' 0:05:41 [150/404/6] test_subclassinit passed -- running: test_io (45 sec) 0:05:42 [151/404/6] test_set passed -- running: test_io (46 sec) 0:05:43 [152/404/6] test_xml_etree_c passed -- running: test_io (47 sec) 0:05:43 [153/404/6] test_binascii passed -- running: test_io (47 sec) 0:05:48 [154/404/6] test_normalization passed -- running: test_io (52 sec) fetching http://www.pythontest.net/unicode/9.0.0/NormalizationTest.txt ... 0:05:49 [155/404/6] test_os passed -- running: test_io (54 sec) stty: stdin isn't a terminal 0:05:50 [156/404/6] test_abc passed -- running: test_io (54 sec) 0:05:50 [157/404/6] test_dummy_threading passed -- running: test_io (54 sec) 0:05:50 [158/404/6] test_pkgutil passed -- running: test_io (54 sec) 0:05:50 [159/404/6] test_compile passed -- running: test_io (55 sec) 0:05:51 [160/404/6] test_largefile passed -- running: test_io (55 sec) 0:05:54 [161/404/6] test_io failed (env changed) (57 sec) test_BufferedIOBase_destructor (test.test_io.CIOTest) ... ok ... test_interrupted_write_unbuffered (test.test_io.PySignalsTest) ... ok ---------------------------------------------------------------------- Ran 565 tests in 57.439s OK (skipped=2) Warning -- files was modified by test_io Before: [] After: ['python.core'] ---------- components: Tests messages: 291921 nosy: haypo, koobs priority: normal severity: normal status: open title: python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 20:03:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 00:03:28 +0000 Subject: [issue29887] test_normalization doesn't work In-Reply-To: <1490288230.58.0.523545383484.issue29887@psf.upfronthosting.co.za> Message-ID: <1492646608.62.0.751945781565.issue29887@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1321 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 20:04:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 00:04:43 +0000 Subject: [issue29887] test_normalization doesn't work In-Reply-To: <1490288230.58.0.523545383484.issue29887@psf.upfronthosting.co.za> Message-ID: <1492646683.51.0.513531031449.issue29887@psf.upfronthosting.co.za> STINNER Victor added the comment: > The test should try to write the file in a temporary file, or simply skip the test. I proposed https://github.com/python/cpython/pull/1196 to skip the test in that case. Creating a temporary file is more complex since the API doesn't work as a context manager, and it's unclear who would be responsible to remove the temporary file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 20:23:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 00:23:12 +0000 Subject: [issue30108] test_site modifies sys.path Message-ID: <1492647792.33.0.749226067814.issue30108@psf.upfronthosting.co.za> New submission from STINNER Victor: See on Travis CI: https://travis-ci.org/python/cpython/jobs/223771666 Warning -- sys.path was modified by test_site Before: (47345855849656, ['', '/usr/local/lib/python37.zip', '/home/travis/build/python/cpython/Lib', '/home/travis/build/python/cpython/build/lib.linux-x86_64-3.7-pydebug'], ['', '/usr/local/lib/python37.zip', '/home/travis/build/python/cpython/Lib', '/home/travis/build/python/cpython/build/lib.linux-x86_64-3.7-pydebug']) After: (47345855849656, ['', '/usr/local/lib/python37.zip', '/home/travis/build/python/cpython/Lib', '/home/travis/build/python/cpython/build/lib.linux-x86_64-3.7-pydebug'], ['', '/usr/local/lib/python37.zip', '/home/travis/build/python/cpython/Lib', '/home/travis/build/python/cpython/build/lib.linux-x86_64-3.7-pydebug', '/home/travis/.local/lib/python3.7/site-packages']) ---------- components: Tests messages: 291923 nosy: haypo priority: normal severity: normal status: open title: test_site modifies sys.path versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 20:36:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 00:36:02 +0000 Subject: [issue30108] test_site modifies sys.path In-Reply-To: <1492647792.33.0.749226067814.issue30108@psf.upfronthosting.co.za> Message-ID: <1492648562.21.0.783747328597.issue30108@psf.upfronthosting.co.za> STINNER Victor added the comment: Ah, I reproduced the bug: $ rmdir ~/.local/lib/python3.7/site-packages; ./python -m test test_site Run tests sequentially 0:00:00 [1/1] test_site Warning -- sys.path was modified by test_site Before: (140302199734024, ['', '/home/haypo/prog/GIT/perf', '/usr/local/lib/python37.zip', '/home/haypo/prog/python/master/Lib', '/home/haypo/prog/python/master/build/lib.linux-x86_64-3.7'], ['', '/home/haypo/prog/GIT/perf', '/usr/local/lib/python37.zip', '/home/haypo/prog/python/master/Lib', '/home/haypo/prog/python/master/build/lib.linux-x86_64-3.7']) After: (140302199734024, ['', '/home/haypo/prog/GIT/perf', '/usr/local/lib/python37.zip', '/home/haypo/prog/python/master/Lib', '/home/haypo/prog/python/master/build/lib.linux-x86_64-3.7'], ['', '/home/haypo/prog/GIT/perf', '/usr/local/lib/python37.zip', '/home/haypo/prog/python/master/Lib', '/home/haypo/prog/python/master/build/lib.linux-x86_64-3.7', '/home/haypo/.local/lib/python3.7/site-packages']) test_site failed (env changed) 1 test altered the execution environment: test_site Total duration: 229 ms Tests result: SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 20:39:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 00:39:29 +0000 Subject: [issue30108] test_site modifies sys.path In-Reply-To: <1492647792.33.0.749226067814.issue30108@psf.upfronthosting.co.za> Message-ID: <1492648769.94.0.310691149912.issue30108@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1322 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 20:40:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 00:40:01 +0000 Subject: [issue29887] test_normalization doesn't work In-Reply-To: <1490288230.58.0.523545383484.issue29887@psf.upfronthosting.co.za> Message-ID: <1492648801.75.0.419937242296.issue29887@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset d13d54748d3a7db023d9db37223ea7d40bb8f8e3 by Victor Stinner in branch 'master': bpo-29887: test_normalization handles PermissionError (#1196) https://github.com/python/cpython/commit/d13d54748d3a7db023d9db37223ea7d40bb8f8e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 20:41:32 2017 From: report at bugs.python.org (Pavol Lisy) Date: Thu, 20 Apr 2017 00:41:32 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1492648892.68.0.781999517231.issue30024@psf.upfronthosting.co.za> Pavol Lisy added the comment: Maybe I am wrong but don't we get another weird behavior? import sys.path # this is error now ModuleNotFoundError: No module named 'sys.path'; 'sys' is not a package So we probably expect same behavior here: import sys.path as foo But if we just replace LOAD_ATTR with IMPORT_FROM in the compiler then wouldn't it works like: from sys import path as foo ? ---------- nosy: +Pavol Lisy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 20:55:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 00:55:41 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1492649741.17.0.84445892843.issue30106@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 11470b6dcdbc170779499a4a040b93c842a0d194 by Victor Stinner in branch 'master': bpo-30106: Fix tearDown() of test_asyncore (#1194) https://github.com/python/cpython/commit/11470b6dcdbc170779499a4a040b93c842a0d194 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 21:09:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 01:09:36 +0000 Subject: [issue30102] improve performance of libSSL usage on hashing In-Reply-To: <1492625768.04.0.0441991699383.issue30102@psf.upfronthosting.co.za> Message-ID: <1492650576.33.0.737179048252.issue30102@psf.upfronthosting.co.za> STINNER Victor added the comment: > This small change also changes behavior of OpenSSL dramatically. What do you mean by "dramatically"? What does a openssl.cnf configuration contain? Do other applications using OpenSSL call OPENSSL_config(NULL)? Since OPENSSL_config() accepts a filename, maybe a first step would be to expose the function as ssl.OPENSSL_config(filename) to allow user to load *explicitly* a configuration file? ssl.OPENSSL_config() would call OPENSSL_config(NULL). Would it work for you, Gustavo? -- More links: - https://wiki.openssl.org/index.php/Manual:OPENSSL_config(3) - https://en.wikibooks.org/wiki/OpenSSL/Initialization ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 21:12:35 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 20 Apr 2017 01:12:35 +0000 Subject: [issue25002] Deprecate asyncore/asynchat In-Reply-To: <1441399683.85.0.786847810998.issue25002@psf.upfronthosting.co.za> Message-ID: <1492650755.59.0.698033364716.issue25002@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: For the archaeologists of the future, smtpd.py is also deprecated in favor of aiosmtpd. http://aiosmtpd.readthedocs.io/en/latest/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 21:25:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 01:25:12 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1492651512.87.0.158107446893.issue30106@psf.upfronthosting.co.za> STINNER Victor added the comment: It seems like the change 11470b6dcdbc170779499a4a040b93c842a0d194 fixed test_handle_write(), but test_quick_connect() fails on thread.join(). test_quick_connect (test.test_asyncore.TestAPI_UseIPv4Poll) ... Exception in thread Thread-2: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_asyncore.py", line 785, in count=500)) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 144, in poll r, w, e = select.select(r, w, e, timeout) OSError: [Errno 9] Bad file descriptor FAIL test_quick_connect (test.test_asyncore.TestAPI_UseIPv4Select) ... Exception in thread Thread-3: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_asyncore.py", line 785, in count=500)) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/asyncore.py", line 144, in poll r, w, e = select.select(r, w, e, timeout) OSError: [Errno 9] Bad file descriptor FAIL ====================================================================== FAIL: test_quick_connect (test.test_asyncore.TestAPI_UseIPv4Poll) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py", line 2042, in decorator return func(*args) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_asyncore.py", line 800, in test_quick_connect self.fail("join() timed out") AssertionError: join() timed out ====================================================================== FAIL: test_quick_connect (test.test_asyncore.TestAPI_UseIPv4Select) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py", line 2042, in decorator return func(*args) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_asyncore.py", line 800, in test_quick_connect self.fail("join() timed out") AssertionError: join() timed out ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 21:29:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 01:29:15 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1492651755.22.0.44963233962.issue30106@psf.upfronthosting.co.za> STINNER Victor added the comment: Since my change 7b9619ae249ed637924d1c76687b411061753e5a, test_asyncore now fails on the AMD64 FreeBSD CURRENT Debug 3.x buildbot, it wasn't the case before. First fail: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/174/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 21:45:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 01:45:36 +0000 Subject: [issue29887] test_normalization doesn't work In-Reply-To: <1490288230.58.0.523545383484.issue29887@psf.upfronthosting.co.za> Message-ID: <1492652736.51.0.948722870351.issue29887@psf.upfronthosting.co.za> STINNER Victor added the comment: Cool! "x86 Gentoo Installed with X 3.x" succeeded. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 21:46:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 01:46:45 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1492652805.55.0.753523834485.issue30106@psf.upfronthosting.co.za> STINNER Victor added the comment: I started to work on this issue because I noticed many "xxx modified by test_xxx" on the two FreeBSD CURRENT buildbots. Examples: AMD64_FreeBSD_CURRENT_Debug_3.x/163:Warning -- threading._dangling was modified by test_logging AMD64_FreeBSD_CURRENT_Debug_3.x/159:Warning -- asyncore.socket_map was modified by test_ssl ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 22:32:19 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 02:32:19 +0000 Subject: [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1492655539.24.0.229674090208.issue12414@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1323 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 22:41:30 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 02:41:30 +0000 Subject: [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1492656090.37.0.94674624194.issue12414@psf.upfronthosting.co.za> Dong-hee Na added the comment: I create PR 1168 and PR 1198 for master branch and the 3.6 branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 22:59:26 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Thu, 20 Apr 2017 02:59:26 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1492657166.58.0.614793691563.issue19225@psf.upfronthosting.co.za> Changes by KINEBUCHI Tomohiko : ---------- pull_requests: +1324 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:00:23 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Thu, 20 Apr 2017 03:00:23 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1492657223.12.0.220074578194.issue19225@psf.upfronthosting.co.za> Changes by KINEBUCHI Tomohiko : ---------- pull_requests: +1325 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:01:46 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Thu, 20 Apr 2017 03:01:46 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1492657306.84.0.492446085141.issue19225@psf.upfronthosting.co.za> Changes by KINEBUCHI Tomohiko : ---------- pull_requests: +1326 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:17:36 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 03:17:36 +0000 Subject: [issue30109] make reindent failed. Message-ID: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> New submission from Dong-hee Na: When I try to `make reindent` It was failed with this messages. ```` ./python.exe ./Tools/scripts/reindent.py -r ./Lib Traceback (most recent call last): File "/Users/corona10/cpython/Lib/tokenize.py", line 404, in find_cookie codec = lookup(encoding) LookupError: unknown encoding: uft-8 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./Tools/scripts/reindent.py", line 329, in main() File "./Tools/scripts/reindent.py", line 101, in main check(arg) File "./Tools/scripts/reindent.py", line 115, in check check(fullname) File "./Tools/scripts/reindent.py", line 115, in check check(fullname) File "./Tools/scripts/reindent.py", line 121, in check encoding, _ = tokenize.detect_encoding(f.readline) File "/Users/corona10/cpython/Lib/tokenize.py", line 433, in detect_encoding encoding = find_cookie(first) File "/Users/corona10/cpython/Lib/tokenize.py", line 412, in find_cookie raise SyntaxError(msg) SyntaxError: unknown encoding for './Lib/test/bad_coding.py': uft-8 make: *** [reindent] Error 1 ``` ---------- messages: 291935 nosy: corona10 priority: normal severity: normal status: open title: make reindent failed. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:24:40 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 03:24:40 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492658680.83.0.192031168236.issue30109@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- type: -> behavior versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:47:01 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 03:47:01 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492660021.79.0.984345217795.issue30078@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset f7e62cf8adfb8ab6a6a870903defe8ff218a0383 by Berker Peksag (Louie Lu) in branch 'master': bpo-30078: Add an example of passing a path to unittest (#1178) https://github.com/python/cpython/commit/f7e62cf8adfb8ab6a6a870903defe8ff218a0383 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:49:38 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 03:49:38 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492660178.36.0.184284428696.issue30078@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- pull_requests: +1327 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:51:13 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 03:51:13 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492660273.73.0.34597905383.issue30078@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- pull_requests: +1328 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:54:08 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 03:54:08 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1492660448.36.0.060535342947.issue19225@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 5fb4bf91e78e128a22b5b58da179f09d0b307f2d by Berker Peksag (cocoatomo) in branch '3.6': bpo-19225: Remove duplicated description for standard warning categories (GH-1068) https://github.com/python/cpython/commit/5fb4bf91e78e128a22b5b58da179f09d0b307f2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:56:07 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 03:56:07 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1492660567.27.0.92036963863.issue19225@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 7e56fe35efe3aef0b9aac989255c4f13dfc01b09 by Berker Peksag (cocoatomo) in branch '3.5': bpo-19225: Remove duplicated description for standard warning categories (GH-1068) https://github.com/python/cpython/commit/7e56fe35efe3aef0b9aac989255c4f13dfc01b09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:57:23 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 03:57:23 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1492660643.65.0.743051370856.issue19225@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 450a69c6a4bfee6a10cbcc0c43b221bb135689c8 by Berker Peksag (cocoatomo) in branch '2.7': bpo-19225: Remove duplicated description for standard warning categories (GH-1068) https://github.com/python/cpython/commit/450a69c6a4bfee6a10cbcc0c43b221bb135689c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 19 23:58:48 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 03:58:48 +0000 Subject: [issue19225] lack of PyExc_BufferError doc In-Reply-To: <1381485777.95.0.364414099437.issue19225@psf.upfronthosting.co.za> Message-ID: <1492660728.54.0.137521749123.issue19225@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the backport PRs! ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 00:11:59 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 04:11:59 +0000 Subject: [issue24739] allow argparse.FileType to accept newline argument In-Reply-To: <1438049324.32.0.674993969885.issue24739@psf.upfronthosting.co.za> Message-ID: <1492661519.22.0.730465882814.issue24739@psf.upfronthosting.co.za> Berker Peksag added the comment: I agree with paul j3. It would be nice to keep the current FileType API as is. The argparse documentation already encourages people to write their own custom types and I think this is a good use case for following the advice. Thanks for the report! ---------- nosy: +berker.peksag resolution: -> rejected stage: -> resolved status: open -> closed versions: +Python 3.7 -Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 00:36:59 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 04:36:59 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492663019.76.0.330767683681.issue30078@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 596e714d79a22d1d53f26ae1a579dcd43f15865a by Berker Peksag in branch '3.6': bpo-30078: Add an example of passing a path to unittest (GH-1178) https://github.com/python/cpython/commit/596e714d79a22d1d53f26ae1a579dcd43f15865a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 00:37:20 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 04:37:20 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492663040.26.0.228856830145.issue30078@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 6fb0f801d73b1e2794888772d016d978eccf52a6 by Berker Peksag in branch '3.5': bpo-30078: Add an example of passing a path to unittest (GH-1178) https://github.com/python/cpython/commit/6fb0f801d73b1e2794888772d016d978eccf52a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 00:37:46 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 04:37:46 +0000 Subject: [issue30078] "-m unittest --help" says nothing about direct script exection In-Reply-To: <1492289385.37.0.918058800689.issue30078@psf.upfronthosting.co.za> Message-ID: <1492663066.59.0.123549317437.issue30078@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 00:38:45 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 04:38:45 +0000 Subject: [issue10379] locale.format() input regression In-Reply-To: <1289345606.99.0.972407204822.issue10379@psf.upfronthosting.co.za> Message-ID: <1492663125.54.0.329555676298.issue10379@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 6dbdedb0b18a5ca850ab8ce512fda24d5a9d0688 by Berker Peksag in branch 'master': bpo-10379: Add %char examples to locale.format() docs (GH-1145) https://github.com/python/cpython/commit/6dbdedb0b18a5ca850ab8ce512fda24d5a9d0688 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 00:39:00 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 20 Apr 2017 04:39:00 +0000 Subject: [issue10379] locale.format() input regression In-Reply-To: <1289345606.99.0.972407204822.issue10379@psf.upfronthosting.co.za> Message-ID: <1492663140.36.0.979167408124.issue10379@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 Thu Apr 20 00:52:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 04:52:13 +0000 Subject: [issue30108] test_site modifies sys.path In-Reply-To: <1492647792.33.0.749226067814.issue30108@psf.upfronthosting.co.za> Message-ID: <1492663933.15.0.169549320867.issue30108@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm wondering if the user site directory should be removed in tearDownModule(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 01:02:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 05:02:06 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1492664526.44.0.407023451928.issue30024@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: No, because the compiler generates different arguments for the IMPORT_NAME opcode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 01:22:24 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 05:22:24 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492665744.8.0.670797010371.issue30109@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1329 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 01:24:33 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 05:24:33 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492665873.68.0.445722173892.issue30109@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- assignee: -> Mariatta nosy: +Mariatta stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 01:59:22 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 05:59:22 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492667962.27.0.79745288316.issue30109@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 58f3c9dc8f5626abe09ac9738c34f6ba99ce2972 by Mariatta in branch 'master': bpo-30109: Fix reindent.py (GH-1207) https://github.com/python/cpython/commit/58f3c9dc8f5626abe09ac9738c34f6ba99ce2972 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 02:00:57 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 06:00:57 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492668057.86.0.2595726855.issue30109@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1330 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 02:01:10 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 06:01:10 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492668070.57.0.364663550406.issue30109@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1331 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 02:04:52 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 06:04:52 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492668292.61.0.515871893694.issue30109@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: patch review -> backport needed versions: +Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 02:06:50 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 20 Apr 2017 06:06:50 +0000 Subject: [issue21150] Add quick links table to argparse docs In-Reply-To: <1396558035.28.0.485991636726.issue21150@psf.upfronthosting.co.za> Message-ID: <1492668410.12.0.567282101967.issue21150@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1332 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 02:13:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 06:13:19 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492668799.47.0.996251680451.issue30109@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't know whether the fix for 2.7 is needed. The interface of tokenize is different in 2.7. Just run the new test and see if it fails. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 02:37:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 06:37:55 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492670275.69.0.707649796202.issue30030@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: On Linux creating a temporary file or directory usually consumes only one random name. But due to a bug on Windows (issue22107) it can consume up to TMP_MAX (2147483647 on Windows) names when called with read-only directory. Generating every name consumes about 16 random bytes. This can exhaust the system entropy and slowdown other applications. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 02:54:20 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 20 Apr 2017 06:54:20 +0000 Subject: [issue30110] test_asyncio reports reference leak Message-ID: <1492671260.02.0.938274219318.issue30110@psf.upfronthosting.co.za> New submission from Xiang Zhang: Running test suite with refleak hunter reports test_asyncio leaks referrences: 0:00:00 [1/1] test_asyncio Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.123 seconds beginning 9 repetitions 123456789 Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.112 seconds .Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.104 seconds .Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.113 seconds .Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.104 seconds .Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.120 seconds .Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.142 seconds .Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.141 seconds .Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.107 seconds .Executing .start() done, defined at /home/angwer/repos/cpython/Lib/test/test_asyncio/test_pep492.py:150> result=None created at /home/angwer/repos/cpython/Lib/asyncio/base_events.py:445> took 0.115 seconds . test_asyncio leaked [-2, 2, 0, 0] memory blocks, sum=0 test_asyncio failed in 4 min 27 sec 1 test failed: test_asyncio git bisect blames ba7e1f9a4e06c0b4ad594fd64edcaf7292515820. Looking at the patch it looks to me the problem is in test_get_event_loop_new_process(), the pool is not shutdown. ---------- messages: 291951 nosy: xiang.zhang, yselivanov priority: normal severity: normal status: open title: test_asyncio reports reference leak versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 03:29:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 07:29:15 +0000 Subject: [issue29840] Avoid raising OverflowError in bool() In-Reply-To: <1489782446.56.0.355449112547.issue29840@psf.upfronthosting.co.za> Message-ID: <1492673355.15.0.76501382036.issue29840@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1333 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 03:31:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 07:31:19 +0000 Subject: [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1492673479.31.0.578154361095.issue12414@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b4dc6af7a7862a8996cffed30d39d6add5ee58a3 by Serhiy Storchaka (Dong-hee Na) in branch 'master': bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168) https://github.com/python/cpython/commit/b4dc6af7a7862a8996cffed30d39d6add5ee58a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 03:36:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 07:36:48 +0000 Subject: [issue27863] multiple issues in _elementtree module In-Reply-To: <1472141830.55.0.358852521473.issue27863@psf.upfronthosting.co.za> Message-ID: <1492673808.88.0.717090114998.issue27863@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- dependencies: -various issues due to misuse of PySlice_GetIndicesEx resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 04:15:41 2017 From: report at bugs.python.org (Marc Schlaich) Date: Thu, 20 Apr 2017 08:15:41 +0000 Subject: [issue29533] urllib2 works slowly with proxy on windows In-Reply-To: <1486802607.23.0.387912582288.issue29533@psf.upfronthosting.co.za> Message-ID: <1492676141.58.0.466814365788.issue29533@psf.upfronthosting.co.za> Marc Schlaich added the comment: BTW, you can workaround this issue by defining the `http_proxy` and `no_proxy` environment variables. In this case urllib isn't doing any DNS request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 04:26:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 08:26:28 +0000 Subject: [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1492676788.43.0.924563019661.issue12414@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset df5df13fdc3a71bcf2295acc2cba7f22cfe2d669 by Serhiy Storchaka (Dong-hee Na) in branch '3.6': [3.6] bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168) (#1198) https://github.com/python/cpython/commit/df5df13fdc3a71bcf2295acc2cba7f22cfe2d669 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 04:27:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 08:27:07 +0000 Subject: [issue12414] getsizeof() on code objects is wrong In-Reply-To: <1309060401.87.0.459388249467.issue12414@psf.upfronthosting.co.za> Message-ID: <1492676827.3.0.889363132785.issue12414@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 05:15:30 2017 From: report at bugs.python.org (Marian Horban) Date: Thu, 20 Apr 2017 09:15:30 +0000 Subject: [issue30111] json module: encoder optimization Message-ID: <1492679730.92.0.726473199526.issue30111@psf.upfronthosting.co.za> New submission from Marian Horban: It is possible to improve performance of json module encoder. Since access to local variables is faster than to globals/builtins I propose to use locals instead of globals. Small test of such improvement: >>> import timeit >>> def flocal(name=False): ... for i in range(5): ... x = name ... >>> timeit.timeit("flocal()", "from __main__ import flocal", number=10000000) 5.0455567836761475 >>> >>> def fbuilt_in(): ... for i in range(5): ... x = False ... >>> >>> timeit.timeit("fbuilt_in()", "from __main__ import fbuilt_in", number=10000000) 5.451796054840088 ---------- components: Library (Lib) files: encoder_opt.patch keywords: patch messages: 291955 nosy: Marian Horban 2 priority: normal severity: normal status: open title: json module: encoder optimization type: performance versions: Python 2.7 Added file: http://bugs.python.org/file46815/encoder_opt.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 05:20:30 2017 From: report at bugs.python.org (David Kirkby) Date: Thu, 20 Apr 2017 09:20:30 +0000 Subject: [issue30112] useful things Message-ID: <1841114936.20170420122013@onetel.net> New submission from David Kirkby: Greetings! I've just come across some very useful things, you might like them too, just take a look here http://www.arqja.com/mission.php?9495 david.kirkby ---------- messages: 291956 nosy: drkirkby priority: normal severity: normal status: open title: useful things _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 05:36:32 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 20 Apr 2017 09:36:32 +0000 Subject: [issue30113] Add profile test case for trace_dispatch_return assertion Message-ID: <1492680992.58.0.5244415067.issue30113@psf.upfronthosting.co.za> New submission from Louie Lu: This is a sub-problem of #9285, in #9285, we aim to provide cProfile and profile a context manager, this will need to add code like this: def __enter__(self): self.set_cmd('') sys.setprofile(self.dispatcher) return self Unfortunately, when setting up profiler via `sys.setprofile`, it will immediately work on next line `return self`, which cause the assertion inside `trace_dispatch_return` claim this is a "Bad return". Technically, `profile.Profile` can not go return upper than it's frame inside the frame stack. This behavior can be observed by this code: def fib(n): if n > 2: return fib(n - 1) + fib(n - 2) return n def foo(): pr = profile.Profile() # Profile was set in the `foo` frame, it can't get more upper than this # that means, we can't return to global frame when this profile is set sys.setprofile(pr.dispatcher) fib(5) # We didn't stop the profile here via sys.setprofile(None) # So it will return 0xDEADBEAF to global frame and cause a bad return return 0xDEADBEAF foo() Here this issue will provide the test of this behavior, then will make some modify in #9285 to prevent this situation when using profile as a context manager. ---------- components: Library (Lib) messages: 291957 nosy: louielu, ncoghlan priority: normal severity: normal status: open title: Add profile test case for trace_dispatch_return assertion type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 05:37:29 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 20 Apr 2017 09:37:29 +0000 Subject: [issue30112] useful things In-Reply-To: <1841114936.20170420122013@onetel.net> Message-ID: <1492681049.6.0.875554693128.issue30112@psf.upfronthosting.co.za> Louie Lu added the comment: Please don't click the link, Google chrome return a security error """ Attackers on www.arqja.com may trick you into doing something dangerous like installing software or revealing your personal information (for example, passwords, phone numbers, or credit cards). """ ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 05:47:18 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 Apr 2017 09:47:18 +0000 Subject: [issue30112] useful things In-Reply-To: <1841114936.20170420122013@onetel.net> Message-ID: <1492681638.75.0.129342871254.issue30112@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 06:02:19 2017 From: report at bugs.python.org (Martin Panter) Date: Thu, 20 Apr 2017 10:02:19 +0000 Subject: [issue30112] useful things In-Reply-To: <1492681049.6.0.875554693128.issue30112@psf.upfronthosting.co.za> Message-ID: <1492682539.91.0.229307200138.issue30112@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- Removed message: http://bugs.python.org/msg291956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 06:04:06 2017 From: report at bugs.python.org (Marian Horban) Date: Thu, 20 Apr 2017 10:04:06 +0000 Subject: [issue30114] json module: it is not possible to override 'true', 'false' values during encoding bool Message-ID: <1492682646.2.0.186501711671.issue30114@psf.upfronthosting.co.za> New submission from Marian Horban: It is not possible to override 'true', 'false' values during encoding bool. For example if I want to dump dict like: {"key": True} and result must be not {"key": true} but let's say {"key": "TRUE"} It is really hard to force json.dumps function to do it. I understand that improving of json encoder performance causes this inflexible implementation. Perfect solution for extending/overriding json module would be move nested functions _iterencode_list _iterencode_dict _iterencode into class JSONEncoder as static methods. But it could make performance a bit worse. So if we cannot afford it I would propose to move function _make_iterencode to JSONEncoder as a static method. This change will not degrade performance. But it will be possible to override this method in SPECIFIC user's Encoder. ---------- components: Library (Lib) files: json_improvement.patch keywords: patch messages: 291959 nosy: Marian Horban 2 priority: normal severity: normal status: open title: json module: it is not possible to override 'true', 'false' values during encoding bool type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file46816/json_improvement.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 06:20:54 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 20 Apr 2017 10:20:54 +0000 Subject: [issue30097] Command-line option to suppress "from None" for debugging In-Reply-To: <1492553512.25.0.992335940269.issue30097@psf.upfronthosting.co.za> Message-ID: <1492683654.84.0.736346554095.issue30097@psf.upfronthosting.co.za> Changes by Wolfgang Maier : ---------- nosy: +wolma _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 06:22:07 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 20 Apr 2017 10:22:07 +0000 Subject: [issue30113] Add profile test case for trace_dispatch_return assertion In-Reply-To: <1492680992.58.0.5244415067.issue30113@psf.upfronthosting.co.za> Message-ID: <1492683727.23.0.2655718188.issue30113@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1334 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 06:22:07 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 20 Apr 2017 10:22:07 +0000 Subject: [issue9285] Add a profile decorator to profile and cProfile In-Reply-To: <1279375274.49.0.102313390752.issue9285@psf.upfronthosting.co.za> Message-ID: <1492683727.3.0.778936721712.issue9285@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1335 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 06:36:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 10:36:21 +0000 Subject: [issue30111] json module: encoder optimization In-Reply-To: <1492679730.92.0.726473199526.issue30111@psf.upfronthosting.co.za> Message-ID: <1492684581.42.0.991446826387.issue30111@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New features can be only added to the default branch. True and False are not global variables but keywords in Python 3. And in any case the json module is accelerated by C implementation which much faster than any microoptimized Python code. ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 06:55:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 10:55:05 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492685705.21.0.178060008007.issue29802@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1336 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 07:03:04 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 20 Apr 2017 11:03:04 +0000 Subject: [issue30115] test_logging report reference leak Message-ID: <1492686184.18.0.863470787856.issue30115@psf.upfronthosting.co.za> New submission from Xiang Zhang: 0:00:00 [1/1] test_logging beginning 9 repetitions 123456789 ......... test_logging leaked [24, -24, 1, 24] memory blocks, sum=25 test_logging failed in 3 min 15 sec 1 test failed: test_logging Seems d61910c598876788c9b4bf0e116370bbfc5a2f85 is responsible. ---------- messages: 291961 nosy: vinay.sajip, xiang.zhang priority: normal severity: normal status: open title: test_logging report reference leak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 07:06:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 11:06:38 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492686398.88.0.0169138498773.issue29802@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your report Artem. But Modules/clinic/_struct.c.h is generated file, it shouldn't be manually edited. And clearing the cache doesn't solves the bug. If _PyArg_ParseStack() failed it calls cache_struct_converter() for clearing s_object and jumps to the end of the function where s_object is decrefed second time. Yet one reference is left in the cache, but this is a hanging reference to deallocated object. Next call of struct.unpack() can retrieve that hanging reference and use it. PR 1213 properly fixes this issue. It also fixes similar bug PyUnicode_FSDecoder(), but the latter is hardly reproducible since in the stdlib PyUnicode_FSDecoder() is used mostly for the last argument of a function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 07:39:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 11:39:42 +0000 Subject: [issue30108] test_site modifies sys.path In-Reply-To: <1492647792.33.0.749226067814.issue30108@psf.upfronthosting.co.za> Message-ID: <1492688382.45.0.00547171687383.issue30108@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b85c136903c6d2368162f7c4a58f258c9c69ead0 by Victor Stinner in branch 'master': bpo-30108: Restore sys.path in test_site (#1197) https://github.com/python/cpython/commit/b85c136903c6d2368162f7c4a58f258c9c69ead0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 07:44:32 2017 From: report at bugs.python.org (Julia Dolgova) Date: Thu, 20 Apr 2017 11:44:32 +0000 Subject: [issue29533] urllib2 works slowly with proxy on windows In-Reply-To: <1486802607.23.0.387912582288.issue29533@psf.upfronthosting.co.za> Message-ID: <1492688672.7.0.229384533008.issue29533@psf.upfronthosting.co.za> Julia Dolgova added the comment: I'm not sure that users of my program will like if I define such variables in their systems ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 07:49:58 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 11:49:58 +0000 Subject: [issue30108] test_site modifies sys.path In-Reply-To: <1492663933.15.0.169549320867.issue30108@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Serhiy Storchaka added the comment: > I'm wondering if the user site directory should be removed in tearDownModule(). Writing into $HOME/.local is just completely wrong :-) The test suite must not modify the "system". On a buildbot, $HOME is the root directory / and so the test is skipped since the buildbot user is not allowed to create /.local. If you want to enhance the code: setUpModule() should mock $HOME to use a temporary directory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 07:50:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 11:50:48 +0000 Subject: [issue30108] test_site modifies sys.path In-Reply-To: <1492647792.33.0.749226067814.issue30108@psf.upfronthosting.co.za> Message-ID: <1492689048.0.0.502948516556.issue30108@psf.upfronthosting.co.za> STINNER Victor added the comment: The initial issue (test_site modifies sys.path) has been fixed. I don't think that it's worth it to backport the change, it's just a warning in tests. @Serhiy: Feel free to open a new issue if you want to enhance test_site ;-) ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 08:08:52 2017 From: report at bugs.python.org (m.meliani) Date: Thu, 20 Apr 2017 12:08:52 +0000 Subject: [issue30116] numpy.ndarray.T doesn't change the structure Message-ID: <1492690132.67.0.227049528037.issue30116@psf.upfronthosting.co.za> New submission from m.meliani: The few following lines, i believe, show how the numpy.ndarray.T or numpy.ndarray.transpose() don't change the structure of the data only the way they're displayed. Which is sometimes a problem when handling big quantities of data which you need to look at a certain way for sorting problems among others. >>> import numpy as np >>> x=np.array([[0,1,2],[1,2,3]]) >>> x=x.T >>> print x [[0 1] [1 2] [2 3]] >>> y=np.array([[0,1],[1,2],[2,3]]) >>> print y [[0 1] [1 2] [2 3]] >>> y.view('i8,i8') array([[(0, 1)], [(1, 2)], [(2, 3)]], dtype=[('f0', '>> x.view('i8,i8') Traceback (most recent call last): File "", line 1, in ValueError: new type not compatible with array. ---------- messages: 291967 nosy: m.meliani priority: normal severity: normal status: open title: numpy.ndarray.T doesn't change the structure type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 08:18:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 12:18:33 +0000 Subject: [issue30030] Simplify _RandomNameSequence In-Reply-To: <1491815858.77.0.234884449004.issue30030@psf.upfronthosting.co.za> Message-ID: <1492690713.9.0.174397056768.issue30030@psf.upfronthosting.co.za> STINNER Victor added the comment: "Generating every name consumes about 16 random bytes. This can exhaust the system entropy and slowdown other applications." Crys and Alex_Gaynor confirmed me on IRC that these two assumptions are both wrong. See for example https://www.2uo.de/myths-about-urandom/ Q: But that's good! /dev/random gives out exactly as much randomness as it has entropy in its pool. /dev/urandom will give you insecure random numbers, even though it has long run out of entropy. A: Fact: No. Even disregarding issues like availability and subsequent manipulation by users, the issue of entropy ?running low? is a straw man. About 256 bits of entropy are enough to get computationally secure numbers for a long, long time. -- About performance, well, it's not exactly "wrong" but "inaccurate". Abusing /dev/urandom only hurt other applications which also abuse /dev/urandom. Such use case is very unlikely. * The bad performance of concurrent /dev/urandom reader was analyzed by an old article of 2014, but see comments: http://drsnyder.us/2014/04/16/linux-dev-urandom-and-concurrency.html * The performance issue was fixed in Linux 4.8, https://github.com/torvalds/linux/commit/1e7f583af67be4ff091d0aeb863c649efd7a9112 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 08:37:17 2017 From: report at bugs.python.org (Erik Bray) Date: Thu, 20 Apr 2017 12:37:17 +0000 Subject: [issue29718] Fixed compile on cygwin. In-Reply-To: <1488599382.84.0.138970896501.issue29718@psf.upfronthosting.co.za> Message-ID: <1492691837.49.0.449937764977.issue29718@psf.upfronthosting.co.za> Erik Bray added the comment: This seems to be fixing a number of different Cygwin issues, many of which are known (some of these patches come from the Cygwin port of Python). However, some of these issues are already being handled separately, such as #25658, and I think rather than one big mongo patch it wold be good to break this up into individual issues. I was also just planning to submit some individual patches for review. ---------- nosy: +erik.bray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 08:45:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 12:45:21 +0000 Subject: [issue30117] test_lib2to3.test_parser.test_all_project_files() fails Message-ID: <1492692321.21.0.476906243501.issue30117@psf.upfronthosting.co.za> New submission from STINNER Victor: The test_lib2to3.test_parser.test_all_project_files() test fails and produces an annoying output. See the issue #13125 Example of a buildbot: 0:11:09 [398/404] test_lib2to3 passed (39 sec) --- /root/buildarea/3.x.angelico-debian-amd64/build/Lib/lib2to3/tests/data/bom.py 2017-02-11 12:20:43.532000000 +1100 +++ @ 2017-04-20 22:05:37.157911808 +1000 @@ -1,2 +1,2 @@ -?# coding: utf-8 +# coding: utf-8 print "BOM BOOM!" Example by running: ./python -m test -v test_lib2to3 --- test_all_project_files (lib2to3.tests.test_parser.TestParserIdempotency) ... /home/haypo/prog/python/master/Lib/lib2to3/tests/test_parser.py:393: UserWarning: ParseError on file /home/haypo/prog/python/master/Lib/lib2to3/main.py (bad input: type=22, value='=', context=('', (130, 38))) warnings.warn('ParseError on file %s (%s)' % (filepath, err)) /home/haypo/prog/python/master/Lib/lib2to3/tests/test_parser.py:393: UserWarning: ParseError on file /home/haypo/prog/python/master/Lib/lib2to3/tests/pytree_idempotency.py (bad input: type=22, value='=', context=('', (49, 33))) warnings.warn('ParseError on file %s (%s)' % (filepath, err)) --- /home/haypo/prog/python/master/Lib/lib2to3/tests/data/bom.py 2017-02-10 23:10:03.392778645 +0100 +++ @ 2017-04-20 14:32:49.921613096 +0200 @@ -1,2 +1,2 @@ -?# coding: utf-8 +# coding: utf-8 print "BOM BOOM!" expected failure --- The test fails to parse the following code: --- from __future__ import print_function import sys print("WARNING", file=sys.stderr) --- whereas lib2to3 is able to parse the code. It seems like the code uses a lib2to3.tests.support.driver object. Maybe this object lacks the fixer which parses the __future__ imports? The minimum fix would be to make the test quiet: remove the warning, don't log anything. The best would be fix the test. ---------- components: Tests keywords: easy messages: 291970 nosy: haypo priority: normal severity: normal status: open title: test_lib2to3.test_parser.test_all_project_files() fails versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 08:45:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 12:45:38 +0000 Subject: [issue13125] test_all_project_files() expected failure In-Reply-To: <1318012693.65.0.29583104397.issue13125@psf.upfronthosting.co.za> Message-ID: <1492692338.57.0.192008898227.issue13125@psf.upfronthosting.co.za> STINNER Victor added the comment: I created the issue #30117 since the bug wasn't fixed yet. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 08:45:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 12:45:52 +0000 Subject: [issue30117] test_lib2to3.test_parser.test_all_project_files() fails In-Reply-To: <1492692321.21.0.476906243501.issue30117@psf.upfronthosting.co.za> Message-ID: <1492692352.86.0.891839511587.issue30117@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 09:08:10 2017 From: report at bugs.python.org (Marc Schlaich) Date: Thu, 20 Apr 2017 13:08:10 +0000 Subject: [issue29533] urllib2 works slowly with proxy on windows In-Reply-To: <1486802607.23.0.387912582288.issue29533@psf.upfronthosting.co.za> Message-ID: <1492693690.4.0.745031925928.issue29533@psf.upfronthosting.co.za> Marc Schlaich added the comment: Well, you can read the proxy settings from registry and write them to os.environ (no_proxy needs to be transformed as it has a different format). This will only take effect for the current process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 10:12:41 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 14:12:41 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492697561.03.0.370254717831.issue30109@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 430020500c56259d31e07d32771f017952bad4e0 by Mariatta in branch '3.6': [3.6] bpo-30109: Fix reindent.py (GH-1207) (GH-1208) https://github.com/python/cpython/commit/430020500c56259d31e07d32771f017952bad4e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 10:12:53 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 14:12:53 +0000 Subject: [issue30109] make reindent failed. In-Reply-To: <1492658256.6.0.028215188728.issue30109@psf.upfronthosting.co.za> Message-ID: <1492697573.09.0.65816626833.issue30109@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 60d27f42a07d0b9d4a2c3fb160cac1683e91f196 by Mariatta in branch '3.5': [3.5] bpo-30109: Fix reindent.py (GH-1207) (GH-1209) https://github.com/python/cpython/commit/60d27f42a07d0b9d4a2c3fb160cac1683e91f196 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 10:27:46 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Apr 2017 14:27:46 +0000 Subject: [issue30116] numpy.ndarray.T doesn't change the structure In-Reply-To: <1492690132.67.0.227049528037.issue30116@psf.upfronthosting.co.za> Message-ID: <1492698466.87.0.0397525596275.issue30116@psf.upfronthosting.co.za> R. David Murray added the comment: Numpy is not part of the Python standard library. You'll need to engage with the numpy community on this question. (I say engage with them on the question, not report a bug to them, because I highly doubt this is a bug...there's probably some way to do what you want, so I suggest asking a question first rather than reporting a bug). ---------- nosy: +r.david.murray resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 10:44:05 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 20 Apr 2017 14:44:05 +0000 Subject: [issue18971] Use argparse in the profile/cProfile modules In-Reply-To: <1378651735.34.0.106872134579.issue18971@psf.upfronthosting.co.za> Message-ID: <1492699445.78.0.793913339174.issue18971@psf.upfronthosting.co.za> Louie Lu added the comment: bad news, somehow the output of std.err and std.out have different between optparse and argparse, even if the test is done, it still need to convert some testcase to argparse compatible. ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 10:47:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 14:47:05 +0000 Subject: [issue18971] Use argparse in the profile/cProfile modules In-Reply-To: <1378651735.34.0.106872134579.issue18971@psf.upfronthosting.co.za> Message-ID: <1492699625.42.0.0426843970061.issue18971@psf.upfronthosting.co.za> STINNER Victor added the comment: > bad news, somehow the output of std.err and std.out have different between optparse and argparse Only test argparse. I don't think that it matters to test that the change doesn't change the behaviour. You can also redirect stderr to stdout. What do you want to test? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 10:56:42 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Apr 2017 14:56:42 +0000 Subject: [issue18971] Use argparse in the profile/cProfile modules In-Reply-To: <1378651735.34.0.106872134579.issue18971@psf.upfronthosting.co.za> Message-ID: <1492700202.56.0.1224984439.issue18971@psf.upfronthosting.co.za> R. David Murray added the comment: Well, part of the point of the tests is to make sure the module's behavior doesn't change when doing the conversion to argparse. But "behavior changing" doesn't extend to the exact format of the output...that can change, as long as what the module *does* given specific cli argument combinations stays the same. Ideally, you write the tests so that it is not sensitive to the exact output, but realistically some tests may need to be different between the optparse case and the argparse case to get good coverage. Note that even with good tests, you can still miss behavior changes. We tried to do a good job on the tests for compileall, for example, and we still introduced a bug or two when we converted to argparse. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 11:03:00 2017 From: report at bugs.python.org (Zachary Ware) Date: Thu, 20 Apr 2017 15:03:00 +0000 Subject: [issue30112] Spam In-Reply-To: <1492681049.6.0.875554693128.issue30112@psf.upfronthosting.co.za> Message-ID: <1492700580.64.0.674617856955.issue30112@psf.upfronthosting.co.za> Changes by Zachary Ware : ---------- nosy: -drkirkby, louielu title: useful things -> Spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 11:12:22 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Thu, 20 Apr 2017 15:12:22 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1492701142.2.0.547640804912.issue29943@psf.upfronthosting.co.za> Nathaniel Smith added the comment: FYI: https://github.com/pandas-dev/pandas/pull/16066 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 11:13:57 2017 From: report at bugs.python.org (Gustavo Serra Scalet) Date: Thu, 20 Apr 2017 15:13:57 +0000 Subject: [issue30102] improve performance of libSSL usage on hashing In-Reply-To: <1492650576.33.0.737179048252.issue30102@psf.upfronthosting.co.za> Message-ID: Gustavo Serra Scalet added the comment: > Since OPENSSL_config() accepts a filename, maybe a first step would be > to expose the function as ssl.OPENSSL_config(filename) to allow user to > load *explicitly* a configuration file? ssl.OPENSSL_config() would call > OPENSSL_config(NULL). Would it work for you, Gustavo? It would work, I would just wait for such a decision. BTW, that interface is deprecated as we're discussing on the issue on GitHub: https://github.com/openssl/openssl/blob/cda3ae5bd0798c56fef5a5c1462d51ca1776504e/doc/crypto/OPENSSL_config.pod#notes I'll continue analyzing this issue there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 11:39:27 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 20 Apr 2017 15:39:27 +0000 Subject: [issue30118] Adding unittest for cProfile / profile command line interface Message-ID: <1492702767.19.0.167930409114.issue30118@psf.upfronthosting.co.za> New submission from Louie Lu: Serhiy provide a cProfile / profile CLI optparse to argparse patch in #18971, it is time to add up the unittest of CLI test. I'll add the unittest these days for it. ---------- components: Library (Lib) messages: 291981 nosy: louielu, serhiy.storchaka priority: normal severity: normal status: open title: Adding unittest for cProfile / profile command line interface versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 11:39:35 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 20 Apr 2017 15:39:35 +0000 Subject: [issue18971] Use argparse in the profile/cProfile modules In-Reply-To: <1378651735.34.0.106872134579.issue18971@psf.upfronthosting.co.za> Message-ID: <1492702775.84.0.290441490106.issue18971@psf.upfronthosting.co.za> Louie Lu added the comment: haypo, murray, thanks for pointing this thing, I will let go about the bad message test, move to output file and sort test tomorrow, also add a new issue: #30118 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 11:41:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 15:41:33 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492702893.24.0.0224551398193.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: test_strtod fails on FreeBSD using clang 4.0, but pass using clang 3.8. Links: * https://gcc.gnu.org/wiki/FloatingPointMath * https://gcc.gnu.org/wiki/Math_Optimization_Flags * ICC fp-model: https://software.intel.com/en-us/node/682946 GCC options: * -ffp-contract=off / -ffp-contract=fast * -fp-model (not supported by clang) * -mfpmath=sse: no effect on Clang, it's already the default and -mfpmath=387 is not supported on x86_64 ISA * -ffast-math * -fexcess-precision=standard: not supported by clang ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 12:13:49 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 20 Apr 2017 16:13:49 +0000 Subject: [issue29387] Tabs vs spaces FAQ out of date In-Reply-To: <1485734038.81.0.0566253928841.issue29387@psf.upfronthosting.co.za> Message-ID: <1492704829.54.0.25862033039.issue29387@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 12:22:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 16:22:49 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492705369.01.0.0936593812857.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: I created a test case: attached dtoa2.c. Ok with GCC 6.3.1 (on Fedora 25) and clang 3.8 (on FreeBSD 11) with -O3: haypo at selma$ gcc -O3 dtoa2.c -o x && ./x text: 29865e170 -> float: 2.9865e+174 0x1.8265ea9f864bcp+579 {bc 64 f8 a9 5e 26 28 64} [haypo at freebsd ~/prog/python/master]$ clang -O3 dtoa2.c -o x && ./x text: 29865e170 -> float: 2.9865e+174 0x1.8265ea9f864bcp+579 {bc 64 f8 a9 5e 26 28 64} Still ok with clang 3.8 with -O1: [haypo at freebsd ~/prog/python/master]$ clang40 -O1 dtoa2.c -o x && ./x text: 29865e170 -> float: 2.9865e+174 0x1.8265ea9f864bcp+579 {bc 64 f8 a9 5e 26 28 64} Error with clang 4.0 using -O2 (on FreeBSD 11): [haypo at freebsd ~/prog/python/master]$ clang40 -O2 dtoa2.c -o x && ./x text: 29865e170 -> float: 2.9865e+174 0x1.8265ea9f864bdp+579 <~~~~~ HERE, bd instead of bc {bd 64 f8 a9 5e 26 28 64} <~~~~~ HERE, bd instead of bc ---------- Added file: http://bugs.python.org/file46817/dtoa2.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 12:24:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 16:24:47 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492705487.35.0.027555750928.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: > Still ok with clang 3.8 with -O1: Sorry, you should read clang 4.0 here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:06:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:06:02 +0000 Subject: [issue21833] Fix unicodeless build of Python In-Reply-To: <1403592802.89.0.505189213304.issue21833@psf.upfronthosting.co.za> Message-ID: <1492707962.74.0.456876473835.issue21833@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:06:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:06:08 +0000 Subject: [issue21854] Fix cookielib in unicodeless build In-Reply-To: <1403595757.33.0.450138611434.issue21854@psf.upfronthosting.co.za> Message-ID: <1492707968.95.0.151148058454.issue21854@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- dependencies: -Fix unicodeless build of Python resolution: -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:06:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:06:25 +0000 Subject: [issue21854] Fix cookielib in unicodeless build In-Reply-To: <1403595757.33.0.450138611434.issue21854@psf.upfronthosting.co.za> Message-ID: <1492707985.49.0.432642181043.issue21854@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- dependencies: +Fix unicodeless build of Python stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:06:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:06:47 +0000 Subject: [issue21852] Fix optparse in unicodeless build In-Reply-To: <1403595612.48.0.11976821558.issue21852@psf.upfronthosting.co.za> Message-ID: <1492708007.86.0.667067829007.issue21852@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:07:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:07:06 +0000 Subject: [issue21851] Fix gettext in unicodeless build In-Reply-To: <1403595544.94.0.0791965662749.issue21851@psf.upfronthosting.co.za> Message-ID: <1492708026.92.0.436534191019.issue21851@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:07:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:07:49 +0000 Subject: [issue21850] Fix httplib and SimpleHTTPServer in unicodeless build In-Reply-To: <1403595340.98.0.841039748191.issue21850@psf.upfronthosting.co.za> Message-ID: <1492708069.7.0.807971542387.issue21850@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:08:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:08:13 +0000 Subject: [issue21848] Fix logging in unicodeless build In-Reply-To: <1403595064.28.0.0373165472144.issue21848@psf.upfronthosting.co.za> Message-ID: <1492708093.83.0.138380770834.issue21848@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:08:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:08:33 +0000 Subject: [issue21846] Fix zipfile in unicodeless build In-Reply-To: <1403594933.03.0.418363538618.issue21846@psf.upfronthosting.co.za> Message-ID: <1492708113.11.0.846219204579.issue21846@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:08:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:08:51 +0000 Subject: [issue21845] Fix plistlib in unicodeless build In-Reply-To: <1403594863.87.0.835492015826.issue21845@psf.upfronthosting.co.za> Message-ID: <1492708131.25.0.0952665357545.issue21845@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:09:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:09:11 +0000 Subject: [issue21843] Fix doctest in unicodeless build In-Reply-To: <1403594596.58.0.13815654086.issue21843@psf.upfronthosting.co.za> Message-ID: <1492708151.2.0.304724522508.issue21843@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:09:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:09:26 +0000 Subject: [issue21841] Fix xml.sax in unicodeless build In-Reply-To: <1403594231.26.0.541614967311.issue21841@psf.upfronthosting.co.za> Message-ID: <1492708166.14.0.858716474308.issue21841@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:09:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:09:41 +0000 Subject: [issue21839] Fix distutils in unicodeless build In-Reply-To: <1403593869.13.0.236302983697.issue21839@psf.upfronthosting.co.za> Message-ID: <1492708181.77.0.43224982228.issue21839@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:10:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:10:00 +0000 Subject: [issue21838] Fix ctypes in unicodeless build In-Reply-To: <1403593806.9.0.0462136346954.issue21838@psf.upfronthosting.co.za> Message-ID: <1492708200.1.0.837137513763.issue21838@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:10:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:10:18 +0000 Subject: [issue21837] Fix tarfile in unicodeless build In-Reply-To: <1403593717.46.0.937130819445.issue21837@psf.upfronthosting.co.za> Message-ID: <1492708218.03.0.298566915106.issue21837@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:10:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:10:35 +0000 Subject: [issue21836] Fix sqlite3 in unicodeless build In-Reply-To: <1403593660.62.0.0164715886324.issue21836@psf.upfronthosting.co.za> Message-ID: <1492708235.87.0.518334300118.issue21836@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:10:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:10:56 +0000 Subject: [issue21835] Fix Tkinter in unicodeless build In-Reply-To: <1403593651.52.0.581013671758.issue21835@psf.upfronthosting.co.za> Message-ID: <1492708256.03.0.0715574506723.issue21835@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:11:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:11:17 +0000 Subject: [issue21834] Fix a number of tests in unicodeless build In-Reply-To: <1403593100.61.0.321675638626.issue21834@psf.upfronthosting.co.za> Message-ID: <1492708277.15.0.410292728269.issue21834@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:12:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 17:12:10 +0000 Subject: [issue21842] Fix IDLE in unicodeless build In-Reply-To: <1403594288.8.0.587190115284.issue21842@psf.upfronthosting.co.za> Message-ID: <1492708330.06.0.529979956184.issue21842@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:16:10 2017 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 20 Apr 2017 17:16:10 +0000 Subject: [issue30115] test_logging report reference leak In-Reply-To: <1492686184.18.0.863470787856.issue30115@psf.upfronthosting.co.za> Message-ID: <1492708570.17.0.454273492441.issue30115@psf.upfronthosting.co.za> Vinay Sajip added the comment: I just did a git pull, then: $ make distclean $ ./configure --with-pydebug $ make EXTRA_CFLAGS="-DPy_REF_DEBUG -DPy_TRACE_REFS" $ ./python Python 3.7.0a0 (heads/master:8f5cdfa, Apr 20 2017, 16:41:52) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> $ ./python -m test.regrtest -R : test_logging Run tests sequentially 0:00:00 [1/1] test_logging beginning 9 repetitions 123456789 ......... test_logging passed in 3 min 2 sec 1 test OK. Total duration: 3 min 2 sec Tests result: SUCCESS I do sometimes get errors if I run again, e.g. test_logging leaked [-164, 164, 0, 0] references, sum=0 test_logging leaked [-29, 31, 0, 0] memory blocks, sum=2 but results appear different every time, it seems. Is there any way to get them reproducibly? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:52:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 17:52:13 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492710733.59.0.440958327445.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: Much simpler test: [haypo at freebsd ~/prog/python/master]$ clang40 -O1 dtoa5.c -o x && ./x k=1 aadj=3.364 test ok [haypo at freebsd ~/prog/python/master]$ clang40 -O2 dtoa5.c -o x && ./x k=1 aadj=1.682 test FAILED: BUG! ---------- Added file: http://bugs.python.org/file46818/dtoa5.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:57:20 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 17:57:20 +0000 Subject: [issue30119] A remote attacker could possibly use this flaw to manipulate an FTP connection opened by a Python application Message-ID: <1492711040.26.0.220875177269.issue30119@psf.upfronthosting.co.za> New submission from Dong-hee Na: It was discovered that the FTP client implementation in the Networking component of Python failed to correctly handle user inputs. A remote attacker could possibly use this flaw to manipulate an FTP connection opened by a Python application if it could make it access a specially crafted FTP URL. See http://blog.blindspotsecurity.com/2017/02/advisory-javapython-ftp-injections.html and https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2017-3533 I upload the patch for this issue. ---------- messages: 291988 nosy: corona10 priority: normal severity: normal status: open title: A remote attacker could possibly use this flaw to manipulate an FTP connection opened by a Python application type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 13:58:26 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 17:58:26 +0000 Subject: [issue30119] A remote attacker could possibly use this flaw to manipulate an FTP connection opened by a Python application In-Reply-To: <1492711040.26.0.220875177269.issue30119@psf.upfronthosting.co.za> Message-ID: <1492711106.39.0.313189168138.issue30119@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1337 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:10:00 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 18:10:00 +0000 Subject: [issue30119] A remote attacker could possibly use this flaw to manipulate an FTP connection opened by a Python application In-Reply-To: <1492711040.26.0.220875177269.issue30119@psf.upfronthosting.co.za> Message-ID: <1492711800.94.0.949972309144.issue30119@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:13:06 2017 From: report at bugs.python.org (Segev Finer) Date: Thu, 20 Apr 2017 18:13:06 +0000 Subject: [issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista In-Reply-To: <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za> Message-ID: <1492711986.73.0.724307432566.issue19764@psf.upfronthosting.co.za> Segev Finer added the comment: Added the 5th version after another review by eryksun (In rietveld). ---------- Added file: http://bugs.python.org/file46819/windows-subprocess-close-fds-v5.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:13:13 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 18:13:13 +0000 Subject: [issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters In-Reply-To: <1492711040.26.0.220875177269.issue30119@psf.upfronthosting.co.za> Message-ID: <1492711993.8.0.451044479278.issue30119@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- title: A remote attacker could possibly use this flaw to manipulate an FTP connection opened by a Python application -> (ftplib) A remote attacker could possibly attack by containing the newline characters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:19:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 18:19:33 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492712373.24.0.10696001014.issue29802@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 40db90c1ce1a59d5f5f2894bb0ce32110000bf27 by Serhiy Storchaka in branch 'master': bpo-29802: Fix reference counting in module-level struct functions (#1213) https://github.com/python/cpython/commit/40db90c1ce1a59d5f5f2894bb0ce32110000bf27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:22:37 2017 From: report at bugs.python.org (=?utf-8?b?0JzQuNGF0LDQudC70L4g0JPQsNCy0LXQu9GP?=) Date: Thu, 20 Apr 2017 18:22:37 +0000 Subject: [issue30120] add new key words to keyword lib Message-ID: <1492712557.12.0.0900736271334.issue30120@psf.upfronthosting.co.za> Changes by ??????? ?????? : ---------- components: Library (Lib) nosy: ??????? ?????? priority: normal severity: normal status: open title: add new key words to keyword lib versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:33:57 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 20 Apr 2017 18:33:57 +0000 Subject: [issue30085] Discourage operator.__dunder__ functions In-Reply-To: <1492396029.61.0.720198059802.issue30085@psf.upfronthosting.co.za> Message-ID: <1492713237.5.0.0986060878828.issue30085@psf.upfronthosting.co.za> Terry J. Reedy added the comment: My suggestion from the python-ideas thread:: replace the current "The function names are those used for special class methods; variants without leading and trailing __ are also provided for convenience." with ""Many function names are those used for special methods, minus the double underscores. For backward compatibility, many of these have a variant with the double underscores kept. We recommend using the dunderless form. Note that operator.__add__(x, y), for instance, being the same as x + y, is not the same as x.__add__(y)." Possibly add ", since the first two may result in calling y.__radd__(x)". Raymond assigned the ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:35:53 2017 From: report at bugs.python.org (=?utf-8?b?0JzQuNGF0LDQudC70L4g0JPQsNCy0LXQu9GP?=) Date: Thu, 20 Apr 2017 18:35:53 +0000 Subject: [issue30120] add new key words to keyword lib Message-ID: <1492713353.15.0.165948936536.issue30120@psf.upfronthosting.co.za> Changes by ??????? ?????? : ---------- pull_requests: +1338 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:39:52 2017 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 20 Apr 2017 18:39:52 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492713592.23.0.261447930972.issue30104@psf.upfronthosting.co.za> Mark Dickinson added the comment: Why is -ffast-math being used? That seems like it's asking for trouble. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:45:33 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 20 Apr 2017 18:45:33 +0000 Subject: [issue30120] add new key words to keyword lib Message-ID: <1492713933.94.0.00780432898619.issue30120@psf.upfronthosting.co.za> Changes by R. David Murray : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> keyword module missing async and await keywords _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:48:47 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 20 Apr 2017 18:48:47 +0000 Subject: [issue30085] Discourage operator.__dunder__ functions In-Reply-To: <1492396029.61.0.720198059802.issue30085@psf.upfronthosting.co.za> Message-ID: <1492714127.48.0.875888687019.issue30085@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Raymond assigned the PR to himself, so I added him here as nosy and assignee. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:52:16 2017 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 20 Apr 2017 18:52:16 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492714336.27.0.224705825002.issue30104@psf.upfronthosting.co.za> Mark Dickinson added the comment: Hmm. Just looked at dto5.c; nice work reducing it to something so simple. This is looking a bit like either a strict-aliasing related problem, or a compiler bug, or both. My understanding of the "union trick" that dtoa.c uses is that it's well-defined under C99+TC3 (though that wasn't clear under the original C99), so it shouldn't be legitimate for an optimisation to cause different results to be produced. So this is smelling like a compiler bug to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:52:52 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 18:52:52 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1492714372.25.0.458632169078.issue29606@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1339 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 14:57:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 18:57:06 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492714626.57.0.684155278884.issue29802@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1340 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 15:09:00 2017 From: report at bugs.python.org (Segev Finer) Date: Thu, 20 Apr 2017 19:09:00 +0000 Subject: [issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista In-Reply-To: <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za> Message-ID: <1492715340.96.0.208981838354.issue19764@psf.upfronthosting.co.za> Segev Finer added the comment: Oh LOL!!! I missed the fact that Python finally moved to GitHub! Rebased the patch on top of the Git master XD (And removed accidentally committed code... sorry...) I still submitted as a patch since I don't know if the infrastructure handles moving a patch to a PR well :P ---------- Added file: http://bugs.python.org/file46820/windows-subprocess-close-fds-v6.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 15:48:32 2017 From: report at bugs.python.org (Segev Finer) Date: Thu, 20 Apr 2017 19:48:32 +0000 Subject: [issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista In-Reply-To: <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za> Message-ID: <1492717712.81.0.455963888153.issue19764@psf.upfronthosting.co.za> Segev Finer added the comment: OK Rietveld definitely punted on the git patch (I guess it's only for the old Mercurial repo, I don't think it actually even support Git...) I will try re-submitting the patch as a PR so that it can be reviewed easily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 15:49:07 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 20 Apr 2017 19:49:07 +0000 Subject: [issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista In-Reply-To: <1385370115.99.0.757096187315.issue19764@psf.upfronthosting.co.za> Message-ID: <1492717747.78.0.560970282132.issue19764@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1341 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 15:55:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 19:55:08 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492718108.23.0.902250003746.issue29802@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7a113a0cbf545588d61286fcc0e89141cf211735 by Serhiy Storchaka in branch '3.6': bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (#1217) https://github.com/python/cpython/commit/7a113a0cbf545588d61286fcc0e89141cf211735 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 15:56:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 20 Apr 2017 19:56:54 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492718214.6.0.884276703259.issue29802@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1342 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 16:32:08 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 20 Apr 2017 20:32:08 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1492720328.55.0.803631344981.issue29606@psf.upfronthosting.co.za> Dong-hee Na added the comment: I uploaded the PR which check invalid URL such as ftp://foo:bar%0d%0aINJECTED at example.net/file.png ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 17:26:04 2017 From: report at bugs.python.org (Eric Appelt) Date: Thu, 20 Apr 2017 21:26:04 +0000 Subject: [issue30096] Update examples in abc documentation to use abc.ABC In-Reply-To: <1492545098.58.0.705598301268.issue30096@psf.upfronthosting.co.za> Message-ID: <1492723564.35.0.374256676558.issue30096@psf.upfronthosting.co.za> Changes by Eric Appelt : ---------- pull_requests: +1343 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 17:30:24 2017 From: report at bugs.python.org (Eric Appelt) Date: Thu, 20 Apr 2017 21:30:24 +0000 Subject: [issue30096] Update examples in abc documentation to use abc.ABC In-Reply-To: <1492545098.58.0.705598301268.issue30096@psf.upfronthosting.co.za> Message-ID: <1492723824.77.0.620789527212.issue30096@psf.upfronthosting.co.za> Eric Appelt added the comment: I created a PR to update the documentation to use this pattern and follow Raymond's suggestion of showing both ways to define an abc. In order to make the examples comprehensible when read from beginning to end, I reordered the classes so that abc.ABC is described first. ---------- nosy: +Eric Appelt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 17:32:08 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 21:32:08 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492723928.75.0.688840408193.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: > Why is -ffast-math being used? That seems like it's asking for trouble. Sorry, my comment was unclear: I only tried to list all compiler options which have an impact on floating point numbers. > So this is smelling like a compiler bug to me. Right, I will report it to LLVM (clang). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 17:46:32 2017 From: report at bugs.python.org (Dimitry Andric) Date: Thu, 20 Apr 2017 21:46:32 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492724792.6.0.0866087078767.issue30104@psf.upfronthosting.co.za> Dimitry Andric added the comment: This is most likely the same issue we found in https://bugs.freebsd.org/216770, which was reported upstream to LLVM here: https://bugs.llvm.org//show_bug.cgi?id=31928, and resulted in a very long and not really productive discussion about whether type punning in this way is officially allowed, or a GNU extension. I will gladly leave it to language lawyers. :) In our case, easy fix was to use -fno-strict-aliasing, as we did here: https://svnweb.freebsd.org/changeset/base/313706 ---------- nosy: +dim _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 18:17:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Apr 2017 22:17:40 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492726660.98.0.237539676046.issue30104@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1344 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 18:43:55 2017 From: report at bugs.python.org (Segev Finer) Date: Thu, 20 Apr 2017 22:43:55 +0000 Subject: [issue30121] Windows: subprocess debug assertion on failure to execute the process Message-ID: <1492728235.69.0.898513798091.issue30121@psf.upfronthosting.co.za> New submission from Segev Finer: subprocess triggers a debug assertion in the CRT on failure to execute the process due to closing the pipe *handles* in the except clause using os.close rather than .Close() (os.close closes CRT file descriptors and not handles). In addition to that once this is fixed there is also a double free/close since we need to set `self._closed_child_pipe_fds = True` once we closed the handles in _execute_child so they won't also be closed in __init__. To reproduce, do this in a debug build of Python: import subprocess subprocess.Popen('exe_that_doesnt_exist.exe', stdout=subprocess.PIPE) See: https://github.com/python/cpython/pull/1218#discussion_r112550959 ---------- components: Library (Lib), Windows messages: 292002 nosy: Segev Finer, eryksun, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows: subprocess debug assertion on failure to execute the process type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 19:03:43 2017 From: report at bugs.python.org (Segev Finer) Date: Thu, 20 Apr 2017 23:03:43 +0000 Subject: [issue29191] liblzma is missing from pcbuild.sln In-Reply-To: <1483778935.32.0.9795840646.issue29191@psf.upfronthosting.co.za> Message-ID: <1492729423.4.0.227178893368.issue29191@psf.upfronthosting.co.za> Changes by Segev Finer : ---------- pull_requests: +1345 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 19:22:46 2017 From: report at bugs.python.org (Segev Finer) Date: Thu, 20 Apr 2017 23:22:46 +0000 Subject: [issue30121] Windows: subprocess debug assertion on failure to execute the process In-Reply-To: <1492728235.69.0.898513798091.issue30121@psf.upfronthosting.co.za> Message-ID: <1492730566.36.0.211515426423.issue30121@psf.upfronthosting.co.za> Changes by Segev Finer : ---------- pull_requests: +1346 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 19:33:30 2017 From: report at bugs.python.org (Steve Dower) Date: Thu, 20 Apr 2017 23:33:30 +0000 Subject: [issue29191] liblzma is missing from pcbuild.sln In-Reply-To: <1483778935.32.0.9795840646.issue29191@psf.upfronthosting.co.za> Message-ID: <1492731210.75.0.420624714488.issue29191@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset f60c9e54f501065f3be2a4cfb4c387dfa2f243a9 by Steve Dower (Segev Finer) in branch 'master': bpo-29191: Add liblzma.vcxproj to pcbuild.sln and other missing entries (#1222) https://github.com/python/cpython/commit/f60c9e54f501065f3be2a4cfb4c387dfa2f243a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 19:33:42 2017 From: report at bugs.python.org (Ed Maste) Date: Thu, 20 Apr 2017 23:33:42 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492731222.65.0.570311359468.issue30104@psf.upfronthosting.co.za> Changes by Ed Maste : ---------- nosy: +emaste _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 20 23:09:21 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 Apr 2017 03:09:21 +0000 Subject: [issue30114] json module: it is not possible to override 'true', 'false' values during encoding bool In-Reply-To: <1492682646.2.0.186501711671.issue30114@psf.upfronthosting.co.za> Message-ID: <1492744161.41.0.0465701199773.issue30114@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Sorry, I think this is unnecessary feature creep. The goal of the JSON module is to generate valid JSON for some semantically equivalent Python. Wanting to turn *True* into the string "True" isn't in the spirit of the module and certainly not worth all the proposed code churn. If this is really what you need (a somewhat exotic need at that), then I would recommend writing a recursive tree walker that replaces *True* nodes with "True" prior to outside of the JSON module. ---------- assignee: -> bob.ippolito nosy: +bob.ippolito, rhettinger versions: +Python 3.7 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 00:03:19 2017 From: report at bugs.python.org (Decorater) Date: Fri, 21 Apr 2017 04:03:19 +0000 Subject: [issue30122] Added missing things to Windows docs. Message-ID: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> New submission from Decorater: I realized the Windows docs lacked some information so I added it. I will try to create an cherry pick for 3.6 and 3.6 as well. Also if desired I could also see if it can be applied to the 2.7 branch as well. ---------- assignee: docs at python components: Documentation messages: 292005 nosy: Decorater, docs at python priority: normal severity: normal status: open title: Added missing things to Windows docs. versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 00:03:31 2017 From: report at bugs.python.org (Decorater) Date: Fri, 21 Apr 2017 04:03:31 +0000 Subject: [issue30122] Added missing things to Windows docs. In-Reply-To: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> Message-ID: <1492747411.27.0.541871869749.issue30122@psf.upfronthosting.co.za> Changes by Decorater : ---------- pull_requests: +1347 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 00:19:08 2017 From: report at bugs.python.org (Decorater) Date: Fri, 21 Apr 2017 04:19:08 +0000 Subject: [issue30122] Added missing things to Windows docs. In-Reply-To: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> Message-ID: <1492748348.39.0.331184314334.issue30122@psf.upfronthosting.co.za> Changes by Decorater : ---------- pull_requests: +1348 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 00:22:47 2017 From: report at bugs.python.org (Decorater) Date: Fri, 21 Apr 2017 04:22:47 +0000 Subject: [issue30122] Added missing things to Windows docs. In-Reply-To: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> Message-ID: <1492748567.29.0.794854242196.issue30122@psf.upfronthosting.co.za> Changes by Decorater : ---------- pull_requests: +1349 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 00:39:14 2017 From: report at bugs.python.org (Decorater) Date: Fri, 21 Apr 2017 04:39:14 +0000 Subject: [issue30122] Added missing archive programs and close option to Windows docs. In-Reply-To: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> Message-ID: <1492749554.1.0.346784221536.issue30122@psf.upfronthosting.co.za> Changes by Decorater : ---------- title: Added missing things to Windows docs. -> Added missing archive programs and close option to Windows docs. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 00:41:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Apr 2017 04:41:24 +0000 Subject: [issue30114] json module: it is not possible to override 'true', 'false' values during encoding bool In-Reply-To: <1492682646.2.0.186501711671.issue30114@psf.upfronthosting.co.za> Message-ID: <1492749684.5.0.235022475405.issue30114@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I concur with Raymond. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 00:48:10 2017 From: report at bugs.python.org (Bob Ippolito) Date: Fri, 21 Apr 2017 04:48:10 +0000 Subject: [issue30114] json module: it is not possible to override 'true', 'false' values during encoding bool In-Reply-To: <1492682646.2.0.186501711671.issue30114@psf.upfronthosting.co.za> Message-ID: <1492750090.94.0.665544721278.issue30114@psf.upfronthosting.co.za> Bob Ippolito added the comment: Agreed, this does seem unnecessary. The library has been in active use for over a decade, and this is the first time I've seen this request. I would recommend preprocessing the data that you're going to encode if you have a need for this. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 01:10:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Apr 2017 05:10:09 +0000 Subject: [issue30114] json module: it is not possible to override 'true', 'false' values during encoding bool In-Reply-To: <1492682646.2.0.186501711671.issue30114@psf.upfronthosting.co.za> Message-ID: <1492751409.59.0.807574222238.issue30114@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 01:29:44 2017 From: report at bugs.python.org (Aivar Annamaa) Date: Fri, 21 Apr 2017 05:29:44 +0000 Subject: [issue23551] IDLE to provide menu link to PIP gui. In-Reply-To: <1425155752.55.0.0736033483828.issue23551@psf.upfronthosting.co.za> Message-ID: <1492752584.79.0.612428962448.issue23551@psf.upfronthosting.co.za> Aivar Annamaa added the comment: In case this issue becomes active again, I'm listing my design implemented in Thonny IDE (http://thonny.org) -- see the attached png. If you decide same design is suitable for IDLE, then I'm happy to create a version of the dialog without Thonny dependencies. Here's the current source: https://bitbucket.org/plas/thonny/src/master/thonny/plugins/pip_gui.py?at=master&fileviewer=file-view-default ---------- nosy: +Aivar.Annamaa Added file: http://bugs.python.org/file46821/thonny_pip_gui.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 02:01:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Apr 2017 06:01:20 +0000 Subject: [issue30123] test_venv failed without pip Message-ID: <1492754480.34.0.492184084687.issue30123@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: $ ./python -m test.regrtest -vuall test_venv ... ====================================================================== FAIL: test_with_pip (test.test_venv.EnsurePipTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython3.5/Lib/test/test_venv.py", line 428, in test_with_pip self.do_test_with_pip(False) File "/home/serhiy/py/cpython3.5/Lib/test/test_venv.py", line 382, in do_test_with_pip self.assertEqual(err, "") AssertionError: '/tmp/tmpxhgghyhm/bin/python: No module named pip\n' != '' - /tmp/tmpxhgghyhm/bin/python: No module named pip ---------------------------------------------------------------------- ---------- components: Tests messages: 292009 nosy: serhiy.storchaka, vinay.sajip priority: normal severity: normal status: open title: test_venv failed without pip type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 02:24:03 2017 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 21 Apr 2017 06:24:03 +0000 Subject: [issue30123] test_venv failed without pip In-Reply-To: <1492754480.34.0.492184084687.issue30123@psf.upfronthosting.co.za> Message-ID: <1492755843.59.0.744247454015.issue30123@psf.upfronthosting.co.za> Vinay Sajip added the comment: I can't reproduce this on the master branch, with the latest checkout. Was this the branch your failure occurred on? $ ./python -m test.regrtest -vuall test_venv == CPython 3.7.0a0 (heads/master:f60c9e5, Apr 21 2017, 07:19:01) [GCC 5.4.0 20160609] == Linux-4.4.0-72-generic-x86_64-with-debian-stretch-sid little-endian == hash algorithm: siphash24 64bit == cwd: /home/vinay/projects/python/master/build/test_python_4297 == encodings: locale=UTF-8, FS=utf-8 Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0) Run tests sequentially 0:00:00 [1/1] test_venv test_defaults (test.test_venv.BasicTest) ... ok test_executable (test.test_venv.BasicTest) ... ok test_executable_symlinks (test.test_venv.BasicTest) ... ok test_isolation (test.test_venv.BasicTest) ... ok test_overwrite_existing (test.test_venv.BasicTest) ... ok test_prefixes (test.test_venv.BasicTest) ... ok test_prompt (test.test_venv.BasicTest) ... ok test_symlinking (test.test_venv.BasicTest) ... ok test_unoverwritable_fails (test.test_venv.BasicTest) ... ok test_upgrade (test.test_venv.BasicTest) ... ok test_devnull (test.test_venv.EnsurePipTest) ... ok test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok test_with_pip (test.test_venv.EnsurePipTest) ... ok ---------------------------------------------------------------------- Ran 14 tests in 9.336s OK 1 test OK. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 02:37:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Apr 2017 06:37:49 +0000 Subject: [issue30123] test_venv failed without pip In-Reply-To: <1492754480.34.0.492184084687.issue30123@psf.upfronthosting.co.za> Message-ID: <1492756669.74.0.930030129311.issue30123@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Actually I tested on 3.5 and 3.6. I can't reproduce on master. ---------- versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 02:51:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Apr 2017 06:51:08 +0000 Subject: [issue30123] test_venv failed without pip In-Reply-To: <1492754480.34.0.492184084687.issue30123@psf.upfronthosting.co.za> Message-ID: <1492757468.38.0.460981925993.issue30123@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Hmm, seems this is local issue of my environment. I now use very small disk, and after building several Python branches and running tests only 16 MB of free space were left. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 03:26:39 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 07:26:39 +0000 Subject: [issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492759599.37.0.711265051231.issue30104@psf.upfronthosting.co.za> Mark Dickinson added the comment: Dimitry: thank you! Indeed, that looks like the very same issue. It's a shame to have to use -fno-strict-aliasing here, since that might prevent legitimate optimisations elsewhere in the code. But if that's what we have to do to maintain correctness with clang, then I guess we have little choice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 03:46:10 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 07:46:10 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492760770.45.0.211838460094.issue30104@psf.upfronthosting.co.za> Mark Dickinson added the comment: I seem the same issues on OS X (10.9.5) when compiling with clang 4.0 from MacPorts. So this doesn't seem to be FreeBSD-specific. Changing title and raising priority: failure for repr (and marshal, JSON, etc.) to roundtrip seems like a critical breakage to me. mdickinson$ CC=/opt/local/bin/clang-mp-4.0 ./configure && make && ./python.exe -m test test_strtod [... log from successful build omitted ...] Run tests sequentially 0:00:00 [1/1] test_strtod test test_strtod failed -- multiple errors occurred; run in verbose mode for details test_strtod failed 1 test failed: test_strtod Total duration: 65 ms Tests result: FAILURE ---------- priority: normal -> critical title: Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot -> clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 03:55:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Apr 2017 07:55:57 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492761357.32.0.104573167689.issue29802@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 17db4b99b4d300a9b024ba0efdaa46d05d4f4cd3 by Serhiy Storchaka in branch '3.5': [3.5] bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (GH-1217) (#1219) https://github.com/python/cpython/commit/17db4b99b4d300a9b024ba0efdaa46d05d4f4cd3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 04:46:03 2017 From: report at bugs.python.org (Segev Finer) Date: Fri, 21 Apr 2017 08:46:03 +0000 Subject: [issue29191] liblzma is missing from pcbuild.sln In-Reply-To: <1483778935.32.0.9795840646.issue29191@psf.upfronthosting.co.za> Message-ID: <1492764363.95.0.465784015627.issue29191@psf.upfronthosting.co.za> Segev Finer added the comment: The PR was merged for Python 3.7. But this also affects older Python 3 versions that include liblzma/_lzma as far as I can tell. So I'm not closing this issue just yet, so that it will serve as a remainder, in case you do want to back port this. Thanks for merging! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 04:49:41 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 08:49:41 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492764581.39.0.890145606131.issue30104@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- components: +Build _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 05:00:40 2017 From: report at bugs.python.org (Louie Lu) Date: Fri, 21 Apr 2017 09:00:40 +0000 Subject: [issue30118] Adding unittest for cProfile / profile command line interface In-Reply-To: <1492702767.19.0.167930409114.issue30118@psf.upfronthosting.co.za> Message-ID: <1492765240.57.0.912914459236.issue30118@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1350 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 05:24:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 09:24:36 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492766676.58.0.0167890255199.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 28205b203a4742c40080b4a2b4b2dcd800716edc by Victor Stinner in branch 'master': bpo-30104: Use -fno-strict-aliasing on clang (#1221) https://github.com/python/cpython/commit/28205b203a4742c40080b4a2b4b2dcd800716edc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 05:28:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 09:28:55 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 Message-ID: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> New submission from STINNER Victor: My change 28205b203a4742c40080b4a2b4b2dcd800716edc added -fno-strict-aliasing on clang to fix the compilation of Python/dtoa.c on clang 4.0. But it's only a temporary workaround until dtoa.c is fixed to respect C99 strict aliasing. Strict aliasing allows the compiler to enable more optimization, and so should make Python a little bit faster. It would only fix a regression, before my change Python was already build with strict aliasing More info about the issue: * bpo-30104 * https://bugs.llvm.org//show_bug.cgi?id=31928 ---------- components: Build messages: 292018 nosy: benjamin.peterson, haypo, mark.dickinson priority: normal severity: normal status: open title: Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 05:31:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 09:31:41 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492767101.92.0.0942370214074.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: Mark: "I seem the same issues on OS X (10.9.5) when compiling with clang 4.0 from MacPorts. So this doesn't seem to be FreeBSD-specific." I confirm, I reproduced the bug on Linux using Clang 4.0. Mark: "But if that's what we have to do to maintain correctness with clang, then I guess we have little choice." I pushed my change adding -fno-strict-aliasing compiler option to clang. I created the issue #30124 to fix the aliasing issue in dtoa.c. I didn't check yet if we have to backport the -fno-strict-aliasing change, maybe we can wait until the aliasing issue is fixed and backport this future fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 05:41:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 09:41:44 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492767704.89.0.177956169236.issue30124@psf.upfronthosting.co.za> STINNER Victor added the comment: I hope that you understand aliasing issues, because I don't undertand them well :-D So I started to create my collection of links on the topic: https://haypo-notes.readthedocs.io/misc.html#c-aliasing The most interesting link is: http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 06:04:39 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 10:04:39 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492769079.72.0.561928108721.issue30104@psf.upfronthosting.co.za> Mark Dickinson added the comment: FWIW, I can confirm that adding `-fno-strict-aliasing` fixes all failing float-related tests on OS X. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 06:07:03 2017 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 Apr 2017 10:07:03 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492769223.22.0.421009448241.issue30104@psf.upfronthosting.co.za> Changes by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 06:12:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 10:12:11 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492769531.2.0.918134624344.issue30104@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1351 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 06:13:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 10:13:29 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492769609.63.0.321530844211.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh... I only tested my configure patch on Linux using ./configure CC=clang, but the change has no effect on FreeBSD where $CC is /usr/bin/cc and so my code doesn't detect clang correctly. I proposed https://github.com/python/cpython/pull/1233 which runs "cc --version" to check if it contains clang. I tested this change on FreeBSD: it works ;-) (it adds -fno-strict-aliasing) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 06:20:46 2017 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 21 Apr 2017 10:20:46 +0000 Subject: [issue30115] test_logging report reference leak In-Reply-To: <1492686184.18.0.863470787856.issue30115@psf.upfronthosting.co.za> Message-ID: <1492770046.3.0.517540487126.issue30115@psf.upfronthosting.co.za> Vinay Sajip added the comment: Also getting values I'm not sure how to interpret: $ ./python -m test.regrtest -R : test_logging Run tests sequentially 0:00:00 [1/1] test_logging beginning 9 repetitions 123456789 ......... test_logging leaked [-164, 164, -164, 0] references, sum=-164 test_logging leaked [-54, 56, -54, 2] memory blocks, sum=-50 test_logging failed in 2 min 57 sec How can you be sure the problem is here rather than in the reference leak checks? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 06:35:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 10:35:26 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1492770926.18.0.0560132101289.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 35f3d240ee5f0958034bd500949b08764e36f4dc by Victor Stinner in branch 'master': bpo-30104: configure now detects when cc is clang (#1233) https://github.com/python/cpython/commit/35f3d240ee5f0958034bd500949b08764e36f4dc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 06:58:59 2017 From: report at bugs.python.org (Mathieu Poussin) Date: Fri, 21 Apr 2017 10:58:59 +0000 Subject: [issue28414] SSL match_hostname fails for internationalized domain names In-Reply-To: <1476172956.13.0.85556243538.issue28414@psf.upfronthosting.co.za> Message-ID: <1492772339.19.0.514185564312.issue28414@psf.upfronthosting.co.za> Mathieu Poussin added the comment: Hello Christian. Is there any update about this issue ? Do we have any alternative to avoid this problem ? Thank you. ---------- nosy: +kedare _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 07:22:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 11:22:41 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1492773761.45.0.988527028153.issue30106@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1352 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 07:23:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 11:23:32 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1492773812.27.0.202562412533.issue30106@psf.upfronthosting.co.za> STINNER Victor added the comment: > AssertionError: join() timed out The following PR fixes this race condition which occurs on FreeBSD: https://github.com/python/cpython/pull/1234 fixes ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 07:51:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 11:51:55 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1492775515.31.0.852216439511.issue30106@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a2c877c3985aba4adb19755e21f477e1c639cfd9 by Victor Stinner in branch 'master': bpo-30106: Fix test_asyncore.test_quick_connect() (#1234) https://github.com/python/cpython/commit/a2c877c3985aba4adb19755e21f477e1c639cfd9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 07:58:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 11:58:01 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1492775881.96.0.161195507249.issue30107@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1353 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 07:59:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 11:59:01 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492770926.18.0.0560132101289.issue30104@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Ok, the FreeBSD CURRENT buildbot is repaired: "AMD64 FreeBSD CURRENT Debug 3.x is complete: Success". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:08:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:08:44 +0000 Subject: [issue30054] Expose tracemalloc C API to track/untrack memory blocks In-Reply-To: <1492004545.36.0.222275200226.issue30054@psf.upfronthosting.co.za> Message-ID: <1492776524.8.0.288657619925.issue30054@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1354 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:09:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:09:03 +0000 Subject: [issue30054] Expose tracemalloc C API to track/untrack memory blocks In-Reply-To: <1492004545.36.0.222275200226.issue30054@psf.upfronthosting.co.za> Message-ID: <1492776543.24.0.447575227139.issue30054@psf.upfronthosting.co.za> STINNER Victor added the comment: @jtaylor: Ok, I created https://github.com/python/cpython/pull/1236 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:23:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:23:18 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" Message-ID: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> New submission from STINNER Victor: Attached PR removes the following scary log. http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.x/builds/655/steps/test/logs/stdio Windows fatal exception: access violation Current thread 0x00000b88 (most recent call first): File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\case.py", line 178 in handle File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\case.py", line 733 in assertRaises File "D:\buildarea\3.x.ware-win81-release\build\lib\ctypes\test\test_win32.py", line 47 in test_SEH File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\case.py", line 605 in run File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\case.py", line 653 in __call__ File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 122 in run File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\suite.py", line 84 in __call__ File "D:\buildarea\3.x.ware-win81-release\build\lib\unittest\runner.py", line 176 in run File "D:\buildarea\3.x.ware-win81-release\build\lib\test\support\__init__.py", line 1896 in _run_suite File "D:\buildarea\3.x.ware-win81-release\build\lib\test\support\__init__.py", line 1930 in run_unittest File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\runtest.py", line 164 in test_runner File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\runtest.py", line 165 in runtest_inner File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\runtest.py", line 119 in runtest File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\runtest_mp.py", line 71 in run_tests_slave File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\main.py", line 470 in _main File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\main.py", line 463 in main File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\main.py", line 527 in main File "D:\buildarea\3.x.ware-win81-release\build\lib\test\regrtest.py", line 46 in _main File "D:\buildarea\3.x.ware-win81-release\build\lib\test\regrtest.py", line 50 in File "D:\buildarea\3.x.ware-win81-release\build\lib\runpy.py", line 85 in _run_code File "D:\buildarea\3.x.ware-win81-release\build\lib\runpy.py", line 193 in _run_module_as_main ---------- components: Windows messages: 292030 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_SEH() of test_ctypes logs "Windows fatal exception: access violation" versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:23:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:23:48 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" In-Reply-To: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> Message-ID: <1492777428.6.0.780578874028.issue30125@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1355 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:26:13 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 12:26:13 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492777573.86.0.373185674091.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: dtoa.c *does* (arguably) respect C99+TC3 strict aliasing. The union trick has long been used as a safe and supported way to do this kind of thing, though it appears there's still disagreement about exactly what the standard intends. I'd strongly prefer not to modify dtoa.c here unless we really have to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:26:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:26:34 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger Message-ID: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> New submission from STINNER Victor: I suggest to skip the following test on OS X Tiger, since it fails but I'm not interested to fix it and it seems to be an old SQLite bug which was fixed after Tiger was released (I don't see this failure on any other buildbot). http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/569/steps/test/logs/stdio ====================================================================== FAIL: CheckTraceCallbackContent (sqlite3.test.hooks.TraceCallbackTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/sqlite3/test/hooks.py", line 270, in CheckTraceCallbackContent self.assertEqual(traced_statements, queries) AssertionError: Lists differ: ['cre[19 chars]'insert into foo(x) values(1)', 'insert into foo(x) values(1)'] != ['cre[19 chars]'insert into foo(x) values(1)'] First list contains 1 additional elements. First extra element 2: 'insert into foo(x) values(1)' + ['create table foo(x)', 'insert into foo(x) values(1)'] - ['create table foo(x)', - 'insert into foo(x) values(1)', - 'insert into foo(x) values(1)'] ---------------------------------------------------------------------- ---------- components: Tests, macOS messages: 292032 nosy: haypo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:30:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:30:20 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492777820.54.0.632280562938.issue30126@psf.upfronthosting.co.za> STINNER Victor added the comment: SQLite version: Re-running test 'test_sqlite' in verbose mode test_sqlite: testing with version '2.6.0', sqlite_version '3.6.11' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:31:32 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 12:31:32 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492777892.49.0.451070968547.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: In case anyone wants to have a go at interpreting the standard, the most immediately relevant part is the footnote to C99+TC3 6.5.2.3p3: """ If the member used to access the contents of a union object is not the same as the member last used to store a value in the object, the appropriate part of the object representation of the value is reinterpreted as an object representation in the new type as described in 6.2.6 (a process sometimes called "type punning"). This might be a trap representation. """ Trap representations could potentially cause undefined behaviour, but are highly unlikely to occur in practice for us for this particular case, so I don't think they can possibly serve as the excuse for clang's behaviour. The "reinterpreted as ..." language here strongly suggests that the union trick should be supported. OTOH, this is just a footnote, so not normative ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:31:52 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 12:31:52 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492777912.97.0.207679970824.issue30124@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:32:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:32:00 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492777920.49.0.324648232635.issue30126@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1356 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:33:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:33:50 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492778030.79.0.788067720433.issue30126@psf.upfronthosting.co.za> STINNER Victor added the comment: The test is already skipped on SQLite version older than 3.3.9, no idea why the test fails on SQLite version 3.6.11 on OS X Tiger: @unittest.skipIf(sqlite.sqlite_version_info < (3, 3, 9), "sqlite3_prepare_v2 is not available") I proposed the PR https://github.com/python/cpython/pull/1238 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:37:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:37:20 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492778240.61.0.1956334032.issue30126@psf.upfronthosting.co.za> STINNER Victor added the comment: It's even more strange. The test started to fail since this build, Sun Apr 9 10:10:15 2017: http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/528 test_sqlite: testing with version '2.6.0', sqlite_version '3.6.11' ... test test_sqlite failed Sadly, before the test passed and so the SQLite version wasn't logged: http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/527/steps/test/logs/stdio 0:26:24 [227/404/1] test_sqlite passed @David Bolen: Did you make a change, like an upgrade, on this buildbot slave around Apr 9, 2017? ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:42:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:42:07 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492778527.4.0.866541780763.issue30124@psf.upfronthosting.co.za> STINNER Victor added the comment: > I'd strongly prefer not to modify dtoa.c here unless we really have to. See the clang bug report: https://bugs.llvm.org//show_bug.cgi?id=31928 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:46:54 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 12:46:54 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492778814.98.0.248556752374.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: And the basic rule that bans aliasing in the first place is C99 6.5p7: """ An object shall have its stored value accessed only by an lvalue expression that has one of the following types ... """ But I'd argue that the "an aggregate or union type" subclause of 6.5p7 covers this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:48:11 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 12:48:11 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492778891.0.0.90744054311.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: > See the clang bug report: Yes, I've read it. And I think the Clang folks are wrong in their interpretation of the standard. And even if they're not, they're going to break a lot of code with this change: the union trick has been widely accepted as a valid way to do things. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 08:59:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 12:59:46 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492779586.22.0.767427033541.issue30124@psf.upfronthosting.co.za> STINNER Victor added the comment: > Yes, I've read it. And I think the Clang folks are wrong in their interpretation of the standard. And even if they're not, they're going to break a lot of code with this change: the union trick has been widely accepted as a valid way to do things. If Clang decides or not to handle union will decide if Python has or has no to change dtoa.c :-) (I would prefer to keep -fstrict-aliasing). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 09:09:52 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 21 Apr 2017 13:09:52 +0000 Subject: [issue30122] Added missing archive programs and close option to Windows docs. In-Reply-To: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> Message-ID: <1492780192.43.0.893157810977.issue30122@psf.upfronthosting.co.za> R. David Murray added the comment: Please close the redundant PRs. I've commented on pr1228. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 09:11:20 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 21 Apr 2017 13:11:20 +0000 Subject: [issue30122] Added missing archive programs and close option to Windows docs. In-Reply-To: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> Message-ID: <1492780280.29.0.853643845136.issue30122@psf.upfronthosting.co.za> R. David Murray added the comment: To be clear: backport PRs should be created only after a PR has been approved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 09:18:20 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 21 Apr 2017 13:18:20 +0000 Subject: [issue30122] Added missing archive programs and close option to Windows docs. In-Reply-To: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> Message-ID: <1492780700.88.0.0918090186996.issue30122@psf.upfronthosting.co.za> R. David Murray added the comment: Also, please review the (newly rewritten) section in the devguide about PRs. I see now that there were changes made from the original here already, but I don't see the commits that made those changes. The history of changes should be kept during PR development (they get squashed at the end). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 09:20:52 2017 From: report at bugs.python.org (Diego Costantini) Date: Fri, 21 Apr 2017 13:20:52 +0000 Subject: [issue30127] argparse action not correctly describing the right behavior Message-ID: <1492780852.4.0.162539678149.issue30127@psf.upfronthosting.co.za> New submission from Diego Costantini: Here https://docs.python.org/2/library/argparse.html#action we have the following: >>> parser = argparse.ArgumentParser() >>> parser.add_argument('--foo', action='store_true') >>> parser.add_argument('--bar', action='store_false') >>> parser.add_argument('--baz', action='store_false') >>> parser.parse_args('--foo --bar'.split()) Namespace(bar=False, baz=True, foo=True) baz should be False because omitted. I also tested it. ---------- assignee: docs at python components: Documentation messages: 292044 nosy: Diego Costantini, docs at python priority: normal severity: normal status: open title: argparse action not correctly describing the right behavior type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 09:28:01 2017 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 Apr 2017 13:28:01 +0000 Subject: [issue30127] argparse action not correctly describing the right behavior In-Reply-To: <1492780852.4.0.162539678149.issue30127@psf.upfronthosting.co.za> Message-ID: <1492781281.92.0.597731514169.issue30127@psf.upfronthosting.co.za> Eric V. Smith added the comment: I think the example is correct. Because baz's action is store_false, the default is True. So if baz is omitted, it should have a True value. That's what the example shows, and what I see when I run this code. Can you show what you tested, what you saw, and what you expected? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 09:44:59 2017 From: report at bugs.python.org (Diego Costantini) Date: Fri, 21 Apr 2017 13:44:59 +0000 Subject: [issue30127] argparse action not correctly describing the right behavior In-Reply-To: <1492780852.4.0.162539678149.issue30127@psf.upfronthosting.co.za> Message-ID: <1492782299.51.0.657759979429.issue30127@psf.upfronthosting.co.za> Diego Costantini added the comment: You are right, I misunderstood the part where it sets defaults opposite to the stored value, although apparently over one year ago I did understand it correctly when I first went through that documentation. Today my second pair of eyes had my same understanding of it though :) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 10:17:02 2017 From: report at bugs.python.org (=?utf-8?b?0JzQuNGF0LDQudC70L4g0JPQsNCy0LXQu9GP?=) Date: Fri, 21 Apr 2017 14:17:02 +0000 Subject: [issue26264] keyword module missing async and await keywords In-Reply-To: <1454378786.53.0.925531991818.issue26264@psf.upfronthosting.co.za> Message-ID: <1492784222.24.0.919530326805.issue26264@psf.upfronthosting.co.za> Changes by ??????? ?????? : ---------- pull_requests: +1357 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 10:21:42 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 14:21:42 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492784502.63.0.403440183037.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: > (I would prefer to keep -fstrict-aliasing). Updating dtoa.c would be a large and error-prone task. It may be simpler to adjust the buildsystem so that we can specify -fno-strict-aliasing just for dtoa.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 10:23:00 2017 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 21 Apr 2017 14:23:00 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492784580.71.0.258884433093.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Updating dtoa.c would be a large and error-prone task. It would also take us even further away from the upstream sources, making it harder to integrate bugfixes from upstream. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 10:27:21 2017 From: report at bugs.python.org (Ralph Corderoy) Date: Fri, 21 Apr 2017 14:27:21 +0000 Subject: [issue30128] xid_start definition for Unicode identifiers refers to xid_continue Message-ID: <1492784841.26.0.847903278881.issue30128@psf.upfronthosting.co.za> New submission from Ralph Corderoy: https://docs.python.org/3/reference/lexical_analysis.html#identifiers has a grammar. identifier ::= xid_start xid_continue* id_start ::= id_continue ::= xid_start ::= xid_continue ::= I struggle to make sense of it unless I remove `xid_continue*' from `xid_start's definition. I suspect it ended up there due to cut and paste. ---------- assignee: docs at python components: Documentation messages: 292049 nosy: docs at python, ralph.corderoy priority: normal severity: normal status: open title: xid_start definition for Unicode identifiers refers to xid_continue versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 10:27:51 2017 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 21 Apr 2017 14:27:51 +0000 Subject: [issue30129] functools.partialmethod should look more like what it's impersonating. Message-ID: <1492784871.01.0.595019366474.issue30129@psf.upfronthosting.co.za> New submission from Skip Montanaro: I needed to create a partial method in Python 2.7, so I grabbed functools.partialmethod from a Python 3.5.2 install. For various reasons, one of the reasons I wanted this was to suck in some methods from a delegated class so they appeared in dir() and help() output on the primary class (the one containing the partialmethod objects). Suppose I have class Something: def meth(self, arg1, arg2): "meth doc" return arg1 + arg2 then in the metaclass for another class I construct an attribute (call it "mymeth") which is a partialmethod object. When I (for example), run pydoc, that other class's attribute appears as: mymeth = It would be nice if it at least included the doc string from meth, something like: mymeth = meth doc Even better would be a proper signature: mymeth(self, arg1, arg2) meth doc In my copy of functools.partialmethod, I inserted an extra line in __get__, right after the call to partial(): results.__doc__ = self.func.__doc__ That helps a bit, as I can print("mymeth doc:", inst.mymeth.__doc__) and see mymeth doc: meth doc displayed. That's not enough for help()/pydoc though. I suspect the heavy lifting will have to be done in pydoc.Doc.document(). inspect.isroutine() returns False for functools.partial objects. I also see _signature_get_partial() in inspect.py. That might be the source of the problem. When I create a partialmethod object in my little example, it actually looks like a functools.partial object, not a partialmethod object. It's not clear that this test: if isinstance(partialmethod, functools.partialmethod): in inspect._signature_from_callable() is testing for the correct type. Apologies that I can't easily provide a detailed example. My Python 2.x metaclass example (where I'm smashing methods from one class into another) doesn't work in Python 3.x for some reason, the whole partialmethod thing isn't available in Python 2.x (inspect doesn't know about partialmethod or partial) and it's not really a "hello world"-sized example anyway. I'll beat on things a bit more to try and craft a workable Python 3.x example. ---------- components: Library (Lib) messages: 292050 nosy: skip.montanaro priority: normal severity: normal status: open title: functools.partialmethod should look more like what it's impersonating. type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 10:39:37 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 21 Apr 2017 14:39:37 +0000 Subject: [issue30129] functools.partialmethod should look more like what it's impersonating. In-Reply-To: <1492784871.01.0.595019366474.issue30129@psf.upfronthosting.co.za> Message-ID: <1492785577.5.0.501960582607.issue30129@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, please do provide an example. Your final words do not make a convincing case that this is a problem in python3 :) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 10:54:28 2017 From: report at bugs.python.org (Aviv Palivoda) Date: Fri, 21 Apr 2017 14:54:28 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492786468.34.0.680685218291.issue30126@psf.upfronthosting.co.za> Aviv Palivoda added the comment: > It's even more strange. The test started to fail since this build, Sun Apr 9 10:10:15 2017: This was merged on Apr 9 (commit 0e6cb2ea624570ed08c354f1ed1f595dab4192d6). >From a quick look in the internet some other people had a similar problem: http://stackoverflow.com/questions/28973887/how-to-fix-sqlite3-libversion-mismatch It seems there might be mismatch between sqlite3_libversion() and SQLITE_VERSION. I am not familiar with the buildbots but can you run a test that check that sqlite3_libversion() == SQLITE_VERSION? ---------- nosy: +palaviv _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 11:00:36 2017 From: report at bugs.python.org (Alexander Gosselin) Date: Fri, 21 Apr 2017 15:00:36 +0000 Subject: [issue30130] array.array is not an instance of collections.MutableSequence Message-ID: <1492786836.55.0.150930236704.issue30130@psf.upfronthosting.co.za> New submission from Alexander Gosselin: array.array has all of the methods required by collections.MutableSequence, but: >>> import array >>> import collections >>> isinstance(array.array, collections.MutableSequence) False ---------- messages: 292053 nosy: Alexander Gosselin priority: normal severity: normal status: open title: array.array is not an instance of collections.MutableSequence type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 11:15:24 2017 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 Apr 2017 15:15:24 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1492787724.76.0.9662276064.issue30124@psf.upfronthosting.co.za> Eric V. Smith added the comment: I agree we shouldn't do anything heroic to "fix" dtoa.c. I'd wait and see if Gay (or other maintainers) will chose an approach if Clang keeps this behavior. At most, I think Mark's idea to use -fno-strict-aliasing only on dtoa.c and nowhere else would be the better approach. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 11:34:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 15:34:06 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492788846.07.0.176963313213.issue30126@psf.upfronthosting.co.za> STINNER Victor added the comment: > It seems there might be mismatch between sqlite3_libversion() and SQLITE_VERSION. I am not familiar with the buildbots but can you run a test that check that sqlite3_libversion() == SQLITE_VERSION? The Python sqlite3 exports sqlite3_libversion() as sqlite3.sqlite_version, "3.6.11" on OS X Tiger. The doc https://sqlite.org/c3ref/libversion.html says "These interfaces [sqlite3_libversion()] provide the same information as the SQLITE_VERSION, ..." I don't know how to check, I don't have access to the buildbot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 11:43:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 15:43:40 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" In-Reply-To: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> Message-ID: <1492789420.95.0.399730716565.issue30125@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 11:59:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 15:59:26 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1492790366.19.0.564824211967.issue30107@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2a1aed04b0943636f605543522e16cca1dc23e70 by Victor Stinner in branch 'master': bpo-30107: don't dump core on expected test_io crash (#1235) https://github.com/python/cpython/commit/2a1aed04b0943636f605543522e16cca1dc23e70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:00:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:00:25 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1492790425.5.0.619706052093.issue30107@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1359 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:06:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:06:15 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" In-Reply-To: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> Message-ID: <1492790775.81.0.580139749648.issue30125@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 46c2b81026bbf966c0898a1fa30d98c33673aea0 by Victor Stinner in branch 'master': bpo-30125: Fix faulthandler.disable() on Windows (#1240) https://github.com/python/cpython/commit/46c2b81026bbf966c0898a1fa30d98c33673aea0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:12:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:12:01 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread Message-ID: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> New submission from STINNER Victor: Example on Windows from AppVeyor: https://ci.appveyor.com/project/python/cpython/build/3.7.0a0.1402 Warning -- threading._dangling was modified by test_logging Before: <_weakrefset.WeakSet object at 0x027CBE30> After: <_weakrefset.WeakSet object at 0x027CBFF0> I also saw this warning on FreeBSD buildbots. ---------- components: Tests messages: 292058 nosy: haypo priority: normal severity: normal status: open title: test_logging leaks a "dangling" thread type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:13:03 2017 From: report at bugs.python.org (Eric Appelt) Date: Fri, 21 Apr 2017 16:13:03 +0000 Subject: [issue30117] test_lib2to3.test_parser.test_all_project_files() fails In-Reply-To: <1492692321.21.0.476906243501.issue30117@psf.upfronthosting.co.za> Message-ID: <1492791183.02.0.974373946755.issue30117@psf.upfronthosting.co.za> Changes by Eric Appelt : ---------- pull_requests: +1360 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:14:58 2017 From: report at bugs.python.org (Eric Appelt) Date: Fri, 21 Apr 2017 16:14:58 +0000 Subject: [issue30117] test_lib2to3.test_parser.test_all_project_files() fails In-Reply-To: <1492692321.21.0.476906243501.issue30117@psf.upfronthosting.co.za> Message-ID: <1492791298.02.0.628814416706.issue30117@psf.upfronthosting.co.za> Eric Appelt added the comment: I added a PR to fix these two (in my opinion) spurious failure conditions in the lib2to3.tests.test_parser.TestParserIdempotency test_parser test with the following changes to the test: 1. Use the same encoding found in the initial file to write a temp file for a diff. This retains the BOM if the encoding was initially utf-8-sig. 2. If the file cannot be parsed using the normal grammar, try again with no print statement which should succeed for valid files using future print_function For case (1), the driver was correctly handling a BOM in a utf-8 file, but then the test was not writing a comparison file using 'utf-8-sig' to diff against, so the BOM got removed. I don't think that is the fault of the parser, and lib2to3 will retain the BOM. For case (2), lib2to3 pre-detects the use of from __future__ import print_function or allows the user to force this interpretation with a -p flag, and then selects a different grammar with the print statement removed. That makes the test cases unfair to this test as the driver itself doesn't know which grammar to use. As a minimal fix, the test will try using a grammar with the print statement, and if that fails fall back on a grammar without it. A more thorough handling of the idempotency test would to be to parse all files using both grammars and ignore if one of the two failed but otherwise check both. I didn't think this was necessary but can change. ---------- nosy: +Eric Appelt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:15:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:15:23 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" In-Reply-To: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> Message-ID: <1492791323.34.0.991617707488.issue30125@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1361 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:17:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:17:40 +0000 Subject: [issue30132] test_distutils leaks a vc140.pdb file Message-ID: <1492791460.36.0.72947186821.issue30132@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/566/steps/test/logs/stdio Warning -- files was modified by test_distutils Before: [] After: ['vc140.pdb'] ---------- components: Tests, Windows messages: 292060 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_distutils leaks a vc140.pdb file type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:17:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:17:47 +0000 Subject: [issue30132] [Windows] test_distutils leaks a vc140.pdb file In-Reply-To: <1492791460.36.0.72947186821.issue30132@psf.upfronthosting.co.za> Message-ID: <1492791467.88.0.162262680543.issue30132@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: test_distutils leaks a vc140.pdb file -> [Windows] test_distutils leaks a vc140.pdb file _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:25:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:25:36 +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: <1492791936.57.0.654550027824.issue17703@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:27:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:27:31 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1492792051.96.0.295413668771.issue30107@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b984a05d557e78b928f38098d0b6c0e95f737b9a by Victor Stinner in branch '3.6': bpo-30107: don't dump core on expected test_io crash (#1235) (#1241) https://github.com/python/cpython/commit/b984a05d557e78b928f38098d0b6c0e95f737b9a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:28:48 2017 From: report at bugs.python.org (Sanket Dasgupta) Date: Fri, 21 Apr 2017 16:28:48 +0000 Subject: [issue30085] Discourage operator.__dunder__ functions In-Reply-To: <1492396029.61.0.720198059802.issue30085@psf.upfronthosting.co.za> Message-ID: <1492792128.06.0.796676986346.issue30085@psf.upfronthosting.co.za> Sanket Dasgupta added the comment: @terry, I have updated the same, thanks! ---------- nosy: +sanketdg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:29:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:29:11 +0000 Subject: [issue30121] Windows: subprocess debug assertion on failure to execute the process In-Reply-To: <1492728235.69.0.898513798091.issue30121@psf.upfronthosting.co.za> Message-ID: <1492792151.53.0.12544749774.issue30121@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:33:23 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Fri, 21 Apr 2017 16:33:23 +0000 Subject: [issue30130] array.array is not an instance of collections.MutableSequence In-Reply-To: <1492786836.55.0.150930236704.issue30130@psf.upfronthosting.co.za> Message-ID: <1492792403.05.0.448845692609.issue30130@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: Thanks for the bug report, Alexander. This is related, if not a superseder, of: https://bugs.python.org/issue29727 ---------- nosy: +Jim Fasarakis-Hilliard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:34:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:34:42 +0000 Subject: [issue29840] Avoid raising OverflowError in bool() In-Reply-To: <1489782446.56.0.355449112547.issue29840@psf.upfronthosting.co.za> Message-ID: <1492792482.94.0.0731594733187.issue29840@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, I dislike this change since it's non-obvious what/who is raising the OverflowError. If an object calls a function in __len__() and the function raises OverflowError, should we consider that object is "true"? In temptation to guess, I prefer to not guess but passthrough the exception. If you want to support bool(range(1<<1000)), we need to get the result of __len__() as a Python object rather than a C Py_ssize_t. Maybe, if __len__() raises an OverflowError: call again the len(), but using the "__len__" method instead of the slot? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:40:09 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Fri, 21 Apr 2017 16:40:09 +0000 Subject: [issue29950] Rename SlotWrapperType to WrapperDescriptorType In-Reply-To: <1490913155.68.0.921075997719.issue29950@psf.upfronthosting.co.za> Message-ID: <1492792809.03.0.270247836664.issue29950@psf.upfronthosting.co.za> Jim Fasarakis-Hilliard added the comment: This was added in python/typing just a couple of days ago, so I'm bumping to maybe get the PR to python/cpython merged too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:43:08 2017 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Apr 2017 16:43:08 +0000 Subject: [issue29191] liblzma is missing from pcbuild.sln In-Reply-To: <1483778935.32.0.9795840646.issue29191@psf.upfronthosting.co.za> Message-ID: <1492792988.96.0.767559485137.issue29191@psf.upfronthosting.co.za> Steve Dower added the comment: Yeah, merging into master is easy right now, but backports are still manual effort. It should only require 3.6, so I'll try to get to it today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:49:49 2017 From: report at bugs.python.org (Steve Dower) Date: Fri, 21 Apr 2017 16:49:49 +0000 Subject: [issue29191] liblzma is missing from pcbuild.sln In-Reply-To: <1483778935.32.0.9795840646.issue29191@psf.upfronthosting.co.za> Message-ID: <1492793389.05.0.583536842391.issue29191@psf.upfronthosting.co.za> Changes by Steve Dower : ---------- pull_requests: +1362 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 12:57:30 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 16:57:30 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1492793850.47.0.0243989988198.issue23404@psf.upfronthosting.co.za> STINNER Victor added the comment: FYI 3 FreeBSD buildbots are currently broken because of this issue. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 13:00:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 17:00:53 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1492794053.94.0.341693918405.issue23404@psf.upfronthosting.co.za> STINNER Victor added the comment: > Anyway my preference was to stop automatically regenerating files, and to keep the build system as simple as practical without hacks like the BOOT="#" flag. In the past, this issue bite me so many times on Solaris, FreeBSD, etc. One because there was not "python" command, then because "python" was an old python 2.6 and so hg touch didn't work, etc. It's "nice" to try to keep track of build dependencies, but in pratice it is super painful. So I'm also in favor of removing these build dependencies based on file modification file, and maybe document how to force a rebuild (do you really need to do that? developers hacking special files know how to rebuild generated files, no?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 13:04:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 17:04:47 +0000 Subject: [issue30060] Crash on Py_Finalize if Py_NoSiteFlag is used In-Reply-To: <1492020071.31.0.759008537591.issue30060@psf.upfronthosting.co.za> Message-ID: <1492794287.59.0.307399846126.issue30060@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 13:35:20 2017 From: report at bugs.python.org (Alexander Gosselin) Date: Fri, 21 Apr 2017 17:35:20 +0000 Subject: [issue30130] array.array is not an instance of collections.MutableSequence In-Reply-To: <1492786836.55.0.150930236704.issue30130@psf.upfronthosting.co.za> Message-ID: <1492796120.43.0.97856581395.issue30130@psf.upfronthosting.co.za> Alexander Gosselin added the comment: Thanks for taking a look at this. I think array is little used, so registering it as a member of some of the abstract base classes in collections could easily have been overlooked. One of the prerequisites for membership in MutableSequence is a .clear() method, and array doesn't have one, though there is no reason why it shouldn't. Here's the workaround that I'm using: import array import collections class array(array.array, collections.MutableSequence): __slots__ = () def __reversed__(self): # this is a bit hacky return reversed(self.tolist()) def clear(self): self.__setitem__(slice(None), self.__class__(self.typecode)) Here are some results: >>> a = array('f', [1,2,3,4]) >>> list(reversed(a)) [4.0, 3.0, 2.0, 1.0] >>> a.clear() >>> a array('f') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 14:04:30 2017 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 21 Apr 2017 18:04:30 +0000 Subject: [issue30129] functools.partialmethod should look more like what it's impersonating. In-Reply-To: <1492785577.5.0.501960582607.issue30129@psf.upfronthosting.co.za> Message-ID: Skip Montanaro added the comment: Yeah, sorry about that. I work in an environment where I can't "eject" any code from my work computer. I've come up with a simple Python3 example, but it will have to wait until I can recreate it from scratch on my home computer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 14:12:44 2017 From: report at bugs.python.org (cburroughs) Date: Fri, 21 Apr 2017 18:12:44 +0000 Subject: [issue29077] build failure when enabling dtrace on FreeBSD In-Reply-To: <1482779942.39.0.346100216113.issue29077@psf.upfronthosting.co.za> Message-ID: <1492798364.78.0.776234791271.issue29077@psf.upfronthosting.co.za> Changes by cburroughs : ---------- nosy: +cburroughs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 14:13:30 2017 From: report at bugs.python.org (Decorater) Date: Fri, 21 Apr 2017 18:13:30 +0000 Subject: [issue30122] Added missing archive programs. In-Reply-To: <1492747399.44.0.402463454209.issue30122@psf.upfronthosting.co.za> Message-ID: <1492798410.2.0.875306575851.issue30122@psf.upfronthosting.co.za> Decorater added the comment: Oh ---------- title: Added missing archive programs and close option to Windows docs. -> Added missing archive programs. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 14:16:10 2017 From: report at bugs.python.org (cburroughs) Date: Fri, 21 Apr 2017 18:16:10 +0000 Subject: [issue28787] Out of tree --with--dtrace builds fail with a traceback In-Reply-To: <1479982245.65.0.843842109576.issue28787@psf.upfronthosting.co.za> Message-ID: <1492798570.94.0.256368507193.issue28787@psf.upfronthosting.co.za> Changes by cburroughs : ---------- nosy: +cburroughs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 14:20:54 2017 From: report at bugs.python.org (cburroughs) Date: Fri, 21 Apr 2017 18:20:54 +0000 Subject: [issue28909] Adding LTTng-UST tracing support In-Reply-To: <1481227474.94.0.337411886613.issue28909@psf.upfronthosting.co.za> Message-ID: <1492798854.18.0.579941118995.issue28909@psf.upfronthosting.co.za> Changes by cburroughs : ---------- nosy: +cburroughs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 14:28:49 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 21 Apr 2017 18:28:49 +0000 Subject: [issue29191] liblzma is missing from pcbuild.sln In-Reply-To: <1483778935.32.0.9795840646.issue29191@psf.upfronthosting.co.za> Message-ID: <1492799329.08.0.0914732534516.issue29191@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 1ccbe6007e5569ab25170f8ecddd5fbbc2ef36b0 by Mariatta (Steve Dower) in branch '3.6': bpo-29191: Add liblzma.vcxproj to pcbuild.sln and other missing entries (GH-1222) (GH-1244) https://github.com/python/cpython/commit/1ccbe6007e5569ab25170f8ecddd5fbbc2ef36b0 ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 14:36:59 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 21 Apr 2017 18:36:59 +0000 Subject: [issue29191] liblzma is missing from pcbuild.sln In-Reply-To: <1483778935.32.0.9795840646.issue29191@psf.upfronthosting.co.za> Message-ID: <1492799819.34.0.376951172724.issue29191@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Thanks everyone :) I merged the backport PR, so I'm closing this issue. While backporting is still a manual effort, this utility script automates some part of it. https://github.com/python/core-workflow/tree/master/cherry_picker ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 14:55:21 2017 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 21 Apr 2017 18:55:21 +0000 Subject: [issue28909] Adding LTTng-UST tracing support In-Reply-To: <1481227474.94.0.337411886613.issue28909@psf.upfronthosting.co.za> Message-ID: <1492800921.64.0.171966958556.issue28909@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: Just a small note here for the documentation patch. yum is deprecated in Fedora, and dnf is now the default package manager, so the respective instructions for Fedora should reflect that. ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 15:39:31 2017 From: report at bugs.python.org (David Bolen) Date: Fri, 21 Apr 2017 19:39:31 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492803571.45.0.106089565167.issue30126@psf.upfronthosting.co.za> David Bolen added the comment: No recent changes to the buildbot (I think the last was in September to bump the local python used to run the slave/build installer to 2.7). The default system sqlite (/usr/lib) is 3.0.8.6, so extremely old, but 3.6.11 is in /usr/local/{lib,include} from early days of setting up the slave, so only marginally less old. As long as the python build process finds that (which it appears to) it should be consistent. I configured and built a local 3.x branch version of python on the slave and modified it to dump the version info during module initialization: > ./python.exe Python 3.7.0a0 (heads/master:d1ae24e, Apr 21 2017, 15:06:29) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 SQLITE_VERSION: 3.6.11 SQLITE_VERSION_NUMBER: 3006011 sqlite3_libversion: 3.6.11 so it appears to be in line. This local build still fails the test. Maybe whatever feature is needed for this test is broken with 3.6.11. One thing I did notice, though I suspect it's not an issue, but the 3.6.11 this slave is using seems to fall into the gap in the original bpo-9303 _v2 support patch where a _v2 prepare with a plain close (versions >= 3.3.9 and <3.7.14). Both plain and _v2 close methods have the same signature, but I wonder if there might be an issue mixing and matching? I don't think anything else has a hard dependency on my /usr/local libraries on the slave at this point (the dmg installer builds its own local copies), so I could try updating that to a more current sqlite3 if we wanted to see if that resolved the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 16:07:26 2017 From: report at bugs.python.org (David Bolen) Date: Fri, 21 Apr 2017 20:07:26 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492805246.64.0.779831944432.issue30126@psf.upfronthosting.co.za> David Bolen added the comment: The test appears to pass against a local test build of sqlite3 3.18.0, so I'll probably just plan on updating the slave to that later tonight. Unless anyone is interested in figuring out why it fails with 3.6.11 and not 3.18.0 (e.g., does the test have a higher minimum version than it currently declares). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 16:49:51 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 21 Apr 2017 20:49:51 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492807791.77.0.693945923464.issue30098@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset ae5b3260dd459845aad8a30491b76d471577785d by Mariatta (Charles Renwick) in branch 'master': bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170) https://github.com/python/cpython/commit/ae5b3260dd459845aad8a30491b76d471577785d ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 16:51:02 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 21 Apr 2017 20:51:02 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492807862.51.0.593903211671.issue30098@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: -> backport needed versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 17:17:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 21:17:35 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" In-Reply-To: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> Message-ID: <1492809455.93.0.518284687033.issue30125@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 3a8f8ea2aca46f9ef1e715f2c924357b6719525f by Victor Stinner in branch '3.6': bpo-30125: Fix faulthandler.disable() on Windows (#1243) https://github.com/python/cpython/commit/3a8f8ea2aca46f9ef1e715f2c924357b6719525f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 17:18:05 2017 From: report at bugs.python.org (Patrick Foley) Date: Fri, 21 Apr 2017 21:18:05 +0000 Subject: [issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions. Message-ID: <1492809485.52.0.0203844135424.issue30133@psf.upfronthosting.co.za> New submission from Patrick Foley: The following code demonstrates: import re text = 'ab\\' exp = re.compile('a') print(re.sub(exp, text, '')) If you remove the backslash(es), the code runs fine. This appears to be specific to the re module and only to strings that end in (even properly escaped) backslashes. You could easily receive raw data like this from freehand input sources so it would be nice not to have to remove trailing backslashes before running a regular expression. ---------- components: Regular Expressions files: sample.py messages: 292079 nosy: Patrick Foley, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions. versions: Python 2.7, Python 3.4 Added file: http://bugs.python.org/file46822/sample.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 17:51:01 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 21 Apr 2017 21:51:01 +0000 Subject: [issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions. In-Reply-To: <1492809485.52.0.0203844135424.issue30133@psf.upfronthosting.co.za> Message-ID: <1492811461.34.0.487800780101.issue30133@psf.upfronthosting.co.za> R. David Murray added the comment: I think you are missing a re.escape around text. Text is otherwise not a valid replacement pattern. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 18:31:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 22:31:15 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" In-Reply-To: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> Message-ID: <1492813875.6.0.575618201379.issue30125@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a36e939aeb3b5a2c56561eb24f0e339eee9f3f9d by Victor Stinner in branch 'master': bpo-30125: disable faulthandler in ctypes test_SEH (#1237) https://github.com/python/cpython/commit/a36e939aeb3b5a2c56561eb24f0e339eee9f3f9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:37:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 23:37:22 +0000 Subject: [issue29903] struct.Struct Addition In-Reply-To: <1490456688.43.0.618194339702.issue29903@psf.upfronthosting.co.za> Message-ID: <1492817842.15.0.725433206144.issue29903@psf.upfronthosting.co.za> STINNER Victor added the comment: I dislike this feature. I reject it: Serhiy, Raymond and me dislike it. I never needed this feature and a correct implementation can be very complex if you have to take care of endian, alignement, etc. It's trivial to implement you own add using the format attribute if you want the simple implementation format1+format2. ---------- nosy: +haypo resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:43:22 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Apr 2017 23:43:22 +0000 Subject: [issue30075] Printing ANSI Escape Sequences on Windows 10 In-Reply-To: <1492273260.15.0.200357892895.issue30075@psf.upfronthosting.co.za> Message-ID: <1492818202.11.0.0247171071065.issue30075@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This is a (duplicate) enhancement request, not a bug report. The superseder field is for when an issue is closed as a duplicate; I decided that this should be. Further discussion should be on python-ideas. ---------- nosy: +terry.reedy resolution: -> duplicate stage: -> resolved status: open -> closed type: behavior -> enhancement versions: +Python 3.7 -Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:43:37 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Apr 2017 23:43:37 +0000 Subject: [issue29059] Windows: Python not using ANSI compatible console In-Reply-To: <1482543191.02.0.407458515739.issue29059@psf.upfronthosting.co.za> Message-ID: <1492818217.89.0.373121051225.issue29059@psf.upfronthosting.co.za> Terry J. Reedy added the comment: In #30075, Tithen Firion reports that "subprocess.call('', shell=True)" leaves the console in ANSI mode. In Eryk Sun says that this is likely a bug in cmd.exe and gives improved code for putting the console in VT mode, when this is possible. I closed that issue as a duplicate of this. ---------- nosy: +terry.reedy stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:43:43 2017 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 21 Apr 2017 23:43:43 +0000 Subject: [issue30129] functools.partialmethod should look more like what it's impersonating. In-Reply-To: <1492784871.01.0.595019366474.issue30129@psf.upfronthosting.co.za> Message-ID: <1492818223.29.0.302360199546.issue30129@psf.upfronthosting.co.za> Changes by Skip Montanaro : Added file: http://bugs.python.org/file46823/partial3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:43:54 2017 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 21 Apr 2017 23:43:54 +0000 Subject: [issue30129] functools.partialmethod should look more like what it's impersonating. In-Reply-To: <1492784871.01.0.595019366474.issue30129@psf.upfronthosting.co.za> Message-ID: <1492818234.55.0.700902667795.issue30129@psf.upfronthosting.co.za> Changes by Skip Montanaro : ---------- keywords: +patch Added file: http://bugs.python.org/file46824/ft.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:46:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 23:46:00 +0000 Subject: [issue28041] Inconsistent behavior: Get st_nlink from os.stat() and os.scandir() In-Reply-To: <1473413094.07.0.556978499762.issue28041@psf.upfronthosting.co.za> Message-ID: <1492818360.4.0.63072899385.issue28041@psf.upfronthosting.co.za> STINNER Victor added the comment: scandir () is designed for effiency, not for portability or correctness. The API has deliberate limitations which are well documented, as the one you spotted: https://docs.python.org/dev/library/os.html#os.DirEntry.stat Your PR would defeat the whole purpose of scandir. ---------- nosy: +haypo resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:48:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 23:48:13 +0000 Subject: [issue29867] Add asserts in PyXXX_GET_SIZE macros In-Reply-To: <1490082783.53.0.325668446272.issue29867@psf.upfronthosting.co.za> Message-ID: <1492818493.75.0.0285853047879.issue29867@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 1a5856bf9295fa73995898d576e0bedf016aee1f by Victor Stinner (Serhiy Storchaka) in branch 'master': bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. (#751) https://github.com/python/cpython/commit/1a5856bf9295fa73995898d576e0bedf016aee1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:49:17 2017 From: report at bugs.python.org (David Bolen) Date: Fri, 21 Apr 2017 23:49:17 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1492818557.01.0.370216912136.issue30126@psf.upfronthosting.co.za> David Bolen added the comment: Ok, this should be resolved. I opted to be a bit more conservative and only upgraded to sqlite3 3.8.3.1, which is the oldest version still in use for the dmg installer packages (for 2.7). I restarted the most recent 3.x build and while it's not completely done yet, the sqlite tests have passed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:49:55 2017 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 21 Apr 2017 23:49:55 +0000 Subject: [issue30129] functools.partialmethod should look more like what it's impersonating. In-Reply-To: <1492784871.01.0.595019366474.issue30129@psf.upfronthosting.co.za> Message-ID: <1492818595.61.0.832428319532.issue30129@psf.upfronthosting.co.za> Skip Montanaro added the comment: Again, my apologies for the crappy initial bug report. Hopefully this comment and the two files I just attached demonstrate what I am getting at. I just uploaded a stupid little example, partial3.py. Stupid, but still, it demonstrates part of how I think docstrings on these partial methods could be improved. If you run it (I'm using Python 3.6.1), note that the doc strings for the sum method (instance and class), look wrong: Child.sum doc: None c.sum doc: partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. The file, ft.diff, includes a one-line patch to partialmethod.__get__ which corrects the docstring for the instance of the Child class: Child.sum doc: None c.sum doc: sum doc I haven't looked to see where the docstring of Child.sum could be set, but I believe it should be fairly straightforward for someone more familiar with this code. Also, the patch doesn't improve the output of pydoc: partial3.Child = class Child(builtins.object) | Methods defined here: | | diff(self, arg1, arg2) | diff doc | | sum = _method(self, arg2) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:50:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 23:50:52 +0000 Subject: [issue29867] Add asserts in PyXXX_GET_SIZE macros In-Reply-To: <1490082783.53.0.325668446272.issue29867@psf.upfronthosting.co.za> Message-ID: <1492818652.05.0.91191890408.issue29867@psf.upfronthosting.co.za> STINNER Victor added the comment: I merged your PR. We are at the begining of the 3.7 cycle. Applications can be fixed before 3.7. In the worst case, we can revert the change. I like this enhancement, it should help to catch bugs ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 19:58:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 21 Apr 2017 23:58:49 +0000 Subject: [issue29782] Use __builtin_clzl for bits_in_digit if available In-Reply-To: <1489143237.03.0.753738364063.issue29782@psf.upfronthosting.co.za> Message-ID: <1492819129.22.0.256794408658.issue29782@psf.upfronthosting.co.za> STINNER Victor added the comment: I concur with Antoine and suggest to reject this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 20:09:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Apr 2017 00:09:51 +0000 Subject: [issue29442] Replace optparse with argparse in setup.py In-Reply-To: <1486193188.24.0.532905655294.issue29442@psf.upfronthosting.co.za> Message-ID: <1492819791.92.0.515745970679.issue29442@psf.upfronthosting.co.za> STINNER Victor added the comment: Did someone test the patch? Does Python still bootstrap after a distclean or not? If not, I suggest to close the issue, except if Chi Hsuan Yen finf an elegant way to fix them :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 20:17:36 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 22 Apr 2017 00:17:36 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1492820256.03.0.718052405844.issue23404@psf.upfronthosting.co.za> Martin Panter added the comment: Last time I proposed removing the automatic rebuilding of checked-in generated files, it seemed getting a consensus would not be trivial. Nick seemed strongly against changing the status quo: . He did say it has been too hard to remember how to rebuild generated files in the past. Documenting the quirks of the build system would be good even if we keep the automatic regeneration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 21:17:58 2017 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 22 Apr 2017 01:17:58 +0000 Subject: [issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions. In-Reply-To: <1492809485.52.0.0203844135424.issue30133@psf.upfronthosting.co.za> Message-ID: <1492823878.85.0.370150986412.issue30133@psf.upfronthosting.co.za> Matthew Barnett added the comment: Yes, the second argument is a replacement template, not a literal. This issue does point out a different problem, though: re.escape will add backslashes that will then be treated as literals in the template, for example: >>> re.sub(r'a', re.escape('(A)'), 'a') '\\(A\\)' re.escape doesn't always help. The solution here is to pass a replacement function instead: >>> re.sub(r'a', lambda m: '(A)', 'a') '(A)' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 22:03:29 2017 From: report at bugs.python.org (Kubilay Kocak) Date: Sat, 22 Apr 2017 02:03:29 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1492826609.61.0.866309147467.issue23404@psf.upfronthosting.co.za> Changes by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 22:15:45 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 22 Apr 2017 02:15:45 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492827345.88.0.52609518512.issue30098@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1363 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 22:15:53 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 22 Apr 2017 02:15:53 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492827353.86.0.0397117902841.issue30098@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1364 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 22:18:21 2017 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Apr 2017 02:18:21 +0000 Subject: [issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions. In-Reply-To: <1492809485.52.0.0203844135424.issue30133@psf.upfronthosting.co.za> Message-ID: <1492827501.45.0.744941311923.issue30133@psf.upfronthosting.co.za> R. David Murray added the comment: Good point, re.escape is for literal text you want to insert into a matching pattern, but the replacement template isn't a matching pattern. Do we need a different escape function? I guess the function solution is enough? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 22:54:11 2017 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 22 Apr 2017 02:54:11 +0000 Subject: [issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions. In-Reply-To: <1492809485.52.0.0203844135424.issue30133@psf.upfronthosting.co.za> Message-ID: <1492829651.83.0.28325580206.issue30133@psf.upfronthosting.co.za> Matthew Barnett added the comment: The function solution does have a larger overhead than a literal. Could the template be made more accepting of backslashes without breaking anything? (There's also issue29995 "re.escape() escapes too much", which might help.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 22:58:03 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 22 Apr 2017 02:58:03 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492829883.4.0.224135057503.issue30098@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 503d74a60aa9290cf8d174eab95fdfdea1f2b284 by Mariatta in branch '3.5': bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170) (#1246) https://github.com/python/cpython/commit/503d74a60aa9290cf8d174eab95fdfdea1f2b284 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 22:58:30 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 22 Apr 2017 02:58:30 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492829910.05.0.256900544032.issue30098@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset a3d8dda7d899bf41ab7eb2c6148459ad276fe295 by Mariatta in branch '3.6': bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170) (#1247) https://github.com/python/cpython/commit/a3d8dda7d899bf41ab7eb2c6148459ad276fe295 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 23:00:36 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 22 Apr 2017 03:00:36 +0000 Subject: [issue30098] Verbose TypeError for asyncio.ensure_future In-Reply-To: <1492554274.3.0.429824615733.issue30098@psf.upfronthosting.co.za> Message-ID: <1492830036.06.0.873732497486.issue30098@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: PR has been merged and backported to 3.5 and 3.6. Thanks everyone :) ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 23:10:23 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Sat, 22 Apr 2017 03:10:23 +0000 Subject: [issue29952] "keys and values" preferred to "keys and elements" for dict constituent In-Reply-To: <1490931613.41.0.406216073022.issue29952@psf.upfronthosting.co.za> Message-ID: <1492830623.16.0.0739582011829.issue29952@psf.upfronthosting.co.za> Changes by KINEBUCHI Tomohiko : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 23:49:31 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Sat, 22 Apr 2017 03:49:31 +0000 Subject: [issue30134] BytesWarning is missing from the documents Message-ID: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> New submission from KINEBUCHI Tomohiko: In Python 2.6, BytesWarning was added, but a description of that warning is missing from the document, library/exceptions.rst. ---------- assignee: docs at python components: Documentation messages: 292099 nosy: cocoatomo, docs at python priority: normal severity: normal status: open title: BytesWarning is missing from the documents versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 21 23:57:05 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Sat, 22 Apr 2017 03:57:05 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1492833425.29.0.365751747122.issue30134@psf.upfronthosting.co.za> Changes by KINEBUCHI Tomohiko : ---------- pull_requests: +1365 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 00:19:14 2017 From: report at bugs.python.org (Klaus Wolf) Date: Sat, 22 Apr 2017 04:19:14 +0000 Subject: [issue30135] default value of argument seems to be overwritten Message-ID: <1492834754.69.0.481762450521.issue30135@psf.upfronthosting.co.za> New submission from Klaus Wolf: Two function results differ if the parameter is given explictly instead of using the given default. (Enclosed example: A small simple interpreter of Forth language, both scripts should give the same result, but the first one (variant1) fails because the value from the first pass remains on the stack.) ---------- components: Interpreter Core files: misc_math.7z messages: 292100 nosy: approximately priority: normal severity: normal status: open title: default value of argument seems to be overwritten type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file46825/misc_math.7z _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 00:41:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 04:41:59 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1492836119.73.0.868326084231.issue30134@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: BytesWarning should be added in the table in warnings.rst (and check that all other built-in warning categories are in this table). It is worth to mention the -b option. And I think the docstring of BytesWarning should be corrected. "Unicode" should be used rather that "str" since str and bytes is the same in 2.7. ---------- nosy: +benjamin.peterson, r.david.murray, serhiy.storchaka stage: -> patch review type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 00:49:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 04:49:22 +0000 Subject: [issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions. In-Reply-To: <1492809485.52.0.0203844135424.issue30133@psf.upfronthosting.co.za> Message-ID: <1492836562.88.0.596549701488.issue30133@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: re.escape() shouldn't be used for a replacement template. You need just double backslashes when escape a literal string for a replacement template: s.replace('\\', '\\\\'). This should be documented if still is not documented. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 01:02:59 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 22 Apr 2017 05:02:59 +0000 Subject: [issue30136] Add test.support.script_helper to documentation Message-ID: <1492837378.99.0.351852944309.issue30136@psf.upfronthosting.co.za> New submission from Louie Lu: `test.support.script_helper` didn't document at `test` document. It should be add on. ---------- assignee: docs at python components: Documentation messages: 292103 nosy: docs at python, louielu priority: normal severity: normal status: open title: Add test.support.script_helper to documentation versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 01:15:27 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 22 Apr 2017 05:15:27 +0000 Subject: [issue30136] Add test.support.script_helper to documentation In-Reply-To: <1492837378.99.0.351852944309.issue30136@psf.upfronthosting.co.za> Message-ID: <1492838127.95.0.203275226336.issue30136@psf.upfronthosting.co.za> Berker Peksag added the comment: This is a duplicate of issue 18576. ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Document test.support.script_helper _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 01:32:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 05:32:49 +0000 Subject: [issue29782] Use __builtin_clzl for bits_in_digit if available In-Reply-To: <1489143237.03.0.753738364063.issue29782@psf.upfronthosting.co.za> Message-ID: <1492839169.18.0.034598669645.issue29782@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In some microbenchmarks this can give up to 15%. $ ./python.patched -m perf timeit -q --compare-to=./python.default -s "a = list(map(float, range(10000)))" "12345 in a" Mean +- std dev: [python.default] 1.28 ms +- 0.11 ms -> [python.patched] 1.12 ms +- 0.07 ms: 1.15x faster (-13%) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 01:40:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 05:40:58 +0000 Subject: [issue29782] Use __builtin_clzl for bits_in_digit if available In-Reply-To: <1489143237.03.0.753738364063.issue29782@psf.upfronthosting.co.za> Message-ID: <1492839658.54.0.281890072395.issue29782@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: But even 15% speed up in particular microbenchmarks looks too small to me for such complex change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 01:55:20 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 22 Apr 2017 05:55:20 +0000 Subject: [issue30113] Allow helper functions to wrap sys.setprofile In-Reply-To: <1492680992.58.0.5244415067.issue30113@psf.upfronthosting.co.za> Message-ID: <1492840520.03.0.457307563831.issue30113@psf.upfronthosting.co.za> Nick Coghlan added the comment: Thanks Louie. I've adjusted the issue title, as I think the core RFE is that we'd like the following helper function to work exactly the same way as calling sys.setprofile directly: def setprofile_helper(f): sys.setprofile(f) The following utility function can be used to demonstrate the current discrepancy: def profile_call(setprofile, call): pr = profile.Profile() setprofile(pr.dispatcher) try: call() finally: setprofile(None) return pr Specifically: ``` >>> profile_call(sys.setprofile, lambda:print("Profiled!")) Profiled! >>> profile_call(setprofile_helper, lambda:print("Profiled!")) Traceback (most recent call last): File "", line 1, in File "", line 4, in profile_call File "", line 2, in setprofile_helper File "/usr/lib64/python3.5/profile.py", line 209, in trace_dispatch_i if self.dispatch[event](self, frame, t): File "/usr/lib64/python3.5/profile.py", line 293, in trace_dispatch_return assert frame is self.cur[-2].f_back, ("Bad return", self.cur[-3]) AssertionError: ('Bad return', ('profile', 0, 'profiler')) ``` If we can figure out a way to do it reliably, the most desirable approach would be to make helper functions like the above "just work", perhaps by remembering the stack frame where the profiler was *defined*, and using that as the reference point to construct the synthetic stack the first time a trace dispatch occurs. If that transparent-to-the-user approach doesn't appear to be feasible, an alternative would be to offer a new private method on Profile objects to adjust their synthetic stack by one level, as if `sys.setprofile` had been called *before* the call into the helper function. That is, a profiler-aware alternative to the helper function above might look like: def profile_helper(pr): sys.setprofile(pr.dispatcher) pr._adjust_stack() and that's then the approach that the `__enter__` method would use to implement context management support. The advantage of the latter private option is that it wouldn't need to support arbitrary helper functions, just the specific implementation of `__enter__` for issue 9285. In either case, I *don't* think changing the assertion is the right answer - instead, I think the internal profiler state needs to be adjusted so the assertion passes without modification. ---------- title: Add profile test case for trace_dispatch_return assertion -> Allow helper functions to wrap sys.setprofile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 02:07:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 06:07:47 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492841267.27.0.328134961008.issue29802@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1366 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 02:10:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 06:10:48 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1492841448.99.0.825112487654.issue29960@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 9616a82e7802241a4b74cf7ae38d43c37bf66e48 by Serhiy Storchaka (bladebryan) in branch 'master': bpo-29960 _random.Random corrupted on exception in setstate(). (#1019) https://github.com/python/cpython/commit/9616a82e7802241a4b74cf7ae38d43c37bf66e48 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 02:13:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 06:13:14 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1492841594.25.0.484309116057.issue29960@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka stage: needs patch -> backport needed versions: +Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 02:18:37 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 22 Apr 2017 06:18:37 +0000 Subject: [issue18576] Document test.support.script_helper In-Reply-To: <1375014764.64.0.152576599022.issue18576@psf.upfronthosting.co.za> Message-ID: <1492841917.86.0.880125569649.issue18576@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1367 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 02:25:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 06:25:01 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492842301.92.0.147802261493.issue29802@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7bfd740e3d484e6fdf3f5c2d4640450957f9d89c by Serhiy Storchaka in branch 'master': Remove unneeded Misc/NEWS entry for bpo-29802. (#1251) https://github.com/python/cpython/commit/7bfd740e3d484e6fdf3f5c2d4640450957f9d89c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 02:26:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 06:26:10 +0000 Subject: [issue29802] A possible null-pointer dereference in struct.s_unpack_internal() In-Reply-To: <1489379218.66.0.044857321803.issue29802@psf.upfronthosting.co.za> Message-ID: <1492842370.58.0.330011116953.issue29802@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 02:31:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 06:31:18 +0000 Subject: [issue30135] default value of argument seems to be overwritten In-Reply-To: <1492834754.69.0.481762450521.issue30135@psf.upfronthosting.co.za> Message-ID: <1492842678.25.0.299841080308.issue30135@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See "Why are default values shared between objects?" in Python FAQ (https://docs.python.org/3/faq/programming.html#id13). ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 03:52:42 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 22 Apr 2017 07:52:42 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1492847562.87.0.468112521566.issue30024@psf.upfronthosting.co.za> Nick Coghlan added the comment: Expanding on Serhiy's answer: the ModuleNotFoundError for "import sys.path" comes from IMPORT_NAME, not from any of the subsequent attribute lookups. That difference is visible in the bytecode: >>> dis("import sys.path as path") 1 0 LOAD_CONST 0 (0) 3 LOAD_CONST 1 (None) 6 IMPORT_NAME 0 (sys.path) 9 LOAD_ATTR 1 (path) 12 STORE_NAME 1 (path) 15 LOAD_CONST 1 (None) 18 RETURN_VALUE For "import sys.path as path", the given module name is "sys.path", and the "from list" entry on the stack is None. This fails before it even reaches the `LOAD_ATTR` line, since "sys.path" isn't an importable module. Changing LOAD_ATTR to IMPORT_FROM would thus have no effect on its behaviour. >>> dis("from sys import path") 1 0 LOAD_CONST 0 (0) 3 LOAD_CONST 1 (('path',)) 6 IMPORT_NAME 0 (sys) 9 IMPORT_FROM 1 (path) 12 STORE_NAME 1 (path) 15 POP_TOP 16 LOAD_CONST 2 (None) 19 RETURN_VALUE For "from sys import path", the given module name is "sys", and the "from list" entry on the stack is a tuple containing the string "path". This works, since "sys" is importable *and* it has a "path" attribute. Hence why Serhiy's suggestion is such an elegant fix, since the only cases where the LOAD_ATTR vs IMPORT_FROM distinction matters will be those where: 1. The submodule exists, so both "import a.b" and "from a import b" will work for the IMPORT_NAME step 2. It's a circular import, so even though "a.b" exists in sys.modules, it won't be accessible as an attribute of "a" yet Getting the tests and any related documentation updates right will actually be harder than the code change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 05:20:28 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 22 Apr 2017 09:20:28 +0000 Subject: [issue30113] Allow helper functions to wrap sys.setprofile In-Reply-To: <1492680992.58.0.5244415067.issue30113@psf.upfronthosting.co.za> Message-ID: <1492852828.38.0.250547289324.issue30113@psf.upfronthosting.co.za> Louie Lu added the comment: Thanks, Nick. Your analysis is very helpful. After some testing, I found the problem here is because when we using `sys.setprofile` in the helper function, we didn't simulate the call (from where profiler create to helper function), that cause profile's frame link breakup, so if we want to return to outside of helper function, it will report a bad return. A straightforward method is the latter method you propose, to make a profiler-aware function manually insert the frame into profiler's frame stack: def _adjust_frame(self): frame = sys._getframe(1) # Get helper function frame self.dispatch['call'](self, frame, 0) And adjust *before* install profiler: def profile_helper(pr): pr._adjust_frame() sys.setprofile(pr.dispatcher) Then we can get the correct thing we need. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 05:41:37 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 22 Apr 2017 09:41:37 +0000 Subject: [issue30113] Allow helper functions to wrap sys.setprofile In-Reply-To: <1492680992.58.0.5244415067.issue30113@psf.upfronthosting.co.za> Message-ID: <1492854097.83.0.554123088478.issue30113@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1368 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 07:51:45 2017 From: report at bugs.python.org (Klaus Wolf) Date: Sat, 22 Apr 2017 11:51:45 +0000 Subject: [issue30135] default value of argument seems to be overwritten In-Reply-To: <1492834754.69.0.481762450521.issue30135@psf.upfronthosting.co.za> Message-ID: <1492861905.46.0.89005798337.issue30135@psf.upfronthosting.co.za> Klaus Wolf added the comment: A documented misbheavior is still a misbehavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 08:14:11 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 22 Apr 2017 12:14:11 +0000 Subject: [issue29782] Use __builtin_clzl for bits_in_digit if available In-Reply-To: <1489143237.03.0.753738364063.issue29782@psf.upfronthosting.co.za> Message-ID: <1492863251.93.0.603948050151.issue29782@psf.upfronthosting.co.za> Mark Dickinson added the comment: Closing. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 08:19:45 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 22 Apr 2017 12:19:45 +0000 Subject: [issue29782] Use __builtin_clzl for bits_in_digit if available In-Reply-To: <1489143237.03.0.753738364063.issue29782@psf.upfronthosting.co.za> Message-ID: <1492863585.68.0.106547690578.issue29782@psf.upfronthosting.co.za> Louie Lu added the comment: If this issue is closed by "not a big performance improvement", maybe the XXX in mathmoudle.c should be take off? """ /* XXX: This routine does more or less the same thing as * bits_in_digit() in Objects/longobject.c. Someday it would be nice to * consolidate them. On BSD, there's a library function called fls() * that we could use, and GCC provides __builtin_clz(). */ """ ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 08:20:37 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 22 Apr 2017 12:20:37 +0000 Subject: [issue18576] Document test.support.script_helper In-Reply-To: <1375014764.64.0.152576599022.issue18576@psf.upfronthosting.co.za> Message-ID: <1492863637.58.0.850020370544.issue18576@psf.upfronthosting.co.za> Louie Lu added the comment: The PR on GitHub is based on bobcatfist's patch, addressed on Martin request and some minor change. ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 08:31:26 2017 From: report at bugs.python.org (Chi Hsuan Yen) Date: Sat, 22 Apr 2017 12:31:26 +0000 Subject: [issue29442] Replace optparse with argparse in setup.py In-Reply-To: <1486193188.24.0.532905655294.issue29442@psf.upfronthosting.co.za> Message-ID: <1492864286.37.0.462319788747.issue29442@psf.upfronthosting.co.za> Chi Hsuan Yen added the comment: I guess you were asking whether the newly compiled Python binary is able to build extension modules or not? I rebased PR 139 against the latest git master and seems it's fine. Running `make distclean`, `./configure` and then `make` builds all modules as expected. The result is the same on Travis CI and Appveyor. About "elegant": I guess the only issue regarding elegancy in my patch is the local import in GNUTranslations._parse(). For me moving setup.py away from deprecated modules is a good reason for introducing local imports. Does it sound OK? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 08:31:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 12:31:56 +0000 Subject: [issue30135] default value of argument seems to be overwritten In-Reply-To: <1492834754.69.0.481762450521.issue30135@psf.upfronthosting.co.za> Message-ID: <1492864316.87.0.0796718270778.issue30135@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is correct behavior. You just made a common mistake made by newcomers. Read Python FAQ and other resources, this can help you to avoid other pitfalls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 09:03:01 2017 From: report at bugs.python.org (Victor Varvariuc) Date: Sat, 22 Apr 2017 13:03:01 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1492866181.14.0.528129626484.issue30024@psf.upfronthosting.co.za> Victor Varvariuc added the comment: How can I facilitate/contribute to get the changes suggested by Serhiy into Python? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 10:01:58 2017 From: report at bugs.python.org (Akshay Deogaonkar) Date: Sat, 22 Apr 2017 14:01:58 +0000 Subject: [issue30137] Equivalent syntax regarding List returns List objects with non-similar list elements. Message-ID: <1492869718.96.0.983621663084.issue30137@psf.upfronthosting.co.za> New submission from Akshay Deogaonkar: lst = [0,1,2,3,4] print(lst[0:3]) #returns [0,1,2] print(lst[:3]) #returns [0,1,2] #Above two syntax returns same lists. print(lst[0:3:-1]) #returns [] print(lst[:3:-1]) #returns [4] #Here is a bug; what expected was that the both syntax would have returned the similar lists; however, they didn't! ---------- messages: 292120 nosy: Akshay Deogaonkar priority: normal severity: normal status: open title: Equivalent syntax regarding List returns List objects with non-similar list elements. type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 11:08:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 15:08:09 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492873689.37.0.777063366271.issue15718@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1369 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 11:18:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 15:18:18 +0000 Subject: [issue29840] Avoid raising OverflowError in bool() In-Reply-To: <1489782446.56.0.355449112547.issue29840@psf.upfronthosting.co.za> Message-ID: <1492874298.57.0.148487490346.issue29840@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I had similar doubts about this patch and needed opinions of other core developers. > Maybe, if __len__() raises an OverflowError: call again the len(), but using the "__len__" method instead of the slot? Following patch implements this idea. I don't like it because it is too complicated. I think that we should either document that raising an OverflowError by __len__() is normal and interpreted as true in Boolean context, or document that __len__() should return a value not larger than sys.maxsize, otherwise len() and bool() can raise an OverflowError (see issue15718). ---------- Added file: http://bugs.python.org/file46826/bool-no-overflow-double-call.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 11:28:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 15:28:13 +0000 Subject: [issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1 In-Reply-To: <1456268688.08.0.284414420897.issue26423@psf.upfronthosting.co.za> Message-ID: <1492874893.82.0.79801616591.issue26423@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could you create a PR for your patch Victor? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 12:09:17 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Apr 2017 16:09:17 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492877357.95.0.137775687598.issue15718@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Has or will builtin classes be modified to follow advice to include a separate __bool__? In 3.6.1, >>> r = range(19**100) >>> bool(r) Traceback (most recent call last): File "", line 1, in bool(r) OverflowError: Python int too large to convert to C ssize_t ---------- nosy: +serhiy.storchaka versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 12:20:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 16:20:42 +0000 Subject: [issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode In-Reply-To: <1469446931.7.0.792781039481.issue27613@psf.upfronthosting.co.za> Message-ID: <1492878042.0.0.601625485964.issue27613@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > I am surprised that dumping to a string and to a file give different answers. This is a difference between Python and C implementations. An iterable with fake __len__ looks breaking the invariants, but if a collection with overridden __bool__() is considered as more legitimate, the proposed patch fixes Python implementation of json for that case. ---------- components: +Library (Lib) nosy: +bob.ippolito, ezio.melotti, rhettinger, serhiy.storchaka stage: -> patch review versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 12:21:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 16:21:38 +0000 Subject: [issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode In-Reply-To: <1469446931.7.0.792781039481.issue27613@psf.upfronthosting.co.za> Message-ID: <1492878098.6.0.507520885809.issue27613@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1370 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 12:28:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 16:28:26 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492878506.87.0.882706538767.issue15718@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, and the range object already is fixed by issue28876. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 12:50:19 2017 From: report at bugs.python.org (Brett Cannon) Date: Sat, 22 Apr 2017 16:50:19 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1492879819.71.0.169450067346.issue23404@psf.upfronthosting.co.za> Brett Cannon added the comment: Would it make sense to have a `make rebuild` or something which explicitly ignores prebuilt files? That could then also serve as non-obvious documentation on how to build those files in the first place. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 13:24:09 2017 From: report at bugs.python.org (Stephen J. Turnbull) Date: Sat, 22 Apr 2017 17:24:09 +0000 Subject: [issue30138] Incorrect documentation of replacement of slice of length 0 Message-ID: <1492881849.39.0.723167334866.issue30138@psf.upfronthosting.co.za> New submission from Stephen J. Turnbull: In section 4.6.3. "Mutable Sequence Types" of current documentation, Note 1 to the table says "[iterable] t must have the same length as the slice it is replacing." This is incorrect in the case of extension: s[len(s):] = t according to the rest of the documentation, as well as experiment. ---------- assignee: docs at python components: Documentation keywords: easy messages: 292127 nosy: docs at python, sjt priority: normal severity: normal status: open title: Incorrect documentation of replacement of slice of length 0 type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 13:29:56 2017 From: report at bugs.python.org (Stephen J. Turnbull) Date: Sat, 22 Apr 2017 17:29:56 +0000 Subject: [issue30138] Incorrect documentation of replacement of slice of length 0 In-Reply-To: <1492881849.39.0.723167334866.issue30138@psf.upfronthosting.co.za> Message-ID: <1492882196.6.0.873208288754.issue30138@psf.upfronthosting.co.za> Stephen J. Turnbull added the comment: Sorry, I just realized this note only applies to slices with a stride (k in i:j:k). Closing. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 13:44:42 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 22 Apr 2017 17:44:42 +0000 Subject: [issue30135] default value of argument seems to be overwritten In-Reply-To: <1492834754.69.0.481762450521.issue30135@psf.upfronthosting.co.za> Message-ID: <1492883082.23.0.578259621509.issue30135@psf.upfronthosting.co.za> Steven D'Aprano added the comment: In the future please don't post binary files containing source code, especially something as non-standard as 7z. That just makes it difficult for people to review the code. Either paste your code snippet directly into the bug report, or attach it as a .py file. If the file is so huge it needs compression, you shouldn't be posting it at all. You should post the *minimum* code to demonstrate the problem, not an entire application: we don't a 200 line simulation of a Forth interpreter just to see something that can be shown in ten lines. Even though this is written for Java programmers, the same applies here: http://sscce.org/ Thank you. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 13:50:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 17:50:19 +0000 Subject: [issue29816] Get rid of C limitation for shift count in right shift In-Reply-To: <1489568117.43.0.447594281596.issue29816@psf.upfronthosting.co.za> Message-ID: <1492883419.64.0.921800555391.issue29816@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1371 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 13:55:00 2017 From: report at bugs.python.org (Matthew Cowles) Date: Sat, 22 Apr 2017 17:55:00 +0000 Subject: [issue26143] Ensure that IDLE's stdlib imports are from the stdlib In-Reply-To: <1453089950.28.0.356846327087.issue26143@psf.upfronthosting.co.za> Message-ID: <1492883700.13.0.72600009523.issue26143@psf.upfronthosting.co.za> Matthew Cowles added the comment: This bug should be fixed urgently. Over at python-help we just got another Python beginner who was using IDLE and then started to get the "IDLE's subprocess didn't make connection" error. The problem was that the user had named one of their programs random.py. That's a bad introduction to Python and programming. ---------- nosy: +mdcowles _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 14:04:58 2017 From: report at bugs.python.org (Stephen J. Turnbull) Date: Sat, 22 Apr 2017 18:04:58 +0000 Subject: [issue29352] provide the authorative source for s[i:j] negative slice indices (<-len(s)) behavior for standard sequences In-Reply-To: <1485190156.24.0.631194950251.issue29352@psf.upfronthosting.co.za> Message-ID: <1492884298.9.0.641504063815.issue29352@psf.upfronthosting.co.za> Stephen J. Turnbull added the comment: I prefer Josh's wording. The important point to me is that >>> [1, 2][2:0] = "AB" [1, 2, "A", "B"] not an error or ["B", "A"] == [1, 2][2:0:-1]. I think too much talk about the endpoints obscures this important fact. (I think I'd like it to be an error, since the interpretation of s[2:0] = t could reasonably be any of s[0:0] = t, s[1:1] = t, or s[2:2] = t, but I haven't thought carefully enough yet, and "backward compatibility".) Note: Josh's wording is already used in 3.7 (https://docs.python.org/dev/library/stdtypes.html#common-sequence-operations, as of the timestamp of this message). I didn't check if it's been backported. ---------- nosy: +sjt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 14:16:43 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 22 Apr 2017 18:16:43 +0000 Subject: [issue30137] Equivalent syntax regarding List returns List objects with non-similar list elements. In-Reply-To: <1492869718.96.0.983621663084.issue30137@psf.upfronthosting.co.za> Message-ID: <1492885003.06.0.227604956807.issue30137@psf.upfronthosting.co.za> Steven D'Aprano added the comment: The behaviour is as documented and is not a bug. When you have a three-argument extended slice, the starting and stopping values depend on whether the stride (step) is positive or negative. Although that's buried in a footnote to the table. https://docs.python.org/3/library/stdtypes.html#common-sequence-operations The current behaviour is necessary so that the common case of both start and stop being blank is supported correctly for negative stride: py> "abcde"[::-1] 'edcba' So with a positive stride, your first example lst[0:3:-1] starts at index 0, ends at index 3, with step -1. That is an empty slice. But your second example lst[:3:-1] starts at the end of the list, index len(lst), ends at 3, with step -1. That is equivalent to lst[5:3:-1] which is not the same as your first example. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 14:50:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 18:50:11 +0000 Subject: [issue29816] Get rid of C limitation for shift count in right shift In-Reply-To: <1489568117.43.0.447594281596.issue29816@psf.upfronthosting.co.za> Message-ID: <1492887011.63.0.0910505342066.issue29816@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 997a4adea606069e01beac6269920709db3994d1 by Serhiy Storchaka in branch 'master': Remove outdated note about constraining of the bit shift right operand. (#1258) https://github.com/python/cpython/commit/997a4adea606069e01beac6269920709db3994d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 14:54:20 2017 From: report at bugs.python.org (Horacio Hoyos) Date: Sat, 22 Apr 2017 18:54:20 +0000 Subject: [issue30139] Fix for issue 8743 not available in python MacOS 3.5.1 Message-ID: <1492887260.31.0.89800718896.issue30139@psf.upfronthosting.co.za> New submission from Horacio Hoyos: Hi all, I was having issues while testing a custom Set implementation using the _collections_abc base MutableSet and found that my issue was apparently resolved with issue 8743. My test is simple: ms = MySetImpl() ms & 'testword' which should fail with TypeError, given that in the 8743 fix the __and__ incorporated a test for isinstance(other, Set). Looking at the _collections_abc.py in my installation (/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/_collections_abc.py) I can not see the changes in the patches submitted for issue 8743. ---------- components: Library (Lib), macOS messages: 292134 nosy: Horacio Hoyos, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Fix for issue 8743 not available in python MacOS 3.5.1 versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 15:16:25 2017 From: report at bugs.python.org (R. David Murray) Date: Sat, 22 Apr 2017 19:16:25 +0000 Subject: [issue30139] Fix for issue 8743 not available in python MacOS 3.5.1 In-Reply-To: <1492887260.31.0.89800718896.issue30139@psf.upfronthosting.co.za> Message-ID: <1492888585.48.0.314832941871.issue30139@psf.upfronthosting.co.za> R. David Murray added the comment: Then you have a broken copy of 3.5.1. There is nothing OS-specific about that file. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 15:23:13 2017 From: report at bugs.python.org (Ned Deily) Date: Sat, 22 Apr 2017 19:23:13 +0000 Subject: [issue30139] Fix for issue 8743 not available in python MacOS 3.5.1 In-Reply-To: <1492887260.31.0.89800718896.issue30139@psf.upfronthosting.co.za> Message-ID: <1492888993.62.0.652575278007.issue30139@psf.upfronthosting.co.za> Ned Deily added the comment: >> Then you have a broken copy of 3.5.1. Yes. You don't say from where you installed Python 3.5.1 but I just took a quick look at _collections_abc.py in both the versions installed by the python.org 3.5.1 macOS installer and by the current 3.5.3 version (which you should update to, or, better, 3.6.1) and the Issue8743 changes appear to be there. If you still believe there is a problem with Python here, please reopen and provide a complete test case. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 15:30:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 19:30:51 +0000 Subject: [issue30139] Fix for issue 8743 not available in python MacOS 3.5.1 In-Reply-To: <1492887260.31.0.89800718896.issue30139@psf.upfronthosting.co.za> Message-ID: <1492889451.31.0.51456133667.issue30139@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: But there is no neither an entry #8743, nor neighbour entries #14710 and #13355 in Misc/NEWS. Seems Misc/NEWS is broken. ---------- nosy: +serhiy.storchaka resolution: works for me -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 15:31:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Apr 2017 19:31:34 +0000 Subject: [issue30139] Fix for issue 8743 not available in python MacOS 3.5.1 In-Reply-To: <1492887260.31.0.89800718896.issue30139@psf.upfronthosting.co.za> Message-ID: <1492889494.35.0.77744790756.issue30139@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 15:50:56 2017 From: report at bugs.python.org (Ned Deily) Date: Sat, 22 Apr 2017 19:50:56 +0000 Subject: [issue30139] Fix for issue 8743 not available in python MacOS 3.5.1 In-Reply-To: <1492887260.31.0.89800718896.issue30139@psf.upfronthosting.co.za> Message-ID: <1492890656.17.0.242366064644.issue30139@psf.upfronthosting.co.za> Ned Deily added the comment: > But there is no neither an entry #8743, nor neighbour entries #14710 and #13355 in Misc/NEWS. Seems Misc/NEWS is broken. Hmm. They seem to have been properly preserved in the current 3.6 and master branch versions of Misc/HISTORY. Perhaps the 3.5 Misc/NEWS was corrupted in a merge along the way? In any case, this is not relevant to the OP's problem. Once the auto-generation of Misc/NEWS is implemented, we're going to have to go back and redo Misc/NEWS and Misc/HISTORY in active branches. I don't think there is a need for a separate issue to track that but, if you want to open one, Serhiy, feel free to do so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 17:57:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Apr 2017 21:57:14 +0000 Subject: [issue29782] Use __builtin_clzl for bits_in_digit if available In-Reply-To: <1492863585.68.0.106547690578.issue29782@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: I'm in favor of documenting in comments decisions to not micro-optimize such code. I did something similar in ceval.c for 1+1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 18:05:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Apr 2017 22:05:05 +0000 Subject: [issue29840] Avoid raising OverflowError in bool() In-Reply-To: <1492874298.57.0.148487490346.issue29840@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: If someone wants to return a value larger than maxsize and support bool(): it is already possible right now by defining a __bool__ method no? If yes, I suggest to only document this CPython implementation detail (consequence of slots, for efficiency) and suggest to use __bool__ for such corner case. I also dislike retrying to call "__len__" method instead of the slot. It can have annoying side effects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 18:26:39 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 22 Apr 2017 22:26:39 +0000 Subject: [issue29619] st_ino (unsigned long long) is casted to long long in posixmodule.c:_pystat_fromstructstat In-Reply-To: <1487766242.34.0.703380697066.issue29619@psf.upfronthosting.co.za> Message-ID: <1492899999.73.0.173081311862.issue29619@psf.upfronthosting.co.za> Xavier de Gaye added the comment: The compilation of Modules/posixmodule.c fails now on Android architecture 'x86' at api level 21, after the above change 0f6d73343d342c106cda2219ebb8a6f0c4bd9b3c: /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --sysroot=/opt/android-ndk/platforms/android-21/arch-x86 -target i686-none-linux-androideabi -gcc-toolchain /opt/android-ndk/toolchains/x86-4.9/prebuilt/linux-x86_64 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wno-unused-value -Wno-empty-body -Qunused-arguments -Wno-parentheses-equality -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -IObjects -IInclude -IPython -I. -I./Include -I/opt/android-ndk/platforms/android-21/arch-x86/usr/include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o ./Modules/posixmodule.c:1935:5: error: array size is negative Py_BUILD_ASSERT(sizeof(unsigned long) >= sizeof(st->st_ino)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./Include/pymacro.h:43:15: note: expanded from macro 'Py_BUILD_ASSERT' (void)Py_BUILD_ASSERT_EXPR(cond); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~ ./Include/pymacro.h:40:19: note: expanded from macro 'Py_BUILD_ASSERT_EXPR' (sizeof(char [1 - 2*!(cond)]) - 1) ^~~~~~~~~~~~~ 1 error generated. make: *** [Makefile:1720: Modules/posixmodule.o] Error 1 The following code: #include #include int main() { struct stat *st; printf("sizeof(unsigned long): %d - sizeof(st->st_ino): %d\n", sizeof(unsigned long), sizeof(st->st_ino)); return 0; } prints the following result on this same system: sizeof(unsigned long): 4 - sizeof(st->st_ino): 8 ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 18:48:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 22 Apr 2017 22:48:43 +0000 Subject: [issue29619] st_ino (unsigned long long) is casted to long long in posixmodule.c:_pystat_fromstructstat In-Reply-To: <1492899999.73.0.173081311862.issue29619@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Would it work with unsigned long long? What is the value of HAVE_LARGEFILE_SUPPORT? Maybe the code should be simplified to always use unsigned long long. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 21:02:22 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 23 Apr 2017 01:02:22 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1492909342.3.0.250379457415.issue23404@psf.upfronthosting.co.za> Martin Panter added the comment: Do you mean a separate makefile rule to rebuild the generated files, rather than rebuilding them in a normal ?make all? build? I would support this; this is what I meant with my ?make regenerate? proposal in response to Nick linked above. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 21:13:15 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 23 Apr 2017 01:13:15 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1492909995.04.0.612259080889.issue30134@psf.upfronthosting.co.za> Martin Panter added the comment: . Issue 11681 is already open for the -b option, with a patch in progress. If updating the doc string, also change ?buffer? to ?bytearray?. This is what ?bytearray? was originally called in Python 3, and ?buffer? is something different in Python 2. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 22:41:40 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 23 Apr 2017 02:41:40 +0000 Subject: [issue29237] Create enum for pstats sorting options In-Reply-To: <1484098294.24.0.117553666266.issue29237@psf.upfronthosting.co.za> Message-ID: <1492915300.42.0.649391972642.issue29237@psf.upfronthosting.co.za> Louie Lu added the comment: Mariatta, is there any movement on this issue? Thanks! ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 22 23:07:16 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 23 Apr 2017 03:07:16 +0000 Subject: [issue23420] python -m cProfile -s fails with non informative message In-Reply-To: <1423483542.47.0.873331461969.issue23420@psf.upfronthosting.co.za> Message-ID: <1492916836.82.0.385494882465.issue23420@psf.upfronthosting.co.za> Louie Lu added the comment: If we can solve #30118 for argument unittest, and apply #18971 for optparse to argparse, this issue will then can be solve, too. ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 00:11:53 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sun, 23 Apr 2017 04:11:53 +0000 Subject: [issue9285] Add a profile decorator to profile and cProfile In-Reply-To: <1279375274.49.0.102313390752.issue9285@psf.upfronthosting.co.za> Message-ID: <1492920713.87.0.347790535617.issue9285@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Original patch still applies. Not sure if we should continue with that one or with your new PR. The original assertion error is still there. I CCed Tim Peters as it appears he's the one who originally added it in 2001 - maybe he has some clue. ---------- versions: +Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 00:21:44 2017 From: report at bugs.python.org (Stephan Hoyer) Date: Sun, 23 Apr 2017 04:21:44 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first Message-ID: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> New submission from Stephan Hoyer: We are writing a system for overloading NumPy operations (see PR [1] and design doc [2]) that is designed to copy and extend Python's system for overloading binary operators. The reference documentation on binary arithmetic [3] states: > Note: If the right operand's type is a subclass of the left operand?s type and that subclass provides the reflected method for the operation, this method will be called before the left operand?s non-reflected method. This behavior allows subclasses to override their ancestors? operations. However, this isn't actually done if the right operand merely inherits from the left operand's type. In practice, CPython requires that the right operand defines a different method before it defers to it. Note that the behavior is different for comparisons, which defer to subclasses regardless of whether they implement a new method [4]. I think this behavior is a mistake and should be corrected. It is just as useful to write generic binary arithmetic methods that are well defined on subclasses as generic comparison operations. In fact, this is exactly the design pattern we propose for objects implementing special operators like NumPy arrays (see NDArrayOperatorsMixin in [1] and [2]). Here is a simple example, of a well-behaved that implements addition by wrapping its value and returns NotImplemented when the other operand has the wrong type: class A: def __init__(self, value): self.value = value def __add__(self, other): if not isinstance(other, A): return NotImplemented return type(self)(self.value + other.value) __radd__ = __add__ def __repr__(self): return f'{type(self).__name__}({self.value!r})' class B(A): pass class C(A): def __add__(self, other): if not isinstance(other, A): return NotImplemented return type(self)(self.value + other.value) __radd__ = __add__ A does not defer to B: >>> A(1) + B(1) A(2) But it does defer to C, which defines new methods (literally copied/pasted) for __add__/__radd__: >>> A(1) + C(1) C(2) With the current behavior, special operator implementations need to explicitly account for the possibility that they are being called from a subclass by returning NotImplemented. My guess is that this is rarely done, which means that most of these methods are broken when used with subclasses, or subclasses needlessly reimplement these methods. Can we fix this logic for Python 3.7? [1] https://github.com/numpy/numpy/pull/8247 [2] https://github.com/charris/numpy/blob/406bbc652424fff332f49b0d2f2e5aedd8191d33/doc/neps/ufunc-overrides.rst [3] https://docs.python.org/3/reference/datamodel.html#object.__ror__ [4] http://bugs.python.org/issue22052 ---------- messages: 292149 nosy: Stephan Hoyer priority: normal severity: normal status: open title: Binary arithmetic does not always call subclasses first type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 00:44:07 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 23 Apr 2017 04:44:07 +0000 Subject: [issue9285] Add a profile decorator to profile and cProfile In-Reply-To: <1279375274.49.0.102313390752.issue9285@psf.upfronthosting.co.za> Message-ID: <1492922647.71.0.902472039494.issue9285@psf.upfronthosting.co.za> Louie Lu added the comment: Giampaolo, the assertion is still worked good, and no need to remove them. The assertion is to prevent dispatch return too more, to return upper then when the profiler was created. The problem why profile __enter__ can't work, is because it misses the simulate_call between __enter__ and upper frame. The original scenes: pr = profile.Profile() # It will call simulate_call at the end of init sys.setprofile(pr.dispatcher) # profile sys.setprofile(None) The break scenes: def profile_helper(pr): sys.setprofile(pr.dispatcher) # Function will return None, dead here pr = profile.Profile() # Create simulate_call # We go into profile_helper, but didn't simulate a call!! (didn't setprofile yet) profile_helper(pr) sys.setprofile(None) The #30113 issue fix this: def profile_helper(pr): pr._adjust_frame() # call simuate_call here sys.setprofile(pr.dispatcher) pr = profile.Profile() # Create simulate_call profile_helper(pr) sys.setprofile(None) Creating this simuate_call, then profiler can go back to the upper frame without error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 01:38:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 05:38:00 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492925880.37.0.387391811653.issue15718@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 85157cd89a6edac347a5b6871fcf20c500c6fbbf by Serhiy Storchaka in branch 'master': bpo-15718: Document the upper bound constrain on the __len__ return value. (#1256) https://github.com/python/cpython/commit/85157cd89a6edac347a5b6871fcf20c500c6fbbf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 01:42:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 05:42:51 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492926171.94.0.294719397483.issue15718@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1372 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 01:43:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 05:43:24 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492926204.6.0.108689134662.issue15718@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1373 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 01:49:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 05:49:59 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492926599.75.0.103845273617.issue15718@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1374 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 01:50:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 05:50:16 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492926616.57.0.821039473578.issue15718@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset f2ed2858eea7569c8915b3611ca5ec92ae10b17f by Serhiy Storchaka in branch '3.6': [3.6] bpo-15718: Document the upper bound constrain on the __len__ return value. (GH-1256) (#1259) https://github.com/python/cpython/commit/f2ed2858eea7569c8915b3611ca5ec92ae10b17f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 01:50:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 05:50:24 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492926624.22.0.935018345347.issue15718@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset c358536fd5e40e8f29ee4f086588a82fccb25a09 by Serhiy Storchaka in branch '3.5': [3.5] bpo-15718: Document the upper bound constrain on the __len__ return value. (GH-1256) (#1260) https://github.com/python/cpython/commit/c358536fd5e40e8f29ee4f086588a82fccb25a09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 01:58:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 05:58:11 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492927091.19.0.785655480279.issue15718@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset bfc7dff63b9b30371e3423a5c35ccda2f3b52218 by Serhiy Storchaka in branch '2.7': [2.7] bpo-15718: Document the upper bound constrain on the __len__ return value. (GH-1256). (#1261) https://github.com/python/cpython/commit/bfc7dff63b9b30371e3423a5c35ccda2f3b52218 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 03:02:29 2017 From: report at bugs.python.org (Oz Tiram) Date: Sun, 23 Apr 2017 07:02:29 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1492930949.5.0.252784263103.issue30095@psf.upfronthosting.co.za> Oz Tiram added the comment: @Walter, I implemented two possible solutions. Chronologically speaking V2 was implemented before V1, but it's a bit ?ber-smart and might surprise it's users requiring the class attributes to be some kind of iterable. The first version is my current preferred solution. I intentionally didn't create a PR for that yet. These are the branches: https://github.com/oz123/cpython/tree/issue30095-v1 https://github.com/oz123/cpython/tree/issue30095-v2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 03:12:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 07:12:39 +0000 Subject: [issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function) In-Reply-To: <1345202279.02.0.767068523185.issue15718@psf.upfronthosting.co.za> Message-ID: <1492931559.39.0.0444717335741.issue15718@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 03:14:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 07:14:39 +0000 Subject: [issue29840] Avoid raising OverflowError in bool() In-Reply-To: <1489782446.56.0.355449112547.issue29840@psf.upfronthosting.co.za> Message-ID: <1492931679.0.0.724222938919.issue29840@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This was documented in issue15718. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 03:56:37 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 23 Apr 2017 07:56:37 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1492934197.74.0.165525572865.issue30140@psf.upfronthosting.co.za> Changes by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 04:45:07 2017 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 23 Apr 2017 08:45:07 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1492937107.38.0.666157287777.issue30140@psf.upfronthosting.co.za> Mark Dickinson added the comment: This is probably worth bringing up on the python-dev or python-ideas mailing lists for greater visibility. I can't think of any plausible non-historical reason why it makes sense for comparisons to behave one way and arithmetic operators another. Altering this might be a PEP-level change, though. The "Coercion rules" section[1] of the Python 2.7 docs is a bit more explicit about the intent: """ Exception to the previous item: if the left operand is an instance of a built-in type or a new-style class, and the right operand is an instance of a proper subclass of that type or class and overrides the base?s __rop__() method, the right operand?s __rop__() method is tried before the left operand?s __op__() method. """ so the check for an override was clearly intentional, rather than an implementation convenience or accident. (It's also clearly intentional in the source and comments.) The 3.x docs don't have the "and overrides" language; I haven't figured out why and when that language changed. [1] https://docs.python.org/release/2.7.6/reference/datamodel.html#coercion-rules ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 06:30:49 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Sun, 23 Apr 2017 10:30:49 +0000 Subject: [issue30141] If you forget to call do_handshake, then everything seems to work but hostname is disabled Message-ID: <1492943449.26.0.474412408504.issue30141@psf.upfronthosting.co.za> New submission from Nathaniel Smith: Basically what it says in the title... if you create an SSL object via wrap_socket with do_handshake_on_connect=False, or via wrap_bio, and then forget to call do_handshake and just go straight to sending and receiving data, then the encrypted connection is successfully established and everything seems to work. However, in this mode the hostname is silently *not* checked, so the connection is vulnerable to MITM attacks. (I guess from reading the SSL_read and SSL_write manpages that openssl is just silently doing the handshake automatically ? very helpfully! ? but it's only Python's do_handshake code that knows to check the hostname?) This doesn't affect correctly written programs that follow the documentation and either use do_handshake_on_connect=True (the default for wrap_socket) or explicitly call do_handshake, so it's not a super-scary bug. But IMHO it definitely shouldn't be this easy to silently fail-open. The attached test script sets up a TLS echo server that has a certificate for the host "trio-test-1.example.org" that's signed by a locally trusted CA, and then checks: - connecting to it with do_handshake and expecting the correct hostname: works, as expected - connecting to it with do_handshake and expecting a different hostname: correctly raises an error due to the mismatched hostnames - connecting to it withOUT do_handshake and expecting a different hostname: incorrectly succeeds at connecting, sending data, receiving data, etc., without any error and it checks using both ctx.wrap_socket(..., do_handshake_on_connect=False) and a little custom socket wrapper class defined using ctx.wrap_bio(...). I've only marked 3.5 and 3.6 as affected because those are the only versions I've tested, but I suspect other versions are affected as well. ---------- assignee: christian.heimes components: SSL files: ssl-handshake.zip messages: 292158 nosy: christian.heimes, njs priority: normal severity: normal status: open title: If you forget to call do_handshake, then everything seems to work but hostname is disabled versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file46827/ssl-handshake.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 07:15:19 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 23 Apr 2017 11:15:19 +0000 Subject: [issue26143] Ensure that IDLE's stdlib imports are from the stdlib In-Reply-To: <1453089950.28.0.356846327087.issue26143@psf.upfronthosting.co.za> Message-ID: <1492946119.93.0.748199540586.issue26143@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I will make this one of my priority issues once I get up to speed with the new workflow. However, it is not a trivial issue, and I am not sure that all my beliefs of a year ago were correct. What I really do not want to do is break IDLE running when users do not make a mistake. Do you have access to IDLE on any system other than Windows? ---------- stage: needs patch -> test needed versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 07:57:03 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 23 Apr 2017 11:57:03 +0000 Subject: [issue26143] Ensure that IDLE's stdlib imports are from the stdlib In-Reply-To: <1453089950.28.0.356846327087.issue26143@psf.upfronthosting.co.za> Message-ID: <1492948623.55.0.211223421736.issue26143@psf.upfronthosting.co.za> Terry J. Reedy added the comment: >From the viewpoint of IDLE and masking, the stdlib has three parts: idlelib, other modules that IDLE imports, and other modules that IDLE does not import. As I already noted, this division is different for IDLE and user processes. IDLE may delay importing some idlelib modules, and I intend to do this more if possible. But I am not going to worry about someone creating an idlelib directory with duplicate names. If someone does this, too bad. Modules that IDLE does not import are not a concern for the operation of IDLE. If a *user* program masks an stdlib module that the program intends to import, it is not IDLE's direct concern. This issue is about other modules that IDLE *does* import -- directly *or* indirectly. IDLE does not import 'random' -- the word does not appear in idlelib. On the other hand, in 3.6.1, >>> import sys >>> 'random' in sys.modules True For a user random.py to block IDLE startup, it must be that some module that imports it accesses some attribute during import, possibly as part of a 'from' import. In order to make new code unit-testable, it should be put in a new 'fix_path' function, with a detailed specification. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 07:59:48 2017 From: report at bugs.python.org (Christian Heimes) Date: Sun, 23 Apr 2017 11:59:48 +0000 Subject: [issue30141] If you forget to call do_handshake, then everything seems to work but hostname is disabled In-Reply-To: <1492943449.26.0.474412408504.issue30141@psf.upfronthosting.co.za> Message-ID: <1492948788.54.0.063578734835.issue30141@psf.upfronthosting.co.za> Christian Heimes added the comment: Sigh, this is the seventh or eight security issue related to Python's hostname verification, maybe more. I know for years that Python's current approach is buggy and a collection of bad ideas. That's it, I'm going to rip out ssl.match_hostname() and let OpenSSL handle all verification internally. I've been working on another PEP that features the change for quite some time. I'll to finish my SSL PEP before PyCon and language summit. Here is a quick proof-of-concept implementation (requires OpenSSL >= 1.0.2 and libressl >= 2.5). https://github.com/tiran/cpython/tree/openssl_check_hostname ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 08:00:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 12:00:24 +0000 Subject: [issue30142] The "callable" fixer doesn't exist Message-ID: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The "callable" fixer was removed in dbdf029a5575f6e6ec0140260236963ed7d2c2be, but it still is mentioned in the documentation. https://docs.python.org/3/library/2to3.html#2to3fixer-callable ---------- assignee: docs at python components: 2to3 (2.x to 3.x conversion tool), Documentation messages: 292162 nosy: benjamin.peterson, docs at python, gregory.p.smith, serhiy.storchaka priority: normal severity: normal status: open title: The "callable" fixer doesn't exist versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 08:11:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 12:11:25 +0000 Subject: [issue30143] Using collections ABC from collections.abc rather than collections in 2to3 converted code Message-ID: <1492949485.71.0.267091337094.issue30143@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch makes 2to3 generating a code that uses abstract collection classes Sequence and Mapping from collections.abc rather than collections. Since abstract collection classes now are defined in collections.abc and collections contains only aliases for compatibility, this is more idiomatic Python 3 code. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 292163 nosy: benjamin.peterson, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Using collections ABC from collections.abc rather than collections in 2to3 converted code type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 08:13:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 12:13:57 +0000 Subject: [issue30143] Using collections ABC from collections.abc rather than collections in 2to3 converted code In-Reply-To: <1492949485.71.0.267091337094.issue30143@psf.upfronthosting.co.za> Message-ID: <1492949637.07.0.252916237346.issue30143@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1375 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 08:29:38 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Sun, 23 Apr 2017 12:29:38 +0000 Subject: [issue30141] If you forget to call do_handshake, then everything seems to work but hostname checking is disabled In-Reply-To: <1492943449.26.0.474412408504.issue30141@psf.upfronthosting.co.za> Message-ID: <1492950578.16.0.761606614505.issue30141@psf.upfronthosting.co.za> Changes by Nathaniel Smith : ---------- title: If you forget to call do_handshake, then everything seems to work but hostname is disabled -> If you forget to call do_handshake, then everything seems to work but hostname checking is disabled _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 08:30:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 12:30:13 +0000 Subject: [issue30144] Import collections ABC from collections.abc rather than collections Message-ID: <1492950613.95.0.166673742213.issue30144@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Now abstract collection classes are defined in collections.abc rather than collections. collections contains just aliases for compatibility. Importing collections ABC from collections.abc is more idiomatic. And when aliases will be removed from collection this will be the only way. But some code still imports them from collections. Proposed patch makes it importing them from collections.abc. The most basic modules like locale, weakref and pathlib could import them just from _collections_abc for decreasing the startup time, but this is different issue. The patch doesn't touch the collections module itself and its tests, and the _decimal module which imports collections.MutableMapping in C code (changing this would require more rewriting). ---------- components: Library (Lib) messages: 292164 nosy: rhettinger, serhiy.storchaka, stutzbach priority: normal severity: normal stage: patch review status: open title: Import collections ABC from collections.abc rather than collections type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 08:32:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 12:32:03 +0000 Subject: [issue30144] Import collections ABC from collections.abc rather than collections In-Reply-To: <1492950613.95.0.166673742213.issue30144@psf.upfronthosting.co.za> Message-ID: <1492950723.12.0.890009682824.issue30144@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1376 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 08:59:15 2017 From: report at bugs.python.org (Stefan Krah) Date: Sun, 23 Apr 2017 12:59:15 +0000 Subject: [issue30144] Import collections ABC from collections.abc rather than collections In-Reply-To: <1492950613.95.0.166673742213.issue30144@psf.upfronthosting.co.za> Message-ID: <1492952355.83.0.242144061327.issue30144@psf.upfronthosting.co.za> Stefan Krah added the comment: I thought splitting off abc was done for performance reasons (reduce the number of imports at Python startup), not for more idiomatic code. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 09:28:47 2017 From: report at bugs.python.org (Eric Wieser) Date: Sun, 23 Apr 2017 13:28:47 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1492954127.6.0.559923175937.issue30140@psf.upfronthosting.co.za> Changes by Eric Wieser : ---------- nosy: +Eric.Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 09:32:46 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 13:32:46 +0000 Subject: [issue30144] Import collections ABC from collections.abc rather than collections In-Reply-To: <1492950613.95.0.166673742213.issue30144@psf.upfronthosting.co.za> Message-ID: <1492954366.92.0.194997271414.issue30144@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If this is the main cause I can replace collections.abc in this patch with _collections_abc. But I prefer to do this in separate commit. My next patch will include other changes for the number of imports. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 09:36:28 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 23 Apr 2017 13:36:28 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1492954588.03.0.756934032552.issue30142@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- assignee: docs at python -> Mariatta keywords: +easy nosy: +Mariatta stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 10:47:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 14:47:00 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1492958820.54.0.929448885687.issue30024@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1377 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 10:51:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 14:51:39 +0000 Subject: [issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']` In-Reply-To: <1491736314.56.0.10945117979.issue30024@psf.upfronthosting.co.za> Message-ID: <1492959099.0.0.822707524792.issue30024@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 1264 implements this idea. Seems this is a duplicate of issue23203 which contains the same idea. ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 11:16:42 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 23 Apr 2017 15:16:42 +0000 Subject: [issue30145] Create a How to or Tutorial documentation for asyncio Message-ID: <1492960602.26.0.461554169011.issue30145@psf.upfronthosting.co.za> New submission from Mariatta Wijaya: We could use a How To or a tutorial for asyncio in the docs. ---------- assignee: docs at python components: Documentation, asyncio messages: 292168 nosy: Mariatta, docs at python, yselivanov priority: normal severity: normal status: open title: Create a How to or Tutorial documentation for asyncio versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 11:31:29 2017 From: report at bugs.python.org (Matthew Cowles) Date: Sun, 23 Apr 2017 15:31:29 +0000 Subject: [issue26143] Ensure that IDLE's stdlib imports are from the stdlib In-Reply-To: <1453089950.28.0.356846327087.issue26143@psf.upfronthosting.co.za> Message-ID: <1492961489.54.0.536082813704.issue26143@psf.upfronthosting.co.za> Matthew Cowles added the comment: > Do you have access to IDLE on any system other than Windows? I don't have a Windows machine at all. For what it's worth, here's the behavior I'm talking about, albeit with an old version of Python: $ mkdir testidle $ cd testidle $ /usr/local/bin/python /Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/idlelib/idle.py # Works $ >random.py $ /usr/local/bin/python /Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/idlelib/idle.py [. . .] Unhandled server exception! Thread: SockThread [. . .] import tempfile File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 34, in from random import Random as _Random ImportError: cannot import name Random *** Unrecoverable, server exiting! Of course no one starts IDLE from a command line in real life and so a beginner gets send down a blind alley with a misleading error message about firewall software. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 12:06:43 2017 From: report at bugs.python.org (Brett Cannon) Date: Sun, 23 Apr 2017 16:06:43 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1492963603.38.0.187581728156.issue23404@psf.upfronthosting.co.za> Brett Cannon added the comment: Yep, that's exactly what I was suggesting, Martin (and sorry if I missed you saying that earlier; on vacation so trying to keep email/open source time to minimum :) . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 12:21:07 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Apr 2017 16:21:07 +0000 Subject: [issue30144] Import collections ABC from collections.abc rather than collections In-Reply-To: <1492950613.95.0.166673742213.issue30144@psf.upfronthosting.co.za> Message-ID: <1492964467.21.0.73014181566.issue30144@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 This patch looks like a step in the right direction. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 12:31:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Apr 2017 16:31:20 +0000 Subject: [issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode In-Reply-To: <1469446931.7.0.792781039481.issue27613@psf.upfronthosting.co.za> Message-ID: <1492965080.78.0.606176365062.issue27613@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Per PEP-8, the Python preferred-style is, "For sequences, (strings, lists, tuples), use the fact that empty sequences are false." Yes: if not seq: if seq: No: if len(seq): if not len(seq): The Python libraries are not obliged to defend themselves against non-sensical types (i.e. defining an empty iterator as a subclass of list and returning a non-zero len). I recommend leaving the code as-is and closing a "not a bug". In a way, this report is no more interesting than observing that a __hash__ that returns a random value on each call doesn't work well in a dictionary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 12:42:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 16:42:00 +0000 Subject: [issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode In-Reply-To: <1469446931.7.0.792781039481.issue27613@psf.upfronthosting.co.za> Message-ID: <1492965720.01.0.507663726787.issue27613@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This looks as a strong argument to me. Thanks Raymond. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 12:45:55 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Apr 2017 16:45:55 +0000 Subject: [issue29352] provide the authorative source for s[i:j] negative slice indices (<-len(s)) behavior for standard sequences In-Reply-To: <1485190156.24.0.631194950251.issue29352@psf.upfronthosting.co.za> Message-ID: <1492965955.71.0.511974210179.issue29352@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 13:18:28 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 23 Apr 2017 17:18:28 +0000 Subject: [issue29619] st_ino (unsigned long long) is casted to long long in posixmodule.c:_pystat_fromstructstat In-Reply-To: <1487766242.34.0.703380697066.issue29619@psf.upfronthosting.co.za> Message-ID: <1492967908.84.0.939751554727.issue29619@psf.upfronthosting.co.za> Xavier de Gaye added the comment: sizeof(unsigned long long) is 8 on Android x86 and HAVE_LARGEFILE_SUPPORT is undefined. According to msg280053 HAVE_LARGEFILE_SUPPORT is also undefined on Android x86_64 (and also on Linux x86_64). > Maybe the code should be simplified to always use unsigned long long. Yes. If I understand correcty, one could only use 'unsigned long long' to assert at build time and use the smallest of the two unsigned long that fits with the size of st->st_ino at runtime. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 14:07:49 2017 From: report at bugs.python.org (Horacio Hoyos) Date: Sun, 23 Apr 2017 18:07:49 +0000 Subject: [issue30146] Fix for issue 8743 not available in python MacOS 3.6.1 Message-ID: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> New submission from Horacio Hoyos: Hi, attempt 2. My system is MacOs Yosemite (10.10.5), I have installed Python 3.6.1 downloaded from the official Python website. I was having issues while testing a custom Set implementation using the _collections_abc base MutableSet and found that my issue was apparently resolved with issue 8743. From the fix, in the attached script I would expect the and operation between my set implementation and a string to fail with a TypeError, given that string is not an instance of Set. However, the error is not raised, i.e. the print statement is executed. >From the discussion on issue 8743, I would expect _collections_abc.py to have a test for Set instances, but is not the case (for example): def __and__(self, other): if not isinstance(other, Iterable): return NotImplemented return self._from_iterable(value for value in other if value in self) That is, I was expecting a isinstance(other, Set) somewhere there. In my previous post I was told my python installation was broken. However, I checked the collections_abc.py in my windows system and is the same. I am not an expert on the Python build system, but the patch in bug 8743 applies to /Lib/_abcoll.py, but I guess _collections_abc.py is generated somehow. ---------- components: Library (Lib), macOS messages: 292175 nosy: Horacio Hoyos, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Fix for issue 8743 not available in python MacOS 3.6.1 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 14:13:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 18:13:32 +0000 Subject: [issue25794] __setattr__ does not always overload operators In-Reply-To: <1449219157.0.0.30103039285.issue25794@psf.upfronthosting.co.za> Message-ID: <1492971212.41.0.220198825695.issue25794@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Eryk, could you create a pull request? Please take into account my and Berker's comments on Rietveld. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 14:39:56 2017 From: report at bugs.python.org (Greg Lindahl) Date: Sun, 23 Apr 2017 18:39:56 +0000 Subject: [issue30147] change in interface for compiled regex.pattern Message-ID: <1492972796.84.0.355071171235.issue30147@psf.upfronthosting.co.za> New submission from Greg Lindahl: The following script runs fine in python 3.6 and recently started failing the assertion in 3.7-dev and nightly import re r = re.compile(re.escape('/foo')) print(r) print(r.pattern) assert r.pattern.startswith('\\/') ---------- components: Regular Expressions messages: 292177 nosy: ezio.melotti, mrabarnett, wumpus priority: normal severity: normal status: open title: change in interface for compiled regex.pattern versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 15:00:24 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 23 Apr 2017 19:00:24 +0000 Subject: [issue30146] Fix for issue 8743 not available in python MacOS 3.6.1 In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1492974024.4.0.707273688876.issue30146@psf.upfronthosting.co.za> R. David Murray added the comment: You don't appear to have successfully attached the script. Can you try again please? The patching in the issue you point to does not patch __and__, it just sets it equal to __rand__. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 15:10:05 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 23 Apr 2017 19:10:05 +0000 Subject: [issue30147] change in re.escape output is not docuented in whatsnew In-Reply-To: <1492972796.84.0.355071171235.issue30147@psf.upfronthosting.co.za> Message-ID: <1492974605.98.0.173747399863.issue30147@psf.upfronthosting.co.za> R. David Murray added the comment: re.escape was escaping too much previously, and this has been fixed in 3.7 (and only 3.7, because it may cause testing issues such as you have observed). See issue 29995. A note needs to be added to the 'porting' section of whats new covering this. ---------- assignee: -> docs at python components: +Documentation -Regular Expressions nosy: +docs at python, r.david.murray, serhiy.storchaka stage: -> needs patch title: change in interface for compiled regex.pattern -> change in re.escape output is not docuented in whatsnew type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 15:25:37 2017 From: report at bugs.python.org (Ned Deily) Date: Sun, 23 Apr 2017 19:25:37 +0000 Subject: [issue30146] Fix for issue 8743 not available in python MacOS 3.6.1 In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1492975537.44.0.233395644252.issue30146@psf.upfronthosting.co.za> Ned Deily added the comment: And rather than focusing on what lines of code you believe are missing, please provide a complete script or lines of Python code with any instructions on how to run them, the actual output you see when you run it, and what you expect the output should be. Otherwise, we just have to guess at what the issue here is and we'll probably guess wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 15:26:02 2017 From: report at bugs.python.org (Jussi Pakkanen) Date: Sun, 23 Apr 2017 19:26:02 +0000 Subject: [issue30148] Pathological regex behaviour Message-ID: <1492975562.82.0.745519478527.issue30148@psf.upfronthosting.co.za> New submission from Jussi Pakkanen: Attached is a script that runs a single regex against one line of text taking over 12 seconds. If you run the exact same regex in Perl it finishes immediately. The slowness has something to do with spaces. If you replace consecutive spaces in the input with one, the evaluation is immediate. This bug was originally discovered here: https://bugzilla.gnome.org/show_bug.cgi?id=781569 ---------- components: Regular Expressions files: retest.py messages: 292181 nosy: ezio.melotti, jpakkane, mrabarnett priority: normal severity: normal status: open title: Pathological regex behaviour type: resource usage Added file: http://bugs.python.org/file46828/retest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 15:39:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 19:39:06 +0000 Subject: [issue30147] Change in re.escape output is not documented in whatsnew In-Reply-To: <1492972796.84.0.355071171235.issue30147@psf.upfronthosting.co.za> Message-ID: <1492976346.83.0.0928327921702.issue30147@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- title: change in re.escape output is not docuented in whatsnew -> Change in re.escape output is not documented in whatsnew _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 15:47:04 2017 From: report at bugs.python.org (Horacio Hoyos) Date: Sun, 23 Apr 2017 19:47:04 +0000 Subject: [issue30146] Fix for issue 8743 not available in python MacOS 3.6.1 In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1492976824.86.0.0314746540551.issue30146@psf.upfronthosting.co.za> Horacio Hoyos added the comment: Guess my second attempt didn't work as expected ;-). I have attached the file now. To run just invoke the script: $ python3 example.py s&t did not screen-out general iterables I would expect to see no output. ---------- Added file: http://bugs.python.org/file46829/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 16:04:05 2017 From: report at bugs.python.org (Matthew Barnett) Date: Sun, 23 Apr 2017 20:04:05 +0000 Subject: [issue30148] Pathological regex behaviour In-Reply-To: <1492975562.82.0.745519478527.issue30148@psf.upfronthosting.co.za> Message-ID: <1492977845.96.0.211455511043.issue30148@psf.upfronthosting.co.za> Matthew Barnett added the comment: If 'ignores' is '', you get this: (?:\b(?:extern|G_INLINE_FUNC|%s)\s*) which can match an empty string, and it's tried repeatedly. That's inadvisable. There's also: (?:\s+|\*)+ which can match whitespace in multiple ways. That's inadvisable too. If the pattern really doesn't match the string (and it doesn't!), then it won't find out until it has tried _all_ of the possibilities. Some implementations, such as Perl's, have extra checks to try to reduce the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 16:18:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 23 Apr 2017 20:18:25 +0000 Subject: [issue30149] inspect.signature() doesn't support partialmethod without explicit self parameter Message-ID: <1492978705.31.0.200843668782.issue30149@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: >>> import functools, inspect >>> class A: ... f = functools.partialmethod((lambda self, x, y, *args: ...), 1) ... >>> inspect.signature(A.f) >>> class A: ... f = functools.partialmethod((lambda *args: ...), 1) ... >>> inspect.signature(A.f) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/inspect.py", line 3007, in signature return Signature.from_callable(obj, follow_wrapped=follow_wrapped) File "/home/serhiy/py/cpython/Lib/inspect.py", line 2757, in from_callable follow_wrapper_chains=follow_wrapped) File "/home/serhiy/py/cpython/Lib/inspect.py", line 2227, in _signature_from_callable return sig.replace(parameters=new_params) File "/home/serhiy/py/cpython/Lib/inspect.py", line 2780, in replace return_annotation=return_annotation) File "/home/serhiy/py/cpython/Lib/inspect.py", line 2725, in __init__ raise ValueError(msg) ValueError: duplicate parameter name: 'args' ---------- components: Library (Lib) messages: 292184 nosy: ncoghlan, rhettinger, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: inspect.signature() doesn't support partialmethod without explicit self parameter type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 16:45:03 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 23 Apr 2017 20:45:03 +0000 Subject: [issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode In-Reply-To: <1469446931.7.0.792781039481.issue27613@psf.upfronthosting.co.za> Message-ID: <1492980303.89.0.32087754995.issue27613@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thank you Raymond. What I missed before is a) the OP's misnamed EmptyIterator is an iterable (possibly non-empty) but not an iterator, empty or otherwise, and b) a sequence __len__ that lies is just a bug. (So is a iterator that does not yield the contents of a collection.) A non-0 length(lst) is a promise that lst[0] exists. Depending on this is routine. If json.encoder line 296, 'for value in lst:' were replaced by the following, which should be equivalent, for i in range(len(list)): value = lst[i] the encoding would die with IndexError. The intention that buggy code should not cause a crash was met in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 17:14:23 2017 From: report at bugs.python.org (Ned Deily) Date: Sun, 23 Apr 2017 21:14:23 +0000 Subject: [issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1492982063.76.0.0954946128678.issue30146@psf.upfronthosting.co.za> Ned Deily added the comment: OK, thanks for supplying a concrete example. From it, it's clear that it has nothing specific to do with Python on macOS. Adding Raymond as maintainer of sets. ---------- components: -macOS nosy: +rhettinger -ronaldoussoren title: Fix for issue 8743 not available in python MacOS 3.6.1 -> Difference in behavior between set() and collections.abc.MutableSet() derived objects _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 18:01:08 2017 From: report at bugs.python.org (Julian Taylor) Date: Sun, 23 Apr 2017 22:01:08 +0000 Subject: [issue30150] raw debug allocators to not return malloc alignment Message-ID: <1492984868.37.0.0606415089722.issue30150@psf.upfronthosting.co.za> New submission from Julian Taylor: The debug raw allocator do not return the same alignment as malloc. See _PyMem_DebugRawAlloc: https://github.com/python/cpython/blob/master/Objects/obmalloc.c#L1873 The line return p + 2*SST adds 2 * sizeof(size_t) to the pointer returned by malloc. On for example x32 malloc returns 16 byte aligned memory but size_t is 4 bytes. This makes all memory returned by the debug allocators not aligned the what the system assumes on such platforms. ---------- components: Interpreter Core messages: 292187 nosy: jtaylor priority: normal severity: normal status: open title: raw debug allocators to not return malloc alignment versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 21:26:47 2017 From: report at bugs.python.org (Stephan Hoyer) Date: Mon, 24 Apr 2017 01:26:47 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1492997207.23.0.402945334188.issue30140@psf.upfronthosting.co.za> Stephan Hoyer added the comment: Posted to python-ideas: https://mail.python.org/pipermail/python-ideas/2017-April/045451.html Mark -- just out of curiosity, could you point me to where this logic is implemented in CPython's source? This feels like something that could once been called a bug but that by now may have become a feature, by virtue of how long it's lasted out in the world. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 23:04:16 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 24 Apr 2017 03:04:16 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1493003056.55.0.466600767398.issue30140@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 23:54:11 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 03:54:11 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006051.93.0.589489722594.issue29751@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 26896f2832324dde85cdd63d525571ca669f6f0b by Mariatta (csabella) in branch 'master': bpo-29751: Improve PyLong_FromString documentation (GH-915) https://github.com/python/cpython/commit/26896f2832324dde85cdd63d525571ca669f6f0b ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 23:56:13 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 03:56:13 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006173.45.0.365170204621.issue29751@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 23:56:20 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 03:56:20 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006180.47.0.761162333864.issue29751@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1378 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 23 23:56:23 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 03:56:23 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006183.96.0.159706466635.issue29751@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1379 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 00:02:00 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 04:02:00 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006520.36.0.373940301051.issue29751@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1380 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 00:02:32 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 04:02:32 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006552.55.0.288169963101.issue29751@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset d51d093b9bbca108f59bad0f1730c48ebf5b2e14 by Mariatta in branch '3.5': [3.5] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1267) https://github.com/python/cpython/commit/d51d093b9bbca108f59bad0f1730c48ebf5b2e14 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 00:03:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 04:03:45 +0000 Subject: [issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1493006625.71.0.828101730659.issue30146@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 00:05:03 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 04:05:03 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006703.52.0.958219736432.issue29751@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset ea0efa3bc1d0b832da75519c6f85d767ae44feda by Mariatta in branch '3.6': [3.6] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1266) https://github.com/python/cpython/commit/ea0efa3bc1d0b832da75519c6f85d767ae44feda ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 00:05:21 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 04:05:21 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006721.65.0.693707597232.issue29751@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 9eb5ca0774f94215be48442100c829db2484e146 by Mariatta in branch 'master': bpo-29751: add Cheryl Sabella to Misc/ACKS (GH-1268) https://github.com/python/cpython/commit/9eb5ca0774f94215be48442100c829db2484e146 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 00:06:38 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 04:06:38 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493006798.73.0.933224121119.issue29751@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: I merged the PR, backported it to 3.5 and 3.6, and added Cheryl to Misc/ACKS. Thanks everyone :) ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 00:25:41 2017 From: report at bugs.python.org (donkopotamus) Date: Mon, 24 Apr 2017 04:25:41 +0000 Subject: [issue30100] WeakSet should allow discard and remove on items that can't have weak references In-Reply-To: <1492579230.86.0.379456919312.issue30100@psf.upfronthosting.co.za> Message-ID: <1493007941.65.0.956151942711.issue30100@psf.upfronthosting.co.za> Changes by donkopotamus : ---------- title: WeakSet should all discard and remove on items that can have weak references -> WeakSet should allow discard and remove on items that can't have weak references _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 02:01:43 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 24 Apr 2017 06:01:43 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1493013703.11.0.721417267893.issue23404@psf.upfronthosting.co.za> Nick Coghlan added the comment: As Martin notes, my concern is that I can go for years without having to touch the low level files (since syntax changes are rare), so it's important to me to make it easy to remember and/or relearn how to regenerate them. However, suitable make commands (e.g. a "make regen" target, with "make regen-X" subtargets) would qualify as "easy to remember", and would also be amenable to automated testing in combination with a `make clobber-gen` command. (Tangent on target naming: I think 'rebuild' would be confusing, while 'regenerate' is a bit long, especially if there are more specific subtargets. 'regen' is just a shortened version of the latter) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 02:05:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 06:05:02 +0000 Subject: [issue30144] Import collections ABC from collections.abc rather than collections In-Reply-To: <1492950613.95.0.166673742213.issue30144@psf.upfronthosting.co.za> Message-ID: <1493013902.56.0.471372175296.issue30144@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 2e576f5aec1f8f23f07001e2eb3db9276851a4fc by Serhiy Storchaka in branch 'master': bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263) https://github.com/python/cpython/commit/2e576f5aec1f8f23f07001e2eb3db9276851a4fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 02:55:43 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Mon, 24 Apr 2017 06:55:43 +0000 Subject: [issue30151] Race condition in use of _PyOS_SigintEvent on windows Message-ID: <1493016943.26.0.351168771487.issue30151@psf.upfronthosting.co.za> New submission from Nathaniel Smith: As pointed out in this stackoverflow answer: http://stackoverflow.com/a/43578450/ and since I seem to be collecting signal-handling bugs these days :-), there's a race condition in how the interpreter uses _PyOS_SigintEvent to allow control-C to break out of functions like time.sleep on Windows. Suppose we have a call to time.sleep(), and the user hits control-C while it's running. What's supposed to happen is: - the windows implementation of pysleep in Modules/timemodule.c does ResetEvent(hInterruptEvent) - then it blocks waiting for the interrupt event to be set *or* the timeout to expire - the C-level signal handler runs in a new thread, which sets the "hey a signal arrived" flag and then sets the event - the main thread wakes up because the event is set, and runs PyErr_CheckSignals() - this notices that that the signal has arrived and runs the Python-level handler, all is good But what can happen instead is: - before doing CALL_FUNCTION, the eval loop checks to see if any signals have arrived. They haven't. - then the C implementation of time.sleep starts executing. - then a signal arrives; the signal handler sets the flag and sets the event - then the main thread clears the event again - then it blocks waiting for the event to be set or the timeout to expire. But the C-level signal handler's already done and gone, so we don't realize that the flag is set and we should wake up and run the Python-level signal handler. The solution is that immediately *after* calling ResetEvent(_PyOS_SigintEvent()) but *before* sleeping, we should call PyErr_CheckSignals(). This catches any signals that arrived before we called ResetEvent, and any signals that arrive after that will cause the event to become set and wake us up, so that eliminates the race condition. This same race-y pattern seems to apply to appear in Modules/timemodule.c, Modules/_multiprocessing/semaphore.c, and Modules/_winapi.c. _winapi.c also handles the event in a weird way that doesn't make sense to me ? if the user hits control-C it raises an OSError instead of running the signal handler? OTOH I *think* Modules/_io/winconsoleio.c already handles the race condition correctly, and I don't dare make a guess about whatever Parser/myreadline.c is doing. ---------- components: Interpreter Core messages: 292196 nosy: njs priority: normal severity: normal status: open title: Race condition in use of _PyOS_SigintEvent on windows versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 02:57:05 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Mon, 24 Apr 2017 06:57:05 +0000 Subject: [issue30151] Race condition in use of _PyOS_SigintEvent on windows In-Reply-To: <1493016943.26.0.351168771487.issue30151@psf.upfronthosting.co.za> Message-ID: <1493017025.64.0.78194070925.issue30151@psf.upfronthosting.co.za> Nathaniel Smith added the comment: Oh, I should also say that this isn't actually affecting me, I just figured that once I was aware of the bug it was worth making a record here. Might be a good starter bug for someone trying to get into CPython's internals :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 03:18:05 2017 From: report at bugs.python.org (Eryk Sun) Date: Mon, 24 Apr 2017 07:18:05 +0000 Subject: [issue30151] Race condition in use of _PyOS_SigintEvent on windows In-Reply-To: <1493016943.26.0.351168771487.issue30151@psf.upfronthosting.co.za> Message-ID: <1493018285.61.0.424492065299.issue30151@psf.upfronthosting.co.za> Changes by Eryk Sun : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 03:21:50 2017 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 24 Apr 2017 07:21:50 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1493018510.2.0.14134712767.issue30140@psf.upfronthosting.co.za> Mark Dickinson added the comment: > could you point me to where this logic is implemented in CPython's source? Most of the relevant code is in Objects/abstract.c and Objects/typeobject.c. A BINARY_ADD opcode (for example) ends up calling PyNumber_Add: https://github.com/python/cpython/blob/v3.6.1/Objects/abstract.c#L913 which in turn calls binary_op1, where you see an explicit check for the nb_add slots of the two operands being identical: https://github.com/python/cpython/blob/v3.6.1/Objects/abstract.c#L769-L770 For a user-defined class, the slots themselves are defined in typeobject.c. Here's where nb_add is defined: https://github.com/python/cpython/blob/v3.6.1/Objects/typeobject.c#L5952 and here's the explicit check for overloading in the SLOT1BIN macro definition: https://github.com/python/cpython/blob/v3.6.1/Objects/typeobject.c#L5796 There's also an explicit test for the arithmetic operation behaviour in Lib/test/test_descr.py. In short, I doubt this was ever a bug: everything points to this being a deliberate design decision. I hope someone on python-ideas can elaborate on the rationale behind that design decision (and also on why that rationale doesn't apply to comparisons). In contrast, it does seem plausible to me that the *comparison* failure to check for an explicit override may have been accidental. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 03:32:49 2017 From: report at bugs.python.org (Christian Heimes) Date: Mon, 24 Apr 2017 07:32:49 +0000 Subject: [issue30141] If you forget to call do_handshake, then everything seems to work but hostname checking is disabled In-Reply-To: <1492943449.26.0.474412408504.issue30141@psf.upfronthosting.co.za> Message-ID: <1493019169.15.0.810159415023.issue30141@psf.upfronthosting.co.za> Christian Heimes added the comment: The PR doesn't fix all bugs with the current approach. In the auto-handshake case, the struct members peer_cert and handshake_done are not set correctly. I'll look into the matter. Perhaps I can set them in the handshake or verify callback. if (self->peer_cert) X509_free (self->peer_cert); self->peer_cert = SSL_get_peer_certificate(self->ssl); self->handshake_done = 1; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 03:33:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 07:33:50 +0000 Subject: [issue30152] Reduce the number of imports for argparse Message-ID: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Since argparse becomes more used as standard way of parsing command-line arguments, the number of imports involved when import argparse becomes more important. Proposed patch reduces that number by 10 modules. Unpatched: $ ./python -c 'import sys; s = set(sys.modules); import argparse; print(len(s), len(sys.modules), len(set(sys.modules) - s)); print(sorted(set(sys.modules) - s))' 35 65 30 ['_collections', '_functools', '_heapq', '_locale', '_operator', '_sre', '_struct', 'argparse', 'collections', 'collections.abc', 'copy', 'copyreg', 'enum', 'functools', 'gettext', 'heapq', 'itertools', 'keyword', 'locale', 'operator', 're', 'reprlib', 'sre_compile', 'sre_constants', 'sre_parse', 'struct', 'textwrap', 'types', 'warnings', 'weakref'] $ ./python -S -c 'import sys; s = set(sys.modules); import argparse; print(len(s), len(sys.modules), len(set(sys.modules) - s)); print(sorted(set(sys.modules) - s))' 23 61 38 ['_collections', '_collections_abc', '_functools', '_heapq', '_locale', '_operator', '_sre', '_stat', '_struct', 'argparse', 'collections', 'collections.abc', 'copy', 'copyreg', 'enum', 'errno', 'functools', 'genericpath', 'gettext', 'heapq', 'itertools', 'keyword', 'locale', 'operator', 'os', 'os.path', 'posixpath', 're', 'reprlib', 'sre_compile', 'sre_constants', 'sre_parse', 'stat', 'struct', 'textwrap', 'types', 'warnings', 'weakref'] Patched: $ ./python -c 'import sys; s = set(sys.modules); import argparse; print(len(s), len(sys.modules), len(set(sys.modules) - s)); print(sorted(set(sys.modules) - s))' 35 55 20 ['_collections', '_functools', '_locale', '_operator', '_sre', 'argparse', 'collections', 'copyreg', 'enum', 'functools', 'itertools', 'keyword', 'operator', 're', 'reprlib', 'sre_compile', 'sre_constants', 'sre_parse', 'types', 'weakref'] $ ./python -S -c 'import sys; s = set(sys.modules); import argparse; print(len(s), len(sys.modules), len(set(sys.modules) - s)); print(sorted(set(sys.modules) - s))' 23 51 28 ['_collections', '_collections_abc', '_functools', '_locale', '_operator', '_sre', '_stat', 'argparse', 'collections', 'copyreg', 'enum', 'errno', 'functools', 'genericpath', 'itertools', 'keyword', 'operator', 'os', 'os.path', 'posixpath', 're', 'reprlib', 'sre_compile', 'sre_constants', 'sre_parse', 'stat', 'types', 'weakref'] The patch defers importing rarely used modules. For example textwrap and gettext are used only for output a help and error messages. The patch also makes argparse itself be imported only when the module is used as a script, not just imported. The patch also replaces importing collections.abc with _collections_abc in some other basic modules (like pathlib), this could allow to avoid importing the collections package if it is not used. Unavoided imports: * functools is used in re for decorating _compile_repl with lru_cache. * collections is used in functools for making CacheInfo a named tuple. * enum is used in re for creating RegexFlag. * types is used in enum for decorating some properties with DynamicClassAttribute. ---------- components: Library (Lib) messages: 292200 nosy: bethard, haypo, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Reduce the number of imports for argparse type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 03:35:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 07:35:37 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493019337.93.0.210220468625.issue30152@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1381 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 03:38:31 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 07:38:31 +0000 Subject: [issue29442] Replace optparse with argparse in setup.py In-Reply-To: <1486193188.24.0.532905655294.issue29442@psf.upfronthosting.co.za> Message-ID: <1493019511.71.0.47124163302.issue29442@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See also issue30152. It includes Chi's change for argparse (actually it was inspired by Chi's change) and much more. ---------- stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 03:41:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 07:41:43 +0000 Subject: [issue30144] Import collections ABC from collections.abc rather than collections In-Reply-To: <1492950613.95.0.166673742213.issue30144@psf.upfronthosting.co.za> Message-ID: <1493019703.37.0.491285480536.issue30144@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Issue30152 replaces some collections.abc with _collections_abc for performance reasons. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 03:51:36 2017 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 24 Apr 2017 07:51:36 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493020296.62.0.700850304288.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: @haypo: for your strict-aliasing notes collection, I highly recommend the recent paper "Detecting Strict Aliasing Violations" by P. Cuoq et. al. http://trust-in-soft.com/wp-content/uploads/2017/01/vmcai.pdf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:17:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 08:17:33 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493021853.45.0.223275434415.issue30124@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could we use Clang specific pragma in dtoa.c rather than a compiler option? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:35:04 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 24 Apr 2017 08:35:04 +0000 Subject: [issue29999] repr() of ImportError misses keyword arguments name and path In-Reply-To: <1491431351.79.0.0513888316468.issue29999@psf.upfronthosting.co.za> Message-ID: <1493022904.54.0.335665794184.issue29999@psf.upfronthosting.co.za> Berker Peksag added the comment: Including 'path' may make the repr less readable in some cases. +1 for 'name', though. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:40:11 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 24 Apr 2017 08:40:11 +0000 Subject: [issue11913] sdist refuses README.rst In-Reply-To: <1303613322.81.0.629577121535.issue11913@psf.upfronthosting.co.za> Message-ID: <1493023211.34.0.673834450135.issue11913@psf.upfronthosting.co.za> Berker Peksag added the comment: PR 563 has been merged. ---------- assignee: merwok -> components: -Distutils2 nosy: +berker.peksag, dstufft resolution: -> fixed stage: needs patch -> resolved status: open -> closed type: behavior -> enhancement versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:43:17 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 24 Apr 2017 08:43:17 +0000 Subject: [issue23404] 'make touch' does not work with git clones of the source repository In-Reply-To: <1423262765.96.0.527396909.issue23404@psf.upfronthosting.co.za> Message-ID: <1493023397.18.0.952438746998.issue23404@psf.upfronthosting.co.za> Martin Panter added the comment: A while ago I wrote a patch targetting Issue 22359 that may be a starting point for ?make regen?: . It pulled out three recipes into separate ?phony? targets: ?make graminit importlib importlib_external?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:45:47 2017 From: report at bugs.python.org (Kubilay Kocak) Date: Mon, 24 Apr 2017 08:45:47 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1493023547.28.0.603355069722.issue30104@psf.upfronthosting.co.za> Kubilay Kocak added the comment: Thank you for investigating Victor. This appears to require backporting to 3.6 and 3.5 which are also failing: FAIL: test_repr (test.test_float.ReprTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.5.koobs-freebsd-current.nondebug/build/Lib/test/test_float.py", line 674, in test_repr self.assertEqual(v, eval(repr(v))) AssertionError: 5.311000000000001e+245 != 5.311000000000002e+245 ---------------------------------------------------------------------- Ran 42 tests in 0.242s FAILED (failures=1, skipped=1) 7 tests failed again: test_cmath test_float test_json test_marshal test_math test_statistics test_strtod ---------- versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:46:49 2017 From: report at bugs.python.org (Kubilay Kocak) Date: Mon, 24 Apr 2017 08:46:49 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1493023609.75.0.721618019801.issue30104@psf.upfronthosting.co.za> Changes by Kubilay Kocak : ---------- stage: -> backport needed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:48:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 08:48:14 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1493023694.55.0.435373319522.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: > This appears to require backporting to 3.6 and 3.5 which are also failing: I'm aware of that and I plan to fix these versions as well (2.7 also, no?), but I would like to first decide if we "fix" dtoa.c aliasing, or if we restrict -fno-strict-aliasing flag on dtoa.c: see discussion on the issue #30124. It seems like restricting the flag to dtoa.c is the favorite option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:59:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 08:59:10 +0000 Subject: [issue29442] Replace optparse with argparse in setup.py In-Reply-To: <1486193188.24.0.532905655294.issue29442@psf.upfronthosting.co.za> Message-ID: <1493024350.54.0.156184064317.issue29442@psf.upfronthosting.co.za> STINNER Victor added the comment: I consider that the issue #30152 is now a dependency of this change. ---------- dependencies: +Reduce the number of imports for argparse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 04:59:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 08:59:27 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493024367.13.0.537320748266.issue30152@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +Chi Hsuan Yen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 05:03:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 09:03:54 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493024634.2.0.157511669302.issue30124@psf.upfronthosting.co.za> STINNER Victor added the comment: > Could we use Clang specific pragma in dtoa.c rather than a compiler option? If we decide to go for the -fno-strict-aliasing only for dtoa.c, I suggest to use it also for GCC. GCC might decide to also optimize dtoa.c further in the future. I don't think that the flag has a major impact on performance if it's restricted to dtoa.c, and it would simplify the build system to only have "per compiler" flags. (Ex: Does ICC also "miscompile" dtoa?) FreeBSD uses the following syntax to only add the flag on a specific C file. Does it work with GNU and BSD make? (is it a "portable" syntax?) CFLAGS.gdtoa_${src}+=-fno-strict-aliasing See https://svnweb.freebsd.org/changeset/base/313706 (linked from http://bugs.python.org/issue30104#msg292001). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 05:11:42 2017 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Mon, 24 Apr 2017 09:11:42 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1493025102.24.0.704021896499.issue30095@psf.upfronthosting.co.za> Walter D?rwald added the comment: The second link is a 404. For the v1 patch: The variable names are a bit inconsistent: The first uses "classes" all others use "styles". This should be consistent within itself and with the existing code, i.e. "classes" should be used. Also each class attribute should be preceded with a comment, explaining what the CSS class is used for. As these are now made public to be overwritten by subclasses, I wonder wether it would make sense to document these class attributes in Doc/library/calendar.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 05:23:49 2017 From: report at bugs.python.org (Oz Tiram) Date: Mon, 24 Apr 2017 09:23:49 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1493025829.05.0.00344947511167.issue30095@psf.upfronthosting.co.za> Oz Tiram added the comment: @Walter, I agree with you about consistent naming. Personally, I would prefer to name all the variables "styles". But I preferred not to break past compatibility too. So I guess we are stuck for a while with "classes". I will rename the variables. As for documenting that, I would also do that. Thanks for the feedback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 05:33:13 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 24 Apr 2017 09:33:13 +0000 Subject: [issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0 In-Reply-To: <1488922068.27.0.463542328186.issue29751@psf.upfronthosting.co.za> Message-ID: <1493026393.91.0.624801328247.issue29751@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Oh, I didn't expect that. That is so cool! Thanks Mariatta. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 05:35:38 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 24 Apr 2017 09:35:38 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493026538.77.0.481292851387.issue30052@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Since no one has said that this change shouldn't be made, I'll start working on this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 06:07:39 2017 From: report at bugs.python.org (Mattia Rizzolo) Date: Mon, 24 Apr 2017 10:07:39 +0000 Subject: [issue30150] raw debug allocators to not return malloc alignment In-Reply-To: <1492984868.37.0.0606415089722.issue30150@psf.upfronthosting.co.za> Message-ID: <1493028459.89.0.296800962957.issue30150@psf.upfronthosting.co.za> Changes by Mattia Rizzolo : ---------- nosy: +mapreri _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 06:23:35 2017 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Mon, 24 Apr 2017 10:23:35 +0000 Subject: [issue28969] lru_cache is not threadsafe In-Reply-To: <1481712564.52.0.530922236321.issue28969@psf.upfronthosting.co.za> Message-ID: <1493029415.8.0.39086001819.issue28969@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 06:29:30 2017 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Mon, 24 Apr 2017 10:29:30 +0000 Subject: [issue30153] lru_cache should support invalidations Message-ID: <1493029770.27.0.722684328954.issue30153@psf.upfronthosting.co.za> New submission from Jes?s Cea Avi?n: I think that "functools.lru_cache()" should have the ability to "invalidate" a (possibly cached) value. Something like: @functools.lru_cache() def func(param): ... func.invalidate(PARAM) # discard this cached call, or ignore if not cached ---------- messages: 292216 nosy: jcea priority: normal severity: normal stage: needs patch status: open title: lru_cache should support invalidations type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 06:31:14 2017 From: report at bugs.python.org (Martijn Pieters) Date: Mon, 24 Apr 2017 10:31:14 +0000 Subject: [issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad Message-ID: <1493029874.23.0.365021685695.issue30154@psf.upfronthosting.co.za> New submission from Martijn Pieters: You can't time out a process tree that includes a never-ending process, *and* which redirects stderr: cat >test.sh< /dev/null # never-ending EOF chmod +x test.sh python -c "import subprocess; subprocess.run(['./test.sh'], stderr=subprocess.PIPE, timeout=3)" This hangs forever; the timeout kicks in, but then the kill on the child process fails and Python forever tries to read stderr, which won't produce data. See https://github.com/python/cpython/blob/v3.6.1/Lib/subprocess.py#L407-L410. The `sh` process is killed, but listed as a zombie process and the `cat` process has migrated to parent id 1: ^Z bg jobs -lr [2]- 21906 Running bin/python -c "import subprocess; subprocess.run(['./test.sh'], stderr=subprocess.PIPE, timeout=3)" & pstree 21906 -+= 21906 mjpieters bin/python -c import subprocess; subprocess.run(['./test.sh'], stderr=subprocess.PIPE, timeout=3) \--- 21907 mjpieters (sh) ps -j | grep 'cat /dev/random' mjpieters 24706 1 24704 0 1 R s003 0:26.54 cat /dev/random mjpieters 24897 99591 24896 0 2 R+ s003 0:00.00 grep cat /dev/random Killing Python at that point leaves the `cat` process running indefinitely. Replace the `cat /dev/random > /dev/null` line with `sleep 10`, and the `subprocess.run()` call returns after 10+ seconds: cat >test.sh<", line 1, in File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py", line 403, in run with Popen(*popenargs, **kwargs) as process: File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py", line 707, in __init__ restore_signals, start_new_session) File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py", line 1326, in _execute_child raise child_exception_type(errno_num, err_msg) OSError: [Errno 8] Exec format error real 0m12.326s user 0m0.041s sys 0m0.018s When you redirect stdin instead, `process.communicate()` does return, but the `cat` subprocess runs on indefinitely nonetheless; only the `sh` process was killed. Is this something subprocess.run should handle better (perhaps by adding in a second timeout poll and a terminate())? Or should the documentation be updated to warn about this behaviour instead (with suitable advice on how to write a subprocess that can be killed properly). ---------- components: Library (Lib) messages: 292217 nosy: mjpieters priority: normal severity: normal status: open title: subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 06:56:51 2017 From: report at bugs.python.org (Kubilay Kocak) Date: Mon, 24 Apr 2017 10:56:51 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1493031411.65.0.242263924653.issue30104@psf.upfronthosting.co.za> Kubilay Kocak added the comment: 2.7 branch on koobs-freebsd-current worker doesn't appear to be failing currently, but there may be differences in (or a lack of equivalent) coverage compared to 3.*. I also note that -fno-strict-aliasing is being included in 2.7's compile arguments: cc -pthread -c -fno-strict-aliasing -OPT:Olimit=0 -g -O2 -g -O0 -Wall -Wstrict-prototypes ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 06:58:00 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 24 Apr 2017 10:58:00 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493031480.32.0.751774428993.issue30152@psf.upfronthosting.co.za> Berker Peksag added the comment: > The patch also makes argparse itself be imported only when the module > is used as a script, not just imported. +1. I'd move this into its own PR. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 07:01:01 2017 From: report at bugs.python.org (Martijn Pieters) Date: Mon, 24 Apr 2017 11:01:01 +0000 Subject: [issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad In-Reply-To: <1493029874.23.0.365021685695.issue30154@psf.upfronthosting.co.za> Message-ID: <1493031661.61.0.130025045687.issue30154@psf.upfronthosting.co.za> Martijn Pieters added the comment: Apologies, I copied the wrong sleep 10 demo. The correct demo is: cat >test.sh< #!/bin/sh > sleep 10 > EOF time bin/python -c "import subprocess; subprocess.run(['./test.sh'], stderr=subprocess.PIPE, timeout=3)" Traceback (most recent call last): File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py", line 405, in run stdout, stderr = process.communicate(input, timeout=timeout) File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py", line 836, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py", line 1497, in _communicate self._check_timeout(endtime, orig_timeout) File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py", line 864, in _check_timeout raise TimeoutExpired(self.args, orig_timeout) subprocess.TimeoutExpired: Command '['./test.sh']' timed out after 3 seconds During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py", line 410, in run stderr=stderr) subprocess.TimeoutExpired: Command '['./test.sh']' timed out after 3 seconds real 0m10.054s user 0m0.033s sys 0m0.015s ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 07:08:46 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 24 Apr 2017 11:08:46 +0000 Subject: [issue26534] subprocess.check_output with shell=True ignores the timeout In-Reply-To: <1457653531.44.0.556796452495.issue26534@psf.upfronthosting.co.za> Message-ID: <1493032126.06.0.896039757216.issue26534@psf.upfronthosting.co.za> Martin Panter added the comment: I don?t know enough about process groups and sessions to properly review, but some things that stand out: * Patch is missing documentation and tests * If the ?killpg? just wraps os.killpg, perhaps adding the method is not justified * Are there any race conditions with killing a process group that has already exited. When does a process group get freed and potentially reused (so you may kill the wrong group)? The ?send_signal? method (and others) have a check to avoid signalling an unrelated process. * The method is called killpg, and the doc string mentions SIGKILL, but the implementation says SIGTERM * What happens if you use killpg without starting a new session? If it kills the parent process as well, that sounds like a source of subtle bugs that may only be detected in unexpected cases (e.g. Ctrl+C or timeout) * Be aware of Issue 25942. It is not clear what should happen to the child process(es) when the timeout happens, or when the ?communicate? call is interrupted. * What platforms does this support and what happens if there is no platform support? ---------- nosy: +martin.panter stage: -> patch review type: behavior -> enhancement versions: +Python 3.7 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 07:20:28 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 24 Apr 2017 11:20:28 +0000 Subject: [issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad In-Reply-To: <1493029874.23.0.365021685695.issue30154@psf.upfronthosting.co.za> Message-ID: <1493032828.06.0.834119288756.issue30154@psf.upfronthosting.co.za> Martin Panter added the comment: This is similar to the problem described in Issue 26534, which proposes ?kill_group? and ?killpg? APIs as a solution. (FYI you should put a shebang at the start of the shell script, or call it as ?sh -c test.sh?, to fix the ?Exec format error?.) ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 07:25:36 2017 From: report at bugs.python.org (Dimitry Andric) Date: Mon, 24 Apr 2017 11:25:36 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493033136.53.0.67173882704.issue30124@psf.upfronthosting.co.za> Dimitry Andric added the comment: Note that gcc has documented accessing union members in this way as an "implementation defined" feature: https://gcc.gnu.org/onlinedocs/gcc/Structures-unions-enumerations-and-bit-fields-implementation.html#Structures-unions-enumerations-and-bit-fields-implementation They specifically mention an example that is very similar to the dtoa pattern as being allowed under *their* implementation, here: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Type-punning However, whether that means that it is generally allowed by all standards is unfortunately still rather vague. I have seen more than one complaint that the standards committees should make this very explicit, instead of weaseling it into post-release footnotes. That said, I'd like to reply to some other posters here. Eric V. Smith writes: > At most, I think Mark's idea to use -fno-strict-aliasing only on dtoa.c and nowhere else would be the better approach. Indeed, this is exactly the solution I chose for FreeBSD. Just the one file that needs it is compiled with -fno-strict-aliasing. The caveat is that this might not work when link-time optimization is in effect. Serhiy Storchaka writes: > Could we use Clang specific pragma in dtoa.c rather than a compiler option? Unfortunately, as far as I know, clang still does not support function-level optimization pragmas. Maybe it was implemented recently, but then you would still have to have a workaround for older versions. STINNER Victor writes: > If we decide to go for the -fno-strict-aliasing only for dtoa.c, I suggest to use it also for GCC. GCC might decide to also optimize dtoa.c further in the future. Theoretically they could, but as I pointed out above, they explicitly document this as a feature of their union implementation. I estimate the probability of them dropping this in the future to be near zero. > I don't think that the flag has a major impact on performance if it's restricted to dtoa.c, and it would simplify the build system to only have "per compiler" flags. (Ex: Does ICC also "miscompile" dtoa?) Disabling strict aliasing for just that file, or even just the one function it applies to (by splitting it off to a separate file, for instance) should not result in different assembly output, unless the compiler is very old and/or dumb. > FreeBSD uses the following syntax to only add the flag on a specific C file. Does it work with GNU and BSD make? (is it a "portable" syntax?) > > CFLAGS.gdtoa_${src}+=-fno-strict-aliasing No, this is specifically a feature of BSD's bsd.sys.mk infrastructure. It's most likely not compatible with GNU make. ---------- nosy: +dim _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 07:34:08 2017 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 24 Apr 2017 11:34:08 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493033648.77.0.625024240548.issue30124@psf.upfronthosting.co.za> Eric V. Smith added the comment: > Unfortunately, as far as I know, clang still does not support > function-level optimization pragmas. Maybe it was implemented > recently, but then you would still have to have a workaround> > for older versions. I realize the answer is probably "no", but I'll ask anyway. Do you know if they support whole-module optimization pragmas? That would still be better than mucking with makefiles to get a per-module flag. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 07:47:08 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 24 Apr 2017 11:47:08 +0000 Subject: [issue26534] subprocess.check_output with shell=True ignores the timeout In-Reply-To: <1457653531.44.0.556796452495.issue26534@psf.upfronthosting.co.za> Message-ID: <1493034427.99.0.966203921149.issue26534@psf.upfronthosting.co.za> Martin Panter added the comment: Issue 5115 is already open with patch that has an alternative API to the low-level ?killpg? method. It also has a Windows implementation and tests. I suggest to focus this bug on the higher-level ?kill_group? option. ---------- dependencies: +Extend subprocess.kill to be able to kill process groups _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 08:01:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 12:01:08 +0000 Subject: [issue28969] lru_cache is not threadsafe In-Reply-To: <1481712564.52.0.530922236321.issue28969@psf.upfronthosting.co.za> Message-ID: <1493035268.85.0.848228056046.issue28969@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 08:06:57 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 24 Apr 2017 12:06:57 +0000 Subject: [issue30153] lru_cache should support invalidations In-Reply-To: <1493029770.27.0.722684328954.issue30153@psf.upfronthosting.co.za> Message-ID: <1493035617.54.0.246499638846.issue30153@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Perhaps the existing ``cache_clear`` method could take optional arguments? def cache_clear(self, *args, **kw): if not (args or kw): # clear the entire cache else: # clear just the cache entry for *args, **kw ---------- components: +Library (Lib) nosy: +rhettinger, steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 08:14:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 12:14:07 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1493031411.65.0.242263924653.issue30104@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > I also note that -fno-strict-aliasing is being included in 2.7's compile arguments Ah right, PyObject structures of Python 2 doesn't respect strict aliasing... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 08:18:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 12:18:41 +0000 Subject: [issue30153] lru_cache should support invalidations In-Reply-To: <1493029770.27.0.722684328954.issue30153@psf.upfronthosting.co.za> Message-ID: <1493036321.75.0.223662252344.issue30153@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could cache_clear() clear the entire cache or discard just the cached call without arguments? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 08:22:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 12:22:00 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493036520.4.0.474813770445.issue30052@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 09:14:28 2017 From: report at bugs.python.org (Chi Hsuan Yen) Date: Mon, 24 Apr 2017 13:14:28 +0000 Subject: [issue29804] test_ctypes test_pass_by_value fails on arm64 (aarch64) architecture In-Reply-To: <1489413054.1.0.4012026352.issue29804@psf.upfronthosting.co.za> Message-ID: <1493039668.05.0.21496528592.issue29804@psf.upfronthosting.co.za> Changes by Chi Hsuan Yen : ---------- nosy: +Chi Hsuan Yen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 09:34:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 13:34:02 +0000 Subject: [issue30153] lru_cache should support invalidations In-Reply-To: <1493029770.27.0.722684328954.issue30153@psf.upfronthosting.co.za> Message-ID: <1493040842.6.0.383879814882.issue30153@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a duplicate of rejected issue28178. See also related issue17528, issue18577, issue19859, issue23030, issue26082, and issue28112. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 11:27:26 2017 From: report at bugs.python.org (Anthony Tuininga) Date: Mon, 24 Apr 2017 15:27:26 +0000 Subject: [issue30155] Add ability to get/set tzinfo on datetime instances in C API Message-ID: <1493047646.24.0.156322797242.issue30155@psf.upfronthosting.co.za> New submission from Anthony Tuininga: Right now there is no documented way to create a datetime instance with a tzinfo instance. The documented macros all hard code the value Py_None for the tzinfo parameter. Using the PyObject_Call() method instead of the macro for creating a datetime instance is ~5x slower. In addition, there is no macro or method for getting the tzinfo from an existing datetime instance. Perhaps creating DATE_GET_TZINFO and TIME_GET_TZINFO would be acceptable? The enhancement 10381 (http://bugs.python.org/issue10381) would also be needed. I can provide a GitHub PR if that would be helpful. I first want to make sure that such an effort would be appreciated! ---------- components: Library (Lib) messages: 292230 nosy: atuining priority: normal severity: normal status: open title: Add ability to get/set tzinfo on datetime instances in C API type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 12:35:31 2017 From: report at bugs.python.org (Daniel Lenski) Date: Mon, 24 Apr 2017 16:35:31 +0000 Subject: [issue30155] Add ability to get/set tzinfo on datetime instances in C API In-Reply-To: <1493047646.24.0.156322797242.issue30155@psf.upfronthosting.co.za> Message-ID: <1493051731.02.0.920452461258.issue30155@psf.upfronthosting.co.za> Changes by Daniel Lenski : ---------- nosy: +dlenski _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 13:06:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 17:06:19 +0000 Subject: [issue29822] inspect.isabstract does not work on abstract base classes during __init_subclass__ In-Reply-To: <1489597569.75.0.0334116955024.issue29822@psf.upfronthosting.co.za> Message-ID: <1493053579.17.0.105473850763.issue29822@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset fcfe80ec2592fed8b3941c79056a8737abef7d3b by Serhiy Storchaka (Nate) in branch 'master': bpo-29822: Make inspect.isabstract() work during __init_subclass__. (#678) https://github.com/python/cpython/commit/fcfe80ec2592fed8b3941c79056a8737abef7d3b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 13:09:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 17:09:07 +0000 Subject: [issue29822] inspect.isabstract does not work on abstract base classes during __init_subclass__ In-Reply-To: <1489597569.75.0.0334116955024.issue29822@psf.upfronthosting.co.za> Message-ID: <1493053747.91.0.704233108346.issue29822@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: patch review -> backport needed versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 13:28:06 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Mon, 24 Apr 2017 17:28:06 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493054886.7.0.239829179646.issue30152@psf.upfronthosting.co.za> Changes by Wolfgang Maier : ---------- nosy: +wolma _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 13:43:47 2017 From: report at bugs.python.org (Oren Tirosh) Date: Mon, 24 Apr 2017 17:43:47 +0000 Subject: [issue30156] PYTHONDUMPREFS segfaults on exit Message-ID: <1493055827.6.0.962682353128.issue30156@psf.upfronthosting.co.za> New submission from Oren Tirosh: Reproduce: Py_DEBUG build PYTHONDUMPREFS=1 ./python -c pass (big dump of reference information) Segmentation fault git-bisected to commit 7822f151b68e40376af657d267ff774439d9adb9 ---------- components: Interpreter Core messages: 292232 nosy: orent, serhiy.storchaka priority: normal severity: normal status: open title: PYTHONDUMPREFS segfaults on exit type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 13:58:13 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 17:58:13 +0000 Subject: [issue30039] Resuming a 'yield from' stack is broken if a signal arrives in the middle In-Reply-To: <1491903207.11.0.00986687800627.issue30039@psf.upfronthosting.co.za> Message-ID: <1493056693.99.0.339384419627.issue30039@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- assignee: -> yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 14:11:52 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 24 Apr 2017 18:11:52 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493057512.17.0.0736592534858.issue30052@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1382 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 14:30:07 2017 From: report at bugs.python.org (Eryk Sun) Date: Mon, 24 Apr 2017 18:30:07 +0000 Subject: [issue5115] Extend subprocess.kill to be able to kill process groups In-Reply-To: <1233370260.58.0.70597374825.issue5115@psf.upfronthosting.co.za> Message-ID: <1493058607.42.0.368856189793.issue5115@psf.upfronthosting.co.za> Eryk Sun added the comment: Using a Windows job object should be paired with the creation flag CREATE_SUSPENDED. Callers may also need CREATE_BREAKAWAY_FROM_JOB, but setting that creation flag shouldn't be integrated into Popen. The child has to be created suspended to ensure it doesn't spawn another process and exit before it's added to the job. Once it's in the job, call ResumeThread to start it. On Windows Vista and 7, the child may need to break away from Python's current job, if allowed. These older versions of Windows don't implement nested jobs, so adding the child to a job will fail if it's already in one. The job used by py.exe for python.exe isn't a problem in this case since it's configured for child processes to automatically break away, but python.exe may have been started directly and added to a job that's not configured for silent breakaway. ---------- nosy: +eryksun versions: +Python 3.7 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 14:46:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 18:46:48 +0000 Subject: [issue30156] PYTHONDUMPREFS segfaults on exit In-Reply-To: <1493055827.6.0.962682353128.issue30156@psf.upfronthosting.co.za> Message-ID: <1493059608.23.0.819884624471.issue30156@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1383 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 14:46:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 18:46:48 +0000 Subject: [issue26811] segfault due to null pointer in tuple In-Reply-To: <1461198016.05.0.40690695807.issue26811@psf.upfronthosting.co.za> Message-ID: <1493059608.44.0.956588577731.issue26811@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1384 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 14:51:52 2017 From: report at bugs.python.org (Oren Tirosh) Date: Mon, 24 Apr 2017 18:51:52 +0000 Subject: [issue30156] PYTHONDUMPREFS segfaults on exit In-Reply-To: <1493055827.6.0.962682353128.issue30156@psf.upfronthosting.co.za> Message-ID: <1493059912.3.0.848827654037.issue30156@psf.upfronthosting.co.za> Oren Tirosh added the comment: In addition to fixing this - perhaps PYTHONDUMPREFS or something similar should be added to test automation? It is apparently capable of uncovering some bugs that none of the other reference and recnt debugging tools could find. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 14:55:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 24 Apr 2017 18:55:59 +0000 Subject: [issue30156] PYTHONDUMPREFS segfaults on exit In-Reply-To: <1493055827.6.0.962682353128.issue30156@psf.upfronthosting.co.za> Message-ID: <1493060159.65.0.375482277072.issue30156@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The regression was added by the fix for issue26811. PR 1272 applies the alternate patch from issue26811. This doesn't harm the performance. $ ./python.patched -m perf timeit -q --compare-to ./python.default -s "from collections import namedtuple; P = namedtuple('P', 'x y'); p = P(1, 2)" --duplicate 1000 "p.x" Mean +- std dev: [python.default] 128 ns +- 7 ns -> [python.patched] 121 ns +- 7 ns: 1.05x faster (-5%) I thought about tests, but I don't know what is the best place for them. Seems other environment variables that controls debug output are not tested too. ---------- nosy: +haypo stage: -> patch review versions: +Python 3.5, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 15:05:12 2017 From: report at bugs.python.org (Oz Tiram) Date: Mon, 24 Apr 2017 19:05:12 +0000 Subject: [issue30095] HTMLCalendar allow custom classes In-Reply-To: <1492544277.59.0.956887104329.issue30095@psf.upfronthosting.co.za> Message-ID: <1493060712.42.0.823666336983.issue30095@psf.upfronthosting.co.za> Oz Tiram added the comment: Apparently, I forgot to push the second branch. It is now pushed. I renamed the class attribute names on the v1 branch. I still need to do the following: - Add docs - Fix existing tests and add new tests demonstrating the usage of the new attributes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 15:55:25 2017 From: report at bugs.python.org (Jussi Pakkanen) Date: Mon, 24 Apr 2017 19:55:25 +0000 Subject: [issue30148] Pathological regex behaviour In-Reply-To: <1492975562.82.0.745519478527.issue30148@psf.upfronthosting.co.za> Message-ID: <1493063725.04.0.236635812033.issue30148@psf.upfronthosting.co.za> Jussi Pakkanen added the comment: This is slow even when ignores is set to a non-empty value. It's not as slow but the real slowdown is in the whitespace regex. Here is a minimal sample: input = ' abc' re.search(r'(\s+)+d', input) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 16:33:56 2017 From: report at bugs.python.org (Tim Peters) Date: Mon, 24 Apr 2017 20:33:56 +0000 Subject: [issue30148] Pathological regex behaviour In-Reply-To: <1492975562.82.0.745519478527.issue30148@psf.upfronthosting.co.za> Message-ID: <1493066036.2.0.927759594789.issue30148@psf.upfronthosting.co.za> Tim Peters added the comment: Yes, that example takes time exponential in the number of blanks to (fail to) match - each time you add a blank to `input`, it essentially doubles the time required. It's _possible_ for an implementation to deduce that `(\s+)+` is an insanely inefficient way to spell `\s+`, like it's _possible_ for an implementation to deduce that 10**10**10 - 10**10**10 is an insanely inefficient way to spell 0. Python's does not. To understand what's going on, Friedl's book "Mastering Regular Expressions" is an excellent source. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 16:59:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 20:59:20 +0000 Subject: [issue30156] PYTHONDUMPREFS segfaults on exit In-Reply-To: <1493055827.6.0.962682353128.issue30156@psf.upfronthosting.co.za> Message-ID: <1493067560.62.0.00749013935485.issue30156@psf.upfronthosting.co.za> STINNER Victor added the comment: Come on, yet another crash from property_descr_get()??? It's the 3rd time... Do we really need this micro-optimization? Previous bugs and workarounds: - issue #26811 - issue #24276 Using the FASTCALL calling convention, no temporary tuple is created to pass arguments if you use the _PyObject_FastCall() API and if the called function supports this calling convention. Sadly, namedtuple.attr uses operator.itergetter, itemgetter_call() doesn't support the FASTCALL, and my tp_fastcall patch was rejected: issue #29259. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 17:14:58 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 24 Apr 2017 21:14:58 +0000 Subject: [issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta) In-Reply-To: <1487271247.7.0.447487107459.issue29581@psf.upfronthosting.co.za> Message-ID: <1493068498.58.0.261905760218.issue29581@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 17:17:20 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 24 Apr 2017 21:17:20 +0000 Subject: [issue28851] namedtuples field_names sequence preferred In-Reply-To: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> Message-ID: <1493068640.24.0.379828670639.issue28851@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1385 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 17:18:56 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 24 Apr 2017 21:18:56 +0000 Subject: [issue28851] namedtuples field_names sequence preferred In-Reply-To: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> Message-ID: <1493068736.68.0.10643357198.issue28851@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Hope it's OK that I've made a PR for these changes. ---------- nosy: +csabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 18:15:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 22:15:19 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493072119.08.0.586197872321.issue30131@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1386 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 18:41:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 22:41:38 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493073698.56.0.785752317373.issue30131@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4bcfa3a2363c30d406c6826e291b30c33a649d18 by Victor Stinner in branch 'master': bpo-30131: Cleanup threads in test_logging (#1275) https://github.com/python/cpython/commit/4bcfa3a2363c30d406c6826e291b30c33a649d18 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 18:45:32 2017 From: report at bugs.python.org (Dimitry Andric) Date: Mon, 24 Apr 2017 22:45:32 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493073932.92.0.473278952994.issue30124@psf.upfronthosting.co.za> Dimitry Andric added the comment: There is a "#pragma clang optimize", but it only has the options "on" or "off", for specific source locations. I guess that would defeat the purpose a little bit. :( As an experiment, and to show what would be needed (at minimum), I have attempted to make Python/dtoa.c completely aliasing-safe here: https://github.com/DimitryAndric/cpython/commit/29c3f6f5cd771fce5630f127b9e7054593e3160c This allowed to remove the -fno-strict-aliasing flag again, and it succeeded all tests, even with clang 5.0.0. It basically replaces the direct union member accesses with getters and setters, which do the right thing for clang. Note that even though those getters and setters use memcpy(), this is actually completely optimized away in the resulting assembly. (Old compilers might not fare that well, though.) In any case, while these are mostly mechanical changes, it is still a lot of code churn, and it should really be reviewed by the original maintainer of dtoa, David M. Gay. I have no idea whether he is still active, though... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 18:55:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 22:55:44 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493074544.6.0.219377083246.issue30124@psf.upfronthosting.co.za> STINNER Victor added the comment: > As an experiment, and to show what would be needed (at minimum), I have attempted to make Python/dtoa.c completely aliasing-safe here: > https://github.com/DimitryAndric/cpython/commit/29c3f6f5cd771fce5630f127b9e7054593e3160c Would it be technically possible to completely get ride of the union? For example, it would allow to replace: set_dval(rv, get_dval(rv) + sulp(rv, bc)); with: rv += sulp(rv, bc); Is it possible to replace Big0 and Big1 with Big double? etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 19:38:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 23:38:24 +0000 Subject: [issue30132] [Windows] test_distutils leaks a vc140.pdb file In-Reply-To: <1492791460.36.0.72947186821.issue30132@psf.upfronthosting.co.za> Message-ID: <1493077104.26.0.097740474584.issue30132@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1387 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 19:39:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Apr 2017 23:39:22 +0000 Subject: [issue30132] [Windows] test_distutils leaks a vc140.pdb file In-Reply-To: <1492791460.36.0.72947186821.issue30132@psf.upfronthosting.co.za> Message-ID: <1493077162.95.0.927235266188.issue30132@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, I found the guilty: test_build_ext, see linked PR which should fix the warning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 19:39:26 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Apr 2017 23:39:26 +0000 Subject: [issue1662581] the re module can perform poorly: O(2**n) versus O(n**2) Message-ID: <1493077166.5.0.139180457964.issue1662581@psf.upfronthosting.co.za> Changes by Gregory P. Smith : ---------- versions: +Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 19:40:02 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 24 Apr 2017 23:40:02 +0000 Subject: [issue1662581] the re module can perform poorly: O(2**n) versus O(n**2) Message-ID: <1493077202.27.0.990442981804.issue1662581@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Note that https://pypi.python.org/pypi/re2 exists today as well and offers a re module compatible interface. I haven't tried it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 20:07:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 00:07:32 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493078852.97.0.513498988437.issue30107@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1388 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 20:08:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 00:08:22 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493078902.85.0.200556294004.issue30107@psf.upfronthosting.co.za> STINNER Victor added the comment: The commit 2a1aed04b0943636f605543522e16cca1dc23e70 introduced a regression on macOS. The PR https://github.com/python/cpython/pull/1279 should fix it. http://buildbot.python.org/all/builders/x86-64%20El%20Capitan%203.x/builds/87/steps/test/logs/stdio ====================================================================== FAIL: test_daemon_threads_shutdown_stderr_deadlock (test.test_io.CMiscIOTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/test_io.py", line 3772, in test_daemon_threads_shutdown_stderr_deadlock self.check_daemon_threads_shutdown_deadlock('stderr') File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/test_io.py", line 3766, in check_daemon_threads_shutdown_deadlock self.assertFalse(err.strip('.!')) AssertionError: '2017-04-24 16:57:21.432 defaults[41046:2462851] \nThe domain/default pair of (com.apple.CrashReporter, DialogType) does not exist\n' is not false ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 20:11:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 00:11:12 +0000 Subject: [issue30132] [Windows] test_distutils leaks a vc140.pdb file In-Reply-To: <1492791460.36.0.72947186821.issue30132@psf.upfronthosting.co.za> Message-ID: <1493079072.24.0.481283080442.issue30132@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f6448e5d65c349576df6e83b8324b9c208e77615 by Victor Stinner in branch 'master': bpo-30132: distutils test_build_ext() uses temp_cwd() (#1278) https://github.com/python/cpython/commit/f6448e5d65c349576df6e83b8324b9c208e77615 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 20:11:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 00:11:27 +0000 Subject: [issue30132] [Windows] test_distutils leaks a vc140.pdb file In-Reply-To: <1492791460.36.0.72947186821.issue30132@psf.upfronthosting.co.za> Message-ID: <1493079087.02.0.796848384419.issue30132@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 21:18:03 2017 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Tue, 25 Apr 2017 01:18:03 +0000 Subject: [issue25949] Lazy creation of __dict__ in OrderedDict In-Reply-To: <1451047688.41.0.0988158472157.issue25949@psf.upfronthosting.co.za> Message-ID: <1493083083.62.0.505925727307.issue25949@psf.upfronthosting.co.za> Changes by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 21:18:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Apr 2017 01:18:20 +0000 Subject: [issue30153] lru_cache should support invalidations In-Reply-To: <1493029770.27.0.722684328954.issue30153@psf.upfronthosting.co.za> Message-ID: <1493083100.41.0.675893420555.issue30153@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Sorry Jes?s, I don't want to add feature creep to the LRU cache. FWIW, it is very easy to make your own variants from collections.OrderedDict. ---------- resolution: -> rejected stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 21:51:06 2017 From: report at bugs.python.org (Jake Davis) Date: Tue, 25 Apr 2017 01:51:06 +0000 Subject: [issue30157] csn.Sniffer.sniff() regex error Message-ID: <1493085066.27.0.612102662908.issue30157@psf.upfronthosting.co.za> New submission from Jake Davis: Line 220 of Lib/csv.py has an extra `>` in the first group: r'(?P>[^\w\n"\']) ---------- components: Library (Lib) messages: 292249 nosy: jcdavis1983 priority: normal pull_requests: 1389 severity: normal status: open title: csn.Sniffer.sniff() regex error versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 21:54:13 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 25 Apr 2017 01:54:13 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493085253.6.0.483530330475.issue30052@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: -> patch review versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 21:57:20 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 25 Apr 2017 01:57:20 +0000 Subject: [issue29617] Drop Python 3.4 support from asyncio In-Reply-To: <1487741869.94.0.0732011694463.issue29617@psf.upfronthosting.co.za> Message-ID: <1493085440.57.0.983740783446.issue29617@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 3e2ad8ec61a322370a6fbdfb2209cf74546f5e08 by INADA Naoki in branch 'master': bpo-29617: Remove Python 3.3 support from asyncio (GH-232) https://github.com/python/cpython/commit/3e2ad8ec61a322370a6fbdfb2209cf74546f5e08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 21:59:14 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 25 Apr 2017 01:59:14 +0000 Subject: [issue29617] Drop Python 3.4 support from asyncio In-Reply-To: <1487741869.94.0.0732011694463.issue29617@psf.upfronthosting.co.za> Message-ID: <1493085554.32.0.819887980654.issue29617@psf.upfronthosting.co.za> Changes by INADA Naoki : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 22:44:34 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Apr 2017 02:44:34 +0000 Subject: [issue30153] lru_cache should support invalidations In-Reply-To: <1493029770.27.0.722684328954.issue30153@psf.upfronthosting.co.za> Message-ID: <1493088274.61.0.392161865929.issue30153@psf.upfronthosting.co.za> Raymond Hettinger added the comment: If you're interested, here is a starting point for experimenting with any variations you want (invalidate a specific entry, changeable maxsize, pickle/unpickle, expiration of entries after a specific time, inspection of the internal contents, ability to inject known values, testing whether a specific argument tuple is in the cache, logging of cache access, or just about anything you could do with a regular dictionary): class LRU(OrderedDict): def __init__(self, func, maxsize=128): self.maxsize = 128 self.func = func def __call__(self, *args): if args in self: value = self[args] self.move_to_end(args) return value value = self.func(*args) if len(self) >= self.maxsize: self.popitem(False) self[args] = value return value ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 24 23:25:04 2017 From: report at bugs.python.org (Louie Lu) Date: Tue, 25 Apr 2017 03:25:04 +0000 Subject: [issue30157] csv.Sniffer.sniff() regex error In-Reply-To: <1493085066.27.0.612102662908.issue30157@psf.upfronthosting.co.za> Message-ID: <1493090704.51.0.765358481825.issue30157@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- title: csn.Sniffer.sniff() regex error -> csv.Sniffer.sniff() regex error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 02:03:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 06:03:55 +0000 Subject: [issue26082] functools.lru_cache user specified cachedict support In-Reply-To: <1452540237.19.0.595360503064.issue26082@psf.upfronthosting.co.za> Message-ID: <1493100235.72.0.0925557753145.issue26082@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 02:16:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 06:16:21 +0000 Subject: [issue30156] PYTHONDUMPREFS segfaults on exit In-Reply-To: <1493055827.6.0.962682353128.issue30156@psf.upfronthosting.co.za> Message-ID: <1493100981.3.0.377193229475.issue30156@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Removing this micro-optimization makes attribute access in namedtuple more than 1.5 times slower: Mean +- std dev: [python.default] 126 ns +- 4 ns -> [python] 200 ns +- 7 ns: 1.58x slower (+58%) This would be a significant regression. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 02:29:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 06:29:03 +0000 Subject: [issue30156] PYTHONDUMPREFS segfaults on exit In-Reply-To: <1493055827.6.0.962682353128.issue30156@psf.upfronthosting.co.za> Message-ID: <1493101743.62.0.99850137219.issue30156@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The previous result was got when use _PyObject_FastCallDict(). Using PyObject_Call() is slightly faster: Mean +- std dev: [python.default] 127 ns +- 4 ns -> [python] 185 ns +- 9 ns: 1.45x slower (+45%) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 04:39:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 08:39:01 +0000 Subject: [issue30157] csv.Sniffer.sniff() regex error In-Reply-To: <1493085066.27.0.612102662908.issue30157@psf.upfronthosting.co.za> Message-ID: <1493109541.85.0.701830504329.issue30157@psf.upfronthosting.co.za> STINNER Victor added the comment: What is the consequence of this change? Does it change the syntax of the parser? Which kind of format wasn't parsed correctly? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 04:52:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 08:52:41 +0000 Subject: [issue30132] [Windows] test_distutils leaks a vc140.pdb file In-Reply-To: <1492791460.36.0.72947186821.issue30132@psf.upfronthosting.co.za> Message-ID: <1493110361.81.0.742744640077.issue30132@psf.upfronthosting.co.za> STINNER Victor added the comment: Reopen, while the warning was fixed on AppVeyor and my Windows VM, I still see the warning on Windows buildbots. http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/578/steps/test/logs/stdio Warning -- files was modified by test_distutils Before: [] After: ['vc140.pdb'] http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/builds/591/steps/test/logs/stdio Warning -- files was modified by test_distutils Before: [] After: ['vc140.pdb'] ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 04:59:04 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 25 Apr 2017 08:59:04 +0000 Subject: [issue30150] raw debug allocators to not return malloc alignment In-Reply-To: <1492984868.37.0.0606415089722.issue30150@psf.upfronthosting.co.za> Message-ID: <1493110744.62.0.884535179141.issue30150@psf.upfronthosting.co.za> INADA Naoki added the comment: How it cause problem? I think you should use `malloc()` instead of `PyMem_Malloc()` or other Python memory allocator when you need strict `malloc()` alignment. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 05:05:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 09:05:45 +0000 Subject: [issue30150] raw debug allocators to not return malloc alignment In-Reply-To: <1492984868.37.0.0606415089722.issue30150@psf.upfronthosting.co.za> Message-ID: <1493111145.88.0.621571946728.issue30150@psf.upfronthosting.co.za> STINNER Victor added the comment: > On for example x32 malloc returns 16 byte aligned memory but size_t is 4 bytes. x32 is a strange platform :-( Does numpy support it? I'm not sure that Python works on such platform. I suggest to hardcode 16 or 32 bytes in _PyMem_DebugRawAlloc instead of relying on sizeof(size_t). pymalloc aligns memory allocations to 8 bytes if I recall correctly. > How it cause problem? numpy uses SIMD instructions which require strict memory alignement. Note: There was also an issue #18835 to "Add aligned memory variants to the suite of PyMem functions/macros", but it was rejected. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 05:06:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 09:06:44 +0000 Subject: [issue30150] raw debug allocators to not return malloc alignment In-Reply-To: <1492984868.37.0.0606415089722.issue30150@psf.upfronthosting.co.za> Message-ID: <1493111204.5.0.390271696407.issue30150@psf.upfronthosting.co.za> STINNER Victor added the comment: Is this issue related to this numpy issue: "ENH: add support for python3.6 memory tracing"? https://github.com/numpy/numpy/pull/8885 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 05:58:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 09:58:19 +0000 Subject: [issue30158] Deprecation warnings emitted in test_importlib Message-ID: <1493114299.05.0.756941591425.issue30158@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: $ ./python -We -m test.regrtest -v test_importlib ... ====================================================================== ERROR: test_find_module (test.test_importlib.test_abc.Frozen_MetaPathFinderDefaultsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_importlib/test_abc.py", line 160, in test_find_module self.assertIsNone(self.ins.find_module('something', None)) File "/home/serhiy/py/cpython/Lib/test/test_importlib/test_abc.py", line 151, in find_module return super().find_module(fullname, path) File "/home/serhiy/py/cpython/Lib/importlib/abc.py", line 72, in find_module stacklevel=2) DeprecationWarning: MetaPathFinder.find_module() is deprecated since Python 3.4 in favor of MetaPathFinder.find_spec()(available since 3.4) ... ---------- components: Tests messages: 292259 nosy: brett.cannon, serhiy.storchaka priority: normal severity: normal status: open title: Deprecation warnings emitted in test_importlib type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 08:31:00 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Tue, 25 Apr 2017 12:31:00 +0000 Subject: [issue30159] gdb autoloading python-gdb.py Message-ID: <1493123460.02.0.558737612722.issue30159@psf.upfronthosting.co.za> New submission from ????? ????????: Please install python-gdb.py in $(datarootdir)/gdb/auto-load/$(libdir)/libpython3.5m.so.1.0-gdb.py during "make install", so that programs linked towards libpython3.5m.so.1.0 will auto-load the -gdb.py script, when debugged. Likewise for the other gdb versions. An alternative to achieve the same effect is to put python-gdb.py in a .debug_gdb_scripts section (https://sourceware.org/gdb/onlinedocs/gdb/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section), but I don't know if $(strip) removes it. ---------- messages: 292260 nosy: dilyan.palauzov priority: normal severity: normal status: open title: gdb autoloading python-gdb.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 10:36:07 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Apr 2017 14:36:07 +0000 Subject: [issue26082] functools.lru_cache user specified cachedict support In-Reply-To: <1452540237.19.0.595360503064.issue26082@psf.upfronthosting.co.za> Message-ID: <1493130967.83.0.803144170835.issue26082@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Marking as closed/rejected for the reasons lists by Josh. The functools.lru_cache() decorator is somewhat tightly focused and is trying to do one thing well. Another reason is that at some point, we want to be able to change the internals (perhaps using the new compact/ordereddict) and that would be precluded by this feature request. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 10:41:18 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Apr 2017 14:41:18 +0000 Subject: [issue28851] namedtuples field_names sequence preferred In-Reply-To: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> Message-ID: <1493131278.39.0.167839788731.issue28851@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Mariatta, I've approved Cheryl's PR. Would like to do the honors and apply it. ---------- assignee: rhettinger -> Mariatta nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 10:43:21 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Apr 2017 14:43:21 +0000 Subject: [issue29727] collections.abc.Reversible doesn't fully support the reversing protocol In-Reply-To: <1488739763.14.0.639498346483.issue29727@psf.upfronthosting.co.za> Message-ID: <1493131401.94.0.526407854206.issue29727@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 10:44:44 2017 From: report at bugs.python.org (Mike) Date: Tue, 25 Apr 2017 14:44:44 +0000 Subject: [issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear Message-ID: <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za> New submission from Mike: The documentation for BaseHTTPRequestHandler explicitly prohibits protocol violations when writing to the `wfile` stream: > BaseHTTPRequestHandler has the following instance variables: > > [...] > > **`wfile`** > > > Contains the output stream for writing a response back to the client. > > Proper adherence to the HTTP protocol must be used when writing to this > > stream. I am interested in testing web browser behavior in response to protocol violations, and my initial interpretation of this text (and the term "must" in particular) is that such conditions are not guaranteed to achievable with this module. However, my colleague believes the text is simply intended to communicate that there is no safety mechanism in place, and that protocol violations will not be corrected. [1] Local testing and a quick reading of the source tends to confirm the latter interpretation, but this may simply be coincidental and not necessarily stable behavior. If it is in fact stable, then I would like to request a modification to the documentation. Changing the word "must" to "should" would help, although it might be better to be more explicit--something like, "Bytes are transmitted 'as-is'; HTTP protocol violations will not be corrected." Thanks! [1] https://github.com/w3c/web-platform-tests/issues/5668 ---------- assignee: docs at python components: Documentation messages: 292263 nosy: docs at python, jugglinmike priority: normal severity: normal status: open title: BaseHTTPRequestHandler.wfile: supported usage unclear _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 10:58:54 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Apr 2017 14:58:54 +0000 Subject: [issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear In-Reply-To: <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za> Message-ID: <1493132334.02.0.355639796065.issue30160@psf.upfronthosting.co.za> R. David Murray added the comment: I would like to say that the latter interpretation is "obviously" correct, except that it clearly wasn't obvious to you. The fact that it "contains the output stream" I would have thought was pretty clear: if you are writing to it, you are responsible for anything you do to that output stream. The "must" refers to the same the the RFC "must" refers to: in order to be RFC compliant, you must conform to the RFC. Perhaps we could clarify that sentence by saying: "Proper adherence to the HTTP protocol must be used when writing to this stream in order to achieve successful interoperation with http clients." I think that would make it clear that if you don't, you'll be testing the client's response to protocol violations :) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 11:31:05 2017 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 25 Apr 2017 15:31:05 +0000 Subject: [issue29727] collections.abc.Reversible doesn't fully support the reversing protocol In-Reply-To: <1488739763.14.0.639498346483.issue29727@psf.upfronthosting.co.za> Message-ID: <1493134265.8.0.479508588122.issue29727@psf.upfronthosting.co.za> Guido van Rossum added the comment: I'm with Raymond. I propose to register array.array() in all the appropriate places and then close this bug as a won't fix. The typing issue might eventually be resolved via PEP 544 (if accepted), or not -- the"fallback protocols" based on __getitem__ and __len__ seem to be a complicating special case that we may want to put off. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 11:55:06 2017 From: report at bugs.python.org (Mike) Date: Tue, 25 Apr 2017 15:55:06 +0000 Subject: [issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear In-Reply-To: <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za> Message-ID: <1493135706.77.0.415950485662.issue30160@psf.upfronthosting.co.za> Mike added the comment: That would certainly satisfy me! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:02:43 2017 From: report at bugs.python.org (Matthew Barnett) Date: Tue, 25 Apr 2017 16:02:43 +0000 Subject: [issue30157] csv.Sniffer.sniff() regex error In-Reply-To: <1493085066.27.0.612102662908.issue30157@psf.upfronthosting.co.za> Message-ID: <1493136163.68.0.0698372385391.issue30157@psf.upfronthosting.co.za> Matthew Barnett added the comment: There are 4 patterns. They try to determine the delimiter and quote by looking for matches. Each pattern supposedly covers one of 4 cases: 1. Delimiter, quote, value, quote, delimiter. 2. Start of line/text, quote, value, quote, delimiter. 3. Delimiter, quote, value, quote, end of line/text. 4. Start of line/text, quote, value, quote, end of line/text. On that basis, case 3 looks wrong because the pattern for delimiter is: >[^\w\n"\'] instead of the expected: [^\w\n"\'] Looks like a bug to me. ---------- nosy: +mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:14:48 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 25 Apr 2017 16:14:48 +0000 Subject: [issue28851] namedtuples field_names sequence preferred In-Reply-To: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> Message-ID: <1493136888.1.0.0173690873294.issue28851@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 97bf722fcd1de1236824377e052369dc7686b644 by Mariatta (csabella) in branch 'master': bpo-28851: Improve namedtuple documentation (GH-1274) https://github.com/python/cpython/commit/97bf722fcd1de1236824377e052369dc7686b644 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:15:54 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 25 Apr 2017 16:15:54 +0000 Subject: [issue28851] namedtuples field_names sequence preferred In-Reply-To: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> Message-ID: <1493136954.67.0.982994989757.issue28851@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: My pleasure :) I merged the PR, and will do the backport later today. ---------- stage: -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:19:26 2017 From: report at bugs.python.org (Nate Soares) Date: Tue, 25 Apr 2017 16:19:26 +0000 Subject: [issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta) In-Reply-To: <1487271247.7.0.447487107459.issue29581@psf.upfronthosting.co.za> Message-ID: <1493137166.04.0.0881597549745.issue29581@psf.upfronthosting.co.za> Changes by Nate Soares : ---------- pull_requests: +1390 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:19:38 2017 From: report at bugs.python.org (Charles Cazabon) Date: Tue, 25 Apr 2017 16:19:38 +0000 Subject: [issue30161] Using `with` statement causes dict to start papering over attribute errors Message-ID: <1493137178.06.0.0316334052023.issue30161@psf.upfronthosting.co.za> New submission from Charles Cazabon: This is a weird one. I've reproduced it with 3 versions of 2.7, including the latest 2.7.13. I didn't find an open bug about this, but I had difficulty crafting a search string for it, so I may have missed something. Basically, using a `with` statement (maybe any such statement, but using an open file definitely does it, even when I do nothing with it) causes the built-in dict class to stop raising AttributeErrors, which can result in odd bugs. Example: Python 2.7.13 (default, Apr 25 2017, 10:12:36) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> with sys.stderr as foo: ... pass ... >>> {}.nosuchattribute >>> {}.nosuchattribute is None >>> I haven't tried the latest 3.x, but it's definitely still there in 3.2.3: Python 3.2.3 (default, Nov 17 2016, 01:04:00) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> with sys.stderr as foo: ... pass ... >>> {}.nosuchattribute >>> {}.nosuchattribute is None >>> ---------- components: Interpreter Core messages: 292270 nosy: charlesc priority: normal severity: normal status: open title: Using `with` statement causes dict to start papering over attribute errors type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:22:31 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 25 Apr 2017 16:22:31 +0000 Subject: [issue30161] Using `with` statement causes dict to start papering over attribute errors In-Reply-To: <1493137178.06.0.0316334052023.issue30161@psf.upfronthosting.co.za> Message-ID: <1493137351.15.0.488173925619.issue30161@psf.upfronthosting.co.za> R. David Murray added the comment: You've closed stderr. ---------- nosy: +r.david.murray resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:25:16 2017 From: report at bugs.python.org (Charles Cazabon) Date: Tue, 25 Apr 2017 16:25:16 +0000 Subject: [issue30161] Using `with` statement causes dict to start papering over attribute errors In-Reply-To: <1493137178.06.0.0316334052023.issue30161@psf.upfronthosting.co.za> Message-ID: <1493137516.55.0.125764333778.issue30161@psf.upfronthosting.co.za> Charles Cazabon added the comment: oh ffs ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:28:28 2017 From: report at bugs.python.org (Tim Golden) Date: Tue, 25 Apr 2017 16:28:28 +0000 Subject: [issue30161] Using `with` statement causes dict to start papering over attribute errors In-Reply-To: <1493137178.06.0.0316334052023.issue30161@psf.upfronthosting.co.za> Message-ID: <7975e22c-8fe4-8ce0-8bd8-deaea94a2b27@timgolden.me.uk> Tim Golden added the comment: I think you're suppressing sys.stderr after the "with". Try a NameError or anything. Alternatively, try a "with" which isn't using sys.stderr Obviously, the next question is why *that's* happening. ---------- nosy: +tim.golden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:51:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 16:51:52 +0000 Subject: [issue30162] Add _PyTuple_Empty and make PyTuple_New(0) never failing Message-ID: <1493139112.34.0.200828606997.issue30162@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch makes the empty tuple be allocated in static memory rather than dynamic memory, expose a reference to it as _PyTuple_Empty, and makes PyTuple_New(0) never raising exceptions. This allows to simplify the code. No longer need to call PyTuple_New(0), check it's result for errors, and clean up it after the use, you just can use a borrowed reference _PyTuple_Empty. _PyTuple_Empty is for CPython internal use only. ---------- components: Interpreter Core messages: 292274 nosy: haypo, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add _PyTuple_Empty and make PyTuple_New(0) never failing type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 12:56:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 16:56:01 +0000 Subject: [issue30162] Add _PyTuple_Empty and make PyTuple_New(0) never failing In-Reply-To: <1493139112.34.0.200828606997.issue30162@psf.upfronthosting.co.za> Message-ID: <1493139361.34.0.750778952031.issue30162@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1391 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 14:29:19 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 25 Apr 2017 18:29:19 +0000 Subject: [issue29950] Rename SlotWrapperType to WrapperDescriptorType In-Reply-To: <1490913155.68.0.921075997719.issue29950@psf.upfronthosting.co.za> Message-ID: <1493144959.07.0.281835597086.issue29950@psf.upfronthosting.co.za> Berker Peksag added the comment: Merged in 08c16016e2a2d1368d001ddebfe9ca92465773c4. Thanks! ---------- nosy: +berker.peksag type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 14:29:25 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 25 Apr 2017 18:29:25 +0000 Subject: [issue29950] Rename SlotWrapperType to WrapperDescriptorType In-Reply-To: <1490913155.68.0.921075997719.issue29950@psf.upfronthosting.co.za> Message-ID: <1493144965.7.0.672461960684.issue29950@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 15:11:23 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 25 Apr 2017 19:11:23 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1493147483.68.0.510897807193.issue29943@psf.upfronthosting.co.za> Nathaniel Smith added the comment: Apparently this also broke pyqt for multiple users; here's the maintainers at conda-forge struggling to figure out the best workaround: https://github.com/conda-forge/pyqt-feedstock/pull/25 I really think it would be good to fix this in 3.6 sooner rather than later. Downstairs projects are accumulating workarounds and pinning 3.6.0 as we speak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 15:16:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 19:16:27 +0000 Subject: [issue29576] Improve some deprecations in the importlib In-Reply-To: <1487208454.1.0.000568467436348.issue29576@psf.upfronthosting.co.za> Message-ID: <1493147787.73.0.864923613143.issue29576@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This change made test_importlib emitting warnings. See issue30158. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 15:19:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 19:19:12 +0000 Subject: [issue30158] Deprecation warnings emitted in test_importlib In-Reply-To: <1493114299.05.0.756941591425.issue30158@psf.upfronthosting.co.za> Message-ID: <1493147952.3.0.939267169455.issue30158@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1392 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 15:20:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 19:20:17 +0000 Subject: [issue29576] Improve some deprecations in the importlib In-Reply-To: <1487208454.1.0.000568467436348.issue29576@psf.upfronthosting.co.za> Message-ID: <1493148017.8.0.299701476311.issue29576@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1393 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 15:30:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 19:30:38 +0000 Subject: [issue30158] Deprecation warnings emitted in test_importlib In-Reply-To: <1493114299.05.0.756941591425.issue30158@psf.upfronthosting.co.za> Message-ID: <1493148638.52.0.109891660657.issue30158@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> patch review versions: -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 16:15:25 2017 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 25 Apr 2017 20:15:25 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1493151325.4.0.0050226098726.issue30140@psf.upfronthosting.co.za> Josh Rosenberg added the comment: I'd assume the preference for __rop__ only on subclass overload is because __rop__ method are usually fallback methods, and differ behaviorally from the __op__ methods in type strictness. In particular, the __rop__ fallbacks are often so non-strict that they return a completely different type; fractions.Fraction.__rop__ is willing to coerce itself and the other operand to float and produce a float result if the other operand is a numbers.Real (and not a Rational). They also tend to be slower (checking against ABCs and doing more type coercion) than the __op__ path. If you jump straight to __rop__ because the right hand side is a subclass, but the subclass didn't overload it, you end up going through that fallback, assumed extra liberal and slow, code path. It doesn't work this way with comparison operators because those are 100% reflexive; there is no expectation that comparing in one direction will be more or less type permissive than comparing in the other direction (stuff like __rcmp__ has been gone for ages after all), so unconditionally comparing using the child class comparator first is fine, and more likely to get correct results. The design pattern that has problems here is a bit unorthodox to start with. It assumes that the child class constructor will work exactly the same as the parent (no additional mandatory arguments for instance), and that it's always correct for parent + child to produce the type of child. Usually, in an OO design, the parent is not supposed to have any specific knowledge of children; it's the job of the children to work with instances of the parent, if necessary. If delegation to the child is desired, implement __op__ with stricter type checking (to preclude subclasses) and __rop__ with relaxed type checking (to allow them); when the __op__ executes, it will return NotImplemented for the child class, then delegate to __rop__, which will use the child's type. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 16:55:08 2017 From: report at bugs.python.org (Stephan Hoyer) Date: Tue, 25 Apr 2017 20:55:08 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1493153708.71.0.071202388948.issue30140@psf.upfronthosting.co.za> Stephan Hoyer added the comment: > The design pattern that has problems here is a bit unorthodox to start with. I agree. This was meant strictly as a simple example for illustrative purposes. Steven D'Aprano's example from python-ideas may be a better one: https://mail.python.org/pipermail/python-ideas/2017-April/045455.html class A: def __add__(self, other): self.log() ... __radd__ = __add__ class B(A): def log(self): ... Our actual use case for NumPy involved writing a mixin that look more like this, that expects a specified method to implement arithmetic, i.e., class NDArrayOperatorsMixin: def __add__(self, other): return self._calculate(np.add, self, other) def __radd__(self, other): return self._calculate(np.add, other, self) ... # repeat for all special methods class A(NDArrayOperatorsMixin): def _calculate(self, op, *args): if not all(isinstance(arg, A) for arg in args): return NotImplemented ... # implement calculation class B(A): def _calculate(self, op, *args): ... # something different In A() + B(), B never gets the chance to override A's implementation of __add__ via _calculate, because it overrode a different method (_calculate) which happens to contain the *implementation* for __radd__, but not __radd__ itself. Anyways, if you have serious concerns about changing this, it is probably best respond to Guido on python-ideas: https://mail.python.org/pipermail/python-ideas/2017-April/045468.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 17:03:32 2017 From: report at bugs.python.org (Dimitry Andric) Date: Tue, 25 Apr 2017 21:03:32 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493154212.02.0.42719517843.issue30124@psf.upfronthosting.co.za> Dimitry Andric added the comment: STINNER Victor writes: > Would it be technically possible to completely get ride of the union? Probably, it's just more work, and it has to be done pretty carefully to avoid regressions. It seems Python already does some exercising of these dtoa functions in its test suite, but ideally you would want to check against upstream's full tests, if those exist. There are probably many edge cases for a set of tricky functions like this... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 17:21:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Apr 2017 21:21:02 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493155262.18.0.245743910915.issue30124@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It seems to me that the purpose of using unions was avoiding aliasing issues. But something went wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 18:41:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 22:41:07 +0000 Subject: [issue30157] csv.Sniffer.sniff() regex error In-Reply-To: <1493085066.27.0.612102662908.issue30157@psf.upfronthosting.co.za> Message-ID: <1493160067.49.0.89785383142.issue30157@psf.upfronthosting.co.za> STINNER Victor added the comment: Can you please try to write a unit test to check for non-regression? Or at least give an example? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 18:55:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 22:55:11 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493160911.5.0.583842096072.issue30107@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset d819ad9832292d854e9710493ecdf959b69802e3 by Victor Stinner in branch 'master': bpo-30107: Make SuppressCrashReport quiet on macOS (#1279) https://github.com/python/cpython/commit/d819ad9832292d854e9710493ecdf959b69802e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 18:57:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 22:57:00 +0000 Subject: [issue30158] Deprecation warnings emitted in test_importlib In-Reply-To: <1493114299.05.0.756941591425.issue30158@psf.upfronthosting.co.za> Message-ID: <1493161020.69.0.286013984185.issue30158@psf.upfronthosting.co.za> STINNER Victor added the comment: > DeprecationWarning: MetaPathFinder.find_module() is deprecated since Python 3.4 in favor of MetaPathFinder.find_spec()(available since 3.4) Is a space missing in the error message between "MetaPathFinder.find_spec()" and "(available since 3.4)"? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 18:58:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 22:58:21 +0000 Subject: [issue30158] Deprecation warnings emitted in test_importlib In-Reply-To: <1493114299.05.0.756941591425.issue30158@psf.upfronthosting.co.za> Message-ID: <1493161101.17.0.0267493826288.issue30158@psf.upfronthosting.co.za> STINNER Victor added the comment: Deprecation introduced by issue #29576 according to the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 19:02:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Apr 2017 23:02:07 +0000 Subject: [issue29576] Improve some deprecations in the importlib In-Reply-To: <1487208454.1.0.000568467436348.issue29576@psf.upfronthosting.co.za> Message-ID: <1493161327.51.0.618422238409.issue29576@psf.upfronthosting.co.za> STINNER Victor added the comment: This issue introduced new warnings when running test_importlib: see issue #30158. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 19:31:29 2017 From: report at bugs.python.org (Michael Seifert) Date: Tue, 25 Apr 2017 23:31:29 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1493163089.25.0.104602412873.issue26828@psf.upfronthosting.co.za> Michael Seifert added the comment: > I explored that notion of iterator length transparency years ago. While I don't remember all the details, I did record some notes at the top of Lib/test/test_iterlen.py. But isn't that the point of the length_hint? To provide an *estimate* for the length? So generally I would expect the length_hint to be accurate (at least accurate enough to avoid reallocations) for well-behaved iterators. And I think that's possible for "zip" and "map" (but also for several itertools: product, permutations, combinations, islice, accumulate, starmap, zip_longest). At least in theory. Also it would allow to prohibit infinite iterators to be passed to "length_hint"-aware functions. For example `list(count())` could raise an exception when `count.length_hint` would return math.inf or sys.maxsize + 1. The pull request was just because I was curious how it performed and wanted to share the code. Feel free to reject it. The performance improvement wasn't amazing in the micro-benchmarks. ---------- nosy: +MSeifert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 20:39:08 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Apr 2017 00:39:08 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1493167148.55.0.396778707735.issue26828@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > But isn't that the point of the length_hint? Where it could be used reliably, it was used and used broadly. However, there are circumstances (iterator vs iterable) where it can't know how to make an estimate and is perhaps wildly off. I would like to mark this tracker item as closed. IMO it is a dead-end. Like you, I share enthusiasm for length_hint and its potential (that I why I created the concept many years ago and worked very hard to apply it everywhere it would fit). But trust me, it doesn't fit everywhere. I left it out of imap() for a reason (it just didn't make sense). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 20:41:28 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Apr 2017 00:41:28 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1493167288.92.0.0955016762374.issue26828@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Also, the ifilter() suggestion is a complete non-starter. There is no way to know in advance whether filter will return all the elements of the input or none of them. In the absence of other knowledge, the best strategy is what list.append() already does (a strategy of mild over-allocations, not exceeding 12.5% for large lists). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 21:02:30 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 26 Apr 2017 01:02:30 +0000 Subject: [issue30157] csv.Sniffer.sniff() regex error In-Reply-To: <1493085066.27.0.612102662908.issue30157@psf.upfronthosting.co.za> Message-ID: <1493168550.53.0.715282487786.issue30157@psf.upfronthosting.co.za> R. David Murray added the comment: If it is a bug that indicates there is at least one missing unit test :) Maybe the OP will contribute a test. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 21:18:19 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 01:18:19 +0000 Subject: [issue28851] namedtuples field_names sequence preferred In-Reply-To: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> Message-ID: <1493169499.75.0.425806854972.issue28851@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1394 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 21:23:07 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 01:23:07 +0000 Subject: [issue28851] namedtuples field_names sequence preferred In-Reply-To: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> Message-ID: <1493169787.21.0.390112897865.issue28851@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 16b6f971bd8afc72b439b83324eba744460adb67 by Mariatta in branch '3.6': [3.6] bpo-28851: Improve namedtuple documentation (GH-1274) (GH-1286) https://github.com/python/cpython/commit/16b6f971bd8afc72b439b83324eba744460adb67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 21:23:57 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 01:23:57 +0000 Subject: [issue28851] namedtuples field_names sequence preferred In-Reply-To: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> Message-ID: <1493169837.18.0.497974193066.issue28851@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Backported to 3.6. Thanks, everyone :) ---------- resolution: later -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 22:33:05 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 02:33:05 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore Message-ID: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> New submission from Louie Lu: When adding mutually exclusive group and required is True, and the group argument has default value. If we type its default value, argparse will ignore the input and return `argument is required` ------- PoC -------- import argparse parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument('-v', type=int, default=10) print(parser.parse_args()) ----- $ python tests.py -v 10 usage: tests.py [-h] -v V tests.py: error: one of the arguments -v is required $ python tests.py -v 11 Namespace(v=11) ---------- components: Library (Lib) messages: 292293 nosy: louielu priority: normal severity: normal status: open title: argparse mx_group is required, when action value equal default will be ignore versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 22:33:13 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 02:33:13 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore In-Reply-To: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> Message-ID: <1493173993.08.0.705224838732.issue30163@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 22:35:33 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 02:35:33 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1493174133.73.0.595432859822.issue29960@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1395 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 22:38:15 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 02:38:15 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1493174295.09.0.158948827114.issue29960@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1396 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 22:40:07 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 02:40:07 +0000 Subject: [issue29960] _random.Random state corrupted on exception In-Reply-To: <1491043586.04.0.46814850863.issue29960@psf.upfronthosting.co.za> Message-ID: <1493174407.58.0.0164857836644.issue29960@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1397 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 22:53:57 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 02:53:57 +0000 Subject: [issue29887] test_normalization doesn't work In-Reply-To: <1490288230.58.0.523545383484.issue29887@psf.upfronthosting.co.za> Message-ID: <1493175237.13.0.599405538542.issue29887@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 22:54:12 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 02:54:12 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493175252.18.0.114144774339.issue30107@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- stage: -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 22:59:51 2017 From: report at bugs.python.org (Jake Davis) Date: Wed, 26 Apr 2017 02:59:51 +0000 Subject: [issue30157] csv.Sniffer.sniff() regex error In-Reply-To: <1493085066.27.0.612102662908.issue30157@psf.upfronthosting.co.za> Message-ID: <1493175591.88.0.256281665338.issue30157@psf.upfronthosting.co.za> Jake Davis added the comment: Will do! I will try to get a regression proof test into test_csv.py in the next 24 hours. Essentially I will make sure that the sniffer returns a positive match for each of the patterns that the regex is intended to hit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 25 23:22:25 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 03:22:25 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore In-Reply-To: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> Message-ID: <1493176945.29.0.994716601708.issue30163@psf.upfronthosting.co.za> Louie Lu added the comment: Strange, this will only trigger when that argument type is int. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 00:01:52 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 04:01:52 +0000 Subject: [issue21150] Add quick links table to argparse docs In-Reply-To: <1396558035.28.0.485991636726.issue21150@psf.upfronthosting.co.za> Message-ID: <1493179312.44.0.224915567258.issue21150@psf.upfronthosting.co.za> Louie Lu added the comment: Could Raymond, Gaurav or paul help to review the PR's summary table? Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 00:03:43 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Apr 2017 04:03:43 +0000 Subject: [issue30162] Add _PyTuple_Empty and make PyTuple_New(0) never failing In-Reply-To: <1493139112.34.0.200828606997.issue30162@psf.upfronthosting.co.za> Message-ID: <1493179423.03.0.924357588322.issue30162@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The patch shows a nice payoff from this short-cut, so go ahead and apply it. Still, I wish there were some aversion to posting a new patch every two days that alters twenty files all over the standard library. The rate of churn is alarming. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 00:06:09 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 04:06:09 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore In-Reply-To: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> Message-ID: <1493179569.38.0.648004720007.issue30163@psf.upfronthosting.co.za> Louie Lu added the comment: Maybe documentation should note that: """ # error if this argument is not allowed with other previously # seen arguments, assuming that actions that use the default # value don't really count as "present" """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 00:50:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 04:50:03 +0000 Subject: [issue30164] Testing FTP support in urllib shouldn't use Debian FTP server Message-ID: <1493182203.15.0.353510107498.issue30164@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: test_urllib2net.py uses ftp://ftp.debian.org/ for testing FTP support in urllib. But Debian just announced shutting down its public FTP services. https://lists.debian.org/debian-announce/2017/msg00001.html ---------- components: Tests messages: 292299 nosy: orsenthil, serhiy.storchaka priority: normal severity: normal status: open title: Testing FTP support in urllib shouldn't use Debian FTP server type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 01:18:48 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 26 Apr 2017 05:18:48 +0000 Subject: [issue30164] Testing FTP support in urllib shouldn't use Debian FTP server In-Reply-To: <1493182203.15.0.353510107498.issue30164@psf.upfronthosting.co.za> Message-ID: <1493183928.71.0.221965402649.issue30164@psf.upfronthosting.co.za> Senthil Kumaran added the comment: I had started taking some action on it recently: https://github.com/python/pythondotorg/issues/1069 I verified that only one test module is affected and rest of our ftp.debian.org references are examples/docstrings that will need to be updated eventually too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 01:19:00 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 26 Apr 2017 05:19:00 +0000 Subject: [issue30164] Testing FTP support in urllib shouldn't use Debian FTP server In-Reply-To: <1493182203.15.0.353510107498.issue30164@psf.upfronthosting.co.za> Message-ID: <1493183940.52.0.590457548283.issue30164@psf.upfronthosting.co.za> Changes by Senthil Kumaran : ---------- assignee: -> orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 01:47:04 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 26 Apr 2017 05:47:04 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493185624.3.0.395232395372.issue30052@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset c6db4811f9ea3aeff0e1fafe1c60a22835ef359e by Nick Coghlan (csabella) in branch 'master': bpo-30052: Link `bytes` & `bytearray` to stdtypes not functions (GH-1271) https://github.com/python/cpython/commit/c6db4811f9ea3aeff0e1fafe1c60a22835ef359e ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 01:48:52 2017 From: report at bugs.python.org (paul j3) Date: Wed, 26 Apr 2017 05:48:52 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore In-Reply-To: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> Message-ID: <1493185732.96.0.160639851316.issue30163@psf.upfronthosting.co.za> paul j3 added the comment: And only for integers smaller than 257! The problem is with this test in `take_action` function # error if this argument is not allowed with other previously # seen arguments, assuming that actions that use the default # value don't really count as "present" if argument_values is not action.default: seen_non_default_actions.add(action) for conflict_action in action_conflicts.get(action, []): if conflict_action in seen_non_default_actions: msg = _('not allowed with argument %s') action_name = _get_action_name(conflict_action) raise ArgumentError(action, msg % action_name) Specifically with the argument_values is not action.default test. In CPython integers below 257 are unique, so that In [33]: int('10') is 10 Out[33]: True In [34]: int('257') is 257 Out[34]: False (and strings from 'sys.argv' do not match in the 'is' sense with strings set via 'default'. So the problem is unique to small integers.) The test is really meant to catch the default that is added in '_get_values()' for positionals with optional nargs ('?'). This issue was raised by some PyPy developers several years ago. PyPy does not treat the small integers as unique. I'll have to dig around to see what the resolution was, if any. For now the solution is to use a string '10' as the default. ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 01:59:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 05:59:44 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1493175252.21.0.538109760253.issue30107@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: I'm waiting for buildbots to check if the issue is really fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:01:28 2017 From: report at bugs.python.org (paul j3) Date: Wed, 26 Apr 2017 06:01:28 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore In-Reply-To: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> Message-ID: <1493186488.82.0.865127637579.issue30163@psf.upfronthosting.co.za> paul j3 added the comment: This issue was raised in 2013. The proposed patch is still pending http://bugs.python.org/issue18943 I'm going to close this new one, though it is a good reminder of a rare, but persistent bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:01:41 2017 From: report at bugs.python.org (paul j3) Date: Wed, 26 Apr 2017 06:01:41 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore In-Reply-To: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> Message-ID: <1493186501.29.0.183032010166.issue30163@psf.upfronthosting.co.za> Changes by paul j3 : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:03:51 2017 From: report at bugs.python.org (paul j3) Date: Wed, 26 Apr 2017 06:03:51 +0000 Subject: [issue18943] argparse: default args in mutually exclusive groups In-Reply-To: <1378458002.17.0.371205806782.issue18943@psf.upfronthosting.co.za> Message-ID: <1493186631.59.0.793130375267.issue18943@psf.upfronthosting.co.za> paul j3 added the comment: This came up again, http://bugs.python.org/issue30163 An optional with int type and small integer default. ---------- priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:04:53 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 06:04:53 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore In-Reply-To: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> Message-ID: <1493186693.88.0.215526035935.issue30163@psf.upfronthosting.co.za> Louie Lu added the comment: Thanks, paul. Your msg help a lot. Will you work on #18943? I can help for this or review the pending patch. ---------- resolution: -> duplicate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:09:02 2017 From: report at bugs.python.org (paul j3) Date: Wed, 26 Apr 2017 06:09:02 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493186941.99.0.181999569452.issue30152@psf.upfronthosting.co.za> Changes by paul j3 : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:23:51 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 26 Apr 2017 06:23:51 +0000 Subject: [issue30165] faulthandler acquires lock from signal handler, can deadlock while crashing Message-ID: <1493187831.24.0.928802817432.issue30165@psf.upfronthosting.co.za> New submission from Gregory P. Smith: https://github.com/python/cpython/blob/master/Modules/faulthandler.c#L240 faulthandler_dump_traceback() is called from the signal handler faulthandler_fatal_error() which needs to be async signal safe and only call async signal safe things... but faulthandler_dump_traceback calls PyGILState_GetThisThreadState() which ultimately calls thread.c's find_key() which acquires a lock: https://github.com/python/cpython/blob/master/Python/thread.c#L208 (*and* calls malloc!) This sometimes leads to a deadlock when the process is crashing, handled via faulthandler, instead of a crash with stacktrace information printed. The opposite of the happy debugging experience it is intended to provide. The _Py_DumpTracebackThreads() code that this calls also calls the same offending function. Despite having comments alluding to how it is called from within a signal handler. https://github.com/python/cpython/blob/master/Python/traceback.c#L754 This is a crashing exception. Rather than ever deadlock, we should do potentially dangerous things (we're already crashing!). Most of the time we'll be able to get and display useful information. On the occasions something bad happens as a result, at least the message printed to stderr before we started trying to do bad things will give a hint as to why the crash reporter crashed. I _believe_ we always want to use _PyThreadState_UncheckedGet() from the signal handler for the entire codepath. Effectively a simple read from TLS. No guarantees possible about the thread state list not in an intermediate state which will trip us up when dumping, but we could never guarantee that anyways. note: I saw https://bugs.python.org/issue23886 but it only seems quasi related though it is also about getting the thread state. ---------- assignee: haypo components: Extension Modules messages: 292307 nosy: gregory.p.smith, haypo priority: normal severity: normal stage: needs patch status: open title: faulthandler acquires lock from signal handler, can deadlock while crashing type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:44:56 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 06:44:56 +0000 Subject: [issue30013] Compiler warning in Modules/posixmodule.c In-Reply-To: <1491559004.62.0.18619105038.issue30013@psf.upfronthosting.co.za> Message-ID: <1493189096.9.0.454989546855.issue30013@psf.upfronthosting.co.za> Louie Lu added the comment: serhiy, haypo, what do you think about this warning's fixed? Thanks! ---------- nosy: +haypo, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:51:31 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 06:51:31 +0000 Subject: [issue19184] dis module has incorrect docs for RAISE_VARARGS In-Reply-To: <1381078012.05.0.236677780468.issue19184@psf.upfronthosting.co.za> Message-ID: <1493189491.18.0.321589835339.issue19184@psf.upfronthosting.co.za> Louie Lu added the comment: I've made a PR, could serhiy or georg help for review? Thanks! ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 02:58:30 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Apr 2017 06:58:30 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493189910.14.0.665338073412.issue30152@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Please stop rearranging everything in the standard library. Every day I look at the tracker and there is a new patch from this dev that alters dozens of files. Some parts of the patch are harmless but other parts needlessly constipates the code for very little benefit. I would be embarrassed to have to explain why core developers think it is a best practice to move a heapq import inside a Counter method. That isn't a PEP-8 recommended practice. Ordinarily, we only recommend deferred imports in extreme cases where the resource might not be available at import time or when the import is *very* expensive. In general, we've already committed too many sins in the name of optimizing start-up time. Mostly, these are false improvements because many of the changes just defer imports that ultimately end-up being needed anyway. As we make useful tools, we're going to want to use them in the standard library to make the code better, but that is going to entail greater inter-dependencies and cross-imports. Trying to avoid these is a losing game. ---------- assignee: -> bethard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 03:06:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 07:06:56 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1493190416.02.0.365073974651.issue26828@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: zip.__length_hint__() must return NotImplemented or raise TypeError if any of iterators don't implement __length_hint__ or its __length_hint__() returns NotImplemented or raises TypeError. And what should return zip(range(3), range(2**1000)).__length_hint__()? I expect 3, not OverflowError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 03:22:33 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Apr 2017 07:22:33 +0000 Subject: [issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1493191353.35.0.618821680823.issue30146@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > I would expect the and operation between my set implementation > and a string to fail with a TypeError, given that string is > not an instance of Set. However, the error is not raised ... Odd as it may seem, this isn't a bug; rather it was a deliberate design decision by GvR. Regular sets have a intersection() method that accepts any iterable. In contrast, the Set abstract base class doesn't have a intersection() method and instead uses __and__() to do the work. While there is room to have debated whether that design decision was a good one, that ship sailed long ago. Tightening the input requirement now would almost certainly break existing code and would take away needed functionality. Alternatively, we could liberalize set.__and__ to make it accept any iterable (to match the ABC), but Guido advised against this based on his bad experiences with list.__iadd__ accepting any iterable (for example: s = ['abc', 'def']; s += 'def'). I think he's right that such an amendment would be a bug factory. You'll likely find a number of places where the collection ABCs differ in minor details from various concrete classes. In almost every case, you'll find a reason for the choices that were made. It hasn't been a problem in practice unless someone (like the OP) expects that the ABCs have higher fidelity and can used to reimplement all of the details of the related concrete class (i.e. expecting to use Set() to match all the concrete implement nuances tested in Lib/test_set.py). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 03:36:08 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 07:36:08 +0000 Subject: [issue18943] argparse: default args in mutually exclusive groups In-Reply-To: <1378458002.17.0.371205806782.issue18943@psf.upfronthosting.co.za> Message-ID: <1493192168.77.0.44641784509.issue18943@psf.upfronthosting.co.za> Louie Lu added the comment: paul, will you work on this patch? or I can help this issue, too. ---------- nosy: +louielu type: -> behavior versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 03:54:51 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Apr 2017 07:54:51 +0000 Subject: [issue18943] argparse: default args in mutually exclusive groups In-Reply-To: <1378458002.17.0.371205806782.issue18943@psf.upfronthosting.co.za> Message-ID: <1493193291.69.0.498623117078.issue18943@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> bethard priority: high -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:00:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 08:00:14 +0000 Subject: [issue30165] faulthandler acquires lock from signal handler, can deadlock while crashing In-Reply-To: <1493187831.24.0.928802817432.issue30165@psf.upfronthosting.co.za> Message-ID: <1493193614.56.0.783427648533.issue30165@psf.upfronthosting.co.za> STINNER Victor added the comment: > but faulthandler_dump_traceback calls PyGILState_GetThisThreadState() which ultimately calls thread.c's find_key() which acquires a lock: Hum, Python 3 now uses native TLS, not this fallback implementation using a lock. At least on Linux and Windows. I don't know if the fallback implementation is still used (which platforms supported by Python don't provide pthread API? PyGILState_GetThisThreadState -> PyThread_get_key_value: * pthread: pthread_getspecific() * Windows ("nt"): TlsGetValue() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:02:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 08:02:55 +0000 Subject: [issue30165] faulthandler acquires lock from signal handler, can deadlock while crashing In-Reply-To: <1493187831.24.0.928802817432.issue30165@psf.upfronthosting.co.za> Message-ID: <1493193775.56.0.270167837935.issue30165@psf.upfronthosting.co.za> STINNER Victor added the comment: > I _believe_ we always want to use _PyThreadState_UncheckedGet() faulthandler_dump_traceback() uses PyGILState_GetThisThreadState(). There is a comment to explain why: /* SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL are synchronous signals and are thus delivered to the thread that caused the fault. Get the Python thread state of the current thread. PyThreadState_Get() doesn't give the state of the thread that caused the fault if the thread released the GIL, and so this function cannot be used. Read the thread local storage (TLS) instead: call PyGILState_GetThisThreadState(). */ See also test_faulthandler tests, especially tests releasing the GIL: * test_gil_released() * test_fatal_error_without_gil() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:06:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 08:06:51 +0000 Subject: [issue30165] faulthandler acquires lock from signal handler, can deadlock while crashing In-Reply-To: <1493187831.24.0.928802817432.issue30165@psf.upfronthosting.co.za> Message-ID: <1493194011.84.0.349203418123.issue30165@psf.upfronthosting.co.za> STINNER Victor added the comment: > This sometimes leads to a deadlock when the process is crashing, handled via faulthandler, instead of a crash with stacktrace information printed. The opposite of the happy debugging experience it is intended to provide. Is it an hypothetical analysis by reading the C code, or did you get deadlock in practice? If yes, can you please explain how to reproduce the bug and try to get the gdb traceback of the thread which is blocked in faulthandler? In general, faulthandler is an opt-in option for developers, it's not perfect, it only promises best-effort ;-) But I'm a little bit surprised of your deadlock issue. test_faulthandler is running on a wide range of platforms and I didn't notice such deadlock on buildbots yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:15:09 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 08:15:09 +0000 Subject: [issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example In-Reply-To: <1479230636.43.0.863548306007.issue28698@psf.upfronthosting.co.za> Message-ID: <1493194509.17.0.347571518697.issue28698@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 0d637e236d7099f7b724026c8cb7bd83d8e12e6b by Berker Peksag (Louie Lu) in branch 'master': bpo-28698: Fix c_wchar_p doc example (GH-1160) https://github.com/python/cpython/commit/0d637e236d7099f7b724026c8cb7bd83d8e12e6b ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:20:18 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 08:20:18 +0000 Subject: [issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example In-Reply-To: <1479230636.43.0.863548306007.issue28698@psf.upfronthosting.co.za> Message-ID: <1493194818.66.0.864184122616.issue28698@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1398 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:21:03 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Wed, 26 Apr 2017 08:21:03 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493194863.06.0.113541098666.issue30152@psf.upfronthosting.co.za> Wolfgang Maier added the comment: @rhettinger: I do not quite understand this harsh reaction. Making argparse more responsive could, in fact, be quite a nice improvement. This is particularly true, I guess, if you want argument completion with a package like https://pypi.python.org/pypi/argcomplete. You have a point that the patch probably tries to optimize too many things in too many places at once, but that could be amended rather easily. The idea of delaying imports in argparse itself to when they are actually needed is a really good one and, for this module, it is also very reasonable that other places in the stdlib only import it when they are run as __main__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:21:28 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 08:21:28 +0000 Subject: [issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example In-Reply-To: <1479230636.43.0.863548306007.issue28698@psf.upfronthosting.co.za> Message-ID: <1493194888.26.0.395234113106.issue28698@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1399 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:34:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 08:34:19 +0000 Subject: [issue30166] Import command-line parsing modules only when needed Message-ID: <1493195659.65.0.461959154112.issue30166@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Berker suggested to move this part from issue30152 to its own PR. When the file can be imported as a module and run as a script it is worth to make command-line parsing modules (getopt, optparse, argparse) be imported only when they are used, i.e. when the file is ran as a script. Most of the stdlib modules already do this. Proposed patch moves imports of command-line parsing modules and some other modules used only when the module is ran to the main() function or to the branch executed only if __name__ == "__main__". It doesn't change scripts and files that are purposed to be used only for running (__main__.py, main.py). ---------- components: Library (Lib) messages: 292319 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Import command-line parsing modules only when needed type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:36:46 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 08:36:46 +0000 Subject: [issue30166] Import command-line parsing modules only when needed In-Reply-To: <1493195659.65.0.461959154112.issue30166@psf.upfronthosting.co.za> Message-ID: <1493195806.64.0.798984654958.issue30166@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:38:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 08:38:00 +0000 Subject: [issue30166] Import command-line parsing modules only when needed In-Reply-To: <1493195659.65.0.461959154112.issue30166@psf.upfronthosting.co.za> Message-ID: <1493195880.03.0.284213764954.issue30166@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +aronacher, berker.peksag, bethard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:40:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 08:40:09 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493196009.91.0.168355817225.issue30152@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > I'd move this into its own PR. Done. Issue30166. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:45:33 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 08:45:33 +0000 Subject: [issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example In-Reply-To: <1479230636.43.0.863548306007.issue28698@psf.upfronthosting.co.za> Message-ID: <1493196333.44.0.0796601957517.issue28698@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 9f6828119df23fca9e799f47e02baabe87adca2a by Berker Peksag (Louie Lu) in branch '3.6': bpo-28698: Fix c_wchar_p doc example (GH-1160) https://github.com/python/cpython/commit/9f6828119df23fca9e799f47e02baabe87adca2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:47:05 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 08:47:05 +0000 Subject: [issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example In-Reply-To: <1479230636.43.0.863548306007.issue28698@psf.upfronthosting.co.za> Message-ID: <1493196425.4.0.76381368931.issue28698@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset c7b8367076dc7771dabcb9491bd98218c788d489 by Berker Peksag (Louie Lu) in branch '3.5': bpo-28698: Fix c_wchar_p doc example (GH-1160) https://github.com/python/cpython/commit/c7b8367076dc7771dabcb9491bd98218c788d489 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:48:40 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 08:48:40 +0000 Subject: [issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example In-Reply-To: <1479230636.43.0.863548306007.issue28698@psf.upfronthosting.co.za> Message-ID: <1493196520.47.0.316838597067.issue28698@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the report, Alex and thanks for the PRs, Louie! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:48:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 08:48:44 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493189910.14.0.665338073412.issue30152@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Raymond Hettinger added the comment: > Some parts of the patch are harmless but other parts needlessly constipates the code for very little benefit. In general, Python startup is currently the most severe performance regression in Python 3 compared to Python 2.7: https://speed.python.org/comparison/?exe=12%2BL%2Bmaster%2C12%2BL%2B3.5%2C12%2BL%2B3.6%2C12%2BL%2B2.7&ben=649&env=1&hor=true&bas=12%2BL%2B2.7&chart=normal+bars Python 3.7 is the fastest of Python 3 versions, but Python 3.7 still more than 2.2x slower than Python 2.7. 2.2x is a large number, it's not a tiny slowdown. I agree with Serhiy that argparse became more popular so became more important for Python startup time in applications. Maybe Serhiy can try to run a benchmark for get timing (milliseconds) instead of comparing the number of imports? Sorry, I didn't have time to review the change itself yet. But I like efforts to optimize Python startup time in general. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 04:53:33 2017 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9_Anjos?=) Date: Wed, 26 Apr 2017 08:53:33 +0000 Subject: [issue30167] site.main() does not work on Python 3.6 and superior Message-ID: <1493196813.64.0.567701209744.issue30167@psf.upfronthosting.co.za> New submission from Andr? Anjos: Apparently, "import site; site.main()" does not seem to work anymore on Python 3.6 and superior. The reason is a change on the behavior of "os.path.abspath(None)". Before Python 3.6, it used to report an AttributeError which is properly caught inside "site.abs_paths" (see: https://github.com/python/cpython/blob/master/Lib/site.py#L99), making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None. With Python 3.6 and superior, os.path.abspath(None) reports a TypeError, which makes calling "site.main()" raise an exception and stop. How to reproduce: On python 3.6 or superior, do "import site; site.main()". Expected behavior: Exception is properly caught and treated inside "site.abs_paths", ignoring modules in which __file__ and/or __cached__ are set to None. ---------- components: Library (Lib) messages: 292325 nosy: anjos priority: normal severity: normal status: open title: site.main() does not work on Python 3.6 and superior type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 05:01:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 09:01:19 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493197279.46.0.803226043646.issue30152@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: collections is very popular module. It is almost impossible to avoid importing it since so much stdlib modules use namedtuple, OrderedDict, deque, or defaultdict. The reason of moving a heapq import inside a Counter method is that importing heapq adds two entries in sys.modules ('heapq' and '_heapq'), but it is needed only when Counter.most_common() is called with non-default argument. The Counter class is less used than other four popular collections classes, not every use of the Counter class involves using of the most_common() method, and the most_common() method not always is called with argument (actually it is used only twice in the stdlib, in both cases without argument). I'll remove this change if you say this, but this will decrease the effect of this patch from 10 to 8 modules. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 05:13:10 2017 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9_Anjos?=) Date: Wed, 26 Apr 2017 09:13:10 +0000 Subject: [issue30167] site.main() does not work on Python 3.6 and superior In-Reply-To: <1493196813.64.0.567701209744.issue30167@psf.upfronthosting.co.za> Message-ID: <1493197990.94.0.200353456158.issue30167@psf.upfronthosting.co.za> Andr? Anjos added the comment: More information: to reproduce the problem, don't use Python's "-c" command-line option. In this case "__main__" won't be inside sys.modules which mitigates the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 05:39:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 09:39:10 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493199550.68.0.224601134986.issue30152@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In general I agree with Raymond's principle and I am not very happy doing these changes. But heavy startup is a sore spot of CPython. For comparison Python 2.7 and optparse: $ python -c 'import sys; s = set(sys.modules); import argparse; print(len(s), len(sys.modules), len(set(sys.modules) - s))' (43, 63, 20) $ python -S -c 'import sys; s = set(sys.modules); import argparse; print(len(s), len(sys.modules), len(set(sys.modules) - s))' (15, 57, 42) $ python -c 'import sys; s = set(sys.modules); import optparse; print(len(s), len(sys.modules), len(set(sys.modules) - s))' (43, 56, 13) $ python -S -c 'import sys; s = set(sys.modules); import optparse; print(len(s), len(sys.modules), len(set(sys.modules) - s))' (15, 50, 35) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 05:55:28 2017 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9_Anjos?=) Date: Wed, 26 Apr 2017 09:55:28 +0000 Subject: [issue30167] site.main() does not work on Python 3.6 and superior In-Reply-To: <1493196813.64.0.567701209744.issue30167@psf.upfronthosting.co.za> Message-ID: <1493200528.68.0.832647158244.issue30167@psf.upfronthosting.co.za> Andr? Anjos added the comment: After further investigation, the issue can only be reproduced iff the user sets PYTHONSTARTUP which triggers "__main__" to appear in sys.modules and the problem to occur. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 06:00:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 10:00:35 +0000 Subject: [issue28769] Make PyUnicode_AsUTF8 returning "const char *" rather of "char *" In-Reply-To: <1479801324.65.0.962202188144.issue28769@psf.upfronthosting.co.za> Message-ID: <1493200835.18.0.677378387716.issue28769@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1401 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 06:01:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 10:01:50 +0000 Subject: [issue28769] Make PyUnicode_AsUTF8 returning "const char *" rather of "char *" In-Reply-To: <1479801324.65.0.962202188144.issue28769@psf.upfronthosting.co.za> Message-ID: <1493200910.96.0.919542938745.issue28769@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: -1072 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 06:13:59 2017 From: report at bugs.python.org (Louie Lu) Date: Wed, 26 Apr 2017 10:13:59 +0000 Subject: [issue28964] AST literal_eval exceptions provide no information about line number In-Reply-To: <1481665664.26.0.256194535172.issue28964@psf.upfronthosting.co.za> Message-ID: <1493201639.31.0.0268762105906.issue28964@psf.upfronthosting.co.za> Louie Lu added the comment: Steve, will you work on this patch to GitHub? ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 06:14:26 2017 From: report at bugs.python.org (Christian Heimes) Date: Wed, 26 Apr 2017 10:14:26 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493201666.15.0.799526418947.issue30152@psf.upfronthosting.co.za> Christian Heimes added the comment: Instead of messing with all modules, we should rather try to improve startup time with lazy imports first. Mercurial added an on-demand importer to speed up CLI performance. Many years ago I worked on PEP 369 for lazy import. It should be much easier to implement with Brett's import system. We'd to come up with a syntax, maybe something like: with lazy import gettext with lazy from foo import bar Or we could re-use async keyword: async import gettext async from foo import bar ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 06:49:49 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 10:49:49 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493203789.18.0.105887729322.issue29974@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 87c07fe9d908d0a2143fcc8369255c6ff3241503 by Berker Peksag (Mathias Rav) in branch 'master': bpo-29974: Improve typing.TYPE_CHECKING example (GH-982) https://github.com/python/cpython/commit/87c07fe9d908d0a2143fcc8369255c6ff3241503 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 07:03:20 2017 From: report at bugs.python.org (Martin Panter) Date: Wed, 26 Apr 2017 11:03:20 +0000 Subject: [issue28769] Make PyUnicode_AsUTF8 returning "const char *" rather of "char *" In-Reply-To: <1479801324.65.0.962202188144.issue28769@psf.upfronthosting.co.za> Message-ID: <1493204600.98.0.770689560807.issue28769@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- nosy: -martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 07:06:53 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 26 Apr 2017 11:06:53 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493204813.13.0.656642180527.issue29974@psf.upfronthosting.co.za> Changes by Ivan Levkivskyi : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 07:09:11 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 26 Apr 2017 11:09:11 +0000 Subject: [issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial In-Reply-To: <1475194645.41.0.947079052008.issue28315@psf.upfronthosting.co.za> Message-ID: <1493204951.63.0.569531858504.issue28315@psf.upfronthosting.co.za> Cheryl Sabella added the comment: @Mariatta I believe you can do this now? ---------- nosy: +csabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 07:13:48 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 26 Apr 2017 11:13:48 +0000 Subject: [issue29727] collections.abc.Reversible doesn't fully support the reversing protocol In-Reply-To: <1488739763.14.0.639498346483.issue29727@psf.upfronthosting.co.za> Message-ID: <1493205228.54.0.576184366608.issue29727@psf.upfronthosting.co.za> Changes by Ivan Levkivskyi : ---------- assignee: -> levkivskyi stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 07:19:46 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 11:19:46 +0000 Subject: [issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger In-Reply-To: <1492777594.65.0.679686114743.issue30126@psf.upfronthosting.co.za> Message-ID: <1493205586.67.0.981831606217.issue30126@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 07:19:46 2017 From: report at bugs.python.org (Stefan Krah) Date: Wed, 26 Apr 2017 11:19:46 +0000 Subject: [issue28769] Make PyUnicode_AsUTF8 returning "const char *" rather of "char *" In-Reply-To: <1479801324.65.0.962202188144.issue28769@psf.upfronthosting.co.za> Message-ID: <1493205586.89.0.144465293583.issue28769@psf.upfronthosting.co.za> Changes by Stefan Krah : ---------- nosy: -skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 07:32:48 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 11:32:48 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493206368.86.0.958510806187.issue29974@psf.upfronthosting.co.za> Berker Peksag added the comment: 87c07fe9d908d0a2143fcc8369255c6ff3241503 should still be backported to 3.5 and 3.6 branches so please don't close it yet. ---------- resolution: fixed -> stage: resolved -> backport needed status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 07:51:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 11:51:50 +0000 Subject: [issue28769] Make PyUnicode_AsUTF8 returning "const char *" rather of "char *" In-Reply-To: <1479801324.65.0.962202188144.issue28769@psf.upfronthosting.co.za> Message-ID: <1493207510.35.0.277604560033.issue28769@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 6e676954de7c4f3f06dd5b56842c9a2c931a1cab by Victor Stinner in branch 'master': timemodule.c: Cast PyUnicode_AsUTF8() to char* (#1294) https://github.com/python/cpython/commit/6e676954de7c4f3f06dd5b56842c9a2c931a1cab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 08:44:01 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Wed, 26 Apr 2017 12:44:01 +0000 Subject: [issue30168] Class Logger is unindented in the documentation. Message-ID: <1493210640.98.0.578541878256.issue30168@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Currently, `Logger` in `logging.rst` doesn't have an indent after `.. class:: Logger`. This causes the formatting for the specific section to look somewhat unexpected [1]. I've already created a PR that indents the methods/attributes accordingly. After @bitdancer's request, created this issue to get feedback from vinay if this was done on purpose. [1]: https://docs.python.org/3/library/logging.html#logging.Logger ---------- assignee: docs at python components: Documentation messages: 292336 nosy: Jim Fasarakis-Hilliard, docs at python, vinay.sajip priority: normal severity: normal status: open title: Class Logger is unindented in the documentation. versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 08:44:17 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Wed, 26 Apr 2017 12:44:17 +0000 Subject: [issue30168] Class Logger is unindented in the documentation. In-Reply-To: <1493210640.98.0.578541878256.issue30168@psf.upfronthosting.co.za> Message-ID: <1493210657.2.0.804173681795.issue30168@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- pull_requests: +1402 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 08:54:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 12:54:26 +0000 Subject: [issue30169] test_multiprocessing_spawn crashed on AMD64 Windows8.1 Non-Debug 3.x buildbot Message-ID: <1493211266.82.0.263574668344.issue30169@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.x/builds/670/steps/test/logs/stdio 0:05:37 [255/404/1] test_multiprocessing_spawn crashed (Exit code 3221225477) Windows fatal exception: access violation Current thread 0x00001644 (most recent call first): File "D:\buildarea\3.x.ware-win81-release\build\lib\test\_test_multiprocessing.py", line 3997 in ManagerMixin File "D:\buildarea\3.x.ware-win81-release\build\lib\test\_test_multiprocessing.py", line 3988 in File "", line 205 in _call_with_frames_removed File "", line 679 in exec_module File "", line 655 in _load_unlocked File "", line 950 in _find_and_load_unlocked File "", line 961 in _find_and_load File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_multiprocessing_spawn.py", line 2 in File "", line 205 in _call_with_frames_removed File "", line 679 in exec_module File "", line 655 in _load_unlocked File "", line 950 in _find_and_load_unlocked File "", line 961 in _find_and_load File "", line 978 in _gcd_import File "D:\buildarea\3.x.ware-win81-release\build\lib\importlib\__init__.py", line 127 in import_module File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\runtest.py", line 152 in runtest_inner File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\runtest.py", line 119 in runtest File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\runtest_mp.py", line 71 in run_tests_slave File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\main.py", line 470 in _main File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\main.py", line 463 in main File "D:\buildarea\3.x.ware-win81-release\build\lib\test\libregrtest\main.py", line 527 in main File "D:\buildarea\3.x.ware-win81-release\build\lib\test\regrtest.py", line 46 in _main File "D:\buildarea\3.x.ware-win81-release\build\lib\test\regrtest.py", line 50 in File "D:\buildarea\3.x.ware-win81-release\build\lib\runpy.py", line 85 in _run_code File "D:\buildarea\3.x.ware-win81-release\build\lib\runpy.py", line 193 in _run_module_as_main Note: same crash in test_multiprocessing_fork, even if Windows has no os.fork(): the crash occurs at lib\test\test_multiprocessing_fork.py:2 "import test._test_multiprocessing", before check if os.fork() exists. ---------- components: Library (Lib), Tests, Windows messages: 292337 nosy: davin, haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: test_multiprocessing_spawn crashed on AMD64 Windows8.1 Non-Debug 3.x buildbot type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:06:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:06:11 +0000 Subject: [issue30169] test_multiprocessing_spawn crashed on AMD64 Windows8.1 Non-Debug 3.x buildbot In-Reply-To: <1493211266.82.0.263574668344.issue30169@psf.upfronthosting.co.za> Message-ID: <1493211971.01.0.381864391866.issue30169@psf.upfronthosting.co.za> STINNER Victor added the comment: The crash is probably random. I looked at the last 250 builds. Since build 421, the first crash occurred at build 578 (commit a00c3fd12d421e41b769debd7df717d17b0deed5, no idea if it's related): http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.x/builds/578/ I found 8 test_multiprocessing_spawn crashes in builds: * 578 * 579 * 659 * 660 * 661 * 664 * 665 * 670 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:11:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:11:50 +0000 Subject: [issue30169] test_multiprocessing_spawn crashed on AMD64 Windows8.1 Non-Debug 3.x buildbot In-Reply-To: <1493211266.82.0.263574668344.issue30169@psf.upfronthosting.co.za> Message-ID: <1493212310.47.0.871570300063.issue30169@psf.upfronthosting.co.za> STINNER Victor added the comment: Current thread 0x00001644 (most recent call first): File "D:\buildarea\3.x.ware-win81-release\build\lib\test\_test_multiprocessing.py", line 3997 in ManagerMixin Line 3997 is: Condition = property(operator.attrgetter('manager.Condition')) I don't understand how creating operator.attrgetter() or property() object can crash? Maybe the memory was corrupted before? Extract of _test_multiprocessing.py around this line: class ManagerMixin(object): TYPE = 'manager' Process = multiprocessing.Process Queue = property(operator.attrgetter('manager.Queue')) JoinableQueue = property(operator.attrgetter('manager.JoinableQueue')) Lock = property(operator.attrgetter('manager.Lock')) RLock = property(operator.attrgetter('manager.RLock')) Semaphore = property(operator.attrgetter('manager.Semaphore')) BoundedSemaphore = property(operator.attrgetter('manager.BoundedSemaphore')) Condition = property(operator.attrgetter('manager.Condition')) Event = property(operator.attrgetter('manager.Event')) Barrier = property(operator.attrgetter('manager.Barrier')) Value = property(operator.attrgetter('manager.Value')) Array = property(operator.attrgetter('manager.Array')) list = property(operator.attrgetter('manager.list')) dict = property(operator.attrgetter('manager.dict')) Namespace = property(operator.attrgetter('manager.Namespace')) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:17:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:17:22 +0000 Subject: [issue30170] "tests may fail, unable to create temporary directory" warning on buildbot: add a cleanup step to buildbots Message-ID: <1493212642.62.0.333467089335.issue30170@psf.upfronthosting.co.za> New submission from STINNER Victor: On buildbots, it's common to see such warning: 0:32:04 [269/404] test_property passed -- running: test_multiprocessing_spawn (74 sec) D:\buildarea\3.x.bolen-windows10\build\lib\test\support\__init__.py:1012: RuntimeWarning: tests may fail, unable to create temporary directory 'D:\\buildarea\\3.x.bolen-windows10\\build\\build\\test_python_1048': [WinError 183] Cannot create a file when that file already exists: 'D:\\buildarea\\3.x.bolen-windows10\\build\\build\\test_python_1048' with temp_dir(path=name, quiet=quiet) as temp_path: running: test_cmd_line_script (30 sec), test_multiprocessing_spawn (104 sec) I also got it *sometimes*. It took me months to understand where it does come from. It's quite stupid in fact: temporary directories are not removed if a test does crash (ex: segfault). Later, if a test process has the same PID than the crashed process, you get the warning. I suggest to add a "clean" step on buildbots to first remove old "test_python_*" directories leaked by previous runs. First, I wanted to add such cleanup in regrtest directly, but it's common that I run two main regrtest processes in parallel, and I would like to keep this feature. If regrtest starts by removing test_python_*: it will break currently running tests. I'm not 100% confident that the warning is caused by previous runs, but I think that it's worth it to try to cleanup to check if it's case ;-) ---------- components: Tests keywords: buildbot messages: 292340 nosy: haypo, serhiy.storchaka, zach.ware priority: normal severity: normal status: open title: "tests may fail, unable to create temporary directory" warning on buildbot: add a cleanup step to buildbots versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:18:59 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Apr 2017 13:18:59 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493212739.11.0.818484827453.issue30142@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1403 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:23:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:23:34 +0000 Subject: [issue30169] test_multiprocessing_spawn crashed on AMD64 Windows8.1 Non-Debug 3.x buildbot In-Reply-To: <1493211266.82.0.263574668344.issue30169@psf.upfronthosting.co.za> Message-ID: <1493213014.57.0.778185654451.issue30169@psf.upfronthosting.co.za> STINNER Victor added the comment: I also checked the last 250 builds of AMD64 Windows8 3.x: test_multiprocessing_spawn never crashed. http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x We got 8 crashed on "AMD64 Windows8.1 Non-Debug 3.x", but 0 crash on "AMD64 Windows8 3.x" (similar Windows version, but it's a different buildbot slave, so different hardware, version, etc.)... So *maybe* it's related to the commit a00c3fd12d421e41b769debd7df717d17b0deed5 and the issue #29941 since this patch changed the behaviour of Python compiled in release mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:26:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:26:21 +0000 Subject: [issue29941] Confusion between asserts and Py_DEBUG In-Reply-To: <1490805708.56.0.244134698101.issue29941@psf.upfronthosting.co.za> Message-ID: <1493213181.39.0.860881026593.issue29941@psf.upfronthosting.co.za> STINNER Victor added the comment: Please see the issue #30169 "test_multiprocessing_spawn crashed on AMD64 Windows8.1 Non-Debug 3.x buildbot", a mysterious and random bug on Windows which started to occur since the commit a00c3fd12d421e41b769debd7df717d17b0deed5 *or later* (who knows?)... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:31:53 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 13:31:53 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493213513.43.0.0341753573046.issue29974@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- pull_requests: +1404 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:32:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:32:52 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493213572.68.0.0735937385879.issue30131@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1405 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:33:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:33:26 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493213606.39.0.874758434741.issue30131@psf.upfronthosting.co.za> STINNER Victor added the comment: After stressing test_logging during 2 days on my FreeBSD VM, it seems like I found the root bug: see https://github.com/python/cpython/pull/1298 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:34:24 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 13:34:24 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493213664.59.0.0888154207457.issue29974@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- pull_requests: +1406 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:38:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:38:26 +0000 Subject: [issue29941] Confusion between asserts and Py_DEBUG In-Reply-To: <1493213181.39.0.860881026593.issue29941@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > since the commit a00c3fd12d421e41b769debd7df717d17b0deed5 *or later* (who knows?)... Hum, my sentence is unclear: I mean that I am not sure that this commit is related to issue #30169 crash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:40:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:40:31 +0000 Subject: [issue30170] "tests may fail, unable to create temporary directory" warning on buildbot: add a cleanup step to buildbots In-Reply-To: <1493212642.62.0.333467089335.issue30170@psf.upfronthosting.co.za> Message-ID: <1493214031.23.0.962961382321.issue30170@psf.upfronthosting.co.za> STINNER Victor added the comment: I also see this warning on AppVeyor: 0:01:42 [170/404] test_fcntl skipped -- running: test_concurrent_futures (76 sec) C:\projects\cpython\lib\test\support\__init__.py:1012: RuntimeWarning: tests may fail, unable to create temporary directory 'C:\\projects\\cpython\\build\\test_python_1080': [WinError 183] Cannot create a file when that file already exists: 'C:\\projects\\cpython\\build\\test_python_1080' with temp_dir(path=name, quiet=quiet) as temp_path: test_fcntl skipped -- No module named 'fcntl' 0:01:42 [171/404] test_eintr passed -- running: test_concurrent_futures (76 sec) https://ci.appveyor.com/project/python/cpython/build/3.7.0a0.1476 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:52:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:52:50 +0000 Subject: [issue30171] Emit ResourceWarning in multiprocessing Queue destructor Message-ID: <1493214770.49.0.943228970697.issue30171@psf.upfronthosting.co.za> New submission from STINNER Victor: A multiprocessing Queue object managers multiple resources: * a multiprocessing Pipe * a thread * (a lock and a semaphore) If a Queue is not cleaned up properly, your application may leak many resources. Try attached queue_leak.py to see an example "leaking a thread". I suggest to emit a ResourceWarning warning in Queue destrutor. I don't know what should be the test to decide if a warning must be emitted? * if the queue wasn't closed yet? * if the thread is alive? * if the queue wasn't closed yet and/or the thread is alive? (my favorite choice) Other examples of objects emitting ResourceWarning: * io files: io.FileIO, io.TextIOWrapper, etc. * socket.socket * subprocess.Popen: I recently added a ResourceWarning on that one * asyncio transports and event loops ---------- components: Library (Lib) files: queue_leak.py messages: 292346 nosy: davin, haypo, serhiy.storchaka priority: normal severity: normal status: open title: Emit ResourceWarning in multiprocessing Queue destructor type: resource usage versions: Python 3.7 Added file: http://bugs.python.org/file46830/queue_leak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:54:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:54:09 +0000 Subject: [issue30171] Emit ResourceWarning in multiprocessing Queue destructor In-Reply-To: <1493214770.49.0.943228970697.issue30171@psf.upfronthosting.co.za> Message-ID: <1493214849.9.0.795096958342.issue30171@psf.upfronthosting.co.za> STINNER Victor added the comment: Example: haypo at selma$ ./python queue_leak.py number of thread diff: +1 dangling threads! before: [<_MainThread(MainThread, started 139814961067072)>] after: [<_MainThread(MainThread, started 139814961067072)>] Note: queue_leak.py resource check is based on test.support.reap_threads. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:55:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:55:18 +0000 Subject: [issue30171] Emit ResourceWarning in multiprocessing Queue destructor In-Reply-To: <1493214770.49.0.943228970697.issue30171@psf.upfronthosting.co.za> Message-ID: <1493214918.74.0.206140797634.issue30171@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I forgot that I hitted this issue while analyzing issue #30131: test_logging leaks a "dangling" thread. It took me a while to find multiprocessing queues in the big test_logging file! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 09:56:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 13:56:28 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493214988.88.0.617559651125.issue30131@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 8ca2f2faefa8dba323a2e4c4b86efb633d7a53cf by Victor Stinner in branch 'master': bpo-30131: test_logging now joins queue threads (#1298) https://github.com/python/cpython/commit/8ca2f2faefa8dba323a2e4c4b86efb633d7a53cf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:10:13 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 14:10:13 +0000 Subject: [issue18669] curses.chgat() moves cursor, documentation says it shouldn't In-Reply-To: <1375800170.73.0.20062232661.issue18669@psf.upfronthosting.co.za> Message-ID: <1493215813.13.0.0572184626819.issue18669@psf.upfronthosting.co.za> Berker Peksag added the comment: I think this is a documentation issue. curses.chgat() documentation tries to describe different signatures in one place and some of these signatures change the behavior of the function. For example, curses.chgat() calls mvwchgat() when users pass y and x to it and mvwchgat() is documented as "the mvwchgat function does a cursor move before acting". ---------- keywords: +easy nosy: +berker.peksag stage: -> needs patch versions: +Python 3.6, Python 3.7 -Python 3.2, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:23:52 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 26 Apr 2017 14:23:52 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493216632.25.0.139029229944.issue29974@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: > 87c07fe9d908d0a2143fcc8369255c6ff3241503 should still be backported to 3.5 and 3.6 branches so please don't close it yet. Thanks for making backport PRs! (and sorry for closing prematurely) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:24:08 2017 From: report at bugs.python.org (Mike) Date: Wed, 26 Apr 2017 14:24:08 +0000 Subject: [issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear In-Reply-To: <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za> Message-ID: <1493216648.68.0.271159116515.issue30160@psf.upfronthosting.co.za> Changes by Mike : ---------- pull_requests: +1407 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:24:38 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 14:24:38 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493216678.42.0.94565034791.issue29974@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 271a289a03ad10c91c5326bde3020f1cdf6a1fff by Berker Peksag in branch '3.5': bpo-29974: Improve typing.TYPE_CHECKING example (GH-982) https://github.com/python/cpython/commit/271a289a03ad10c91c5326bde3020f1cdf6a1fff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:24:56 2017 From: report at bugs.python.org (Mark Lawrence) Date: Wed, 26 Apr 2017 14:24:56 +0000 Subject: [issue18669] curses.chgat() moves cursor, documentation says it shouldn't In-Reply-To: <1375800170.73.0.20062232661.issue18669@psf.upfronthosting.co.za> Message-ID: <1493216696.9.0.483878385136.issue18669@psf.upfronthosting.co.za> Changes by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:25:39 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 14:25:39 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493216739.21.0.908873062411.issue29974@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 04f389b8b357c8507b6c9642adcb8b956489e034 by Berker Peksag in branch '3.6': bpo-29974: Improve typing.TYPE_CHECKING example (GH-982) https://github.com/python/cpython/commit/04f389b8b357c8507b6c9642adcb8b956489e034 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:28:41 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 26 Apr 2017 14:28:41 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493216921.52.0.889070249003.issue29974@psf.upfronthosting.co.za> Berker Peksag added the comment: Now all backport PRs have been merged. Thanks for the PR, Mathias. > Thanks for making backport PRs! (and sorry for closing prematurely) No problem, thanks for the reviews! By the way, sorry I missed the typo in your last name while doing the initial merge. ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:43:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 14:43:35 +0000 Subject: [issue30172] test_tools takes longer than 5 minutes on some buildbots Message-ID: <1493217815.35.0.304443202168.issue30172@psf.upfronthosting.co.za> New submission from STINNER Victor: On x86-64 El Capitan 3.x buildbot, test_tools takes longer than 5 minutes, whereas the overall test suite took 31 min. Is someone wrong in test_tools? http://buildbot.python.org/all/builders/x86-64%20El%20Capitan%203.x/builds/92/steps/test/logs/stdio Run tests in parallel using 2 child processes ... 10 slowest tests: - test_tools: 5 min 3 sec - test_tokenize: 4 min 52 sec - test_multiprocessing_spawn: 4 min 4 sec - test_datetime: 3 min 32 sec - test_lib2to3: 3 min 14 sec - test_mmap: 2 min 43 sec - test_multiprocessing_forkserver: 2 min 11 sec - test_multiprocessing_fork: 1 min 58 sec - test_io: 1 min 54 sec - test_subprocess: 1 min 11 sec ... Total duration: 31 min 20 sec ... ---------- components: Tests keywords: buildbot messages: 292355 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: test_tools takes longer than 5 minutes on some buildbots type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:50:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 14:50:09 +0000 Subject: [issue30173] x86 Windows7 3.x buildbot has the issue #26624 bug Message-ID: <1493218209.79.0.825922715699.issue30173@psf.upfronthosting.co.za> New submission from STINNER Victor: It looks like the x86 Windows7 3.x buildbot has the issue #26624 bug: test__locale hangs. This buildbot slave is managed by David Bolen. @David: please see: * https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk * https://bugs.python.org/issue26624#msg270695 http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/549/steps/compile/logs/stdio ValidateUcrtbase: setlocal set PYTHONPATH=D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\Lib "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCBuild\win32\python_d.exe" "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PC\validate_ucrtbase.py" ucrtbased C:\Windows\system32\ucrtbased.dll is version 10.0.10240.16384 WARN: ucrtbased contains known issues. Please update the Windows 10 SDK. See: http://bugs.python.org/issue27705 https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/549/steps/test/logs/stdio 0:58:28 [335/404] test_base64 passed running: test_venv (56 sec), test__locale (30 sec) ... 1:07:49 [403/404] test_asyncgen passed -- running: test__locale (562 sec) command timed out: 3600 seconds without output running ['Tools\\buildbot\\test.bat', '-j2'], attempting to kill running: test__locale (592 sec) ... running: test__locale (4162 sec) 2:07:54 [404/404/1] test__locale crashed (Exit code 1) program finished with exit code 1 elapsedTime=7680.676000 ---------- components: Tests, Windows keywords: buildbot messages: 292356 nosy: db3l, haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: x86 Windows7 3.x buildbot has the issue #26624 bug versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:50:55 2017 From: report at bugs.python.org (Michael Seifert) Date: Wed, 26 Apr 2017 14:50:55 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1493218255.54.0.909358728154.issue26828@psf.upfronthosting.co.za> Michael Seifert added the comment: > I would like to mark this tracker item as closed. IMO it is a dead-end. Yes, even some (not very uncommon cases) give incorrect results: it = iter([1,2,3]) zip(it, it, it) has length_hint 3 but will only yield one item. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:54:44 2017 From: report at bugs.python.org (Michael Seifert) Date: Wed, 26 Apr 2017 14:54:44 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1493218484.59.0.317975840701.issue26828@psf.upfronthosting.co.za> Michael Seifert added the comment: > zip.__length_hint__() must return NotImplemented or raise TypeError if any of iterators don't implement __length_hint__ or its __length_hint__() returns NotImplemented or raises TypeError. > And what should return zip(range(3), range(2**1000)).__length_hint__()? I expect 3, not OverflowError. That's actually non-trivial because PyObject_LengthHint just returns a Py_ssize_t. To recover NotImplemented will be complicated and there's no way to discriminate if the OverflowError happened in PyObject_LengthHint or in the called __length_hint__. But TypeError is correctly re-raised in the tests I made. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 10:55:30 2017 From: report at bugs.python.org (Thomas Wouters) Date: Wed, 26 Apr 2017 14:55:30 +0000 Subject: [issue30169] test_multiprocessing_spawn crashed on AMD64 Windows8.1 Non-Debug 3.x buildbot In-Reply-To: <1493211266.82.0.263574668344.issue30169@psf.upfronthosting.co.za> Message-ID: <1493218530.15.0.46172283262.issue30169@psf.upfronthosting.co.za> Thomas Wouters added the comment: Eh, commit a00c3fd12d421e41b769debd7df717d17b0deed5 wasn't supposed to affect any behaviour in release builds, just in non-debug builds *with asserts enabled*, and only in making them build. (There is a bug in that commit that was fixed right after, commit 06bb4873d6a9ac303701d08a851d6cd9a51e02a3, but there shouldn't be any behavioural change since that went in.) What kind of behaviour change do you think the change caused? ---------- nosy: +twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:11:22 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Apr 2017 15:11:22 +0000 Subject: [issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter) In-Reply-To: <1461327160.24.0.621419084727.issue26828@psf.upfronthosting.co.za> Message-ID: <1493219482.76.0.356382138254.issue26828@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:11:54 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Apr 2017 15:11:54 +0000 Subject: [issue30171] Emit ResourceWarning in multiprocessing Queue destructor In-Reply-To: <1493214770.49.0.943228970697.issue30171@psf.upfronthosting.co.za> Message-ID: <1493219514.24.0.427801487624.issue30171@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- assignee: -> davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:17:15 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 26 Apr 2017 15:17:15 +0000 Subject: [issue30101] Add support for ncurses A_ITALIC Message-ID: <1493219835.06.0.373425294396.issue30101@psf.upfronthosting.co.za> New submission from Xiang Zhang: New changeset ab7886b78574d9224b26dc3a5b08e5c105fbbf11 by Xiang Zhang (Eijebong) in branch 'master': bpo-30101: Add support for curses.A_ITALIC. (#1015) https://github.com/python/cpython/commit/ab7886b78574d9224b26dc3a5b08e5c105fbbf11 ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:17:40 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 26 Apr 2017 15:17:40 +0000 Subject: [issue30101] Add support for ncurses A_ITALIC In-Reply-To: <1493219835.06.0.373425294396.issue30101@psf.upfronthosting.co.za> Message-ID: <1493219860.61.0.987201775369.issue30101@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:18:35 2017 From: report at bugs.python.org (Mathias Rav) Date: Wed, 26 Apr 2017 15:18:35 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493219915.22.0.903013711056.issue29974@psf.upfronthosting.co.za> Mathias Rav added the comment: Sorry for making a typo in your last name, Ivan Levkivskyi! I should know better and use copy-and-paste. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:21:38 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 26 Apr 2017 15:21:38 +0000 Subject: [issue29974] Change typing.TYPE_CHECKING doc example In-Reply-To: <1491240763.76.0.717121375128.issue29974@psf.upfronthosting.co.za> Message-ID: <1493220098.2.0.383231141484.issue29974@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: > Sorry for making a typo in your last name No problem! This actually happened maaany times with me :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:33:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 15:33:04 +0000 Subject: [issue30101] Add support for ncurses A_ITALIC In-Reply-To: <1493219835.06.0.373425294396.issue30101@psf.upfronthosting.co.za> Message-ID: <1493220784.12.0.852868570275.issue30101@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Bastien Orivel for your first contribution to Python! ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:50:03 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 26 Apr 2017 15:50:03 +0000 Subject: [issue30174] Duplicate code in pickletools.py Message-ID: <1493221803.92.0.461723845799.issue30174@psf.upfronthosting.co.za> New submission from Jelle Zijlstra: The bytes1 ArgumentDescriptor is duplicated in pickletools.py. ---------- messages: 292364 nosy: Jelle Zijlstra, alexandre.vassalotti priority: normal pull_requests: 1408 severity: normal status: open title: Duplicate code in pickletools.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:50:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Apr 2017 15:50:28 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x Message-ID: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> New submission from STINNER Victor: http://buildbot.python.org/all/builders/x86%20Gentoo%20Installed%20with%20X%203.x/builds/593/steps/test/logs/stdio ====================================================================== ERROR: test_logincapa_with_client_certfile (test.test_imaplib.RemoteIMAP_SSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/test/test_imaplib.py", line 972, in test_logincapa_with_client_certfile certfile=CERTFILE) File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/imaplib.py", line 1280, in __init__ IMAP4.__init__(self, host, port) File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/imaplib.py", line 197, in __init__ self.open(host, port) File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/imaplib.py", line 1293, in open IMAP4.open(self, host, port) File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/imaplib.py", line 294, in open self.sock = self._create_socket() File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/imaplib.py", line 1285, in _create_socket server_hostname=self.host) File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/ssl.py", line 401, in wrap_socket _context=self, _session=session) File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/ssl.py", line 808, in __init__ self.do_handshake() File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/ssl.py", line 1061, in do_handshake self._sslobj.do_handshake() File "/buildbot/buildarea/3.x.ware-gentoo-x86.installed/build/target/lib/python3.7/ssl.py", line 683, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:749) ---------- components: Tests messages: 292365 nosy: haypo priority: normal severity: normal status: open title: Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 11:54:11 2017 From: report at bugs.python.org (Tim Peters) Date: Wed, 26 Apr 2017 15:54:11 +0000 Subject: [issue30174] Duplicate code in pickletools.py In-Reply-To: <1493221803.92.0.461723845799.issue30174@psf.upfronthosting.co.za> Message-ID: <1493222051.35.0.982273493848.issue30174@psf.upfronthosting.co.za> Tim Peters added the comment: I already commented on github - +1 for this change. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:10:21 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 26 Apr 2017 16:10:21 +0000 Subject: [issue30176] curses attribute constants list is incomplete Message-ID: <1493223021.33.0.50678717528.issue30176@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- assignee: docs at python components: Documentation nosy: berker.peksag, docs at python, haypo, xiang.zhang priority: normal severity: normal stage: patch review status: open title: curses attribute constants list is incomplete versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:12:13 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 26 Apr 2017 16:12:13 +0000 Subject: [issue30176] curses attribute constants list is incomplete Message-ID: <1493223133.9.0.750163004574.issue30176@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1409 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:15:20 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 16:15:20 +0000 Subject: [issue30174] Duplicate code in pickletools.py In-Reply-To: <1493221803.92.0.461723845799.issue30174@psf.upfronthosting.co.za> Message-ID: <1493223320.22.0.547793360083.issue30174@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Does this need to be backported? ---------- nosy: +Mariatta stage: -> patch review versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:16:23 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 16:16:23 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493223383.63.0.741715391803.issue30142@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset a90b990480f45b6a0ad02d43455cf8b620bac9c5 by Mariatta (Dong-hee Na) in branch 'master': bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1296) https://github.com/python/cpython/commit/a90b990480f45b6a0ad02d43455cf8b620bac9c5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:19:45 2017 From: report at bugs.python.org (Michael Shuffett) Date: Wed, 26 Apr 2017 16:19:45 +0000 Subject: [issue30177] pathlib.resolve(strict=False) only includes first child Message-ID: <1493223585.29.0.982122563762.issue30177@psf.upfronthosting.co.za> New submission from Michael Shuffett: According to the documentation https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve If strict is False, the path is resolved as far as possible and any remainder is appended without checking whether it exists. The current behavior is not consistent with this, and only appends the first remainder. For example: If we have an empty '/tmp' directory Path('/tmp/foo').resolve() and Path('/tmp/foo/bar').resolve() both result in Path('/tmp/foo') but Path('/tmp/foo/bar').resolve() should result in Path('/tmp/foo/bar') ---------- components: Library (Lib) messages: 292369 nosy: mshuffett priority: normal severity: normal status: open title: pathlib.resolve(strict=False) only includes first child type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:30:38 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Apr 2017 16:30:38 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493224238.51.0.233206142603.issue30142@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1410 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:31:30 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Apr 2017 16:31:30 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493224290.24.0.543616967918.issue30142@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1411 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:31:53 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Apr 2017 16:31:53 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493224313.66.0.0935264553285.issue30142@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1412 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:32:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 16:32:47 +0000 Subject: [issue30174] Duplicate code in pickletools.py In-Reply-To: <1493221803.92.0.461723845799.issue30174@psf.upfronthosting.co.za> Message-ID: <1493224367.46.0.840199641365.issue30174@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The variant without " in the string" is more correct and consistent with bytes4 and bytes8. The first bytes1 was added in issue16550. The duplicate was mistakenly added in issue17810. This change can be backported, but it is not worth since the duplication doesn't have any effect. ---------- components: +Library (Lib) nosy: +pitrou, serhiy.storchaka type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:55:24 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 16:55:24 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493225723.99.0.597732866942.issue30142@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 9a626ec4e58c0bca1b4f71154e9e1da7e6d7e4a7 by Mariatta (Dong-hee Na) in branch '3.5': [3.5] bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1304) https://github.com/python/cpython/commit/9a626ec4e58c0bca1b4f71154e9e1da7e6d7e4a7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:55:34 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 16:55:34 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493225734.79.0.806442191764.issue30142@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 19b3a4885cc685adb42db6f8f7b625768f6d1baf by Mariatta (Dong-hee Na) in branch '2.7': [2.7] bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1305) https://github.com/python/cpython/commit/19b3a4885cc685adb42db6f8f7b625768f6d1baf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:55:58 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 16:55:58 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493225758.11.0.847843735343.issue30142@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 2fc3c543fc93d6211de8dcfaeac3a0fd10a356e0 by Mariatta (Dong-hee Na) in branch '3.6': [3.6] bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1303) https://github.com/python/cpython/commit/2fc3c543fc93d6211de8dcfaeac3a0fd10a356e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 12:56:53 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 16:56:53 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493225813.4.0.588545249181.issue30142@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:05:18 2017 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9_Anjos?=) Date: Wed, 26 Apr 2017 17:05:18 +0000 Subject: [issue30167] site.main() does not work on Python 3.6 and superior with PYTHONSTARTUP is set In-Reply-To: <1493196813.64.0.567701209744.issue30167@psf.upfronthosting.co.za> Message-ID: <1493226318.03.0.212752909252.issue30167@psf.upfronthosting.co.za> Changes by Andr? Anjos : ---------- title: site.main() does not work on Python 3.6 and superior -> site.main() does not work on Python 3.6 and superior with PYTHONSTARTUP is set _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:05:32 2017 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9_Anjos?=) Date: Wed, 26 Apr 2017 17:05:32 +0000 Subject: [issue30167] site.main() does not work on Python 3.6 and superior if PYTHONSTARTUP is set In-Reply-To: <1493196813.64.0.567701209744.issue30167@psf.upfronthosting.co.za> Message-ID: <1493226332.8.0.796968012076.issue30167@psf.upfronthosting.co.za> Changes by Andr? Anjos : ---------- title: site.main() does not work on Python 3.6 and superior with PYTHONSTARTUP is set -> site.main() does not work on Python 3.6 and superior if PYTHONSTARTUP is set _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:13:34 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Wed, 26 Apr 2017 17:13:34 +0000 Subject: [issue30178] Indent methods and attributes of MimeTypes class Message-ID: <1493226814.74.0.770717289652.issue30178@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Similar to #30168 opened earlier. The MimeTypes class's methods and attributes aren't indented and the resulting documentation is not indented and duplicates the class name. Didn't find anything that might indicate this was intentional when trying to blame this change. It seems to have happened at some point between 2.6 [1] and 2.7 [2], though, where the class directive was moved to the MimeTypes Objects section. Also didn't find an expert for this module in the index. Proposed change just indents these. [1]: https://github.com/python/cpython/blame/2.6/Doc/library/mimetypes.rst [2]: https://github.com/python/cpython/blame/2.7/Doc/library/mimetypes.rst ---------- assignee: docs at python components: Documentation messages: 292374 nosy: Jim Fasarakis-Hilliard, docs at python priority: normal severity: normal status: open title: Indent methods and attributes of MimeTypes class versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:14:15 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Wed, 26 Apr 2017 17:14:15 +0000 Subject: [issue30178] Indent methods and attributes of MimeTypes class In-Reply-To: <1493226814.74.0.770717289652.issue30178@psf.upfronthosting.co.za> Message-ID: <1493226855.99.0.624405789159.issue30178@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- pull_requests: +1413 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:15:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 17:15:06 +0000 Subject: [issue30176] curses attribute constants list is incomplete Message-ID: <1493226906.47.0.950642994662.issue30176@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Initially constants was enumerated in alphabetical order (except A_ITALIC). Maybe continue supporting this order? On other hand, it may be worth to group highlighting attributes separately. A_ATTRIBUTES, A_CHARTEXT and A_COLOR are not specific attributes, but bit masks, they also could be grouped separately or moved into a separate table. Perhaps it is worth to add notes for A_ITALIC and highlighting attributes. They are not always available. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:16:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 17:16:45 +0000 Subject: [issue30142] The "callable" fixer doesn't exist In-Reply-To: <1492948824.23.0.412292082563.issue30142@psf.upfronthosting.co.za> Message-ID: <1493227005.22.0.736732822551.issue30142@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Dong-hee Na and Mariatta. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:18:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 17:18:12 +0000 Subject: [issue30177] pathlib.resolve(strict=False) only includes first child In-Reply-To: <1493223585.29.0.982122563762.issue30177@psf.upfronthosting.co.za> Message-ID: <1493227092.78.0.343057885404.issue30177@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +pitrou, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:25:12 2017 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 26 Apr 2017 17:25:12 +0000 Subject: [issue30176] curses attribute constants list is incomplete In-Reply-To: <1493226906.47.0.950642994662.issue30176@psf.upfronthosting.co.za> Message-ID: <1493227512.15.0.107914546529.issue30176@psf.upfronthosting.co.za> Xiang Zhang added the comment: +1 for group. I added "The exact constants available are system dependent" to note some may be absent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:30:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 17:30:07 +0000 Subject: [issue30172] test_tools takes longer than 5 minutes on some buildbots In-Reply-To: <1493217815.35.0.304443202168.issue30172@psf.upfronthosting.co.za> Message-ID: <1493227807.37.0.952543019658.issue30172@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is expected. test_tools just runs a large number of subprocesses. Some subtests proceeds a large number of Python source files as test_tokenize and test_lib2to3. Maybe it would be better to run and report tests for different tools as separate tests (test_tools.test_pindent, test_tools.test_unparse, etc), but allowing to run a group as a whole. Does unittest or regrtest support this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:38:18 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 26 Apr 2017 17:38:18 +0000 Subject: [issue27618] docs for threading.Lock claim it's a class (since 3.3), but it's not (and has never been, apparently) In-Reply-To: <1469480103.96.0.342423272445.issue27618@psf.upfronthosting.co.za> Message-ID: <1493228298.08.0.314514304936.issue27618@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:46:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 17:46:26 +0000 Subject: [issue30176] curses attribute constants list is incomplete In-Reply-To: <1493226906.47.0.950642994662.issue30176@psf.upfronthosting.co.za> Message-ID: <1493228786.32.0.638240352037.issue30176@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I still think that the difference between the groups should be documented in more details. Not all functions that support A_BOLD support also A_ITALIC and A_HORIZONTAL (even if they are defined). Bit masks are used in totally different way than other constants. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:47:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Apr 2017 17:47:58 +0000 Subject: [issue30176] curses attribute constants list is incomplete In-Reply-To: <1493226906.47.0.950642994662.issue30176@psf.upfronthosting.co.za> Message-ID: <1493228878.72.0.378482056902.issue30176@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- nosy: +twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:52:58 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Apr 2017 17:52:58 +0000 Subject: [issue30149] inspect.signature() doesn't support partialmethod without explicit self parameter In-Reply-To: <1492978705.31.0.200843668782.issue30149@psf.upfronthosting.co.za> Message-ID: <1493229178.74.0.150827489048.issue30149@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1415 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:53:39 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Apr 2017 17:53:39 +0000 Subject: [issue30149] inspect.signature() doesn't support partialmethod without explicit self parameter In-Reply-To: <1492978705.31.0.200843668782.issue30149@psf.upfronthosting.co.za> Message-ID: <1493229219.5.0.0770111650536.issue30149@psf.upfronthosting.co.za> Dong-hee Na added the comment: I submitted the PR for this issue. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 13:59:06 2017 From: report at bugs.python.org (Steve Merritt) Date: Wed, 26 Apr 2017 17:59:06 +0000 Subject: [issue28964] AST literal_eval exceptions provide no information about line number In-Reply-To: <1481665664.26.0.256194535172.issue28964@psf.upfronthosting.co.za> Message-ID: <1493229546.04.0.0328366575446.issue28964@psf.upfronthosting.co.za> Steve Merritt added the comment: I'll try to get to it this weekend. A bit swamped on another project right now. Thanks for the interest and the reminder! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 16:23:38 2017 From: report at bugs.python.org (John Beck) Date: Wed, 26 Apr 2017 20:23:38 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1493238218.26.0.972680055912.issue26228@psf.upfronthosting.co.za> John Beck added the comment: Solaris has this problem also, and Chris' patch fixes it for us. ---------- nosy: +jbeck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 18:19:39 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 26 Apr 2017 22:19:39 +0000 Subject: [issue30179] Update Copyright to 2017 Message-ID: <1493245179.59.0.780402360042.issue30179@psf.upfronthosting.co.za> New submission from Cheryl Sabella: The copyright page is only through 2016. ---------- assignee: docs at python components: Documentation messages: 292383 nosy: csabella, docs at python priority: normal severity: normal status: open title: Update Copyright to 2017 type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 18:22:15 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 26 Apr 2017 22:22:15 +0000 Subject: [issue30179] Update Copyright to 2017 In-Reply-To: <1493245179.59.0.780402360042.issue30179@psf.upfronthosting.co.za> Message-ID: <1493245335.39.0.268501583643.issue30179@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1416 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 18:34:47 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 26 Apr 2017 22:34:47 +0000 Subject: [issue30179] Update Copyright to 2017 In-Reply-To: <1493245179.59.0.780402360042.issue30179@psf.upfronthosting.co.za> Message-ID: <1493246087.32.0.378253260199.issue30179@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Duplicate of http://bugs.python.org/issue29555. ---------- nosy: +Mariatta resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 20:51:02 2017 From: report at bugs.python.org (Joe Jevnik) Date: Thu, 27 Apr 2017 00:51:02 +0000 Subject: [issue30180] PyArg_ParseTupleAndKeywords supports required keyword only arguments Message-ID: <1493254262.66.0.357413160828.issue30180@psf.upfronthosting.co.za> New submission from Joe Jevnik: I opened a pr to remove a line in the docs about $ needing to follow | in PyArg_ParseTupleAndKeywords. In practice, you can just use a $ to create required keyword arguments which intuitively makes sense. I was told this should raise a SystemError; however, you can create required keyword only arguments in Python so I am not sure why we would want to fail when this is done with PyArg_ParseTupleAndKeywords. ---------- messages: 292385 nosy: llllllllll, serhiy.storchaka priority: normal pull_requests: 1417 severity: normal status: open title: PyArg_ParseTupleAndKeywords supports required keyword only arguments _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 20:51:12 2017 From: report at bugs.python.org (Joe Jevnik) Date: Thu, 27 Apr 2017 00:51:12 +0000 Subject: [issue30180] PyArg_ParseTupleAndKeywords supports required keyword only arguments In-Reply-To: <1493254262.66.0.357413160828.issue30180@psf.upfronthosting.co.za> Message-ID: <1493254272.66.0.604419747838.issue30180@psf.upfronthosting.co.za> Changes by Joe Jevnik : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 21:30:20 2017 From: report at bugs.python.org (Tim Graham) Date: Thu, 27 Apr 2017 01:30:20 +0000 Subject: [issue27172] Undeprecate inspect.getfullargspec() In-Reply-To: <1464767888.9.0.788649321892.issue27172@psf.upfronthosting.co.za> Message-ID: <1493256620.88.0.664408816802.issue27172@psf.upfronthosting.co.za> Tim Graham added the comment: Does it seems likely that getfullargspec() will be deprecated after Python 2 is EOL? Django is currently reimplementing getargspec(): https://github.com/django/django/blob/8ab7ce8558792f41637d6f87f2a8a117e169dd18/django/utils/inspect.py#L4-L24 A pull request proposes to modify that implementation to behave as getfullargspec(): https://github.com/django/django/pull/8410 Django master now supports Python 3.4+, so I guess we would rather use getfullargspec() if it's not going to be deprecated in the future. The only downside is that it would introduce deprecation warnings for Python 3.5 users since those warnings haven't been removed yet. I guess Django could silence them. ---------- nosy: +Tim.Graham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 22:44:34 2017 From: report at bugs.python.org (Ben Finney) Date: Thu, 27 Apr 2017 02:44:34 +0000 Subject: [issue30181] Incorrect parsing of test case docstring Message-ID: <1493261074.73.0.807341942876.issue30181@psf.upfronthosting.co.za> New submission from Ben Finney: The docstring of a test case is not correctly parsed for display. The attached ?test_foo.py? module contains two test case functions. Both docstrings conform to PEP 257 : they have a single-line synopsis and some extra text in a new paragraph. However, only one of the functions has its docstring synopsis used in the output: ===== ====================================================================== FAIL: test_lower_returns_expected_code (test_foo.Foo_TestCase) Should return expected code. ---------------------------------------------------------------------- Traceback (most recent call last): [?] ====================================================================== FAIL: test_reverse_returns_expected_text (test_foo.Foo_TestCase) ---------------------------------------------------------------------- Traceback (most recent call last): [?] ---------------------------------------------------------------------- Ran 2 tests in 0.001s ===== This violates the docstring parsing as described in PEP 257. The synopsis should be obtained by, first, stripping leading and trailing whitespace from the docstring; then, from that stripped text, taking the first line as the synopsis. So the expected output for ?test_foo.Foo_TestCase. test_reverse_returns_expected_text? should include its docstring synopsis, ?Should return expected reverse text.? ---------- components: Library (Lib) files: test_foo.py messages: 292387 nosy: benf_wspdigital priority: normal severity: normal status: open title: Incorrect parsing of test case docstring type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46831/test_foo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 22:48:43 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 02:48:43 +0000 Subject: [issue30176] curses attribute constants list is incomplete In-Reply-To: <1493226906.47.0.950642994662.issue30176@psf.upfronthosting.co.za> Message-ID: <1493261323.57.0.377180597764.issue30176@psf.upfronthosting.co.za> Xiang Zhang added the comment: I can't find any official, portable doc about the details so I don't prefer to have them. I support bit-masks are different. Previously I don't what's the better way to organize them, now I have a try. Please check the update. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 22:50:12 2017 From: report at bugs.python.org (Jesse Gonzalez) Date: Thu, 27 Apr 2017 02:50:12 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" Message-ID: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> New submission from Jesse Gonzalez: When reviewing the Unicode HOWTO, I found a reference to ISO as "International Standards Organization", which should instead read "International Organization for Standardization". https://www.iso.org/home.html ---------- assignee: docs at python components: Documentation messages: 292389 nosy: Jesse Gonzalez, docs at python priority: normal severity: normal status: open title: Incorrect in referring to ISO as "International Standards Organization" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 22:53:18 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 27 Apr 2017 02:53:18 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493261598.4.0.694639760952.issue30182@psf.upfronthosting.co.za> Louie Lu added the comment: Add the link: Python 3: https://docs.python.org/3/howto/unicode.html Python 2: https://docs.python.org/2/howto/unicode.html Both of 2 and 3 howto unicode use "International Standards Organization" Jesse, would you like to create a PR for this? ---------- nosy: +louielu versions: +Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:12:13 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Apr 2017 03:12:13 +0000 Subject: [issue30165] faulthandler acquires lock from signal handler, can deadlock while crashing In-Reply-To: <1493187831.24.0.928802817432.issue30165@psf.upfronthosting.co.za> Message-ID: <1493262733.0.0.556588714448.issue30165@psf.upfronthosting.co.za> Gregory P. Smith added the comment: This report is based on manual code inspection in CPython head after we encountered a deadlock using pytracemalloc on Python 2.7.12 where it _appeared_ to be the scenario I've described. I see now that I missed noticing the "#ifndef Py_HAVE_NATIVE_TLS" within thread.c which should imply a different PyThread_get_key_value() implementation that likely does not use our lock acquiring fallback find_key(). So my code analysis may not make sense... To give a taste of the large process setup we saw it in: * A CPython process that has extension modules which create their own threads as well as potentially Python having created its own threads. * We've called faulthandler.enable() *and* faulthandler.register(SIGTERM). * We send a SIGTERM to processes in this environment which are taking too long to complete; the goal was to get a stack trace of what the process was potentially stuck doing when our external timeout monitoring mechanism kicked in. our stuck process had received the SIGTERM and analyzing it revealed a deadlock between two threads which appeared to involve this faulthandler path. let me gather more info into one place. from there i should be able to come up with a way to reproduce it (or even better, not) ---------- assignee: haypo -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:24:56 2017 From: report at bugs.python.org (Zahari Dim) Date: Thu, 27 Apr 2017 03:24:56 +0000 Subject: [issue13349] Non-informative error message in index() and remove() functions In-Reply-To: <1320526177.89.0.678573577515.issue13349@psf.upfronthosting.co.za> Message-ID: <1493263496.2.0.0989076903984.issue13349@psf.upfronthosting.co.za> Changes by Zahari Dim : ---------- pull_requests: +1418 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:36:38 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 03:36:38 +0000 Subject: [issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad In-Reply-To: <1476176180.11.0.398413685253.issue28415@psf.upfronthosting.co.za> Message-ID: <1493264198.11.0.984939329955.issue28415@psf.upfronthosting.co.za> Xiang Zhang added the comment: New changeset 88c38b32b761cb566759b8ad96704bff590a1de9 by Xiang Zhang (Louie Lu) in branch 'master': bpo-28415: Note 0 conversion different between Python and C (#885) https://github.com/python/cpython/commit/88c38b32b761cb566759b8ad96704bff590a1de9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:36:38 2017 From: report at bugs.python.org (Brian May) Date: Thu, 27 Apr 2017 03:36:38 +0000 Subject: [issue30181] Incorrect parsing of test case docstring In-Reply-To: <1493261074.73.0.807341942876.issue30181@psf.upfronthosting.co.za> Message-ID: <1493264198.63.0.0558057497769.issue30181@psf.upfronthosting.co.za> Changes by Brian May : ---------- nosy: +brian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:38:33 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 03:38:33 +0000 Subject: [issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad In-Reply-To: <1476176180.11.0.398413685253.issue28415@psf.upfronthosting.co.za> Message-ID: <1493264313.03.0.090475218364.issue28415@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:43:28 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 27 Apr 2017 03:43:28 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493264608.03.0.743733937917.issue30182@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- keywords: +easy stage: -> needs patch versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:50:43 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 27 Apr 2017 03:50:43 +0000 Subject: [issue30165] faulthandler acquires lock from signal handler, can deadlock while crashing In-Reply-To: <1493187831.24.0.928802817432.issue30165@psf.upfronthosting.co.za> Message-ID: <1493265043.5.0.372378242753.issue30165@psf.upfronthosting.co.za> Gregory P. Smith added the comment: So... it looks like this could and does happen only on the 2.7 backport of faulthandler. 2.7 is missing the following commit to use pthreads native TLS instead of our lock filled non-async signal safe implementation: https://github.com/python/cpython/commit/2fea9b961d6ea1041ace66037513fcad1fc2173d Which is easy to backport to 2.7 for anyone who maintains their own patched interpreter. For the faulthandler backport package on PyPI perspective I'm not sure what if anything you want to do about it or if you want to track that here or on the faulthandler github issue tracker. It is not safe to call PyGILState_GetThisThreadState() on POSIX systems in a 2.7 extension module without the above patch to the interpreter. No idea how many people run into this in practice, or if they do, have actually noticed what is going on. Because the process is already crashing when it deadlocks so if they do, they are likely to just wind up killing it anyways at some point. We happened to run into it in an integration test framework due to a crash introduced by an unrelated change that caused a single digit percentage of test runs to timeout instead of pass or fail as they had in the past. ---------- assignee: gregory.p.smith -> haypo versions: +Python 2.7 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:54:59 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 03:54:59 +0000 Subject: [issue30115] test_logging report reference leak In-Reply-To: <1492686184.18.0.863470787856.issue30115@psf.upfronthosting.co.za> Message-ID: <1493265299.09.0.706251991118.issue30115@psf.upfronthosting.co.za> Xiang Zhang added the comment: Seems in #30131 Victor has solved this. :-) ---------- nosy: +haypo resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 26 23:55:30 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 03:55:30 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493265330.72.0.775422608501.issue30131@psf.upfronthosting.co.za> Xiang Zhang added the comment: Does this need to be backported? ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 00:12:17 2017 From: report at bugs.python.org (Louie Lu) Date: Thu, 27 Apr 2017 04:12:17 +0000 Subject: [issue30181] Incorrect parsing of test case docstring In-Reply-To: <1493261074.73.0.807341942876.issue30181@psf.upfronthosting.co.za> Message-ID: <1493266337.46.0.840869200648.issue30181@psf.upfronthosting.co.za> Louie Lu added the comment: This is because unittest.TestCase method `shortDescription()` will only return the first line of docstring, writing at here*: """ The default implementation of this method returns the first line of the test method?s docstring, if available, or None. """ Not sure if we may change this default behavior for this. * https://docs.python.org/3/library/unittest.html#unittest.TestCase.shortDescription ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 00:24:50 2017 From: report at bugs.python.org (David Haney) Date: Thu, 27 Apr 2017 04:24:50 +0000 Subject: [issue30183] [HPUX] compilation error in pytime.c with cc compiler Message-ID: <1493267090.1.0.00115311377195.issue30183@psf.upfronthosting.co.za> New submission from David Haney: When compiling on HP-UX with the native cc compiler, the following compilation error occurs in pytime.c cc -Ae -c -O -O -I. -I./Include -DPy_BUILD_CORE -o Python/pytime.o Python/pytime.c "Python/pytime.c", line 723: error #2020: identifier "CLOCK_MONOTONIC" is undefined const clockid_t clk_id = CLOCK_MONOTONIC; ^ 1 error detected in the compilation of "Python/pytime.c". *** Error exit code 2 Stop. HP-UX does not support the CLOCK_MONOTONIC state. ---------- components: Build messages: 292397 nosy: David Haney priority: normal severity: normal status: open title: [HPUX] compilation error in pytime.c with cc compiler type: compile error versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 00:41:57 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 04:41:57 +0000 Subject: [issue21071] struct.Struct.format is bytes, but should be str In-Reply-To: <1395856133.5.0.672707015318.issue21071@psf.upfronthosting.co.za> Message-ID: <1493268117.33.0.48479665619.issue21071@psf.upfronthosting.co.za> Xiang Zhang added the comment: +1 for change bytes to str. But struct.Struct() accepts both bytes and str, maybe in future buffer objects. When it gets a bytes object, converting it to a str looks unnecessary to me, and as OP said, comparison (a theoretical use case) could still fail. Could we just leave what the user passes in? bytes(bytes-like) -> bytes, str -> str. This looks more natural to me. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 00:43:32 2017 From: report at bugs.python.org (Jesse Gonzalez) Date: Thu, 27 Apr 2017 04:43:32 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493268212.5.0.549376177262.issue30182@psf.upfronthosting.co.za> Changes by Jesse Gonzalez : ---------- pull_requests: +1419 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 00:54:01 2017 From: report at bugs.python.org (Jesse Gonzalez) Date: Thu, 27 Apr 2017 04:54:01 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493268841.39.0.437684327974.issue30182@psf.upfronthosting.co.za> Jesse Gonzalez added the comment: PR created. CLA signed, but indicates otherwise in my account details. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:16:32 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 27 Apr 2017 05:16:32 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493270192.76.0.462133809051.issue30182@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1420 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:16:39 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 27 Apr 2017 05:16:39 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493270199.33.0.184846341634.issue30182@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1421 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:16:45 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 27 Apr 2017 05:16:45 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493270205.85.0.890623223725.issue30182@psf.upfronthosting.co.za> Changes by Mariatta Wijaya : ---------- pull_requests: +1422 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:18:56 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 27 Apr 2017 05:18:56 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493270336.0.0.83324371752.issue30182@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 33a5568f69301562d536852d12b9e03cd8dfc3a4 by Mariatta in branch '3.6': [3.6] bpo-30182: Use the correct name for ISO in Unicode HOWTO. (GH-1312) (GH-1313) https://github.com/python/cpython/commit/33a5568f69301562d536852d12b9e03cd8dfc3a4 ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:19:11 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 27 Apr 2017 05:19:11 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493270351.9.0.278966233392.issue30182@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset c4dfe2537fee970dc1bf3eb4fc2a3e007b36531c by Mariatta in branch '3.5': [3.5] bpo-30182: Use the correct name for ISO in Unicode HOWTO. (GH-1312) (GH-1314) https://github.com/python/cpython/commit/c4dfe2537fee970dc1bf3eb4fc2a3e007b36531c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:25:42 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 27 Apr 2017 05:25:42 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493270742.53.0.112412066859.issue30182@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 24404b4c92fc4195422c38563d0c6204fa7b16b1 by Mariatta in branch '2.7': [2.7] bpo-30182: Use the correct name for ISO in Unicode HOWTO. (GH-1312). (#1315) https://github.com/python/cpython/commit/24404b4c92fc4195422c38563d0c6204fa7b16b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:26:28 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Thu, 27 Apr 2017 05:26:28 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493270788.08.0.875138264167.issue30182@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Thanks :) ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:45:36 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Apr 2017 05:45:36 +0000 Subject: [issue30182] Incorrect in referring to ISO as "International Standards Organization" In-Reply-To: <1493261412.39.0.965032185029.issue30182@psf.upfronthosting.co.za> Message-ID: <1493271936.52.0.0637669850785.issue30182@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Since I had the same wrong idea, I dug further into the site. The explanation is at https://www.iso.org/about-us.html ''' It's all in the name Because 'International Organization for Standardization' would have different acronyms in different languages (IOS in English, OIN in French for Organisation internationale de normalisation), our founders decided to give it the short form ISO. ISO is derived from the Greek isos, meaning equal. Whatever the country, whatever the language, we are always ISO. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 01:47:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 05:47:02 +0000 Subject: [issue30165] faulthandler acquires lock from signal handler, can deadlock while crashing In-Reply-To: <1493265043.5.0.372378242753.issue30165@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Oh sorry, you reported the bug on my 2.7 backport but I ask you to report the bug here, and now the bug is specific to 2.7 :-) Yes, faulthandler implementation is different on Python 2.7. If you look in depth, it is even very different especially "dump later" (2.7 uses alarm, 3.x uses a thread). The stdlib implementation is much more reliable because of different Python enhancements likr native TLS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 02:10:11 2017 From: report at bugs.python.org (Ben Finney) Date: Thu, 27 Apr 2017 06:10:11 +0000 Subject: [issue30181] Incorrect parsing of test case docstring In-Reply-To: <1493261074.73.0.807341942876.issue30181@psf.upfronthosting.co.za> Message-ID: <1493273411.86.0.697759251745.issue30181@psf.upfronthosting.co.za> Ben Finney added the comment: > This is because unittest.TestCase method `shortDescription()` will only return the first line of docstring Yes, that is the ?docstring synopsis? I referred to. PEP 257 has a section specifically about how tools should parse a docstring: https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation In particular, note that ? Blank lines should be removed from the beginning and end of the docstring.? So, the ?first line of the docstring? for the example ?test_reverse_returns_expected_text? is the text ?Should return expected reverse text.?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 02:38:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 06:38:26 +0000 Subject: [issue30184] Add tests for invalid use of PyArg_ParseTupleAndKeywords Message-ID: <1493275106.78.0.678380665144.issue30184@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch adds tests that check that PyArg_ParseTupleAndKeywords() correctly detects errors in the format string and keywords list and raises SystemError. It also allows the format argument in _testcapi.parse_tuple_and_keywords() be string. ---------- components: Tests messages: 292407 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add tests for invalid use of PyArg_ParseTupleAndKeywords type: enhancement versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 02:41:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 06:41:34 +0000 Subject: [issue30184] Add tests for invalid use of PyArg_ParseTupleAndKeywords In-Reply-To: <1493275106.78.0.678380665144.issue30184@psf.upfronthosting.co.za> Message-ID: <1493275294.77.0.255452550381.issue30184@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1423 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 03:01:37 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 27 Apr 2017 07:01:37 +0000 Subject: [issue27172] Undeprecate inspect.getfullargspec() In-Reply-To: <1464767888.9.0.788649321892.issue27172@psf.upfronthosting.co.za> Message-ID: <1493276497.08.0.961223799064.issue27172@psf.upfronthosting.co.za> Nick Coghlan added the comment: No, there are no plans to ever deprecate getfullargspec() again - it isn't hard to maintain indefinitely as a wrapper around inspect.Signature(), and it doesn't have the significant limitations that affected getargspec(). ---------- priority: deferred blocker -> normal stage: needs patch -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 03:05:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 07:05:22 +0000 Subject: [issue21071] struct.Struct.format is bytes, but should be str In-Reply-To: <1395856133.5.0.672707015318.issue21071@psf.upfronthosting.co.za> Message-ID: <1493276722.75.0.96912630692.issue21071@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: After changing the type of Struct.format to str we perhaps should deprecate accepting bytes as format. Currently this can lead to emitting a BytesWarning. $ ./python -Wa -b >>> import struct >>> struct.pack('I', 12345) b'90\x00\x00' >>> struct.pack(b'I', 12345) __main__:1: BytesWarning: Comparison between bytes and string __main__:1: BytesWarning: Comparison between bytes and string b'90\x00\x00' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 03:05:26 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 27 Apr 2017 07:05:26 +0000 Subject: [issue27172] Undeprecate inspect.getfullargspec() In-Reply-To: <1464767888.9.0.788649321892.issue27172@psf.upfronthosting.co.za> Message-ID: <1493276726.63.0.171902562131.issue27172@psf.upfronthosting.co.za> Nick Coghlan added the comment: Also, note that the programmatic deprecation warning change in the patch is to the warning for `getargspec()`, so that it recommends `getfullargspec()` rather than `Signature()`. There's no runtime deprecation warning for `getfullargspec()` in any version of Python 3.x, so projects can use it freely, regardless of target version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 03:41:12 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 27 Apr 2017 07:41:12 +0000 Subject: [issue30179] Update Copyright to 2017 In-Reply-To: <1493245179.59.0.780402360042.issue30179@psf.upfronthosting.co.za> Message-ID: <1493278872.97.0.153629203318.issue30179@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- superseder: -> Update Python Software Foundation Copyright Year _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 04:48:52 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 08:48:52 +0000 Subject: [issue21071] struct.Struct.format is bytes, but should be str In-Reply-To: <1395856133.5.0.672707015318.issue21071@psf.upfronthosting.co.za> Message-ID: <1493282932.27.0.529772913213.issue21071@psf.upfronthosting.co.za> Xiang Zhang added the comment: The warnings are possible to remove I think... but deprecate bytes arguments sounds good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 05:32:25 2017 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 27 Apr 2017 09:32:25 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493285544.99.0.0785471768315.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: > It seems Python already does some exercising of these dtoa functions in its test suite, but ideally you would want to check against upstream's full tests, if those exist. They barely do: Python's tests for dtoa.c are much more comprehensive than the upstream tests. Or at least they were at the time when I was adapting dtoa.c for use in Python and communicating with Gay about issues, and I doubt that that situation has changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 05:35:25 2017 From: report at bugs.python.org (Martin Panter) Date: Thu, 27 Apr 2017 09:35:25 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493285725.78.0.889164686737.issue29606@psf.upfronthosting.co.za> Martin Panter added the comment: Isn?t Issue 30119 a duplicate of this? In that bug Dong-hee you posted a pull request that changes the ?ftplib? module, which makes more sense to me than adding a special case to ?urlsplit? that understands FTP. See how this was addressed for HTTP in Issue 22928. ---------- nosy: +martin.panter stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 05:59:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 09:59:28 +0000 Subject: [issue30165] faulthandler acquires lock from signal handler, can deadlock while crashing In-Reply-To: <1493187831.24.0.928802817432.issue30165@psf.upfronthosting.co.za> Message-ID: <1493287168.48.0.151705271358.issue30165@psf.upfronthosting.co.za> STINNER Victor added the comment: Since CPython 3 is not affected, I close this issue and move back the discussion on the bug tracker of the CPython 2.7 backport: https://github.com/haypo/faulthandler/issues/29 ---------- resolution: -> works for me stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:04:34 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 27 Apr 2017 10:04:34 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493287474.35.0.805806280402.issue30052@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- stage: patch review -> backport needed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:06:35 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 27 Apr 2017 10:06:35 +0000 Subject: [issue30163] argparse mx_group is required, when action value equal default will be ignore In-Reply-To: <1493173985.7.0.845758399817.issue30163@psf.upfronthosting.co.za> Message-ID: <1493287595.61.0.764530533822.issue30163@psf.upfronthosting.co.za> Changes by Berker Peksag : ---------- superseder: -> argparse: default args in mutually exclusive groups _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:08:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 10:08:29 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493287709.6.0.835174025652.issue30124@psf.upfronthosting.co.za> STINNER Victor added the comment: Mark Dickinson: "It would also take us even further away from the upstream sources, making it harder to integrate bugfixes from upstream." We have two main options: * Use -fno-strict-aliasing on clang (solution currently used), maybe restrict the option to dtoa.c * Avoid union to avoid any risk of aliasing issue: option experimented by dim According to Mark, rewriting the code without union is not only more risky but would also be a major shift from upstream. I disagree with it's so risky, there is a risk yes, but we can take our timeto review it and test it on many platforms with the Python extensive test suite. For example, the aliasing issue on clang 4 was catched quicky on our FreeBSD CURRENT buildbot. But the current blocker point is upstream: Mark doesn't want diverge from upstream, so Mark: can you (or someone else?) please contact "Gay (or other maintainers)" to take a decision with him/them? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:23:42 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 10:23:42 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493288622.94.0.132477589462.issue30103@psf.upfronthosting.co.za> Xiang Zhang added the comment: Looks like perl has already encoded in this way: [~]$ perl -e 'print pack("u","Ca\x00t")' $0V$`=``` > Oddly, the uu.decode function does properly decode files encoded using "`", but encode is unable to create them. The decoder source code explicitly states it could resolve backtick since some encoders use '`' instead of space. To maintain backwards compatibility, I think we can add a keyword-only backtick parameter to binascii.b2a_uu and uuencode. ---------- nosy: +serhiy.storchaka, xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:33:52 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 27 Apr 2017 10:33:52 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493289232.0.0.297116628984.issue29606@psf.upfronthosting.co.za> Dong-hee Na added the comment: Smillar issue but this issue is about FTP protocal using by httplib. Looks simillar but different. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:43:33 2017 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 27 Apr 2017 10:43:33 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493289813.58.0.236881110919.issue30124@psf.upfronthosting.co.za> Mark Dickinson added the comment: Victor: I don't think that's necessary. We simply need to add -fno-strict-aliasing for this file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:51:26 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 27 Apr 2017 10:51:26 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493290286.2.0.088844752124.issue29606@psf.upfronthosting.co.za> Dong-hee Na added the comment: So if you want not to add this special case for httplib and just solving this issue for ftplib. We could close this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:51:47 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Apr 2017 10:51:47 +0000 Subject: [issue30185] forkserver process should silence KeyboardInterrupt Message-ID: <1493290307.72.0.662985232827.issue30185@psf.upfronthosting.co.za> New submission from Antoine Pitrou: The forkserver intermediate process is an implementation detail. However, if you Ctrl-C the main process, the forkserver process will exit with a KeyboardInterrupt traceback, even if the main process catches KeyboardInterrupt to exit silently. This produces stderr such as: $ ./python forkserversignal.py ^CTraceback (most recent call last): File "", line 1, in File "/home/antoine/cpython/default/Lib/multiprocessing/forkserver.py", line 164, in main rfds = [key.fileobj for (key, events) in selector.select()] File "/home/antoine/cpython/default/Lib/selectors.py", line 445, in select fd_event_list = self._epoll.poll(timeout, max_ev) KeyboardInterrupt For the sake of usability, forkserver should probably silence those tracebacks by default, for example by changing the default signal handler in the forkserver process (but children forked by the forkserver process should probably get the default Python signal handlers...). Not sure this can be considered a bugfix or an enhancement. ---------- components: Library (Lib) messages: 292420 nosy: davin, pitrou, rhettinger, sbt priority: normal severity: normal stage: needs patch status: open title: forkserver process should silence KeyboardInterrupt type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:53:01 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Apr 2017 10:53:01 +0000 Subject: [issue30185] forkserver process should silence KeyboardInterrupt In-Reply-To: <1493290307.72.0.662985232827.issue30185@psf.upfronthosting.co.za> Message-ID: <1493290381.09.0.294061053381.issue30185@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Uploading small reproducer script. ---------- Added file: http://bugs.python.org/file46832/forkserversignal.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 06:55:36 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Apr 2017 10:55:36 +0000 Subject: [issue30185] forkserver process should silence KeyboardInterrupt In-Reply-To: <1493290307.72.0.662985232827.issue30185@psf.upfronthosting.co.za> Message-ID: <1493290536.08.0.621447878553.issue30185@psf.upfronthosting.co.za> Antoine Pitrou added the comment: A simpler solution would actually be to catch KeyboardInterrupt inside the forkserver loop and exit cleanly... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 07:21:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 11:21:50 +0000 Subject: [issue30183] [HPUX] compilation error in pytime.c with cc compiler In-Reply-To: <1493267090.1.0.00115311377195.issue30183@psf.upfronthosting.co.za> Message-ID: <1493292110.45.0.488530374142.issue30183@psf.upfronthosting.co.za> STINNER Victor added the comment: > HP-UX does not support the CLOCK_MONOTONIC state. I'm sorry but CPython requires a monotonic clock since CPython 3.5. According to https://bugreports.qt.io/browse/QTBUG-22301 HP-UX < 11.3 and Solaris 9 don't support monotonic clock. It seems like gethrtime() is the right function to be used on HP-UX. https://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/gethrtime.3C.html "gethrtime() is measured from an unspecified starting point and is not subject to time server and administrator changes" src: http://nadeausoftware.com/articles/2012/04/c_c_tip_how_measure_elapsed_real_time_benchmarking#gethrtimenbsp ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 07:24:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 11:24:37 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493292277.4.0.833463238078.issue30131@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1424 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 07:25:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 11:25:14 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493292314.17.0.250611372212.issue30131@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1425 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 07:27:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 11:27:49 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493292469.77.0.977923952175.issue30131@psf.upfronthosting.co.za> STINNER Victor added the comment: > Does this need to be backported? I checked: Python 3.5 and 3.6 have the bug, but Python 2.7 is not affected (it doesn't have the unit test which leaks resources). I created PRs. ---------- versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 07:32:30 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 11:32:30 +0000 Subject: [issue30185] forkserver process should silence KeyboardInterrupt In-Reply-To: <1493290307.72.0.662985232827.issue30185@psf.upfronthosting.co.za> Message-ID: <1493292750.25.0.385497851554.issue30185@psf.upfronthosting.co.za> STINNER Victor added the comment: > A simpler solution would actually be to catch KeyboardInterrupt inside the forkserver loop and exit cleanly... I'm not sure that we always want to exit on CTRL-c. But I agree that the forkserver has to handle CTRL-c. Maybe ignore it, but be killed when its master gets a CTRL-c? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 07:39:37 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Apr 2017 11:39:37 +0000 Subject: [issue30185] forkserver process should silence KeyboardInterrupt In-Reply-To: <1493290307.72.0.662985232827.issue30185@psf.upfronthosting.co.za> Message-ID: <1493293177.46.0.16455293172.issue30185@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > I'm not sure that we always want to exit on CTRL-c. That's what the forkserver does right now, it's just that it does it with a traceback that's useless to the user. > Maybe ignore it, but be killed when its master gets a CTRL-c? That's a possibility (the forkserver should already exit automatically when its parent dies), the problem is what to do for the forkserver's children? Should they restore the default signal handler? Simply silencing the KeyboardInterrupt traceback at least is a straightforward solution with little risk of side effects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 07:49:57 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Apr 2017 11:49:57 +0000 Subject: [issue30181] Incorrect parsing of test case docstring In-Reply-To: <1493261074.73.0.807341942876.issue30181@psf.upfronthosting.co.za> Message-ID: <1493293797.59.0.637505906352.issue30181@psf.upfronthosting.co.za> R. David Murray added the comment: Considering that in the cpython test suite we avoid using docstrings in unittests because of this "feature" of unittest, I doubt anyone on the core team is going to be motivated to fix this :) That doesn't mean we won't accept a PR, but if we do we would only put it in 3.7 because it is a visible behavior change, and there are tools that parse unittest output. ---------- nosy: +r.david.murray type: behavior -> enhancement versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 07:53:43 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 27 Apr 2017 11:53:43 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493294023.72.0.870223903244.issue30052@psf.upfronthosting.co.za> Cheryl Sabella added the comment: FYI. When I tested this change locally, I needed to do a 'make clean' then a 'make html' for all the pages to relink to the stdtypes page for :class:`bytes`. I had asked on the IRC channel about that and thought maybe the merge into the master would do that automatically, but checking some of the links (like on the urllib.parse page), it didn't update them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:15:37 2017 From: report at bugs.python.org (Martin Panter) Date: Thu, 27 Apr 2017 12:15:37 +0000 Subject: [issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear In-Reply-To: <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za> Message-ID: <1493295337.05.0.246669904613.issue30160@psf.upfronthosting.co.za> Martin Panter added the comment: The ?Proper adherence? sentence has always bothered me. Why does ?wfile? have to adhere, but not other other APIs (rfile, send_header, etc)? I wonder if the sentence is useful at all. (Of course you have to use HTTP to operate with HTTP clients.) Perhaps it was intended to say that socket-level HTTP is written to wfile, that it is up to the caller to ensure the encoding, content length, etc is consistent with the HTTP header, and/or the caller has to supply the header (either direct through wfile or via send_header etc). A plausable alternative would be a higher-level file object like the request body in ?http.client?, where encoding and content length is handled by the library. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:18:00 2017 From: report at bugs.python.org (Sebastian Ernst) Date: Thu, 27 Apr 2017 12:18:00 +0000 Subject: [issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only Message-ID: <1493295480.01.0.116959327637.issue30186@psf.upfronthosting.co.za> New submission from Sebastian Ernst: I am investigating a bug in Wine: https://bugs.winehq.org/show_bug.cgi?id=42474 The Python 3.6(.1) interpreter fails to start on Wine because of an unimplemented function in Wine: "api-ms-win-core-path-l1-1-0.dll.PathCchCombineEx". While the missing function is clearly a problem in Wine, the fact that PathCchCombineEx is called in the first place is somewhat odd. The call was added to Python 3.6 on 09 Sep 2016 by Steve Dower of Microsoft: https://hg.python.org/cpython/rev/03517dd54977 Logically, Python 3.5.x and prior do not require this call and work flawlessly under Wine. Digging deeper into this, I found that PathCchCombineEx was introduced in Windows 8: https://msdn.microsoft.com/en-us/library/windows/desktop/hh707086(v=vs.85).aspx However, the following page states, that the current version of Python (3.6) should support Windows Vista and 7: https://docs.python.org/3/using/windows.html I am seeking clarification on why PathCchCombineEx is called during the Python interpreter startup although Wine pretends to be Windows 7 and although Python should support Windows Vista & 7. My thinking is that this call might also happen on an actual Windows 7 system under some circumstances and break Python there as well, which would make it a bug in Python. ---------- components: Interpreter Core, Windows messages: 292430 nosy: paul.moore, smernst, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:21:12 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Apr 2017 12:21:12 +0000 Subject: [issue30185] forkserver process should silence KeyboardInterrupt In-Reply-To: <1493290307.72.0.662985232827.issue30185@psf.upfronthosting.co.za> Message-ID: <1493295672.0.0.126782660414.issue30185@psf.upfronthosting.co.za> Changes by Antoine Pitrou : ---------- pull_requests: +1426 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:23:36 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 27 Apr 2017 12:23:36 +0000 Subject: [issue27200] make doctest in CPython has failures In-Reply-To: <1464988408.0.0.840317371896.issue27200@psf.upfronthosting.co.za> Message-ID: <1493295816.56.0.333557374533.issue27200@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset e65fcde85abf6617508f2d6b77020e24b8ca6f6b by Berker Peksag (Marco Buttu) in branch 'master': bpo-27200: Fix several doctests (GH-604) https://github.com/python/cpython/commit/e65fcde85abf6617508f2d6b77020e24b8ca6f6b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:27:32 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Apr 2017 12:27:32 +0000 Subject: [issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear In-Reply-To: <1493131484.95.0.842958745675.issue30160@psf.upfronthosting.co.za> Message-ID: <1493296052.74.0.022322730141.issue30160@psf.upfronthosting.co.za> R. David Murray added the comment: My impression is that the sentence is there because you are acting directly on the raw byte stream, which you are not in the other cases. (Well, rfile, but that's reading, so what you do there doesn't affect the wire protocol you send). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:43:09 2017 From: report at bugs.python.org (Jake Davis) Date: Thu, 27 Apr 2017 12:43:09 +0000 Subject: [issue30157] csv.Sniffer.sniff() regex error In-Reply-To: <1493085066.27.0.612102662908.issue30157@psf.upfronthosting.co.za> Message-ID: <1493296989.75.0.37401764102.issue30157@psf.upfronthosting.co.za> Jake Davis added the comment: I've added some unittests for Sniffer._guess_quote_and_delimiter(); they should prevent regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:46:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 12:46:42 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493297202.2.0.961047819042.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: RemoteIMAP_SSLTest uses cyrus.andrew.cmu.edu server with the port 993. Would it be possible to setup an IMAP server on pythontest.net instead of using a server of an university? http://www.cmu.edu/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:47:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 12:47:37 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493297257.98.0.0820129563009.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: https://travis-ci.org/python/cpython/jobs/226357867 Oh, the test started to fail on Travis CI as well: ====================================================================== ERROR: test_logincapa_with_client_certfile (test.test_imaplib.RemoteIMAP_SSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/travis/build/python/cpython/Lib/test/test_imaplib.py", line 973, in test_logincapa_with_client_certfile certfile=CERTFILE) File "/home/travis/build/python/cpython/Lib/imaplib.py", line 1280, in __init__ IMAP4.__init__(self, host, port) File "/home/travis/build/python/cpython/Lib/imaplib.py", line 197, in __init__ self.open(host, port) File "/home/travis/build/python/cpython/Lib/imaplib.py", line 1293, in open IMAP4.open(self, host, port) File "/home/travis/build/python/cpython/Lib/imaplib.py", line 294, in open self.sock = self._create_socket() File "/home/travis/build/python/cpython/Lib/imaplib.py", line 1285, in _create_socket server_hostname=self.host) File "/home/travis/build/python/cpython/Lib/ssl.py", line 401, in wrap_socket _context=self, _session=session) File "/home/travis/build/python/cpython/Lib/ssl.py", line 808, in __init__ self.do_handshake() File "/home/travis/build/python/cpython/Lib/ssl.py", line 1061, in do_handshake self._sslobj.do_handshake() File "/home/travis/build/python/cpython/Lib/ssl.py", line 683, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:749) ====================================================================== ERROR: test_logincapa_with_client_ssl_context (test.test_imaplib.RemoteIMAP_SSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/travis/build/python/cpython/Lib/test/test_imaplib.py", line 979, in test_logincapa_with_client_ssl_context self.host, self.port, ssl_context=self.create_ssl_context()) File "/home/travis/build/python/cpython/Lib/imaplib.py", line 1280, in __init__ IMAP4.__init__(self, host, port) File "/home/travis/build/python/cpython/Lib/imaplib.py", line 197, in __init__ self.open(host, port) File "/home/travis/build/python/cpython/Lib/imaplib.py", line 1293, in open IMAP4.open(self, host, port) File "/home/travis/build/python/cpython/Lib/imaplib.py", line 294, in open self.sock = self._create_socket() File "/home/travis/build/python/cpython/Lib/imaplib.py", line 1285, in _create_socket server_hostname=self.host) File "/home/travis/build/python/cpython/Lib/ssl.py", line 401, in wrap_socket _context=self, _session=session) File "/home/travis/build/python/cpython/Lib/ssl.py", line 808, in __init__ self.do_handshake() File "/home/travis/build/python/cpython/Lib/ssl.py", line 1061, in do_handshake self._sslobj.do_handshake() File "/home/travis/build/python/cpython/Lib/ssl.py", line 683, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:749) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 08:49:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 12:49:35 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493297375.22.0.542390796506.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: haypo at selma$ openssl s_client -connect cyrus.andrew.cmu.edu:993 CONNECTED(00000003) depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root verify return:1 depth=2 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Certification Authority verify return:1 depth=1 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Organization Validation Secure Server CA verify return:1 depth=0 C = US, postalCode = 15213, ST = PA, L = Pittsburgh, street = 5000 Forbes, O = Carnegie Mellon University, OU = Carnegie Mellon University, OU = Multi-Domain SSL, CN = cyrus.andrew.cmu.edu verify return:1 --- Certificate chain 0 s:/C=US/postalCode=15213/ST=PA/L=Pittsburgh/street=5000 Forbes/O=Carnegie Mellon University/OU=Carnegie Mellon University/OU=Multi-Domain SSL/CN=cyrus.andrew.cmu.edu i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Organization Validation Secure Server CA 1 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Organization Validation Secure Server CA i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Authority 2 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Authority i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root 3 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root --- Server certificate -----BEGIN CERTIFICATE----- MIIF2zCCBMOgAwIBAgIQTkDJp5DZKOpt6Vy2UaZ24DANBgkqhkiG9w0BAQsFADCB ljELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxPDA6BgNV BAMTM0NPTU9ETyBSU0EgT3JnYW5pemF0aW9uIFZhbGlkYXRpb24gU2VjdXJlIFNl cnZlciBDQTAeFw0xNzA0MjQwMDAwMDBaFw0yMDA0MjMyMzU5NTlaMIHZMQswCQYD VQQGEwJVUzEOMAwGA1UEERMFMTUyMTMxCzAJBgNVBAgTAlBBMRMwEQYDVQQHEwpQ aXR0c2J1cmdoMRQwEgYDVQQJEws1MDAwIEZvcmJlczEjMCEGA1UEChMaQ2FybmVn aWUgTWVsbG9uIFVuaXZlcnNpdHkxIzAhBgNVBAsTGkNhcm5lZ2llIE1lbGxvbiBV bml2ZXJzaXR5MRkwFwYDVQQLExBNdWx0aS1Eb21haW4gU1NMMR0wGwYDVQQDExRj eXJ1cy5hbmRyZXcuY211LmVkdTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAM0VgQbuCBrfWJ0B6YB+TrCD2KDSeOmRyKJkFB+T0fKK658pBNlAxS8i98QC 7tOApMdGXw3OJaiCIoUq6QMyXC1SnnEITi5m1qORLlwu3+FG6548FHonAyMydU/i JBHs4goA7Cy3QUxMPe+ZZTkWr+lQpElukYqmDao/x4ZERz8mZPI/zPzlNALv3TF1 lcpQUHuI5Kw2G0hymANJY3W0hU8JwOBRAjO4em+XVNKXJD4seYGHp+7YZP40Xua/ YrRSwokUqVy/Y3+ytLH6Amnp3zJKpgFM/XSGy3KcuQCwEa86H/DVj/dN710KOpW5 S1Szza4b+gaCb+BKi2u9bFYB0PcCAwEAAaOCAd4wggHaMB8GA1UdIwQYMBaAFJrz K9rPrU+2L7sqSEgqErcbQsEkMB0GA1UdDgQWBBR/3PPQ2+NzaAVGAghMELRikx4Q hTAOBgNVHQ8BAf8EBAMCBaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEF BQcDAQYIKwYBBQUHAwIwUAYDVR0gBEkwRzA7BgwrBgEEAbIxAQIBAwQwKzApBggr BgEFBQcCARYdaHR0cHM6Ly9zZWN1cmUuY29tb2RvLmNvbS9DUFMwCAYGZ4EMAQIC MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9E T1JTQU9yZ2FuaXphdGlvblZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgYsG CCsGAQUFBwEBBH8wfTBVBggrBgEFBQcwAoZJaHR0cDovL2NydC5jb21vZG9jYS5j b20vQ09NT0RPUlNBT3JnYW5pemF0aW9uVmFsaWRhdGlvblNlY3VyZVNlcnZlckNB LmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMB8GA1Ud EQQYMBaCFGN5cnVzLmFuZHJldy5jbXUuZWR1MA0GCSqGSIb3DQEBCwUAA4IBAQCf 1U2esEfk12MXwrYYvWI0QJSnMvYG9qu8nVDHwoSGsivr4GoBf5cFhtF6gGGERD2x 8kvCuXbkCtf3nWNffUhs7OXzMapA8eOJr7VtmwQraYaDpFCTZpj2X8rpdyhjIBCb V1VXdxS56TKiQKN72JmdB+e06+w49ym0WMzBjPxZGncogNA0mvKaquiFWe0j0ZT9 rqfuIIon2P3cg+jZctytejVoMFOLkTxSslxjNDNjDvJ4zQnuH6zuhP/1vkpNGSp3 +J8xSw1ubLU7pN/Kv8tR9KsJcRafFC0iryipaah2zib27zaRgO25eq5/dKqRUa96 77xcSeTyQ/2hwVFLrJjW -----END CERTIFICATE----- subject=/C=US/postalCode=15213/ST=PA/L=Pittsburgh/street=5000 Forbes/O=Carnegie Mellon University/OU=Carnegie Mellon University/OU=Multi-Domain SSL/CN=cyrus.andrew.cmu.edu issuer=/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Organization Validation Secure Server CA --- Acceptable client certificate CA names /C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Authority /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Organization Validation Secure Server CA Client Certificate Types: RSA sign, DSA sign, ECDSA sign Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:ECDSA+SHA512:RSA+SHA384:DSA+SHA384:ECDSA+SHA384:RSA+SHA256:DSA+SHA256:ECDSA+SHA256:RSA+SHA224:DSA+SHA224:ECDSA+SHA224:RSA+SHA1:DSA+SHA1:ECDSA+SHA1 Shared Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:ECDSA+SHA512:RSA+SHA384:DSA+SHA384:ECDSA+SHA384:RSA+SHA256:DSA+SHA256:ECDSA+SHA256:RSA+SHA224:DSA+SHA224:ECDSA+SHA224:RSA+SHA1:DSA+SHA1:ECDSA+SHA1 Peer signing digest: SHA512 Server Temp Key: ECDH, P-256, 256 bits --- SSL handshake has read 6657 bytes and written 339 bytes --- New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES256-GCM-SHA384 Session-ID: E02AC176F356733EF7E923E01CC744E42E0FA82633E3CEC3E605E89059AFC469 Session-ID-ctx: Master-Key: 8B2B2E8287A4CC571B77628A14D2E21A284FEFB57843F6C057BE9BE57CC663C7DFCF6DA7BC260CE41785EE00A45F3310 Key-Arg : None Krb5 Principal: None PSK identity: None PSK identity hint: None TLS session ticket lifetime hint: 86400 (seconds) TLS session ticket: 0000 - dd 0a e4 c7 07 68 8e de-90 9d 90 9c 1c cb 18 8a .....h.......... 0010 - da 1c eb 77 9a f5 0b 0c-28 1a 43 4e cc 4d fa 1a ...w....(.CN.M.. 0020 - 9e 3e 50 7d d5 5c 99 7f-d8 c7 2a 80 8d 3b 88 49 .>P}.\....*..;.I 0030 - 84 36 33 46 04 be 4c c8-ac 5d 2a 38 d6 4f c7 da .63F..L..]*8.O.. 0040 - b5 28 05 b2 36 f8 fd 6f-40 0b 70 ea e1 8c e0 59 .(..6..o at .p....Y 0050 - 58 12 d3 b1 75 7c 99 bc-d7 6c f9 95 ea 33 d5 d9 X...u|...l...3.. 0060 - 41 99 ac 6f 53 75 96 f5-32 52 ac 6f 26 76 c7 28 A..oSu..2R.o&v.( 0070 - 63 9e 5c 19 c4 fc cd 0c-9e ea 6c d0 9c 50 77 7a c.\.......l..Pwz 0080 - ff 28 a4 a1 96 56 1f 45-3c d8 fc 6e 9e 5f 0b 9d .(...V.E<..n._.. 0090 - 2e 12 42 db f4 56 55 20-ef 87 d4 a7 2d 8f 57 74 ..B..VU ....-.Wt Start Time: 1493297318 Timeout : 300 (sec) Verify return code: 0 (ok) --- * OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE MUPDATE=mupdate://mupdate.andrew.cmu.edu/ AUTH=GSSAPI AUTH=PLAIN AUTH=ANONYMOUS SASL-IR] cyrus.andrew.cmu.edu Cyrus IMAP 3.0.0-beta1-dev3191 server ready ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 09:10:00 2017 From: report at bugs.python.org (David Haney) Date: Thu, 27 Apr 2017 13:10:00 +0000 Subject: [issue30183] [HPUX] compilation error in pytime.c with cc compiler In-Reply-To: <1493267090.1.0.00115311377195.issue30183@psf.upfronthosting.co.za> Message-ID: <1493298600.19.0.241432938607.issue30183@psf.upfronthosting.co.za> David Haney added the comment: > It seems like gethrtime() is the right function to be used on HP-UX. > https://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/gethrtime.3C.html Thanks, I'll work on getting a patch that leverages gethrtime() tested and submitted for review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 09:22:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 13:22:20 +0000 Subject: [issue30183] [HPUX] compilation error in pytime.c with cc compiler In-Reply-To: <1493267090.1.0.00115311377195.issue30183@psf.upfronthosting.co.za> Message-ID: <1493299340.8.0.330686176918.issue30183@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm quite sure that once I wrote a patch using gethrtime() for Solaris, but then I saw that it's the same clock than clock_gettime(CLOCK_MONOTONIC), so I removed gethrtime() to simplify the code. See also my PEP 418, which mentions gethrtime() by the way: https://www.python.org/dev/peps/pep-0418/#solaris-gethrtime ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 09:35:18 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 27 Apr 2017 13:35:18 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493300118.84.0.317846740535.issue30052@psf.upfronthosting.co.za> Nick Coghlan added the comment: Indeed, checking the dev build at https://docs.python.org/dev/library/urllib.parse.html#url-quoting shows it still linking to the old location. Perhaps the `autobuild-dev-html` target in the Makefile should be adding `-E` and `-a` so it always regenerates everything, rather than re-using the potentially stale cached info from the previous day? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 09:46:54 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Apr 2017 13:46:54 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493300814.22.0.462370376414.issue30175@psf.upfronthosting.co.za> Antoine Pitrou added the comment: "tlsv1 alert unknown ca" means our client certificate isn't accepted by the server. I suggest simply skipping the test, unless we find a remote IMAP server that accepts random TLS certs. https://serverfault.com/questions/793260/what-does-tlsv1-alert-unknown-ca-mean ---------- nosy: +christian.heimes, pitrou stage: -> needs patch type: -> behavior versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 09:51:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 13:51:49 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493301109.18.0.824915346717.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: > "tlsv1 alert unknown ca" means our client certificate isn't accepted by the server. I suggest simply skipping the test, unless we find a remote IMAP server that accepts random TLS certs. Wait, the test tries to connect to a public IMAP server using a x509 client certificate? Wow, I'm surprised that it works sometimes :-) In RemoteIMAP_SSLTest, I see 3 unit tests which use create_ssl_context(), the method which loads the client certificate, but I only see 2 failures, not 3. Should I understand that sometimes the TLS connection succeeded, but sometimes it fails, on the same server? Strange :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 09:56:14 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Apr 2017 13:56:14 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493301374.04.0.666246244758.issue30175@psf.upfronthosting.co.za> Antoine Pitrou added the comment: test_logincapa_with_client_certfile and test_logincapa_with_client_ssl_context both fail accordingly. test_ssl_context_certfile_exclusive and test_ssl_context_keyfile_exclusive raise another error (ValueError) and succeed expectedly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 10:04:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 14:04:34 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493301874.63.0.247784920883.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: > I suggest simply skipping the test, unless we find a remote IMAP server that accepts random TLS certs. I tried "imap.gmail.com" server: first, it fails with: imaplib.IMAP4.error: b'[AUTHENTICATIONFAILED] Invalid credentials (Failure)' And then: imaplib.IMAP4.error: b'[ALERT] Web login required: https://support.google.com/mail/answer/78754 (Failure)' Well, I don't see why an IMAP server would accept our client cert? Lib/test/keycert3.pem was added by the commit 58ddc9d743d09ee93d5cf46a4de62eab30dad79d (made by Antoine Pitrou): the certificated was *generated* randomly by Lib/test/make_ssl_certs.py (also added by the same commit). RemoteIMAP_SSLTest was added by commit b1436f185dac249f0f6dc342b2a543ae2d1db63d (Antoine Pitrou) in 2010 with the server: cyrus.andrew.cmu.edu. So since 2010 until a few days ago, cyrus.andrew.cmu.edu accepted random client certificate, but now the server started to fail... as expected? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 10:07:54 2017 From: report at bugs.python.org (Chris Seto) Date: Thu, 27 Apr 2017 14:07:54 +0000 Subject: [issue30187] Regex becomes invalid in python 3.6 Message-ID: <1493302074.44.0.42828185983.issue30187@psf.upfronthosting.co.za> New submission from Chris Seto: Expected behavior: ~ ??? pyenv shell 3.5.2 ~ ??? python --version Python 3.5.2 ~ ??? python Python 3.5.2 (default, Oct 24 2016, 00:12:20) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> re.compile('[^\B]') re.compile('[^\\B]') >>> re.compile(r'[^\B]') re.compile('[^\\B]') Actual: ~ ??? pyenv shell 3.6.0 ~ ??? python --version Python 3.6.0 ~ ??? python Python 3.6.0 (default, Apr 26 2017, 17:24:07) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> re.compile('[^\B]') Traceback (most recent call last): File "", line 1, in File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/re.py", line 233, in compile return _compile(pattern, flags) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/re.py", line 301, in _compile p = sre_compile.compile(pattern, flags) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_compile.py", line 562, in compile p = sre_parse.parse(p, flags) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 856, in parse p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 415, in _parse_sub itemsappend(_parse(source, state, verbose)) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 526, in _parse code1 = _class_escape(source, this) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 336, in _class_escape raise source.error('bad escape %s' % escape, len(escape)) sre_constants.error: bad escape \B at position 2 >>> re.compile(r'[^\B]') Traceback (most recent call last): File "", line 1, in File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/re.py", line 233, in compile return _compile(pattern, flags) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/re.py", line 301, in _compile p = sre_compile.compile(pattern, flags) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_compile.py", line 562, in compile p = sre_parse.parse(p, flags) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 856, in parse p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 415, in _parse_sub itemsappend(_parse(source, state, verbose)) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 526, in _parse code1 = _class_escape(source, this) File "/Users/chrisseto/.pyenv/versions/3.6.0/lib/python3.6/sre_parse.py", line 336, in _class_escape raise source.error('bad escape %s' % escape, len(escape)) sre_constants.error: bad escape \B at position 2 ---------- components: Regular Expressions messages: 292445 nosy: Chris Seto2, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: Regex becomes invalid in python 3.6 type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 10:10:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 14:10:29 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493302229.34.0.987973528373.issue30175@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1428 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 10:13:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 14:13:40 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493302420.81.0.47022146651.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: I proposed a quick fix to repair our development process (CI) and buildbots, skip the two failing files: https://github.com/python/cpython/pull/1320/ I would give our more time to decide what to do: * contact cyrus.andrew.cmu.edu sysadmin to ask him/her to accept our client cert or revert their IMAP config :-) * setup a new IMAP server accepts this client cert on pythontest.net * mock a IMAP server in test_imaplib: mock everything (no network), or "real" TCP server doing the TLS handshake? Mock everything doens't make sense for a unit test designed to use "remote" resources? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 10:16:56 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Apr 2017 14:16:56 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493302616.95.0.651336798196.issue30175@psf.upfronthosting.co.za> R. David Murray added the comment: Setting up an imap server on pythontest is the "right" answer. Somebody has to do the work, though :) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 10:57:18 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 27 Apr 2017 14:57:18 +0000 Subject: [issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in In-Reply-To: <1487781321.4.0.45367640243.issue29621@psf.upfronthosting.co.za> Message-ID: <1493305038.03.0.0534764729173.issue29621@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: +1429 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 10:59:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 14:59:38 +0000 Subject: [issue30187] Regex becomes invalid in python 3.6 In-Reply-To: <1493302074.44.0.42828185983.issue30187@psf.upfronthosting.co.za> Message-ID: <1493305178.5.0.581133933606.issue30187@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is ambiguous syntax. Unknown escapes consisting of '\' and ASCII letter were deprecated in 3.5 (run the interpreter with the option -Wa to see all warnings) and are errors since 3.6. Note that the string literal '[^\B]' itself produces a DeprecationWarning in 3.6. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:06:49 2017 From: report at bugs.python.org (Chris Seto) Date: Thu, 27 Apr 2017 15:06:49 +0000 Subject: [issue30187] Regex becomes invalid in python 3.6 In-Reply-To: <1493302074.44.0.42828185983.issue30187@psf.upfronthosting.co.za> Message-ID: <1493305609.96.0.132115312136.issue30187@psf.upfronthosting.co.za> Chris Seto added the comment: Thank you for pointing that out to me! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:07:08 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:07:08 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() Message-ID: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> New submission from STINNER Victor: Example of failure: ====================================================================== ERROR: setUpClass (test.test_nntplib.NetworkedNNTPTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/haypo/prog/python/master/Lib/test/test_nntplib.py", line 289, in setUpClass cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=TIMEOUT, usenetrc=False) File "/home/haypo/prog/python/master/Lib/nntplib.py", line 1048, in __init__ readermode, timeout) File "/home/haypo/prog/python/master/Lib/nntplib.py", line 330, in __init__ self.welcome = self._getresp() File "/home/haypo/prog/python/master/Lib/nntplib.py", line 449, in _getresp resp = self._getline() File "/home/haypo/prog/python/master/Lib/nntplib.py", line 437, in _getline if not line: raise EOFError EOFError ---------------------------------------------------------------------- Attached PR catch this error and skips the test. See also issue #19613 and #19756. ---------- components: Tests messages: 292450 nosy: haypo priority: normal severity: normal status: open title: test_nntplib: random EOFError in setUpClass() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:09:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:09:37 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493305777.98.0.940120344341.issue30188@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1430 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:10:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:10:36 +0000 Subject: [issue19756] test_nntplib: sporadic failures, network isses? server down? In-Reply-To: <1385316451.32.0.948186129781.issue19756@psf.upfronthosting.co.za> Message-ID: <1493305836.22.0.763440152321.issue19756@psf.upfronthosting.co.za> STINNER Victor added the comment: > ERROR: setUpClass (test.test_nntplib.NetworkedNNTP_SSLTests) I wrote an obvious fix for this one: issue #30188. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:13:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:13:34 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493306014.04.0.835095246728.issue30175@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1431 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:30:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:30:15 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493307015.27.0.780356997681.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 5bccca58b9b2b3a925b16750bedbd907695ea8d7 by Victor Stinner in branch 'master': bpo-30175: Skip client cert tests of test_imaplib (#1320) https://github.com/python/cpython/commit/5bccca58b9b2b3a925b16750bedbd907695ea8d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:30:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:30:15 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493307015.36.0.829074503064.issue30188@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 5bccca58b9b2b3a925b16750bedbd907695ea8d7 by Victor Stinner in branch 'master': bpo-30175: Skip client cert tests of test_imaplib (#1320) https://github.com/python/cpython/commit/5bccca58b9b2b3a925b16750bedbd907695ea8d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:30:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:30:57 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493307057.71.0.274439925975.issue30188@psf.upfronthosting.co.za> STINNER Victor added the comment: NetworkedNNTPTests uses the NNTP server news.trigofacile.com (port 119). It's possible to connect to this server (IPv4: 91.121.26.68), but recv() returns an empty string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:32:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:32:20 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493307140.99.0.170266060166.issue30188@psf.upfronthosting.co.za> STINNER Victor added the comment: I see 3 options: * Contact news.trigofacile.com administrator to ask him to repair the NNTP server * Run a NNTP server on pythontest.net * Mock the server: see http://bugs.python.org/issue19756#msg268841 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:35:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:35:00 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493307300.75.0.366794100479.issue30188@psf.upfronthosting.co.za> STINNER Victor added the comment: The news.trigofacile.com server was chosen in the commit 1cb121eceae698b1be0b383de5d42dc9b9accd02 (Antoine Pitrou in 2010) which also added the new NetworkedNNTPTests test case. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:38:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:38:50 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493307530.62.0.198767134118.issue30175@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1432 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:38:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:38:50 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493307530.7.0.00167318864216.issue30188@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1433 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:40:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:40:00 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493307600.44.0.204065521376.issue30175@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1434 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:40:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 15:40:00 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493307600.52.0.052167044742.issue30188@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1435 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 11:58:42 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 27 Apr 2017 15:58:42 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1493308722.03.0.614271837628.issue30140@psf.upfronthosting.co.za> Changes by Roundup Robot : ---------- pull_requests: +1436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:05:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 16:05:29 +0000 Subject: [issue30174] Duplicate code in pickletools.py In-Reply-To: <1493221803.92.0.461723845799.issue30174@psf.upfronthosting.co.za> Message-ID: <1493309129.45.0.486415093691.issue30174@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 5a4e3d8f9c37e700402b23fafbfc413e5ca3113d by Serhiy Storchaka (Jelle Zijlstra) in branch 'master': bpo-30174: Remove duplicate definition from pickletools (#1301) https://github.com/python/cpython/commit/5a4e3d8f9c37e700402b23fafbfc413e5ca3113d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:06:20 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 27 Apr 2017 16:06:20 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493309180.94.0.847214654679.issue30152@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'd like to vote for a lazy import system that would benefit everyone (many third-party packages are also affected by startup time issues), but I've seen enough handwaving about it along the years that I'm not really hoping any soon. My own limited attempts at writing one have failed miserably. In other words, I think Serhiy's proposal is a good concrete improvement over the statu quo. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:07:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 16:07:12 +0000 Subject: [issue30174] Duplicate code in pickletools.py In-Reply-To: <1493221803.92.0.461723845799.issue30174@psf.upfronthosting.co.za> Message-ID: <1493309232.76.0.286640663659.issue30174@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for catching this Jelle! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:08:15 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 16:08:15 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493309295.36.0.0299467288377.issue30103@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1437 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:14:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 16:14:17 +0000 Subject: [issue30140] Binary arithmetic does not always call subclasses first In-Reply-To: <1492921304.69.0.401017078402.issue30140@psf.upfronthosting.co.za> Message-ID: <1493309657.87.0.490393565797.issue30140@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: binary_op1() is wrong place for fixing this issue. You need to change SLOT1BINFULL in Objects/typeobject.c. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:16:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 16:16:36 +0000 Subject: [issue27593] Deprecate sys._mercurial and create sys._git In-Reply-To: <1469223805.51.0.614192375682.issue27593@psf.upfronthosting.co.za> Message-ID: <1493309796.25.0.247947613078.issue27593@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1438 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:19:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 16:19:38 +0000 Subject: [issue27593] Deprecate sys._mercurial and create sys._git In-Reply-To: <1469223805.51.0.614192375682.issue27593@psf.upfronthosting.co.za> Message-ID: <1493309978.38.0.419358154317.issue27593@psf.upfronthosting.co.za> STINNER Victor added the comment: Ned Deily: "I'll be doing backports to 2.7 for this and some other things shortly." It seems like Ned was busy or forgot 2.7, so I wrote a change: https://github.com/python/cpython/pull/1327 My change doesn't touch platform.py. platform._sys_version() uses sys.subversion but not sys._hg. If someone wants to enhance the platform module of Python 2.7, I suggest to open a new issue. There is a non-zero risk of breaking the backward compatibility, so I skipped my turn for that one :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:25:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 16:25:06 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493310306.35.0.956464334588.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4dc3b9cf2a868a8378ecbc2221a15e7b59e8e944 by Victor Stinner in branch '3.6': bpo-30175: Skip client cert tests of test_imaplib (#1320) (#1323) https://github.com/python/cpython/commit/4dc3b9cf2a868a8378ecbc2221a15e7b59e8e944 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:25:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 16:25:06 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493310306.56.0.215050598322.issue30188@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4dc3b9cf2a868a8378ecbc2221a15e7b59e8e944 by Victor Stinner in branch '3.6': bpo-30175: Skip client cert tests of test_imaplib (#1320) (#1323) https://github.com/python/cpython/commit/4dc3b9cf2a868a8378ecbc2221a15e7b59e8e944 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:40:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 16:40:12 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493311212.54.0.0555754007013.issue30103@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is there any standard? >From Wikipedia [1]: """ Note that 96 ("`" grave accent) is a character that is seen in uuencoded files but is typically only used to signify a 0-length line, usually at the end of a file. It will never naturally occur in the actual converted data since it is outside the range of 32 to 95. The sole exception to this is that some uuencoding programs use the grave accent to signify padding bytes instead of a space. However, the character used for the padding byte is not standardized, so either is a possibility. """ This obviously makes impossible using "`" as zero instead of space. [1] https://en.wikipedia.org/wiki/Uuencoding#Uuencode_table ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 12:57:26 2017 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 27 Apr 2017 16:57:26 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493312246.4.0.402724971722.issue30103@psf.upfronthosting.co.za> Xiang Zhang added the comment: There seems no standard. I also read the wikipedia but for perl and uuencode on my Linux, they now all use backticks to represent zero instead of spaces. [~]$ perl -e 'print pack("u","Ca\x00t")' $0V$`=``` [~]$ cat /tmp/test Ca[~]$ uuencode /tmp/test - begin 664 - "0V$` ` end while Python now: >>> import uu >>> uu.encode('/tmp/test', '-') begin 664 test "0V$ end Except the link Kyle gives, the manpage of FreeBSD describes the new algorithm: http://www.unix.com/man-page/freebsd/5/uuencode/ I don't propose to change current behaviour to break backwards compatibility. But I think it's reasonable to provide a way to allow users to use backticks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 13:39:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 27 Apr 2017 17:39:56 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493314796.53.0.0388850477389.issue30103@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What about other popular languages? Java, PHP, Ruby, Tcl, C#, JavaScript, Swift, Go, Rust? Do any languages provide a way for configuring zero character and what are the names of the options? Are there languages that use "`" instead of a space only for padding, but not for representing an ordinal zero? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 13:59:16 2017 From: report at bugs.python.org (Horacio Hoyos) Date: Thu, 27 Apr 2017 17:59:16 +0000 Subject: [issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1493315956.48.0.295335687769.issue30146@psf.upfronthosting.co.za> Horacio Hoyos added the comment: Although I agree that some design decisions forge a language and sometimes these historical developments win over sounder or more "logical" arguments. That being said, I believe (as the OP of issue 8743) that the ABC collections should comply to the API of the Python base collections. In that sense, I would expect any custom collection implemented by extending the ABC collections to be used in place of an exiting base one, without any "hiccups". Thus, the custom collection should pass all the tests in the Lib/tests. Of course, for the moment, this would just require extra work on my part in order to implement all the magic methods and such. If history is to win again, then at least the documentation of the ABC collections should clearly state the subtle, but IMHO important, differences between the two. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 14:16:08 2017 From: report at bugs.python.org (Mario Viapiano) Date: Thu, 27 Apr 2017 18:16:08 +0000 Subject: [issue30189] SSL match_hostname does not accept IP Address Message-ID: <1493316968.53.0.265512116525.issue30189@psf.upfronthosting.co.za> New submission from Mario Viapiano: I need this patch to be available in python 2.7.13 https://bugs.python.org/issue23239 ---------- components: Extension Modules messages: 292468 nosy: emeve89 priority: normal severity: normal status: open title: SSL match_hostname does not accept IP Address type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 14:31:44 2017 From: report at bugs.python.org (Brett Cannon) Date: Thu, 27 Apr 2017 18:31:44 +0000 Subject: [issue27869] test failures under Bash on Windows / WSL In-Reply-To: <1472236837.41.0.811658562373.issue27869@psf.upfronthosting.co.za> Message-ID: <1493317904.88.0.696846615307.issue27869@psf.upfronthosting.co.za> Brett Cannon added the comment: Under Creators Update with a clean Ubuntu 16.04 image and only installing clang and make, I built with `CC=clang ./configure; make -s -j` and ran with `./python -m test -j0 -x test_socket` (test_socket hung in a previous run; I let it run for 10 minutes previously): 348 tests OK. 19 tests failed: test_asyncio test_asyncore test_epoll test_fcntl test_ftplib test_httpservers test_import test_mmap test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn test_os test_posix test_resource test_selectors test_signal test_subprocess test_time test_unicode_file 36 tests skipped: test_bz2 test_crypt test_ctypes test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_gdb test_gzip test_idle test_kqueue test_lzma test_msilib test_nis test_ossaudiodev test_readline test_smtpnet test_socketserver test_sqlite test_ssl test_startfile test_tcl test_timeout test_tix test_tk test_ttk_guionly test_ttk_textonly test_turtle test_urllib2net test_urllibnet test_winconsoleio test_winreg test_winsound test_xmlrpc_net test_zipfile64 test_zlib Total duration: 3 min 56 sec Tests result: FAILURE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 14:32:07 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 27 Apr 2017 18:32:07 +0000 Subject: [issue30189] SSL match_hostname does not accept IP Address In-Reply-To: <1493316968.53.0.265512116525.issue30189@psf.upfronthosting.co.za> Message-ID: <1493317927.63.0.60496774338.issue30189@psf.upfronthosting.co.za> Christian Heimes added the comment: In general we don't backport features. https://www.python.org/dev/peps/pep-0466/ allows backports of network security enhancements. However IP address validation is not a security enhancement. You can either update to a new version of Python or role your own verification code. ---------- nosy: +christian.heimes resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 14:34:45 2017 From: report at bugs.python.org (Eryk Sun) Date: Thu, 27 Apr 2017 18:34:45 +0000 Subject: [issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only In-Reply-To: <1493295480.01.0.116959327637.issue30186@psf.upfronthosting.co.za> Message-ID: <1493318085.22.0.800910530843.issue30186@psf.upfronthosting.co.za> Eryk Sun added the comment: PathCchCombineEx isn't an import dependency. It's used dynamically via LoadLibraryW and GetProcAddress, with a fallback to PathCombineW. Does Wine maybe have a stub for this function that returns E_NOTIMPL (not implemented)? ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 15:32:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 19:32:12 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493321532.07.0.808341082293.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 0eda2d43a7d5b262c979b944592999015a822395 by Victor Stinner in branch '3.5': bpo-30175: Skip client cert tests of test_imaplib (#1320) (#1324) https://github.com/python/cpython/commit/0eda2d43a7d5b262c979b944592999015a822395 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 15:32:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 19:32:12 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493321532.16.0.898612506465.issue30188@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 0eda2d43a7d5b262c979b944592999015a822395 by Victor Stinner in branch '3.5': bpo-30175: Skip client cert tests of test_imaplib (#1320) (#1324) https://github.com/python/cpython/commit/0eda2d43a7d5b262c979b944592999015a822395 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 15:35:21 2017 From: report at bugs.python.org (Sebastian Ernst) Date: Thu, 27 Apr 2017 19:35:21 +0000 Subject: [issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only In-Reply-To: <1493295480.01.0.116959327637.issue30186@psf.upfronthosting.co.za> Message-ID: <1493321721.2.0.0686099335126.issue30186@psf.upfronthosting.co.za> Sebastian Ernst added the comment: Relaying this on behalf of Gijs Vermeulen from Wine: "In my patch I tried returning E_NOTIMPL and I got the error: Fatal Python error: buffer overflow in getpathp.c's join()" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 15:57:59 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Apr 2017 19:57:59 +0000 Subject: [issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1493323079.29.0.45742749085.issue30146@psf.upfronthosting.co.za> R. David Murray added the comment: For backward compatibility reasons, history will win. I'm not sure if documenting the additional restrictions of the concrete stdlib types in the ABC docs makes sense, either, since the ABCs are intentionally the minimal requirements for a concrete type to conform to the ABC. The concrete ABC methods are really examples, even though they are also widely useful (and widely used). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:00:28 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Apr 2017 20:00:28 +0000 Subject: [issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1493323228.21.0.942255643667.issue30146@psf.upfronthosting.co.za> R. David Murray added the comment: I suppose someone could propose a set of tests that an implementation of an ABC type should pass, to complement the stdlib type tests. There would probably be a lot of bikeshedding involved in such tests though, so I don't hold out great hope anything would ever get accepted for merge :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:12:42 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 27 Apr 2017 20:12:42 +0000 Subject: [issue30190] unittest's assertAlmostEqual should show the difference Message-ID: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> New submission from Giampaolo Rodola': When comparing 2 numbers as "self.assertAlmostEqual(a, b, delta=1000)" the error message looks like this: AssertionError: 27332885 != 27391120 within 1000 delta Especially when a and b are big numbers or differ a lot, it would be useful to see the absolute difference between the 2 numbers as in: AssertionError: 27332885 != 27391120 within 1000 delta (58235 difference) ---------- messages: 292477 nosy: giampaolo.rodola priority: normal severity: normal stage: needs patch status: open title: unittest's assertAlmostEqual should show the difference versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:21:22 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 27 Apr 2017 20:21:22 +0000 Subject: [issue30190] unittest's assertAlmostEqual should show the difference In-Reply-To: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> Message-ID: <1493324482.08.0.495535597157.issue30190@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +ezio.melotti, michael.foord, rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:21:39 2017 From: report at bugs.python.org (Eryk Sun) Date: Thu, 27 Apr 2017 20:21:39 +0000 Subject: [issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only In-Reply-To: <1493295480.01.0.116959327637.issue30186@psf.upfronthosting.co.za> Message-ID: <1493324499.79.0.859683878825.issue30186@psf.upfronthosting.co.za> Eryk Sun added the comment: I didn't mean that there's support to fall back on PathCombineW if PathCchCombineEx returns E_NOTIMPL. I was just guessing at what the stub in Wine might be doing. I took a look at the source. It seems the Wine stub function for unimplemented functions is __wine_spec_unimplemented_stub in dlls/winecrt0/stub.c, which calls RaiseException. I think this issue should be closed as 3rd party since I don't see anything wrong with Steve's code, but I'll leave it open for Steve to make that decision. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:33:06 2017 From: report at bugs.python.org (Sogand Ka) Date: Thu, 27 Apr 2017 20:33:06 +0000 Subject: [issue30191] > Message-ID: <1493325186.88.0.762638771729.issue30191@psf.upfronthosting.co.za> New submission from Sogand Ka: I am using COM in python 2.7 (win32com) and here is my problem: >>> Vissim >>> Vissim.Net > why is it unknown? Also, I have to type everything in shell, since it does not show me the keywords. Would be great to see any helpful suggestion. ---------- components: Interpreter Core messages: 292479 nosy: Sogand Ka priority: normal severity: normal status: open title: > type: performance versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:47:34 2017 From: report at bugs.python.org (Eryk Sun) Date: Thu, 27 Apr 2017 20:47:34 +0000 Subject: [issue30191] > In-Reply-To: <1493325186.88.0.762638771729.issue30191@psf.upfronthosting.co.za> Message-ID: <1493326054.0.0.339424770815.issue30191@psf.upfronthosting.co.za> Eryk Sun added the comment: This issue tracker is only for CPython. win32com is part of PyWin32, which is an independent project that's hosted at the following SourceForge site: https://sourceforge.net/projects/pywin32 I suggest that you ask for help on the python-win32 list: https://mail.python.org/mailman/listinfo/python-win32 ---------- nosy: +eryksun resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:51:06 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 27 Apr 2017 20:51:06 +0000 Subject: [issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only In-Reply-To: <1493295480.01.0.116959327637.issue30186@psf.upfronthosting.co.za> Message-ID: <1493326266.25.0.340123063227.issue30186@psf.upfronthosting.co.za> R. David Murray added the comment: Indeed, it sounds like wine is claiming to be Windows 7 but then implementing (as not implemented) later-than-windows-7 apis. That definitely sounds like a bug in wine. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:52:25 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 27 Apr 2017 20:52:25 +0000 Subject: [issue30190] unittest's assertAlmostEqual should show the difference In-Reply-To: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> Message-ID: <1493326345.04.0.355406139968.issue30190@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- pull_requests: +1439 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:53:36 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 27 Apr 2017 20:53:36 +0000 Subject: [issue30190] unittest's assertAlmostEqual should show the difference In-Reply-To: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> Message-ID: <1493326416.14.0.32781832511.issue30190@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: PR: https://github.com/python/cpython/pull/1331/ ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 16:56:33 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Thu, 27 Apr 2017 20:56:33 +0000 Subject: [issue30190] unittest's assertAlmostEqual improved error message In-Reply-To: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> Message-ID: <1493326593.3.0.0570810786085.issue30190@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- title: unittest's assertAlmostEqual should show the difference -> unittest's assertAlmostEqual improved error message _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 17:01:16 2017 From: report at bugs.python.org (Steve Dower) Date: Thu, 27 Apr 2017 21:01:16 +0000 Subject: [issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only In-Reply-To: <1493295480.01.0.116959327637.issue30186@psf.upfronthosting.co.za> Message-ID: <1493326876.48.0.970999508272.issue30186@psf.upfronthosting.co.za> Steve Dower added the comment: The approach I used is the correct way to use the function if it's available. If Wine is not supporting this function, it should return NULL from GetProcAddress, not a stub. If the function exists, any error it returns is fatal. We need the better function for Win10 in order to support paths longer than 260 characters. PathcombineW fails on long paths. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 17:01:32 2017 From: report at bugs.python.org (Steve Dower) Date: Thu, 27 Apr 2017 21:01:32 +0000 Subject: [issue30186] Python interpreter calling "PathCchCombineEx" on startup, Windows 8 and above only In-Reply-To: <1493295480.01.0.116959327637.issue30186@psf.upfronthosting.co.za> Message-ID: <1493326892.83.0.864972108817.issue30186@psf.upfronthosting.co.za> Changes by Steve Dower : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 17:14:32 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 27 Apr 2017 21:14:32 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493327672.04.0.478415736674.issue30052@psf.upfronthosting.co.za> Cheryl Sabella added the comment: I don't think it would add a lot of time or processing to rebuild it daily, would it? Seems safer than not doing it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 17:20:03 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 27 Apr 2017 21:20:03 +0000 Subject: [issue30192] hashlib module breaks with 64-bit kernel and 32-bit user space Message-ID: <1493328003.41.0.178410988374.issue30192@psf.upfronthosting.co.za> New submission from Neil Schemenauer: The test in setup.py to check for SSE2 support is incorrect. Checking that arch == x86_64 is not sufficient. If the kernel is 64-bit but Python is compiled with a 32-bit compiler, the _blake2 module will fail to build. The attached patch fixes this issue. I did a quick search of the x86_64 string, I don't see this mistake being made elsewhere but I imagine it could be done elsewhere. Obviously a machine with a 64-bit kernel and 32-bit userspace is a rare as hen's teeth these days. Still, I think it is worth fixing this bug. Python 3.6.1 (default, Apr 27 2017, 20:09:03) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import hashlib ERROR:root:code for hash blake2b was not found. Traceback (most recent call last): File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 243, in globals()[__func_name] = __get_hash(__func_name) File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 119, in __get_openssl_constructor return __get_builtin_constructor(name) File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type blake2b ERROR:root:code for hash blake2s was not found. Traceback (most recent call last): File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 243, in globals()[__func_name] = __get_hash(__func_name) File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 119, in __get_openssl_constructor return __get_builtin_constructor(name) File "/home/nas/PPython-3.6.1/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type blake2s ---------- components: Build messages: 292485 nosy: nascheme priority: normal severity: normal stage: patch review status: open title: hashlib module breaks with 64-bit kernel and 32-bit user space type: compile error versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 17:24:49 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 27 Apr 2017 21:24:49 +0000 Subject: [issue30192] hashlib module breaks with 64-bit kernel and 32-bit user space In-Reply-To: <1493328003.41.0.178410988374.issue30192@psf.upfronthosting.co.za> Message-ID: <1493328289.16.0.580241016022.issue30192@psf.upfronthosting.co.za> Changes by Neil Schemenauer : ---------- pull_requests: +1440 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 17:39:56 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 27 Apr 2017 21:39:56 +0000 Subject: [issue27377] Add smarter socket.fromfd() In-Reply-To: <1466706816.6.0.72770597716.issue27377@psf.upfronthosting.co.za> Message-ID: <1493329196.04.0.350393007092.issue27377@psf.upfronthosting.co.za> Changes by Neil Schemenauer : ---------- pull_requests: +1441 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 18:55:44 2017 From: report at bugs.python.org (Nikolay Kim) Date: Thu, 27 Apr 2017 22:55:44 +0000 Subject: [issue30193] Allow to load buffer objects with json.loads() Message-ID: <1493333744.87.0.320689923757.issue30193@psf.upfronthosting.co.za> New submission from Nikolay Kim: It is not possible to use buffer objects in json.loads() ---------- messages: 292487 nosy: fafhrd91 priority: normal severity: normal status: open title: Allow to load buffer objects with json.loads() versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 18:57:40 2017 From: report at bugs.python.org (Nikolay Kim) Date: Thu, 27 Apr 2017 22:57:40 +0000 Subject: [issue30193] Allow to load buffer objects with json.loads() In-Reply-To: <1493333744.87.0.320689923757.issue30193@psf.upfronthosting.co.za> Message-ID: <1493333860.85.0.093103318779.issue30193@psf.upfronthosting.co.za> Changes by Nikolay Kim : ---------- pull_requests: +1443 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 19:25:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Apr 2017 23:25:40 +0000 Subject: [issue30188] test_nntplib: random EOFError in setUpClass() In-Reply-To: <1493305628.27.0.924756319794.issue30188@psf.upfronthosting.co.za> Message-ID: <1493335540.31.0.896805402858.issue30188@psf.upfronthosting.co.za> STINNER Victor added the comment: > Contact news.trigofacile.com administrator to ask him to repair the NNTP server I did that and I got a reply: the server is now fixed! :-D The test is now skipped on server failure (in 3.5, 3.6 and master), and the server is repaired. So I close the issue. Note: Python 2.7 doesn't have the unit test and so is not impacted. ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 20:10:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 00:10:51 +0000 Subject: [issue30193] Accept memoryview in json.loads() In-Reply-To: <1493333744.87.0.320689923757.issue30193@psf.upfronthosting.co.za> Message-ID: <1493338251.19.0.622773258666.issue30193@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- title: Allow to load buffer objects with json.loads() -> Accept memoryview in json.loads() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 20:11:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 00:11:03 +0000 Subject: [issue30193] Accept memoryview in json.loads() In-Reply-To: <1493333744.87.0.320689923757.issue30193@psf.upfronthosting.co.za> Message-ID: <1493338263.72.0.729517262683.issue30193@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 20:20:23 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Apr 2017 00:20:23 +0000 Subject: [issue19417] Bdb: add docstrings and a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493338823.54.0.376692478585.issue19417@psf.upfronthosting.co.za> Terry J. Reedy added the comment: IDLE's debugger needs multiple patches. It is based on bdb. So I want to be able to understand the bdb code and know that it is sound. The file is nearly devoid of docstrings, so I would like to add those first, probably in a separate patch. A first draft can be derived from the bdb doc. Docstrings will help in reviewing the patch. ---------- assignee: -> terry.reedy title: Add tests for bdb (previously not tested) -> Bdb: add docstrings and a unittest file (test.test_bdb) versions: +Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 20:22:45 2017 From: report at bugs.python.org (David Bolen) Date: Fri, 28 Apr 2017 00:22:45 +0000 Subject: [issue30173] x86 Windows7 3.x buildbot has the issue #26624 bug In-Reply-To: <1493218209.79.0.825922715699.issue30173@psf.upfronthosting.co.za> Message-ID: <1493338965.11.0.601016545419.issue30173@psf.upfronthosting.co.za> David Bolen added the comment: Ok, I believe I've got the latest ucrtbased now on the Win7 buildbot (validate_ucrtbase.py reports it as 10.0.15063.137). It appears as if my Win8 and Win10 buildbots also have the older dll, so I'm guessing they're just fast enough or lucky enough not to run into the issue. I'll plan on addressing them in the near future as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 20:50:14 2017 From: report at bugs.python.org (Martin Panter) Date: Fri, 28 Apr 2017 00:50:14 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493340614.64.0.330493492007.issue30103@psf.upfronthosting.co.za> Martin Panter added the comment: FWIW I am using NXP LPC microcontrollers at the moment, whose bootloader uses the grave/backtick instead of spaces. (NXP application note AN11229.) Although in practice it does seem to accept Python's spaces instead of graves. I wouldn't put too much weight to Wikipedia, especially where it says graves are not used for encoded data (vs length and padding). Earlier versions of Wikipedia did mention graves in regular data. I understand the reason for avoiding spaces is to due to spaces being stripped (e.g. by email, copy and paste, etc). You have to avoid spaces in data, not just padding, because a data space may still appear at the end of a line. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 20:54:16 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 28 Apr 2017 00:54:16 +0000 Subject: [issue19417] Bdb: add docstrings and a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493340856.16.0.436055247313.issue19417@psf.upfronthosting.co.za> Cheryl Sabella added the comment: I'll work on the bdb docstrings. ---------- nosy: +csabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:02:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:02:31 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493341351.78.0.461138197881.issue30107@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1446 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:03:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:03:06 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493341386.01.0.436991837362.issue30107@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- versions: +Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:06:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:06:06 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493341566.51.0.562015316523.issue30175@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, the test is now skipped on 3.5, 3.6 and master to fix CI and buildbots. R. David Murray: "Setting up an imap server on pythontest is the "right" answer. Somebody has to do the work, though :)" Who work on pytohntest? Where should I ask that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:15:03 2017 From: report at bugs.python.org (Jacob B) Date: Fri, 28 Apr 2017 01:15:03 +0000 Subject: [issue30194] AttributeError on opening ZipFile Message-ID: <1493342103.41.0.38342721045.issue30194@psf.upfronthosting.co.za> New submission from Jacob B: The error occurs when I attempt to run the following code: from urllib.request import urlretrieve from os import path from zipfile import ZipFile download_url = "https://www.dropbox.com/s/obiqvrt4m53pmoz/tesseract-4.0.0-alpha.zip?dl=1" def setup_program(): zip_name = urlretrieve(download_url) zip_file = ZipFile(zip_name, "r") zip_file.extractall(path.abspath("__tesseract/")) zip_file.close() setup_program() # REMOVE after test I get the following traceback: $ python downloader.py Traceback (most recent call last): File "downloader.py", line 15, in setup_program() File "downloader.py", line 11, in setup_program zip_file = ZipFile(zip_name, "r") File "C:\Python36\lib\zipfile.py", line 1100, in __init__ self._RealGetContents() File "C:\Python36\lib\zipfile.py", line 1163, in _RealGetContents endrec = _EndRecData(fp) File "C:\Python36\lib\zipfile.py", line 241, in _EndRecData fpin.seek(0, 2) AttributeError: 'tuple' object has no attribute 'seek' ---------- messages: 292494 nosy: Jacob B2 priority: normal severity: normal status: open title: AttributeError on opening ZipFile versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:20:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:20:15 +0000 Subject: [issue30194] AttributeError on opening ZipFile In-Reply-To: <1493342103.41.0.38342721045.issue30194@psf.upfronthosting.co.za> Message-ID: <1493342415.02.0.334230492897.issue30194@psf.upfronthosting.co.za> STINNER Victor added the comment: urlretrieve() returns (filename, file-like object). It's a bug in your code, not in Python itself ;-) ---------- nosy: +haypo resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:25:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:25:17 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1493342717.55.0.0566734331104.issue30106@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1447 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:26:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:26:32 +0000 Subject: [issue27726] ctags -t does not exists in Makefile.pre.in In-Reply-To: <1470828204.23.0.262773554003.issue27726@psf.upfronthosting.co.za> Message-ID: <1493342792.38.0.746703766884.issue27726@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1448 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:27:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:27:54 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493342874.07.0.177272615331.issue30107@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c9ca57eeea4d9da748d84281506c5803512b79ac by Victor Stinner in branch '3.6': bpo-30107: Make SuppressCrashReport quiet on macOS (#1279) (#1335) https://github.com/python/cpython/commit/c9ca57eeea4d9da748d84281506c5803512b79ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:33:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:33:07 +0000 Subject: [issue30173] x86 Windows7 3.x buildbot has the issue #26624 bug In-Reply-To: <1493218209.79.0.825922715699.issue30173@psf.upfronthosting.co.za> Message-ID: <1493343187.25.0.781963423608.issue30173@psf.upfronthosting.co.za> STINNER Victor added the comment: @David: Oh, a build on x86 Windows7 3.5 just failed on the git step with a strange erorr: http://buildbot.python.org/all/builders/x86%20Windows7%203.5/builds/209/steps/git/logs/err.text twisted.spread.pb.RemoteError: unrecognized SlaveCommand 'stat' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:42:51 2017 From: report at bugs.python.org (David Bolen) Date: Fri, 28 Apr 2017 01:42:51 +0000 Subject: [issue30173] x86 Windows7 3.x buildbot has the issue #26624 bug In-Reply-To: <1493218209.79.0.825922715699.issue30173@psf.upfronthosting.co.za> Message-ID: <1493343771.43.0.63106692306.issue30173@psf.upfronthosting.co.za> David Bolen added the comment: Yeah, there were a few transient build errors while I was getting the buildbot back online. My initial attempt to fix this ticket involved using the VS 2015 installer which turned out very badly, so I had to fall back to an older VM image and start over. But the older image had an older buildbot version which didn't work with the git workflow, which hit a few pending builds before I got it fixed. I'm not yet sure if there may be some other fallback (e.g., the link error in the recent 3.x build seems familiar but I can't recall why offhand) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:44:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 01:44:02 +0000 Subject: [issue30173] x86 Windows7 3.x buildbot has the issue #26624 bug In-Reply-To: <1493218209.79.0.825922715699.issue30173@psf.upfronthosting.co.za> Message-ID: <1493343842.78.0.878312806536.issue30173@psf.upfronthosting.co.za> STINNER Victor added the comment: > Yeah, there were a few transient build errors while I was getting the buildbot back online Oh ok, I understand that the issue is already fixed. Thanks :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 21:48:15 2017 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 28 Apr 2017 01:48:15 +0000 Subject: [issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in In-Reply-To: <1487781321.4.0.45367640243.issue29621@psf.upfronthosting.co.za> Message-ID: <1493344095.42.0.244329488584.issue29621@psf.upfronthosting.co.za> Dong-hee Na added the comment: I submitted PR to handle this issue like this way. tn.write([b'data sample without IAC']) File "/Users/corona10/cpython/Lib/telnetlib.py", line 288, in write raise TypeError('%s must be a bytes-like type.' % buffer) TypeError: [b'data sample without IAC'] must be a bytes-like type. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 22:03:20 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Apr 2017 02:03:20 +0000 Subject: [issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in In-Reply-To: <1487781321.4.0.45367640243.issue29621@psf.upfronthosting.co.za> Message-ID: <1493345000.46.0.496609373802.issue29621@psf.upfronthosting.co.za> R. David Murray added the comment: We generally don't do this kind of type checking in the standard library. The message may not be clear, but it is accurate and decipherable, especially given the fact that the write parameter name is 'buffer'. I don't think anything should be done here. If you want type checking use the types module :) Thanks for the PR, @corona10, but I think we should just close this issue. Other devs may disagree, though, so I'm not closing it myself. On the other hand, enhancing telnetlib to also work with strings might be a nice project for someone. It would require some design discussion, though, so I don't think anyone should hop on it without discussing it somewhere first (python-ideas, maybe?). ---------- nosy: +jackdied, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 22:05:47 2017 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 28 Apr 2017 02:05:47 +0000 Subject: [issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in In-Reply-To: <1487781321.4.0.45367640243.issue29621@psf.upfronthosting.co.za> Message-ID: <1493345147.42.0.148672915817.issue29621@psf.upfronthosting.co.za> Dong-hee Na added the comment: Thanks for the response. I agree with you. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 22:06:42 2017 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 28 Apr 2017 02:06:42 +0000 Subject: [issue29621] telnetlib.Telnet.write gives confusing error message when a string is passed in In-Reply-To: <1487781321.4.0.45367640243.issue29621@psf.upfronthosting.co.za> Message-ID: <1493345202.34.0.733156345286.issue29621@psf.upfronthosting.co.za> Changes by Dong-hee Na : ---------- pull_requests: -1429 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 22:13:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 02:13:39 +0000 Subject: [issue30106] test_asyncore: test_handle_write() fails in tearDown() In-Reply-To: <1492642462.27.0.792408985482.issue30106@psf.upfronthosting.co.za> Message-ID: <1493345619.82.0.711351944457.issue30106@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset caa59c156d1e6ff3d005e0112bb27c5bed4afb71 by Victor Stinner in branch '3.6': [3.6] bpo-30106: Fix test_asyncore.test_quick_connect() (#1336) https://github.com/python/cpython/commit/caa59c156d1e6ff3d005e0112bb27c5bed4afb71 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 22:13:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 02:13:55 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493345635.67.0.467502473782.issue30131@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset cb21f5f3d2005b891df0b76e3fc4d4676e285f21 by Victor Stinner in branch '3.6': bpo-30131: test_logging now joins queue threads (#1298) (#1317) https://github.com/python/cpython/commit/cb21f5f3d2005b891df0b76e3fc4d4676e285f21 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 22:27:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 02:27:13 +0000 Subject: [issue30131] test_logging leaks a "dangling" thread In-Reply-To: <1492791121.95.0.979158654075.issue30131@psf.upfronthosting.co.za> Message-ID: <1493346433.72.0.0770479448505.issue30131@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset d855e53eabca0e8b2b39d25670c37bbdb4ab2e4c by Victor Stinner in branch '3.5': bpo-30131: test_logging now joins queue threads (#1298) (#1318) https://github.com/python/cpython/commit/d855e53eabca0e8b2b39d25670c37bbdb4ab2e4c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 22:37:24 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 28 Apr 2017 02:37:24 +0000 Subject: [issue30175] Random test_imaplib.test_logincapa_with_client_certfile failure on x86 Gentoo Installed with X 3.x In-Reply-To: <1493221828.31.0.979573561746.issue30175@psf.upfronthosting.co.za> Message-ID: <1493347044.2.0.356067603096.issue30175@psf.upfronthosting.co.za> R. David Murray added the comment: I think Benjamin is the only one who has done any work on it so far. I think you'd ask the infrastructure team for access if you want to do so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 27 23:54:48 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 28 Apr 2017 03:54:48 +0000 Subject: [issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects In-Reply-To: <1492970869.72.0.0063699562935.issue30146@psf.upfronthosting.co.za> Message-ID: <1493351688.28.0.439098014453.issue30146@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > That being said, I believe (as the OP of issue 8743) > that the ABC collections should comply to the API of > the Python base collections. Sorry Horacio, but your beliefs don't trump Guido's intentional design decisions. He was the one who decided that the collections.abc.Set should have a __and__ that accepts an iterable and that it should not have the named methods (union, intersection, difference, etc). Once released, that decision is not changeable without breaking existing code that relies on any iterable being accepted (which is a useful behavior given the absence of an union() method). Guido also decided long ago that no class other that list would repeat its list.__iadd__ design mistake. You can search the python-dev archives to find the discussion where it was decided that this applies to the concrete set type (i.e. that s |= 'abc' would raise a TypeError). I happen to agree with that decision. Though it seems to offend your sense of consistency, it does have the advantage of precluding what would likely be a common source of errors. I'm marking this as closed. The time to litigate API design decisions is prior to their being released. This particular ship sailed a decade ago and has mostly worked out fine for all of our users. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 00:53:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 04:53:24 +0000 Subject: [issue30193] Support the buffer protocol in json.loads() In-Reply-To: <1493333744.87.0.320689923757.issue30193@psf.upfronthosting.co.za> Message-ID: <1493355204.8.0.839923447507.issue30193@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This isn't so easy. Supporting the buffer protocol can slowdown the common case -- str. Do you have concrete use case for this feature or add it just as an extension of bytes and bytearray support? ---------- components: +Library (Lib) nosy: +bob.ippolito, ezio.melotti, rhettinger stage: -> patch review title: Accept memoryview in json.loads() -> Support the buffer protocol in json.loads() type: -> enhancement versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 00:55:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 04:55:51 +0000 Subject: [issue30193] Support the buffer protocol in json.loads() In-Reply-To: <1493333744.87.0.320689923757.issue30193@psf.upfronthosting.co.za> Message-ID: <1493355351.77.0.220825614264.issue30193@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Withdraw my note about slowing down str. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 01:02:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 05:02:48 +0000 Subject: [issue30190] unittest's assertAlmostEqual improved error message In-Reply-To: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> Message-ID: <1493355768.48.0.244248688313.issue30190@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is it worth to output a difference when the delta argument is not passed? Is it worth to output a signed difference rather than an absolute value? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 01:39:19 2017 From: report at bugs.python.org (Mandeep Bhutani) Date: Fri, 28 Apr 2017 05:39:19 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1493357959.18.0.346813593293.issue30004@psf.upfronthosting.co.za> Mandeep Bhutani added the comment: Looks like both examples need a closing \b. Is this being worked on or should I submit a PR? ---------- nosy: +mandeepb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 01:43:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 05:43:16 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493358196.96.0.928900400687.issue30152@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I just realized that is is not so easy to avoid gettext import. gettext is used in the ArgumentParser constructor for localizing names of default groups and the default help (besides they are used only for formatting help). This adds importing the locale module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 01:52:41 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 28 Apr 2017 05:52:41 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493358761.02.0.775585555727.issue30103@psf.upfronthosting.co.za> Xiang Zhang added the comment: Uuencode has no official standards and it all depends on the implementation. For other languages, I could only find PHP, java, activetcl? have official implementation. PHP and activetcl defaults to backticks and no options. Java defaults to spaces and no options. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 02:05:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 06:05:21 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493359521.26.0.535764081653.issue30152@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: After reverting some changes (import heapq on Raymond's request and import gettext since it is needed for the ArgumentParser constructor) the effect of the patch is reducing the number of imports by 6 and the time by 0.017 sec (> 10%) on my computer. $ time for i in `seq 100`; do ./python -S -c 'import argparse; argparse.ArgumentParser()'; done Unpatched: real 0m13.236s user 0m12.100s sys 0m0.808s Patched: real 0m11.535s user 0m10.356s sys 0m0.756s ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 02:29:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 06:29:52 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493360992.28.0.0742979909746.issue30103@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Martin and Xiang. Wikipedia is not a reliable source, but it usually is based on reliable sources. In this case seems it is wrong. The next question is about parameter name. The Wikipedia uses the name "grave accent", the manpage of FreeBSD uuencode uses the name "backquote", the proposed patch uses the name "backtick". "Grave accent" is an official Unicode name, "backquote" and "backtick" are commonly used in programming context. We could use also the name containing "space" with the default value True. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 02:39:29 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 28 Apr 2017 06:39:29 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493361569.82.0.450343122004.issue30103@psf.upfronthosting.co.za> Xiang Zhang added the comment: I think "grave accent" is not suitable. Although it's the standard unicode name but it's not commonly used in programming so not direct enough. "backquote" and "backtick" seems could be used interchangeably I don't have any preference. Perl seems to use backtick instead of backquote when ` is a language part. Yeah, space is also a choice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 03:25:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 07:25:11 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493364311.63.0.341000962096.issue30103@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Python 2 used the term "backquote" when ` is a language part. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 03:38:58 2017 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 28 Apr 2017 07:38:58 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493365138.86.0.0658709856932.issue30103@psf.upfronthosting.co.za> Xiang Zhang added the comment: token defines it as backquote. But in doc there are also several places calling it backticks[1][2]. Do you have any preference Serhiy and Martin? [1] https://docs.python.org/release/3.0.1/whatsnew/3.0.html#removed-syntax [2] https://docs.python.org/2/library/2to3.html?highlight=backtick#2to3fixer-repr ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 04:51:04 2017 From: report at bugs.python.org (Louie Lu) Date: Fri, 28 Apr 2017 08:51:04 +0000 Subject: [issue24263] unittest cannot load module whose name starts with Unicode In-Reply-To: <1435031451.77.0.239152930978.issue24263@psf.upfronthosting.co.za> Message-ID: <1493369464.31.0.527764551034.issue24263@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1449 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 04:54:00 2017 From: report at bugs.python.org (Louie Lu) Date: Fri, 28 Apr 2017 08:54:00 +0000 Subject: [issue24263] unittest cannot load module whose name starts with Unicode In-Reply-To: <1435031451.77.0.239152930978.issue24263@psf.upfronthosting.co.za> Message-ID: <1493369640.07.0.444532393716.issue24263@psf.upfronthosting.co.za> Louie Lu added the comment: Add PR: https://github.com/python/cpython/pull/1338/ rbcollins: Need for help to review the patch, I think that both `$thing` and `$thing.py` can't be used in python (and for UNIX dir), and `\u2603` (?) though can do something like `?.py`, but it is not a valid identifier in python, too. ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 05:20:24 2017 From: report at bugs.python.org (Socob) Date: Fri, 28 Apr 2017 09:20:24 +0000 Subject: [issue4773] HTTPMessage not documented and has inconsistent API across Py2/Py3 In-Reply-To: <1230586952.45.0.591912771259.issue4773@psf.upfronthosting.co.za> Message-ID: <1493371224.2.0.4415795305.issue4773@psf.upfronthosting.co.za> Changes by Socob <206a8535 at opayq.com>: ---------- nosy: +Socob _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 05:30:14 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 28 Apr 2017 09:30:14 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493371814.18.0.913441500979.issue30052@psf.upfronthosting.co.za> Changes by Nick Coghlan : ---------- pull_requests: +1450 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 05:33:44 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 28 Apr 2017 09:33:44 +0000 Subject: [issue30052] URL Quoting page links to function Bytes instead of defintion In-Reply-To: <1492001374.68.0.411275444037.issue30052@psf.upfronthosting.co.za> Message-ID: <1493372024.72.0.620517906398.issue30052@psf.upfronthosting.co.za> Nick Coghlan added the comment: New PR disabling the output caching and adding a corresponding NEWS entry: https://github.com/python/cpython/pull/1339 On my local machine, it takes a "nothing changed" build from less than 2 seconds to just under 2 minutes, but I think that's fine for a daily build task. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 06:14:52 2017 From: report at bugs.python.org (mahboubi) Date: Fri, 28 Apr 2017 10:14:52 +0000 Subject: [issue30195] writing non-ascii characters in xml file using python code embedded in C Message-ID: <1493374492.88.0.89710812833.issue30195@psf.upfronthosting.co.za> New submission from mahboubi: my python code embedded in C program, uses etree from lxml to write a plain string as element attribute in xml file. the problem is when my string contains non english characters(non ascii), the program fails to write even with unicode conversion such as unicode(mystring, "utf-8"), but when I use python code only, it works. ---------- components: XML messages: 292521 nosy: aimad, benjamin.peterson, ezio.melotti, haypo, lemburg priority: normal severity: normal status: open title: writing non-ascii characters in xml file using python code embedded in C type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 06:19:20 2017 From: report at bugs.python.org (=?utf-8?b?SsOhY2h5bSBCYXJ2w61uZWs=?=) Date: Fri, 28 Apr 2017 10:19:20 +0000 Subject: [issue30196] Add __matmul__ to collections.Counter Message-ID: <1493374760.56.0.320449301178.issue30196@psf.upfronthosting.co.za> New submission from J?chym Barv?nek: The class collections.Counter should semantically contain only numbers, so it makes sense to define dot product od Counters, something like this: def __matmul__(self, other): return sum(self[x] * other[x] for x in self.keys() | other.keys()) I find this useful ocassionaly. ---------- components: Library (Lib) messages: 292522 nosy: J?chym Barv?nek priority: normal severity: normal status: open title: Add __matmul__ to collections.Counter type: enhancement versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 06:20:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 10:20:35 +0000 Subject: [issue30196] Add __matmul__ to collections.Counter In-Reply-To: <1493374760.56.0.320449301178.issue30196@psf.upfronthosting.co.za> Message-ID: <1493374835.33.0.269876078774.issue30196@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 06:25:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 10:25:16 +0000 Subject: [issue30195] writing non-ascii characters in xml file using python code embedded in C In-Reply-To: <1493374492.88.0.89710812833.issue30195@psf.upfronthosting.co.za> Message-ID: <1493375116.89.0.499570715994.issue30195@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: lxml is not the part of the Python standard library. Use lxml bug tracker if your issue is specific for lxml. If you can reproduce the issue with xml.etree.ElementTree from the stdlib, please provide a simple example code that does this. ---------- nosy: +serhiy.storchaka stage: -> test needed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 06:34:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 10:34:51 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493375691.37.0.271931043567.issue30152@psf.upfronthosting.co.za> STINNER Victor added the comment: > $ time for i in `seq 100`; do ./python -S -c 'import argparse; argparse.ArgumentParser()'; done Measuring Python startup performance is painful, there is a huge deviation. You may try the new "command" command that I added to perf 1.1: ----------------------- haypo at selma$ python3 -m perf command --stats -- python3 -S -c pass ..................... Total duration: 21.0 sec Start date: 2017-04-28 12:15:57 End date: 2017-04-28 12:16:20 Raw value minimum: 174 ms Raw value maximum: 229 ms Number of calibration run: 1 Number of run with values: 20 Total number of run: 21 Number of warmup per run: 1 Number of value per run: 3 Loop iterations per value: 16 Total number of values: 60 Minimum: 10.9 ms Median +- MAD: 12.3 ms +- 0.5 ms Mean +- std dev: 12.4 ms +- 0.7 ms Maximum: 14.3 ms 0th percentile: 10.9 ms (-12% of the mean) -- minimum 5th percentile: 11.2 ms (-10% of the mean) 25th percentile: 11.9 ms (-4% of the mean) -- Q1 50th percentile: 12.3 ms (-1% of the mean) -- median 75th percentile: 12.9 ms (+4% of the mean) -- Q3 95th percentile: 13.7 ms (+10% of the mean) 100th percentile: 14.3 ms (+15% of the mean) -- maximum Number of outlier (out of 10.4 ms..14.4 ms): 0 command: Mean +- std dev: 12.4 ms +- 0.7 ms ----------------------- There is a huge difference between the minimum and the maximum. By the way, I'm interested by feedback on that tool, I'm not sure that it's reliable, it can likely be enhanced somewhere ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 06:48:27 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Fri, 28 Apr 2017 10:48:27 +0000 Subject: [issue30196] Add __matmul__ to collections.Counter In-Reply-To: <1493374760.56.0.320449301178.issue30196@psf.upfronthosting.co.za> Message-ID: <1493376507.75.0.923794016867.issue30196@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- versions: -Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 06:48:45 2017 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Fri, 28 Apr 2017 10:48:45 +0000 Subject: [issue30196] Add __matmul__ to collections.Counter In-Reply-To: <1493374760.56.0.320449301178.issue30196@psf.upfronthosting.co.za> Message-ID: <1493376525.94.0.320113582899.issue30196@psf.upfronthosting.co.za> Changes by Jim Fasarakis-Hilliard : ---------- nosy: +Jim Fasarakis-Hilliard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 07:00:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 11:00:07 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1493377207.24.0.968424209404.issue30104@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1451 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 07:05:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 11:05:07 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493377507.13.0.93075576742.issue30124@psf.upfronthosting.co.za> STINNER Victor added the comment: I would like to fix FreeBSD CURRENT buildbots of Python 2.7, 3.5 and 3.6, so here my attempt to restrict the -fno-strict-aliasing option to the dtoa.c file: https://github.com/python/cpython/pull/1340 I chose to add the flag for any C compiler. If you think that a C compiler may not support that option, we can start by only adding the option on clang, and maybe add it on other C compilers if someone complains. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 07:05:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 11:05:10 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1493377510.71.0.0221906609888.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: I would like to fix FreeBSD CURRENT buildbots of Python 2.7, 3.5 and 3.6, so here my attempt to restrict the -fno-strict-aliasing option to the dtoa.c file: https://github.com/python/cpython/pull/1340 I chose to add the flag for any C compiler. If you think that a C compiler may not support that option, we can start by only adding the option on clang, and maybe add it on other C compilers if someone complains. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 07:06:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 11:06:00 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support Message-ID: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch adds two features to functions swap_attr() and swap_item() in the test.support module. 1. They now work (rather than failing in __exit__) when delete the attribute or item inside the with block. There were several cases when I refused to use these functions instead of manually coded try/finally due to lack of this feature. 2. The original value of the attribute or item can be assigned to the target of "as" in the with statement. This can save a line of the code in some cases. ---------- components: Tests messages: 292527 nosy: ezio.melotti, michael.foord, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Enhance swap_attr() and swap_item() in test.support type: enhancement versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 07:09:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 11:09:58 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493377798.13.0.952462824233.issue30197@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1452 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 07:23:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 11:23:10 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493378590.91.0.0547609934075.issue30152@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > Measuring Python startup performance is painful, there is a huge deviation. That is why I run Python 100 times and repeat that several times for testing that the result is stable. With perf I got roughly the same result -- the absolute difference is 18-19 ms, or 17%. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 08:08:16 2017 From: report at bugs.python.org (Philippe Pinard) Date: Fri, 28 Apr 2017 12:08:16 +0000 Subject: [issue24960] Can't use lib2to3 with embeddable zip file. In-Reply-To: <1440869782.83.0.207113001402.issue24960@psf.upfronthosting.co.za> Message-ID: <1493381296.79.0.100843556363.issue24960@psf.upfronthosting.co.za> Philippe Pinard added the comment: As S?bastien Taylor, I ran into the same problem. The workaround I found was to unzip the content of python35.zip and put it in the Lib/ folder. ---------- nosy: +ppinard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 08:17:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 12:17:50 +0000 Subject: [issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel Message-ID: <1493381870.33.0.670258208626.issue30198@psf.upfronthosting.co.za> New submission from STINNER Victor: Since Python 3.5, distutils is able to build extensions in parallel, nice enhancement! But setup.py of CPython is 2x slower in parallel mode when all modules are already built: (1 sec vs 500 ms). Building extensions calls newer_group() which calls os.stat() 6,856 times. I wrote a cache for os.stat() but it has no impact on performance. It seems like threads are fighting to death for the GIL in the os.stat() race... Attached pull request calls newer_group() before spawning threads in parallel mode, so "setup.py build" takes the same time with and without parallel module, when all extensions are already built. I didn't measure performance when all extensions must be built. ---------- components: Distutils messages: 292530 nosy: dstufft, haypo, merwok priority: normal severity: normal status: open title: distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 08:20:58 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 12:20:58 +0000 Subject: [issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel In-Reply-To: <1493381870.33.0.670258208626.issue30198@psf.upfronthosting.co.za> Message-ID: <1493382058.34.0.49835003966.issue30198@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1453 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 08:22:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 12:22:25 +0000 Subject: [issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel In-Reply-To: <1493381870.33.0.670258208626.issue30198@psf.upfronthosting.co.za> Message-ID: <1493382145.64.0.28066788513.issue30198@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- nosy: +brett.cannon, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 08:46:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 12:46:56 +0000 Subject: [issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0 In-Reply-To: <1492766935.79.0.662322517567.issue30124@psf.upfronthosting.co.za> Message-ID: <1493383616.69.0.562498276724.issue30124@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1454 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 09:07:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 13:07:12 +0000 Subject: [issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing In-Reply-To: <1492634362.26.0.662150141345.issue30104@psf.upfronthosting.co.za> Message-ID: <1493384832.59.0.131631087587.issue30104@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 826f83f1d562a7b878499bc3af2267cfdfe5f2f9 by Victor Stinner in branch 'master': bpo-30104: Only use -fno-strict-aliasing on dtoa.c (#1340) https://github.com/python/cpython/commit/826f83f1d562a7b878499bc3af2267cfdfe5f2f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 09:38:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 13:38:20 +0000 Subject: [issue30199] Warning -- asyncore.socket_map was modified by test_ssl Message-ID: <1493386700.85.0.622931101422.issue30199@psf.upfronthosting.co.za> New submission from STINNER Victor: It seems like test_asyncore_server() of test_ssl doesn't cleanup properly asyncore on FreeBSD, and so following unit tests can be impacted (and fail). http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/210/steps/test/logs/stdio test_asyncore_server (test.test_ssl.ThreadedTests) Check the example asyncore integration. ... server: new connection from 127.0.0.1:48985 client: sending b'FOO\n'... server: read b'FOO\n' from client client: read b'foo\n' client: closing connection. server: read b'over\n' from client client: connection closed. cleanup: stopping server. cleanup: joining server thread. cleanup: successfully joined. ok ... Warning -- asyncore.socket_map was modified by test_ssl Before: {} After: {6: } Maybe AsyncoreEchoServer.__exit__() should just ends with "asyncore.close_all(ignore_all=True)"? ---------- components: Tests messages: 292532 nosy: haypo priority: normal severity: normal status: open title: Warning -- asyncore.socket_map was modified by test_ssl type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 09:42:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 13:42:55 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" In-Reply-To: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> Message-ID: <1493386975.77.0.611825170927.issue30125@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1455 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 09:47:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 13:47:19 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493387239.19.0.979694694408.issue30107@psf.upfronthosting.co.za> Changes by STINNER Victor : ---------- pull_requests: +1456 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 10:06:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 14:06:50 +0000 Subject: [issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation" In-Reply-To: <1492777398.7.0.77484107928.issue30125@psf.upfronthosting.co.za> Message-ID: <1493388410.6.0.777867402524.issue30125@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e005dd9a6da7dfa34f47a6989a7e0a6b1ad04949 by Victor Stinner in branch '3.6': bpo-30125: disable faulthandler in ctypes test_SEH (#1237) (#1343) https://github.com/python/cpython/commit/e005dd9a6da7dfa34f47a6989a7e0a6b1ad04949 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 10:57:28 2017 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 28 Apr 2017 14:57:28 +0000 Subject: [issue2506] Add mechanism to disable optimizations In-Reply-To: <1206797921.05.0.258043023613.issue2506@psf.upfronthosting.co.za> Message-ID: <1493391448.37.0.342981019977.issue2506@psf.upfronthosting.co.za> Changes by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 10:59:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 14:59:48 +0000 Subject: [issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot In-Reply-To: <1492644177.56.0.807251797434.issue30107@psf.upfronthosting.co.za> Message-ID: <1493391588.07.0.665969553862.issue30107@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 98c7a9e662b49029ff051b6699ddc0f542663c96 by Victor Stinner in branch '3.5': [3.5] bpo-30107: don't dump core on expected test_io crash (#1235) (#1344) https://github.com/python/cpython/commit/98c7a9e662b49029ff051b6699ddc0f542663c96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 11:42:07 2017 From: report at bugs.python.org (Frank Pae) Date: Fri, 28 Apr 2017 15:42:07 +0000 Subject: [issue30200] tkinter ListboxSelect Message-ID: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> New submission from Frank Pae: prerequisite: you have more than one tkinter listbox behavior in py 2.7.13 and py 3.5.3: if you leave a listbox and goes to another, then the abandoned listbox create not a ListboxSelect Event behavior in py 3.6.0 and 3.6.1: if you leave a listbox and goes to another, then the abandoned listbox create a ListboxSelect Event and this gives a error-message I dont know if my program is false, but it works in 2.7 and 3.5 good, however not with 3.6 Thank you ---------- components: Tkinter files: tk_ListboxSelect.py messages: 292535 nosy: Frank Pae priority: normal severity: normal status: open title: tkinter ListboxSelect type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file46833/tk_ListboxSelect.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 12:17:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 16:17:28 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493396248.78.0.680309549023.issue30197@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83 by Victor Stinner (Serhiy Storchaka) in branch 'master': bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341) https://github.com/python/cpython/commit/d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83 ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 12:17:48 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 28 Apr 2017 16:17:48 +0000 Subject: [issue30190] unittest's assertAlmostEqual improved error message In-Reply-To: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> Message-ID: <1493396268.22.0.830157782704.issue30190@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Thanks for chiming in. > Is it worth to output a difference when the delta argument is not passed? Yes, probably. I will change that. > Is it worth to output a signed difference rather than an absolute value? Mmmm probably not IMHO. Personally I never care about the position of left and right arguments. I just want to check whether a and b are almost equal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 12:20:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Apr 2017 16:20:49 +0000 Subject: [issue30201] [3.5] RecvmsgIntoSCMRightsStreamTest fails with "OSError: [Errno 12] Cannot allocate memory" on macOS El Capitan Message-ID: <1493396449.34.0.335378086459.issue30201@psf.upfronthosting.co.za> New submission from STINNER Victor: The test fails on Python 3.5 but pass on Python 3.6, I don't know why. http://buildbot.python.org/all/builders/x86-64%20El%20Capitan%203.5/builds/31/steps/test/logs/stdio ====================================================================== ERROR: testFDPassEmpty (test.test_socket.RecvmsgSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.5.billenstein-elcapitan/build/Lib/test/test_socket.py", line 2851, in testFDPassEmpty len(MSG), 10240), File "/Users/buildbot/buildarea/3.5.billenstein-elcapitan/build/Lib/test/test_socket.py", line 1955, in doRecvmsg result = sock.recvmsg(bufsize, *args) OSError: [Errno 12] Cannot allocate memory ====================================================================== ERROR: testFDPassEmpty (test.test_socket.RecvmsgIntoSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.5.billenstein-elcapitan/build/Lib/test/test_socket.py", line 2851, in testFDPassEmpty len(MSG), 10240), File "/Users/buildbot/buildarea/3.5.billenstein-elcapitan/build/Lib/test/test_socket.py", line 2046, in doRecvmsg result = sock.recvmsg_into([buf], *args) OSError: [Errno 12] Cannot allocate memory ---------- components: Tests, macOS messages: 292538 nosy: haypo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: [3.5] RecvmsgIntoSCMRightsStreamTest fails with "OSError: [Errno 12] Cannot allocate memory" on macOS El Capitan versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 12:31:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 16:31:04 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493397064.16.0.0118003108575.issue30197@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1457 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 12:35:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 16:35:02 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493397302.99.0.293743524594.issue30197@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1458 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 12:46:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 16:46:21 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493397981.58.0.699504574652.issue30197@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1459 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 12:54:12 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Fri, 28 Apr 2017 16:54:12 +0000 Subject: [issue27377] Add smarter socket.fromfd() In-Reply-To: <1466706816.6.0.72770597716.issue27377@psf.upfronthosting.co.za> Message-ID: <1493398452.7.0.508138818325.issue27377@psf.upfronthosting.co.za> Changes by Neil Schemenauer : ---------- pull_requests: +1460 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 13:05:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 17:05:07 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493399107.69.0.241478684526.issue30197@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 712114b3f9f5f98f03c66a80607b6f7101c5cc90 by Serhiy Storchaka in branch '3.6': [3.6] bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (GH-1341) (#1345) https://github.com/python/cpython/commit/712114b3f9f5f98f03c66a80607b6f7101c5cc90 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 13:05:26 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 28 Apr 2017 17:05:26 +0000 Subject: [issue30190] unittest's assertAlmostEqual improved error message In-Reply-To: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> Message-ID: <1493399126.76.0.12531592291.issue30190@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 13:05:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 17:05:55 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493399155.85.0.0890675972461.issue30197@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 910ba937e90ffe3aa154a5b27dc7e2c3d3c88d1f by Serhiy Storchaka in branch '3.5': [3.5] bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341) (#1346) https://github.com/python/cpython/commit/910ba937e90ffe3aa154a5b27dc7e2c3d3c88d1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 13:06:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 17:06:32 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493399192.56.0.64037317922.issue30197@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 941ea53b5776aaeb9dc1026e482a4ce5c5768830 by Serhiy Storchaka in branch '2.7': [2.7] bpo-30197: Enhance swap_attr() and backport swap_item() in test.test_support. (#1341) (#1347) https://github.com/python/cpython/commit/941ea53b5776aaeb9dc1026e482a4ce5c5768830 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 13:07:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Apr 2017 17:07:22 +0000 Subject: [issue30197] Enhance swap_attr() and swap_item() in test.support In-Reply-To: <1493377560.96.0.413320673715.issue30197@psf.upfronthosting.co.za> Message-ID: <1493399242.18.0.63916801692.issue30197@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 13:13:58 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Fri, 28 Apr 2017 17:13:58 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1493399638.8.0.874441625416.issue29943@psf.upfronthosting.co.za> Nathaniel Smith added the comment: Pillow also had broken wheels up on pypi for a while; they've now put out a bug fix release that #undef's PySlice_GetIndicesEx, basically monkeypatching out the bugfix to get back to the 3.6.0 behavior: https://github.com/python-pillow/Pillow/issues/2479 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 14:36:14 2017 From: report at bugs.python.org (Stefan Krah) Date: Fri, 28 Apr 2017 18:36:14 +0000 Subject: [issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches In-Reply-To: <1490830588.09.0.152876220246.issue29943@psf.upfronthosting.co.za> Message-ID: <1493404574.21.0.943380099325.issue29943@psf.upfronthosting.co.za> Stefan Krah added the comment: I'm with Nathaniel here: The fixed-bug is probably too obscure to warrant ABI breakage. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 15:06:00 2017 From: report at bugs.python.org (Brett Cannon) Date: Fri, 28 Apr 2017 19:06:00 +0000 Subject: [issue27869] test failures under Bash on Windows / WSL In-Reply-To: <1472236837.41.0.811658562373.issue27869@psf.upfronthosting.co.za> Message-ID: <1493406360.34.0.329041375924.issue27869@psf.upfronthosting.co.za> Brett Cannon added the comment: Running the tests with -uall didn't change the results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 15:07:30 2017 From: report at bugs.python.org (Christian Heimes) Date: Fri, 28 Apr 2017 19:07:30 +0000 Subject: [issue28134] socket.socket(fileno=fd) does not work as documented In-Reply-To: <1473794011.65.0.923929152137.issue28134@psf.upfronthosting.co.za> Message-ID: <1493406450.44.0.0145754082648.issue28134@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- pull_requests: +1461 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 15:19:20 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 28 Apr 2017 19:19:20 +0000 Subject: [issue26143] Ensure that IDLE's stdlib imports are from the stdlib In-Reply-To: <1453089950.28.0.356846327087.issue26143@psf.upfronthosting.co.za> Message-ID: <1493407160.33.0.0608054315655.issue26143@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I and others constantly tell people to start IDLE from the command line when they have a problem. Today, someone actually followed the advice and the traceback revealed that the problem was a personal tkinter.py masking the stdlib file! Renaming it to mytkinter.py fixed the problem. This tell me that 'fixing' sys.path for the idle process must be done immediately after importing sys and before importing tkinter. In the user process, the sys import should again be first, followed by the fixup. I have verified that a user 'sys.py' does not mask sys imports. Python itself imports sys, so IDLE's 'import sys' just gets the existing sys.modules['sys']. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 16:11:48 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 28 Apr 2017 20:11:48 +0000 Subject: [issue30196] Add __matmul__ to collections.Counter In-Reply-To: <1493374760.56.0.320449301178.issue30196@psf.upfronthosting.co.za> Message-ID: <1493410308.05.0.162646848319.issue30196@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Periodically, I've looked at possibly adding these kind of extensions. The argument in favor in that it is easy to do and is an obvious extension with plausible utility. The main arguments against is that it represents feature creep far removed from the original intended use cases (the tool is primary about counting and trys not to venture into elementwise arithmetic on sparse vectors.) It is tempting to add a new feature that might sometimes be useful, but we should also worry that usability and learnability are impaired if the class becomes less cohesive, less thematic, and less focused on unified design goals. The other factor against adding the feature is that since the Counter is just a dict subclass, it is easy for users to just manipulate the data directly. We're not really adding much that a person can't already easily do themselves. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 16:26:01 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 28 Apr 2017 20:26:01 +0000 Subject: [issue30190] unittest's assertAlmostEqual improved error message In-Reply-To: <1493323962.23.0.575947649634.issue30190@psf.upfronthosting.co.za> Message-ID: <1493411161.1.0.579559879105.issue30190@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The patch looks good to me. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 16:28:23 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 28 Apr 2017 20:28:23 +0000 Subject: [issue19417] Bdb: add docstrings and a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493411303.01.0.480124057846.issue19417@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1462 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 16:40:40 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Fri, 28 Apr 2017 20:40:40 +0000 Subject: [issue27377] Add socket.fdtype() In-Reply-To: <1466706816.6.0.72770597716.issue27377@psf.upfronthosting.co.za> Message-ID: <1493412040.67.0.130682728977.issue27377@psf.upfronthosting.co.za> Neil Schemenauer added the comment: Changing title, I think #28134 (socket.socket(fileno=fd) does not work as documented) is a cleaner solution. However, exposing the ability to query a socket file descriptor seems useful so I'm still proposing to add socket.fdtype(). The github PR 1348 has been modified to remove fromfd2() and only add the function fdtype(). ---------- title: Add smarter socket.fromfd() -> Add socket.fdtype() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 17:13:04 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 28 Apr 2017 21:13:04 +0000 Subject: [issue30196] Add __matmul__ to collections.Counter In-Reply-To: <1493374760.56.0.320449301178.issue30196@psf.upfronthosting.co.za> Message-ID: <1493413984.22.0.782353727498.issue30196@psf.upfronthosting.co.za> Changes by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 17:14:04 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 28 Apr 2017 21:14:04 +0000 Subject: [issue30145] Create a How to or Tutorial documentation for asyncio In-Reply-To: <1492960602.26.0.461554169011.issue30145@psf.upfronthosting.co.za> Message-ID: <1493414044.67.0.821603480476.issue30145@psf.upfronthosting.co.za> Changes by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 17:17:33 2017 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 28 Apr 2017 21:17:33 +0000 Subject: [issue30145] Create a How to or Tutorial documentation for asyncio In-Reply-To: <1492960602.26.0.461554169011.issue30145@psf.upfronthosting.co.za> Message-ID: <1493414253.51.0.869027083901.issue30145@psf.upfronthosting.co.za> Yury Selivanov added the comment: Yes, this is a very longstanding open issue. I've already discussed this with Guido many times, and even found someone to help us. Will try to kickstart the project this weekend. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 17:22:33 2017 From: report at bugs.python.org (Brett Cannon) Date: Fri, 28 Apr 2017 21:22:33 +0000 Subject: [issue27869] test failures under Bash on Windows / WSL In-Reply-To: <1472236837.41.0.811658562373.issue27869@psf.upfronthosting.co.za> Message-ID: <1493414553.88.0.730537317008.issue27869@psf.upfronthosting.co.za> Brett Cannon added the comment: When failures are bit more isolated they should probably be reported to https://github.com/microsoft/bashonwindows . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 17:22:38 2017 From: report at bugs.python.org (Brett Cannon) Date: Fri, 28 Apr 2017 21:22:38 +0000 Subject: [issue27869] test failures under Bash on Windows / WSL In-Reply-To: <1472236837.41.0.811658562373.issue27869@psf.upfronthosting.co.za> Message-ID: <1493414558.04.0.176702822538.issue27869@psf.upfronthosting.co.za> Changes by Brett Cannon : ---------- versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 17:56:12 2017 From: report at bugs.python.org (Brett Cannon) Date: Fri, 28 Apr 2017 21:56:12 +0000 Subject: [issue30202] Update test.test_importlib.test_abc to test find_spec() Message-ID: <1493416572.94.0.214494308366.issue30202@psf.upfronthosting.co.za> New submission from Brett Cannon: It looks like test_abc isn't really testing find_spec() very much compared to find_module(). There might also be some tests still using find_module() that should be updated to use find_spec() instead. ---------- components: Tests messages: 292552 nosy: brett.cannon, eric.snow, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Update test.test_importlib.test_abc to test find_spec() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 19:26:47 2017 From: report at bugs.python.org (David Haney) Date: Fri, 28 Apr 2017 23:26:47 +0000 Subject: [issue30183] [HPUX] compilation error in pytime.c with cc compiler In-Reply-To: <1493267090.1.0.00115311377195.issue30183@psf.upfronthosting.co.za> Message-ID: <1493422007.12.0.161547133404.issue30183@psf.upfronthosting.co.za> Changes by David Haney : ---------- pull_requests: +1463 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 22:08:43 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 29 Apr 2017 02:08:43 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493431723.7.0.33588321682.issue29606@psf.upfronthosting.co.za> Martin Panter added the comment: I understand this bug (as reported by ECBFTW) is about Python injecting unexpected FTP commands when the ?urllib? and ?urllib2? modules are used. The ?httplib? module (?http.client? in Python 3) is unaffected. I only mentioned HTTP as an example of a similar fix made recently; sorry if that was confusing. To be clear, in Python 2 I think both the ?urllib? _and_ ?urllib2? modules are affected, as well as ?ftplib? directly. In Python 3, ?urllib.request? and ?ftplib? are affected. But I don?t think ?urlparse? and ?urllib.parse? should be changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 22:24:06 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 29 Apr 2017 02:24:06 +0000 Subject: [issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters In-Reply-To: <1492711040.26.0.220875177269.issue30119@psf.upfronthosting.co.za> Message-ID: <1493432646.59.0.543244808274.issue30119@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 22:24:50 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 29 Apr 2017 02:24:50 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493432690.29.0.864791666224.issue29606@psf.upfronthosting.co.za> Changes by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 22:44:49 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 02:44:49 +0000 Subject: [issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions. In-Reply-To: <1492809485.52.0.0203844135424.issue30133@psf.upfronthosting.co.za> Message-ID: <1493433889.43.0.521802023303.issue30133@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- versions: +Python 3.6, Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 22:46:14 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 29 Apr 2017 02:46:14 +0000 Subject: [issue16349] Document whether it's safe to use bytes for struct format string In-Reply-To: <1351428222.6.0.656645524198.issue16349@psf.upfronthosting.co.za> Message-ID: <1493433974.94.0.683473443579.issue16349@psf.upfronthosting.co.za> Martin Panter added the comment: I think the direction to take for this depends on the outcome of Issue 21071. First we have to decide if the ?format? attribute is blessed as a byte string (and not deprecated), or whether it is deprecated or changed to a text string. Serhiy pointed out that it is not entirely ?safe? because mixing equivalent byte and text formats can generate ByteWarning. ---------- dependencies: +Document whether it's safe to use bytes for struct format string _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 22:46:28 2017 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 29 Apr 2017 02:46:28 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493433988.96.0.708462889223.issue29606@psf.upfronthosting.co.za> Dong-hee Na added the comment: Thanks, Martin I agree with you. So, in this case, we should update FTPHandler right? If this approach right, Can I proceed this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 22:46:51 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 29 Apr 2017 02:46:51 +0000 Subject: [issue16349] Document whether it's safe to use bytes for struct format string In-Reply-To: <1351428222.6.0.656645524198.issue16349@psf.upfronthosting.co.za> Message-ID: <1493434011.08.0.708303817037.issue16349@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- dependencies: +struct.Struct.format is bytes, but should be str -Document whether it's safe to use bytes for struct format string _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 22:58:36 2017 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 29 Apr 2017 02:58:36 +0000 Subject: [issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters In-Reply-To: <1492711040.26.0.220875177269.issue30119@psf.upfronthosting.co.za> Message-ID: <1493434716.14.0.785750556243.issue30119@psf.upfronthosting.co.za> Dong-hee Na added the comment: One of the purposes of the JDK patch is to prevent '\ r' and '\ n' from being inserted into the ftp command. In particular, it seems to assume that if another malice command is inserted after '\ n', the possibility of such an attack will be opened at a later time. IMO, I think that we can block '\ r \ n' and '\ n' at the same time by blocking only '\ n'. Although '\ r' allows ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 23:00:23 2017 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 29 Apr 2017 03:00:23 +0000 Subject: [issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters In-Reply-To: <1492711040.26.0.220875177269.issue30119@psf.upfronthosting.co.za> Message-ID: <1493434823.38.0.528865258095.issue30119@psf.upfronthosting.co.za> Dong-hee Na added the comment: '\ r' -> '\r' '\ n' -> '\n' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 23:07:47 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 29 Apr 2017 03:07:47 +0000 Subject: [issue21071] struct.Struct.format is bytes, but should be str In-Reply-To: <1395856133.5.0.672707015318.issue21071@psf.upfronthosting.co.za> Message-ID: <1493435267.17.0.911335605178.issue21071@psf.upfronthosting.co.za> Martin Panter added the comment: I don?t think the API should be expanded to accept arbitrary bytes-like objects as format strings. Struct formats are strings of ASCII-compatible characters, but not arbitrary chunks of memory. I think the main question is whether it is okay to break compatibility (Victor?s pull request, or my format-str.patch), or whether there has to be a backwards-compatible deprecation of the existing bytes attribute. FWIW I am okay with breaking compatibility, since the main documentation already implies it should be a text string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 28 23:26:31 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 29 Apr 2017 03:26:31 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493436391.53.0.23023831127.issue30103@psf.upfronthosting.co.za> Martin Panter added the comment: I think I would prefer b2a_uu(data, grave=True), but am also happy with Xiang?s backtick=True if others prefer that. :) In my mind ?grave accent? is the pure ASCII character; it just got abused for other things. Other options: b2a_uu(data, space=False) b2a_uu(data, avoid_spaces=True) b2a_uu(data, use_0x60=True) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 00:06:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Apr 2017 04:06:51 +0000 Subject: [issue30158] Deprecation warnings emitted in test_importlib In-Reply-To: <1493114299.05.0.756941591425.issue30158@psf.upfronthosting.co.za> Message-ID: <1493438811.22.0.473329039397.issue30158@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3cc8259b71ef784a9f7593f04da96043afe2228a by Serhiy Storchaka in branch 'master': bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (#1285) https://github.com/python/cpython/commit/3cc8259b71ef784a9f7593f04da96043afe2228a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 00:06:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Apr 2017 04:06:51 +0000 Subject: [issue29576] Improve some deprecations in the importlib In-Reply-To: <1487208454.1.0.000568467436348.issue29576@psf.upfronthosting.co.za> Message-ID: <1493438811.38.0.42083128684.issue29576@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3cc8259b71ef784a9f7593f04da96043afe2228a by Serhiy Storchaka in branch 'master': bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (#1285) https://github.com/python/cpython/commit/3cc8259b71ef784a9f7593f04da96043afe2228a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 00:10:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Apr 2017 04:10:47 +0000 Subject: [issue30158] Deprecation warnings emitted in test_importlib In-Reply-To: <1493114299.05.0.756941591425.issue30158@psf.upfronthosting.co.za> Message-ID: <1493439047.63.0.486883566212.issue30158@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 00:17:34 2017 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 29 Apr 2017 04:17:34 +0000 Subject: [issue29982] tempfile.TemporaryDirectory fails to delete itself In-Reply-To: <1491330378.49.0.274398190766.issue29982@psf.upfronthosting.co.za> Message-ID: <1493439454.8.0.984540965368.issue29982@psf.upfronthosting.co.za> Guido van Rossum added the comment: A simpler approach would be to simply ignore the error when it occurs in TemporaryDirectory._cleanup. There are no absolute guarantees about tempfile always cleaning up -- just a best effort. The complexity (and potential delays) of a retry loop seem more risky than simply occasionally not cleaning up -- that happens anyways, for a variety of reasons. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 00:26:53 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 04:26:53 +0000 Subject: [issue30152] Reduce the number of imports for argparse In-Reply-To: <1493019230.17.0.769999123229.issue30152@psf.upfronthosting.co.za> Message-ID: <1493440013.93.0.700273672418.issue30152@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I believe importing argparse in the __main__ clause (or a main or test function called therein) is common. I prefer it there as it is not germain to the code that is usually imported. I have a similar view on not immediately importing warnings when only needed for deprecation. I am interested in argparse import time because I have thought about switching IDLE arg processing from getopt to argparse. But both IDLE and user process startup time are already slow enough. (For IDLE, the numbers for Serhiy's import counter for 3.6 on Win 10 with idlelib.idle instead of argparse are 38 192 154. I recently sped up user process startup (performed each time one 'runs' code from the editor) by around 25% (.1 second on my machine, just noticeable) by a few fairly straightforword changes. For idlelib.run, the import numbers are 40 182 142 in 3.5.3 and 38 138 100 in 3.6.1. I probably can improve this further, but each change would have to be justified on its own. So I think it appropriate to start with a subset of possible speedup changes for argparse. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 01:04:56 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 05:04:56 +0000 Subject: [issue30196] Add __matmul__ to collections.Counter In-Reply-To: <1493374760.56.0.320449301178.issue30196@psf.upfronthosting.co.za> Message-ID: <1493442296.6.0.171457208215.issue30196@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The '|' should be '&' to avoid useless summing of 0 products. I think this should be rejected. Python's number and collections classes provide basic operations from which users can build application-specific functions. Or in the case of floats, we provide a separate module of specialized functions. Or in the case of itertools, a section of recipes that build on the basic iterators in the module. In this case, it makes little sense to me to provide an 'inner product' of Counters (bags, multisets). >>> a, b, c, d = 'a', 'b', 'c', 'd' >>> c1 = C([a,a,a,b,b,c]) >>> c2 = C([a, c,c,c, d,d,d]) >>> sum(c1[x]*c2[x] for x in c1.keys() & c2.keys()) 6 Even if the keys are counts and one thinks of the counters as sparse vectors, they are not really matrices. Hence @ does not exactly fit. If one does want sparse vectors implemented as dicts, they do not always have to be Counters. A function would not require that. def sparse_inner_prod(v1, v2): return sum(v1[x]*v2[x] for x in v1.keys() & v2.keys()) This only requires that v1 and v2 both have keys and __getitem__ methods. ---------- nosy: +terry.reedy stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 01:32:59 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 05:32:59 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493443979.81.0.548610436461.issue30200@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Bug examples should be the bare minimum of code needed to reproduce the problem, not a dump of (failing) application code. See, for instance, https://stackoverflow.com/help/mcve. http://www.tcl.tk/man/tcl8.6/TkCmd/listbox.htm says "Any time the set of selected item(s) in the listbox is updated by the user through the keyboard or mouse, the virtual event <> will be generated." It was the same for 8.5. What precise actions are *needed* to produce what you consider buggy behavior? Please copy the complete traceback for the exception. What system (OS) are you using. If *nix, are you using the same tcl/tk for 3.6 as for 3.5? ---------- nosy: +serhiy.storchaka, terry.reedy stage: -> test needed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 02:21:13 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 06:21:13 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493446873.05.0.854602583958.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Removed file: http://bugs.python.org/file46833/tk_ListboxSelect.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 02:23:16 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 06:23:16 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493446996.43.0.546907274471.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Added file: http://bugs.python.org/file46834/tk_ListboxSelect.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 02:24:27 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 06:24:27 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493447067.59.0.354313024169.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Added file: http://bugs.python.org/file46835/py3.5.3.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 02:24:45 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 06:24:45 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493447085.22.0.803066036143.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Added file: http://bugs.python.org/file46836/py3.6.1.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 02:40:13 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 06:40:13 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493448013.31.0.567080690554.issue30200@psf.upfronthosting.co.za> Frank Pae added the comment: thank you for your answer sorry for the "Long" code, but sometime is an longer example better than many words (and the most code is for layout, please fold with PyCharm) i use "original" Python with tcl/tk as it is in the installer in my gif-pictures you can see my sytem and the pyton versions please run my example in 3.5.3 and in 3.6.1 call Font-Menue choose size 11 and than choose style Standard you will see what i mean Thank you ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 02:44:02 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 29 Apr 2017 06:44:02 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493448242.55.0.0154618200244.issue30200@psf.upfronthosting.co.za> Louie Lu added the comment: I can reproduce the problem at 2.7.13 on Linux. Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1542, in __call__ return self.func(*args) File "tests.py", line 174, in get_style lb_sty_get = listbox_style.get(lb_sty_cur) File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2629, in get return self.tk.call(self._w, 'get', first) TclError: bad listbox index "": must be active, anchor, end, @x,y, or a number ---------- nosy: +louielu versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 02:52:26 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 06:52:26 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493448746.11.0.0566348100469.issue30200@psf.upfronthosting.co.za> Frank Pae added the comment: i have added my picture for 2.7.13 i mean there is no problem ---------- Added file: http://bugs.python.org/file46837/py2.7.13.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 02:56:15 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 29 Apr 2017 06:56:15 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493448975.33.0.634105123616.issue30200@psf.upfronthosting.co.za> Louie Lu added the comment: The problem cause by listbox.curselection(). When crossing from a listbox to another listbox, it will trigger twice event. The first time get a valid select tuple from curselection() (which will return (index, label)), and the second time will generate empty tuple. You should check curselection()'s tuple before passing into listbox.get(). The easiest is to add a if stmt for lb_*_cur, for example: def get_style(event): # self.style.set(listbox_style.get(listbox_style.curselection())) # ____TEST____ > lb_sty_cur = listbox_style.curselection() if lb_sty_cur: lb_sty_get = listbox_style.get(lb_sty_cur) self.style.set(lb_sty_get) return ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 03:06:31 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 29 Apr 2017 07:06:31 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493449591.45.0.553018928209.issue30200@psf.upfronthosting.co.za> Louie Lu added the comment: But I'm not sure if this is a behavior error or something else, I'm still trying to find the root cause. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 03:30:03 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 07:30:03 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493451003.41.0.895621677061.issue30200@psf.upfronthosting.co.za> Frank Pae added the comment: it works in py 2.7 and 3.5 normal there must be a change in 3.6, intended or unintentional this is my Workaround: def get_size(event): # self.size.set(listbox_size.get(listbox_size.curselection())) # ____TEST____ > ok=True try: lb_siz_cur = listbox_size.curselection() lb_siz_get = listbox_size.get(lb_siz_cur) except: ok=False if ok: self.size.set(lb_siz_get) print('<>', 'def get_size: listbox_size.curselection()= ', lb_siz_cur,'listbox_size.get()= ',lb_siz_get) return you need the workaround also for get_style and get_font ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 03:33:02 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 29 Apr 2017 07:33:02 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493451182.23.0.387746863489.issue30200@psf.upfronthosting.co.za> Louie Lu added the comment: I think this is only a normal behavior now. Generate two events make sense, they are generate by different widget: .!editor.!font_dialog.!frame.!frame.!listbox (0,) # Select Font .!editor.!font_dialog.!frame2.!frame.!listbox (0,) # Select Style .!editor.!font_dialog.!frame.!frame.!listbox () # Deselect Font When you select one list and trying to select another listbox, you will trigger two event, first is the select, and second the de-select. So you will need to handle the de-select part. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 03:43:56 2017 From: report at bugs.python.org (Louie Lu) Date: Sat, 29 Apr 2017 07:43:56 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493451836.03.0.157965909319.issue30200@psf.upfronthosting.co.za> Louie Lu added the comment: This behavior is as same as on my Linux Python 2.7.13: (, (2,)) # Select Font (, (3,)) # Select Style (, ()) # Deselect Font And also, you don't need a try expect to handle this situation. You can see that when de-select the listbox, curselection() will return an empty tuple, you only need an if statement to handle this: def get_style(event): lb_sty_cur = event.widget.curselection() if lb_sty_cur: lb_sty_get = listbox_style.get(lb_sty_cur) self.style.set(lb_sty_get) return ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 03:50:12 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 07:50:12 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493452212.57.0.24915261131.issue30200@psf.upfronthosting.co.za> Frank Pae added the comment: Thanks for the answers Can you please explain why python 3.6 requires another treatment? In 2.7 und 3.5 I do not need that Thank you ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:20:32 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 08:20:32 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493454032.04.0.263461151482.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Removed file: http://bugs.python.org/file46835/py3.5.3.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:20:42 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 08:20:42 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493454042.63.0.0256307976743.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Removed file: http://bugs.python.org/file46836/py3.6.1.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:20:51 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 08:20:51 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493454051.42.0.660948525644.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Removed file: http://bugs.python.org/file46837/py2.7.13.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:21:00 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 08:21:00 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493454060.55.0.05808853245.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Added file: http://bugs.python.org/file46838/py2.7.13.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:21:08 2017 From: report at bugs.python.org (Luke Campagnola) Date: Sat, 29 Apr 2017 08:21:08 +0000 Subject: [issue30203] AttributeError in Popen.communicate() Message-ID: <1493454068.21.0.26238856169.issue30203@psf.upfronthosting.co.za> New submission from Luke Campagnola: In my application, calling communicate() on a Popen instance is giving the following exception: . . . File "/usr/lib/python3.5/subprocess.py", line 1072, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "/usr/lib/python3.5/subprocess.py", line 1693, in _communicate stdout = self._fileobj2output[self.stdout] AttributeError: 'Popen' object has no attribute '_fileobj2output' I have not been able to reproduce this in a simple example, but I imagine this could happen if Popen._communicate() raises an exception in the first 20 lines or so--this would cause _communication_started to be set True, even though _fileobj2output has not been initialized. I suggest setting self._fileobj2output = None in Popen.__init__() and changing the relevant code in _communicate() from if not self._communication_started: self._fileobj2output = {} to: if self._fileobj2output is None: self._fileobj2output = {} ---------- messages: 292575 nosy: Luke Campagnola priority: normal severity: normal status: open title: AttributeError in Popen.communicate() type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:21:09 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 08:21:09 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493454069.92.0.571004569573.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Added file: http://bugs.python.org/file46839/py3.5.3.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:21:19 2017 From: report at bugs.python.org (Frank Pae) Date: Sat, 29 Apr 2017 08:21:19 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493454079.87.0.543302607511.issue30200@psf.upfronthosting.co.za> Changes by Frank Pae : Added file: http://bugs.python.org/file46840/py3.6.1.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:23:43 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 29 Apr 2017 08:23:43 +0000 Subject: [issue30204] socket.setblocking(0) changes socket.type Message-ID: <1493454223.18.0.808565419105.issue30204@psf.upfronthosting.co.za> New submission from Giampaolo Rodola': This caused me a lot of headaches (broken test) before figuring out what the heck was wrong: =) >>> import socket >>> s = socket.socket() >>> s.type >>> s.setblocking(0) >>> s.type 2049 >>> s.setblocking(1) >>> s.type getsockopt() on the other hand always tells the truth: >>> s.getsockopt(socket.SOL_SOCKET, socket.SO_TYPE) 1 ...so I suppose we can do that in the "type" property of the Python socket class. It appears the type is set in socket init: https://github.com/python/cpython/blob/1e2147b9d75a64df370a9393c2b5b9d170dc0afd/Modules/socketmodule.c#L904 ...and it's changed later in setblocking: https://github.com/python/cpython/blob/1e2147b9d75a64df370a9393c2b5b9d170dc0afd/Modules/socketmodule.c#L609 ---------- components: Library (Lib) messages: 292576 nosy: giampaolo.rodola priority: normal severity: normal status: open title: socket.setblocking(0) changes socket.type versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:24:46 2017 From: report at bugs.python.org (Luke Campagnola) Date: Sat, 29 Apr 2017 08:24:46 +0000 Subject: [issue30203] AttributeError in Popen.communicate() In-Reply-To: <1493454068.21.0.26238856169.issue30203@psf.upfronthosting.co.za> Message-ID: <1493454286.16.0.292921069462.issue30203@psf.upfronthosting.co.za> Luke Campagnola added the comment: Update: this appears to be the prior exception that causes _communication_started and _fileobj2ouput to be out of sync: File "/usr/lib/python3.5/subprocess.py", line 1072, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "/usr/lib/python3.5/subprocess.py", line 1672, in _communicate self.stdin.flush() ValueError: flush of closed file ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:38:33 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 29 Apr 2017 08:38:33 +0000 Subject: [issue19417] Bdb: add docstrings and a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493455113.88.0.908417598485.issue19417@psf.upfronthosting.co.za> Xavier de Gaye added the comment: > The file is nearly devoid of docstrings, so I would like to add those first, probably in a separate patch. Please move this new request for enhancement to a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:54:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Apr 2017 08:54:13 +0000 Subject: [issue30103] uu package uses old encoding In-Reply-To: <1492626140.89.0.479583121087.issue30103@psf.upfronthosting.co.za> Message-ID: <1493456053.31.0.148129579026.issue30103@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm +0 for something containing "space" in the option name since the purpose of changing the UU encoding is avoiding stripping spaces. But this is not strong preference. Actually there is no need to add a new option in b2a_uu(), since we can just use b2a_uu(data).replace(b' ', b'`'). It is added just for convenience. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 04:55:10 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 29 Apr 2017 08:55:10 +0000 Subject: [issue30205] socket.getsockname() type mismatch with AF_UNIX on Linux Message-ID: <1493456110.97.0.437176774734.issue30205@psf.upfronthosting.co.za> New submission from Giampaolo Rodola': >>> import socket >>> s = socket.socket(socket.AF_UNIX) >>> s.getsockname() b'' >>> s.bind('foo') >>> s.getsockname() 'foo' ---------- messages: 292580 nosy: giampaolo.rodola priority: normal severity: normal status: open title: socket.getsockname() type mismatch with AF_UNIX on Linux _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:03:15 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 29 Apr 2017 09:03:15 +0000 Subject: [issue30205] socket.getsockname() type mismatch with AF_UNIX on Linux In-Reply-To: <1493456110.97.0.437176774734.issue30205@psf.upfronthosting.co.za> Message-ID: <1493456595.93.0.810191639893.issue30205@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: The change was introduced here: https://github.com/python/cpython/commit/b10c71daa2099c450101e5854fd693a405bec49c ---------- nosy: +neologix versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:04:27 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 29 Apr 2017 09:04:27 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493456667.44.0.0830649843178.issue29606@psf.upfronthosting.co.za> Martin Panter added the comment: I think changing FTPHandler may be more appropriate than urlsplit. But I thought your other pull request in ?ftplib? might be enough. Or are you trying to make it more user-friendly? Also, FTPHandler is not used by URLopener and the Python 2 ?urllib? module as far as I know, so on its own just fixing FTPHandler wouldn?t be enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:07:38 2017 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 29 Apr 2017 09:07:38 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493456858.63.0.447745170209.issue29606@psf.upfronthosting.co.za> Dong-hee Na added the comment: Okay, this part is going to require discussion between core-devs. The ftplib committer says we need to modify urllib, and you seem to think that ftplib's fix is ?correct. The conclusion is needed. Discuss about ftplib is here https://github.com/python/cpython/pull/1214 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:08:58 2017 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 29 Apr 2017 09:08:58 +0000 Subject: [issue29606] urllib FTP protocol stream injection In-Reply-To: <1487609342.46.0.653185585548.issue29606@psf.upfronthosting.co.za> Message-ID: <1493456938.72.0.998419577889.issue29606@psf.upfronthosting.co.za> Dong-hee Na added the comment: And if we update FTPHandler will be only affected on Python3. The other patch would be needed for python2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:22:01 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 29 Apr 2017 09:22:01 +0000 Subject: [issue30206] data parameter for binascii.b2a_base64 is not positional-only Message-ID: <1493457721.34.0.92478948675.issue30206@psf.upfronthosting.co.za> New submission from Xiang Zhang: Before functions in binascii having *data* parameter all accept it as positionaly-only. But after #25357, binascii.b2a_base64 changed it to accept keyword argument also but it looks unintentional. ---------- components: Library (Lib) messages: 292585 nosy: haypo, martin.panter, serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: data parameter for binascii.b2a_base64 is not positional-only type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:24:18 2017 From: report at bugs.python.org (=?utf-8?q?Charles-Fran=C3=A7ois_Natali?=) Date: Sat, 29 Apr 2017 09:24:18 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: <1491676313.63.0.225447568651.issue30014@psf.upfronthosting.co.za> Message-ID: Charles-Fran?ois Natali added the comment: The rationale for rejecting wouldn't be "DRY does not apply in this case", it would be that this makes the code more complicated, and that a negligible speedup would not be worth it. Now, thanks to your benchmark, a 10% speedup is not negligible, so that seems like a reasonable change. I'll have a look at your refactoring code, and once pushed, we can optimize modify(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:26:53 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 29 Apr 2017 09:26:53 +0000 Subject: [issue30204] socket.setblocking(0) changes socket.type In-Reply-To: <1493454223.18.0.808565419105.issue30204@psf.upfronthosting.co.za> Message-ID: <1493458013.43.0.950940399186.issue30204@psf.upfronthosting.co.za> Martin Panter added the comment: Is this a duplicate of Issue 21327? There is some discussion there and a patch to add get_socket_type that excludes SOCK_NONBLOCK. ---------- nosy: +martin.panter superseder: -> socket.type value changes after using settimeout() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:31:34 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Sat, 29 Apr 2017 09:31:34 +0000 Subject: [issue30204] socket.setblocking(0) changes socket.type In-Reply-To: <1493454223.18.0.808565419105.issue30204@psf.upfronthosting.co.za> Message-ID: <1493458294.11.0.143623618731.issue30204@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Woo! I completely forgot I already bumped into this and that I even filed a ticket for it. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:36:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Apr 2017 09:36:09 +0000 Subject: [issue30206] data parameter for binascii.b2a_base64 is not positional-only In-Reply-To: <1493457721.34.0.92478948675.issue30206@psf.upfronthosting.co.za> Message-ID: <1493458569.21.0.570591231426.issue30206@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Because this change looks unintentional (no one of reviewers even noticed it) and was not documented, I think it is better to make the data parameter positional-only in 3.7. The chance of breaking a user code is very low, and even if this breaks some code, it is easy to fix it. But it is safer to left 3.6 untouched. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 05:43:50 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 29 Apr 2017 09:43:50 +0000 Subject: [issue30206] data parameter for binascii.b2a_base64 is not positional-only In-Reply-To: <1493457721.34.0.92478948675.issue30206@psf.upfronthosting.co.za> Message-ID: <1493459030.32.0.67196672526.issue30206@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- pull_requests: +1464 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 06:52:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Apr 2017 10:52:06 +0000 Subject: [issue30207] Rename test.test_support to test.support in 2.7 Message-ID: <1493463126.66.0.743875413442.issue30207@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch converts test.test_support into package and rename it to test.support, move test.script_helper into the test.support package. Old names test.test_support and test.script_helper are left as aliases to test.support and test.support.script_helper for compatibility (hence most tests don't need modification). Benefits of this change: 1. This makes the structure of the test directory more compatible with 3.x. This helps bacporting tests. There were a number of cases when the only required change in backported 2.7 patch was changing "support" to "test_support". Many times backporting simple tests broke 2.7 buildbots because this change was not made. 2. This makes easier backporting changes in test.support itself and backporting 3.x features from test.support. ---------- components: Tests messages: 292590 nosy: ezio.melotti, michael.foord, ncoghlan, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Rename test.test_support to test.support in 2.7 type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 06:59:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Apr 2017 10:59:26 +0000 Subject: [issue30207] Rename test.test_support to test.support in 2.7 In-Reply-To: <1493463126.66.0.743875413442.issue30207@psf.upfronthosting.co.za> Message-ID: <1493463566.89.0.74538716199.issue30207@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1465 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 08:00:06 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 29 Apr 2017 12:00:06 +0000 Subject: [issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters In-Reply-To: <1492711040.26.0.220875177269.issue30119@psf.upfronthosting.co.za> Message-ID: <1493467205.99.0.409449072079.issue30119@psf.upfronthosting.co.za> Martin Panter added the comment: I suggest to close this as a duplicate. The pull request itself looks like the right direction to me, but let?s not split the discussion up more than necessary. ---------- nosy: +martin.panter resolution: -> duplicate superseder: -> urllib FTP protocol stream injection _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 08:24:10 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 29 Apr 2017 12:24:10 +0000 Subject: [issue30128] xid_start definition for Unicode identifiers refers to xid_continue In-Reply-To: <1492784841.26.0.847903278881.issue30128@psf.upfronthosting.co.za> Message-ID: <1493468650.72.0.315416608974.issue30128@psf.upfronthosting.co.za> Xiang Zhang added the comment: Quoting from PEP3131: XID_Start then closes this set under normalization, by removing all characters whose NFKC normalization is not of the form ID_Start ID_Continue* anymore. ---------- nosy: +loewis, xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 09:42:38 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 29 Apr 2017 13:42:38 +0000 Subject: [issue30208] Small typos in IDLE doc Message-ID: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> New submission from Cheryl Sabella: Fix some small typos in IDLE doc. ---------- assignee: docs at python components: Documentation messages: 292593 nosy: csabella, docs at python priority: normal severity: normal status: open title: Small typos in IDLE doc type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 09:53:06 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 29 Apr 2017 13:53:06 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493473986.38.0.588828357764.issue30208@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1466 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 10:16:06 2017 From: report at bugs.python.org (mahboubi) Date: Sat, 29 Apr 2017 14:16:06 +0000 Subject: [issue30195] writing non-ascii characters in xml file using python code embedded in C In-Reply-To: <1493374492.88.0.89710812833.issue30195@psf.upfronthosting.co.za> Message-ID: <1493475366.41.0.0930760044083.issue30195@psf.upfronthosting.co.za> mahboubi added the comment: I have just tried to do this task using xml.etree.ElementTree and still have the same problem. In the file 'write_to_xml1.py' I'm trying to develop some function that creates an xml file and then add data containing non ascii characters.The python program works perfectly, but when I tried to call these functions from C, the program crashes.Note that this problem dosn't happen when adding ascii characters only.Here is the C program : void create_report() { PyObject *pName, *pModule, *pDict, *pFunc, *pValue, *pArgs; // Initialize the Python Interpreter Py_Initialize(); // Build the name object pName = PyString_FromString("write_to_xml1"); // Load the module object pModule = PyImport_Import(pName); // pDict is a borrowed reference pDict = PyModule_GetDict(pModule); // pFunc is also a borrowed reference pFunc = PyDict_GetItemString(pDict,"create_report"); if (PyCallable_Check(pFunc)) { PyObject_CallObject(pFunc,NULL); } else { PyErr_Print(); } } void modif_report() { PyObject *pName, *pModule, *pDict, *pFunc, *pValue, *pArgs; // Initialize the Python Interpreter Py_Initialize(); // Build the name object pName = PyString_FromString("write_to_xml1"); // Load the module object pModule = PyImport_Import(pName); // pDict is a borrowed reference pDict = PyModule_GetDict(pModule); // pFunc is also a borrowed reference pFunc = PyDict_GetItemString(pDict,"traite"); if (PyCallable_Check(pFunc)) { PyObject_CallObject(pFunc,NULL); } else { PyErr_Print(); } } int main(int argc, char *argv[]) { create_report(); modif_report(); return(0); } // end main() ---------- status: pending -> open Added file: http://bugs.python.org/file46841/write_to_xml1.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 11:56:14 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 29 Apr 2017 15:56:14 +0000 Subject: [issue30155] Add ability to get/set tzinfo on datetime instances in C API In-Reply-To: <1493047646.24.0.156322797242.issue30155@psf.upfronthosting.co.za> Message-ID: <1493481374.92.0.152539690617.issue30155@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 12:48:42 2017 From: report at bugs.python.org (Priit Oorn) Date: Sat, 29 Apr 2017 16:48:42 +0000 Subject: [issue30209] some UTF8 symbols Message-ID: <1493484522.27.0.538445993706.issue30209@psf.upfronthosting.co.za> New submission from Priit Oorn: It seems that idle has problems with some UTF8 / Unicode characters and loading files that have them inside them. I tried to do code to replace text with other symbols from unicode table. First in idle and pasting the symbol "?" into the idle it caused both the text editor and idle itself to close. Then made edit and paste in notepad.exe for the same file, which seemed to work fine... but when I tried to open the file in idle, it opened an empty editor which was bugged and unable to close and I had to kill it off from taskmanager. (Yes you can edit and write stuff into the empty new file, and even save it, but you can't close it from the top window X button and Exit causes it to close idle and keep the editor window still open) replacements = {'A':'?', 'B':'?', 'C':'?', 'D':'?'} ---------- files: goth - crasher.py messages: 292595 nosy: Priit Oorn priority: normal severity: normal status: open title: some UTF8 symbols type: crash versions: Python 3.6 Added file: http://bugs.python.org/file46842/goth - crasher.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 12:49:03 2017 From: report at bugs.python.org (Priit Oorn) Date: Sat, 29 Apr 2017 16:49:03 +0000 Subject: [issue30209] some UTF8 symbols In-Reply-To: <1493484522.27.0.538445993706.issue30209@psf.upfronthosting.co.za> Message-ID: <1493484543.8.0.456641347788.issue30209@psf.upfronthosting.co.za> Changes by Priit Oorn : ---------- assignee: -> terry.reedy components: +IDLE nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 12:49:30 2017 From: report at bugs.python.org (Priit Oorn) Date: Sat, 29 Apr 2017 16:49:30 +0000 Subject: [issue30209] some UTF8 symbols In-Reply-To: <1493484522.27.0.538445993706.issue30209@psf.upfronthosting.co.za> Message-ID: <1493484570.58.0.119769402789.issue30209@psf.upfronthosting.co.za> Changes by Priit Oorn : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 12:53:42 2017 From: report at bugs.python.org (Priit Oorn) Date: Sat, 29 Apr 2017 16:53:42 +0000 Subject: [issue30209] some UTF8 symbols In-Reply-To: <1493484522.27.0.538445993706.issue30209@psf.upfronthosting.co.za> Message-ID: <1493484822.93.0.110572917193.issue30209@psf.upfronthosting.co.za> Changes by Priit Oorn : Removed file: http://bugs.python.org/file46842/goth - crasher.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 12:53:57 2017 From: report at bugs.python.org (Priit Oorn) Date: Sat, 29 Apr 2017 16:53:57 +0000 Subject: [issue30209] some UTF8 symbols In-Reply-To: <1493484522.27.0.538445993706.issue30209@psf.upfronthosting.co.za> Message-ID: <1493484837.05.0.816933192589.issue30209@psf.upfronthosting.co.za> Changes by Priit Oorn : Added file: http://bugs.python.org/file46843/goth - crasher.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 14:46:02 2017 From: report at bugs.python.org (Anthony Flury) Date: Sat, 29 Apr 2017 18:46:02 +0000 Subject: [issue30210] No Documentation on tkinter dnd module Message-ID: <1493491562.01.0.41832322565.issue30210@psf.upfronthosting.co.za> New submission from Anthony Flury: There is a level of drag and drop support within the tkinter package - namely the tkinter.dnd module. However there is no documentation at this time about drag and drop either on docs.python.org or on the tkinter reference manual. The only documentation available is via the help command in the python console. or by reading the source code - neither of which are the first point of call for documentation. ---------- assignee: docs at python components: Documentation messages: 292596 nosy: anthony-flury, docs at python priority: normal severity: normal status: open title: No Documentation on tkinter dnd module type: enhancement versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 15:20:28 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 19:20:28 +0000 Subject: [issue19417] Bdb: add docstrings and a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493493628.6.0.588992292292.issue19417@psf.upfronthosting.co.za> Terry J. Reedy added the comment: While I have previously done docstrings and tests together, I can see that for this issue, separation might be preferable. Cherl, can you open a new issue and re-title the PR? (I don't know if that will be sufficient to 'move' it, but I hope so.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 15:54:20 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 29 Apr 2017 19:54:20 +0000 Subject: [issue30211] Bdb: add docstrings Message-ID: <1493495660.85.0.350046044168.issue30211@psf.upfronthosting.co.za> New submission from Cheryl Sabella: Add docstrings to Bdb. See issue 19417. ---------- assignee: docs at python components: Documentation messages: 292598 nosy: csabella, docs at python, terry.reedy priority: normal pull_requests: 1467 severity: normal status: open title: Bdb: add docstrings type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 15:56:13 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 29 Apr 2017 19:56:13 +0000 Subject: [issue19417] Bdb: add docstrings and a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493495773.4.0.189699988499.issue19417@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: -1462 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 15:57:35 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 29 Apr 2017 19:57:35 +0000 Subject: [issue19417] Bdb: add docstrings and a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493495855.5.0.739089950084.issue19417@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Moved to issue 30211 for docstrings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 16:02:32 2017 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 29 Apr 2017 20:02:32 +0000 Subject: [issue30209] some UTF8 symbols In-Reply-To: <1493484522.27.0.538445993706.issue30209@psf.upfronthosting.co.za> Message-ID: <1493496152.8.0.540678773724.issue30209@psf.upfronthosting.co.za> Matthew Barnett added the comment: IDLE uses tkinter, which wraps tcl/tk. Versions up to tcl/tk 8.6 can't handle 'astral' codepoints. See also: Issue #30019: IDLE freezes when opening a file with astral characters Issue #21084: IDLE can't deal with characters above the range (U+0000-U+FFFF) ---------- nosy: +mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 16:12:23 2017 From: report at bugs.python.org (John Tapsell) Date: Sat, 29 Apr 2017 20:12:23 +0000 Subject: [issue968063] Add fileinput.islastline() Message-ID: <1493496743.13.0.0677477424374.issue968063@psf.upfronthosting.co.za> John Tapsell added the comment: > If you need islastline() you can use a wrapper: This doesn't work because fileinput.filename() and fileinput.filelineno() are going to be wrong and pointing to the next file. ---------- nosy: +John Tapsell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 16:49:54 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 20:49:54 +0000 Subject: [issue19417] Bdb: add a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493498994.09.0.104589572472.issue19417@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- dependencies: +Bdb: add docstrings title: Bdb: add docstrings and a unittest file (test.test_bdb) -> Bdb: add a unittest file (test.test_bdb) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 18:23:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 29 Apr 2017 22:23:24 +0000 Subject: [issue30014] Speedup DefaultSelectors.modify() by 2x In-Reply-To: Message-ID: STINNER Victor added the comment: I also like the plan starting with refactoring ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 18:24:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 29 Apr 2017 22:24:20 +0000 Subject: [issue30206] data parameter for binascii.b2a_base64 is not positional-only In-Reply-To: <1493457721.34.0.92478948675.issue30206@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Right, my API change was unintentional. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 18:28:38 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 22:28:38 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493504918.81.0.555572942377.issue30208@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 9dc2b3809f38be2e403ee264958106badfda142d by terryjreedy (csabella) in branch 'master': bpo-30208: DOC: fix small typos in IDLE (#1354) https://github.com/python/cpython/commit/9dc2b3809f38be2e403ee264958106badfda142d ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 19:00:02 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 23:00:02 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493506802.61.0.09404862546.issue30208@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thank you for the review. These are definitely bugs. Please check IDLE component also for IDLE doc issues. That will auto-assign them to me. Your first merged PR? If so, congrats. Changes should be applied to at least 3.6, if not 3.5 and 2.7. 3.6 doc should be essentially identical, so I expect merge without conflict. Likely true for others. Can you (easily) prepare the PRs? Can you use the cherry-pick script? ---------- assignee: docs at python -> terry.reedy stage: -> backport needed versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 19:00:23 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 23:00:23 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493506823.88.0.700627829808.issue30208@psf.upfronthosting.co.za> Changes by Terry J. Reedy : ---------- type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 19:08:39 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 23:08:39 +0000 Subject: [issue30209] some UTF8 symbols In-Reply-To: <1493484522.27.0.538445993706.issue30209@psf.upfronthosting.co.za> Message-ID: <1493507319.5.0.806630088631.issue30209@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Duplicate, or close enough, of #30019, which has more on issue. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> IDLE freezes when opening a file with astral characters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 19:09:12 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Apr 2017 23:09:12 +0000 Subject: [issue30019] IDLE freezes when opening a file with astral characters In-Reply-To: <1491596146.33.0.970912299828.issue30019@psf.upfronthosting.co.za> Message-ID: <1493507352.98.0.361068095777.issue30019@psf.upfronthosting.co.za> Terry J. Reedy added the comment: #30209 has a file that cannot be opened and another description of symptoms. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 19:15:35 2017 From: report at bugs.python.org (david-cpi) Date: Sat, 29 Apr 2017 23:15:35 +0000 Subject: [issue30212] test_ssl.py is broken in Centos7 Message-ID: <1493507734.99.0.744824306698.issue30212@psf.upfronthosting.co.za> New submission from david-cpi: To make the test pass, I added the following try statement: try: sock.sendall(buf) except: pass ---------- components: Tests files: test.log messages: 292608 nosy: david-cpi priority: normal severity: normal status: open title: test_ssl.py is broken in Centos7 type: compile error versions: Python 3.5 Added file: http://bugs.python.org/file46844/test.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:24:27 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 30 Apr 2017 00:24:27 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493511867.71.0.60138939465.issue30208@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1468 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:25:28 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 30 Apr 2017 00:25:28 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493511928.16.0.646732875927.issue30208@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1469 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:26:13 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 30 Apr 2017 00:26:13 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493511973.3.0.530795923155.issue30208@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- pull_requests: +1470 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:31:04 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 30 Apr 2017 00:31:04 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493512264.22.0.830412953908.issue30208@psf.upfronthosting.co.za> Cheryl Sabella added the comment: I followed the steps for cherry-pick, but messed up a little as I made 3 PRs instead of one. However, I couldn't do the labels asked for in this section: When a cherry-pick was applied successfully, this script will open up a browser tab that points to the pull request creation page. The url of the pull request page looks similar to the following: https://github.com/python/cpython/compare/3.5...:backport-6de2b78-3.5?expand=1 Apply the appropriate cherry-pick for ... label Press the Create Pull Request button. Remove the needs backport to ... label from the original pull request against master. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:42:05 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Apr 2017 00:42:05 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493512925.7.0.196831784075.issue30208@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 5a8dcec93936de816cef5c17522e48fca9c30b43 by terryjreedy (csabella) in branch '3.6': [3.6] bpo-30208: DOC: fix small typos in IDLE (#1356) https://github.com/python/cpython/commit/5a8dcec93936de816cef5c17522e48fca9c30b43 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:43:13 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Apr 2017 00:43:13 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493512993.26.0.0807175036715.issue30208@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 52630ae17aa5bd8bffdb430b6515d07ffbaabc9e by terryjreedy (csabella) in branch '3.5': [3.5] bpo-30208: DOC: fix small typos in IDLE (#1357) https://github.com/python/cpython/commit/52630ae17aa5bd8bffdb430b6515d07ffbaabc9e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:44:06 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Apr 2017 00:44:06 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493513046.72.0.798630541048.issue30208@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 4734c2d5c0529632e4b51eb75104b50955afd692 by terryjreedy (csabella) in branch '2.7': [2.7] bpo-30208: DOC: fix small typos in IDLE (#1358) https://github.com/python/cpython/commit/4734c2d5c0529632e4b51eb75104b50955afd692 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:49:42 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Apr 2017 00:49:42 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493513382.47.0.888566218904.issue30208@psf.upfronthosting.co.za> Terry J. Reedy added the comment: >From what I have seen, one PR for each branch is correct. I believe cherry-pick.py was initially written by Mariatta. Please bring up any problems or questions using it on core-mentorship, where she and others will see it. ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:51:47 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 30 Apr 2017 00:51:47 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493513507.6.0.860308459159.issue30208@psf.upfronthosting.co.za> Cheryl Sabella added the comment: For this "Please check IDLE component also for IDLE doc issues.", I see the same text as the doc page in idlelib/help/html. Is that the one you want me to change or is that created automatically by Sphinx? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 20:58:02 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Apr 2017 00:58:02 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493513882.04.0.271480612721.issue30208@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I mean 'IDLE' in the Components: box, to the left of the Versions: box, both in the 'classification' frame near the top of this page. ---------- components: +IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 29 21:33:15 2017 From: report at bugs.python.org (BoppreH) Date: Sun, 30 Apr 2017 01:33:15 +0000 Subject: [issue30213] ZipFile from 'a'ppend-mode file generates invalid zip Message-ID: <1493515995.55.0.223691905377.issue30213@psf.upfronthosting.co.za> New submission from BoppreH: I may be misunderstanding file modes or the `zipfile` library, but from zipfile import ZipFile ZipFile(open('a.zip', 'ab'), 'a').writestr('f.txt', 'z') unexpectedly creates an invalid zip file. 7zip is able to open and show the file list, but files inside look empty, and Windows simply says it's invalid. Changing the file mode from `ab` to `wb+` fixes the problem, but truncates the file, and `rb+` doesn't create the file. Calling `close` on both the `open` and `ZipFile` doesn't help either. Using `ZipFile(...).open` instead of `writestr` has the same problem. I could only reproduce this on [Windows 10, Python 3.6.1, 64 bit]. The zip file was proper on [Windows 10, Python 3.3.5, 32 bit], [Windows 10 Bash, Python 3.4.3, 64 bit], and [FreeBSD, Python 3.5.3, 64 bit]. This is my first bug report, so forgive me if I made any mistakes. ---------- components: Library (Lib), Windows messages: 292616 nosy: BoppreH, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: ZipFile from 'a'ppend-mode file generates invalid zip type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 00:35:48 2017 From: report at bugs.python.org (Decorater) Date: Sun, 30 Apr 2017 04:35:48 +0000 Subject: [issue30214] make_zip.py lacks command a few line options and has a bug. Message-ID: <1493526948.12.0.00156119032978.issue30214@psf.upfronthosting.co.za> New submission from Decorater: make_zip.py does not offer the options to include tests with the tkinner stuff when making the full distributions immediately after building python using MSVC. Basically running makezip like this: ".\PCbuild\amd64\python.exe" ".\Tools\msi\make_zip.py" -a x64 -o ".\python36-x86-x64" or like this: ".\PCbuild\win32\python.exe" ".\Tools\msi\make_zip.py" -o ".\python36-x86" does not even include the tests and tkinner stuff that is optional when installing python by the installer. I would like command sqitches to be able to if desired. Also on the 64 bit copy it does mess up where none of the libs\*.lib, nor any of the assemblies are copied. And is reproducible on me. ---------- components: Demos and Tools, Tkinter, Windows messages: 292617 nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: make_zip.py lacks command a few line options and has a bug. versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 01:21:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Apr 2017 05:21:39 +0000 Subject: [issue30215] Make re.compile() locale agnostic Message-ID: <1493529699.82.0.722013579131.issue30215@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Currently the result of re.compile() with the re.LOCALE flag depends on the locale at compile time. The locale at matching time should be the same as the locale at compile time, otherwise the matching can work incorrectly. This complicates caching in module global functions and increase the chance of race condition. Proposed patch makes re.compile() not depending on locale. Only the locale at matching time affects the result of matching. This is more comprehensive solution of issue22410. ---------- components: Extension Modules, Library (Lib), Regular Expressions messages: 292618 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Make re.compile() locale agnostic type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 01:37:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Apr 2017 05:37:20 +0000 Subject: [issue30215] Make re.compile() locale agnostic In-Reply-To: <1493529699.82.0.722013579131.issue30215@psf.upfronthosting.co.za> Message-ID: <1493530640.42.0.160005448557.issue30215@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- pull_requests: +1471 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 01:38:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Apr 2017 05:38:39 +0000 Subject: [issue22410] Locale dependent regexps on different locales In-Reply-To: <1410711803.67.0.827066928752.issue22410@psf.upfronthosting.co.za> Message-ID: <1493530719.08.0.906033069932.issue22410@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Opened issue30215 for more comprehensive solution. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 03:56:15 2017 From: report at bugs.python.org (Masayuki Yamamoto) Date: Sun, 30 Apr 2017 07:56:15 +0000 Subject: [issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX In-Reply-To: <1447861816.88.0.632584646231.issue25658@psf.upfronthosting.co.za> Message-ID: <1493538975.17.0.948412556906.issue25658@psf.upfronthosting.co.za> Changes by Masayuki Yamamoto : ---------- pull_requests: +1472 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 04:37:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Apr 2017 08:37:00 +0000 Subject: [issue30207] Rename test.test_support to test.support in 2.7 In-Reply-To: <1493463126.66.0.743875413442.issue30207@psf.upfronthosting.co.za> Message-ID: <1493541420.05.0.599979760259.issue30207@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a694e092f6356970ca0d3e86000a3a829fb212b4 by Serhiy Storchaka in branch '2.7': bpo-30207: Rename test.test_support to test.support. (#1353) https://github.com/python/cpython/commit/a694e092f6356970ca0d3e86000a3a829fb212b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 04:38:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Apr 2017 08:38:10 +0000 Subject: [issue30207] Rename test.test_support to test.support in 2.7 In-Reply-To: <1493463126.66.0.743875413442.issue30207@psf.upfronthosting.co.za> Message-ID: <1493541490.53.0.583735628816.issue30207@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 05:21:39 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 30 Apr 2017 09:21:39 +0000 Subject: [issue19417] Bdb: add a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1493544099.76.0.381899962515.issue19417@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Thanks Terry and Cheryl for splitting the issue :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 05:22:52 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 30 Apr 2017 09:22:52 +0000 Subject: [issue30208] Small typos in IDLE doc In-Reply-To: <1493473358.59.0.135881718149.issue30208@psf.upfronthosting.co.za> Message-ID: <1493544171.99.0.761958852892.issue30208@psf.upfronthosting.co.za> Cheryl Sabella added the comment: LOL, well I made that a lot harder than you intended. :-) ---------- components: -Documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 06:12:58 2017 From: report at bugs.python.org (Antoine Pietri) Date: Sun, 30 Apr 2017 10:12:58 +0000 Subject: [issue30177] pathlib.resolve(strict=False) only includes first child In-Reply-To: <1493223585.29.0.982122563762.issue30177@psf.upfronthosting.co.za> Message-ID: <1493547178.52.0.909257102333.issue30177@psf.upfronthosting.co.za> Antoine Pietri added the comment: I can reproduce this bug. This behavior is really confusing. ---------- nosy: +seirl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 06:38:20 2017 From: report at bugs.python.org (Christian Heimes) Date: Sun, 30 Apr 2017 10:38:20 +0000 Subject: [issue29136] Add OP_NO_TLSv1_3 In-Reply-To: <1483391244.76.0.29431388133.issue29136@psf.upfronthosting.co.za> Message-ID: <1493548700.14.0.91062682661.issue29136@psf.upfronthosting.co.za> Changes by Christian Heimes : ---------- pull_requests: +1473 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 07:12:49 2017 From: report at bugs.python.org (Rupert Nash) Date: Sun, 30 Apr 2017 11:12:49 +0000 Subject: [issue30216] xdrlib.Unpacker.unpack_string returns bytes (docs say should be str) Message-ID: <1493550769.45.0.572734600084.issue30216@psf.upfronthosting.co.za> New submission from Rupert Nash: According to the docs this method should return a str, but it returns bytes https://docs.python.org/3.6/library/xdrlib.html#xdrlib.Unpacker.unpack_string I can see three options: a default encoding should be applied the documentation updated to make clear this returns bytes the method removed and just rely on the existing unpack_bytes which does what you'd expect (and in fact the two methods are aliases) ---------- components: Library (Lib) messages: 292624 nosy: rnash priority: normal severity: normal status: open title: xdrlib.Unpacker.unpack_string returns bytes (docs say should be str) type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 07:23:11 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 30 Apr 2017 11:23:11 +0000 Subject: [issue30210] No Documentation on tkinter dnd module In-Reply-To: <1493491562.01.0.41832322565.issue30210@psf.upfronthosting.co.za> Message-ID: <1493551391.88.0.177288031572.issue30210@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +gpolo, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 07:38:59 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 30 Apr 2017 11:38:59 +0000 Subject: [issue30211] Bdb: add docstrings In-Reply-To: <1493495660.85.0.350046044168.issue30211@psf.upfronthosting.co.za> Message-ID: <1493552339.43.0.305345223936.issue30211@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- components: +IDLE -Documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 07:39:09 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 30 Apr 2017 11:39:09 +0000 Subject: [issue30211] Bdb: add docstrings In-Reply-To: <1493495660.85.0.350046044168.issue30211@psf.upfronthosting.co.za> Message-ID: <1493552349.02.0.0712819254328.issue30211@psf.upfronthosting.co.za> Changes by Cheryl Sabella : ---------- components: +Documentation -IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 07:40:36 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 30 Apr 2017 11:40:36 +0000 Subject: [issue30212] test_ssl.py is broken in Centos7 In-Reply-To: <1493507734.99.0.744824306698.issue30212@psf.upfronthosting.co.za> Message-ID: <1493552436.67.0.204841271265.issue30212@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +haypo, xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 07:45:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Apr 2017 11:45:55 +0000 Subject: [issue30210] No Documentation on tkinter dnd module In-Reply-To: <1493491562.01.0.41832322565.issue30210@psf.upfronthosting.co.za> Message-ID: <1493552755.51.0.348717075494.issue30210@psf.upfronthosting.co.za> Changes by Serhiy Storchaka : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 07:46:48 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 30 Apr 2017 11:46:48 +0000 Subject: [issue30213] ZipFile from 'a'ppend-mode file generates invalid zip In-Reply-To: <1493515995.55.0.223691905377.issue30213@psf.upfronthosting.co.za> Message-ID: <1493552808.38.0.864248816104.issue30213@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 07:52:00 2017 From: report at bugs.python.org (Masayuki Yamamoto) Date: Sun, 30 Apr 2017 11:52:00 +0000 Subject: [issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX In-Reply-To: <1447861816.88.0.632584646231.issue25658@psf.upfronthosting.co.za> Message-ID: <1493553120.45.0.0783751595271.issue25658@psf.upfronthosting.co.za> Masayuki Yamamoto added the comment: Victor, The tracemalloc module is not available on platforms that provides own TLS implementation that uses PyMem_* functions. In the own implementation, it occurs deadlock by recursion call in thread key search. PyOnceVar API handles extendable array by using PyMem_Reallloc, therefore, I think TSS key initialization using the API will raise deadlock likewise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 08:05:43 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 30 Apr 2017 12:05:43 +0000 Subject: [issue15346] Tkinter extention modules have no documentation In-Reply-To: <1342198047.2.0.619885102312.issue15346@psf.upfronthosting.co.za> Message-ID: <1493553943.55.0.561475227991.issue15346@psf.upfronthosting.co.za> Changes by Martin Panter : ---------- dependencies: +No Documentation on tkinter dnd module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 08:14:13 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 30 Apr 2017 12:14:13 +0000 Subject: [issue30145] Create a How to or Tutorial documentation for asyncio In-Reply-To: <1492960602.26.0.461554169011.issue30145@psf.upfronthosting.co.za> Message-ID: <1493554453.56.0.851518967608.issue30145@psf.upfronthosting.co.za> Martin Panter added the comment: See Issue 27579, where Victor wanted to focus on outside of Python. ---------- nosy: +haypo, martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 08:14:38 2017 From: report at bugs.python.org (Marien Zwart) Date: Sun, 30 Apr 2017 12:14:38 +0000 Subject: [issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select() In-Reply-To: <1488484095.89.0.988668664064.issue29700@psf.upfronthosting.co.za> Message-ID: <1493554478.48.0.0706002847963.issue29700@psf.upfronthosting.co.za> Marien Zwart added the comment: GNU readline 7.0 introduces the problematic use of pselect(). GNU readline 6.3 is unaffected (and presumably older versions as well). I didn't check other implementations. I'll see if I can get this fixed in GNU readline. The non-select code is still there, and the NEWS file says pselect is used because SIGWINCH interrupts it, while it doesn't interrupt read(). So maybe readline can fall through to the old code if a high FD is used, since it doesn't regress functionality that much (while adding poll support to readline would run into similar portability issues as we're seeing here). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 08:23:32 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 30 Apr 2017 12:23:32 +0000 Subject: [issue26253] tarfile in stream mode always set zlib compression level to 9 In-Reply-To: <1454288123.43.0.462874591937.issue26253@psf.upfronthosting.co.za> Message-ID: <1493555012.98.0.634617625704.issue26253@psf.upfronthosting.co.za> Xiang Zhang added the comment: *compresslevel* takes effect for modes 'w:gz', 'r:gz', 'w:bz2', 'r:bz2', 'x:gz', 'x:bz2'. For stream modes, 'r|gz', 'w|gz', 'r|bz2', 'w|bz2', the *compresslevel* doesn't make sense. It seems not hard to make it possible but I'm not sure it's worth it or there is any reason it's hard-coded. ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 08:59:51 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 30 Apr 2017 12:59:51 +0000 Subject: [issue30216] xdrlib.Unpacker.unpack_string returns bytes (docs say should be str) In-Reply-To: <1493550769.45.0.572734600084.issue30216@psf.upfronthosting.co.za> Message-ID: <1493557191.93.0.132319057818.issue30216@psf.upfronthosting.co.za> Xiang Zhang added the comment: xdrlib doc seems still remain in 2.x world. 'string' is used to represent 'bytes'. And some methods' names like pack_fstring, pack_string seem not suitable in 3.x world. ---------- nosy: +haypo, serhiy.storchaka, xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 10:28:51 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 30 Apr 2017 14:28:51 +0000 Subject: [issue30195] writing non-ascii characters in xml file using python code embedded in C In-Reply-To: <1493374492.88.0.89710812833.issue30195@psf.upfronthosting.co.za> Message-ID: <1493562531.66.0.94494842519.issue30195@psf.upfronthosting.co.za> Xiang Zhang added the comment: IMHO this doesn't look like an error in xml library. With a little tweak in of your problem: adding encoding declaration, removing not needed imports, replace open with codecs.open(encoding='utf8') in create_report, the C problem works fine for me: [tmp]$ cat essai_rapport_test_30-04-2017-22-22_??.xml xml_file.write(doc.toprettyxml()) fails for me since ascii codecs cannot encode the result of doc.toprettyxml, a unicode. And I would suggest you adding failure checks to your C program. Almost every step could fail and then result in a segfault. ---------- nosy: +xiang.zhang status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 10:46:21 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 30 Apr 2017 14:46:21 +0000 Subject: [issue26143] Ensure that IDLE's stdlib imports are from the stdlib In-Reply-To: <1453089950.28.0.356846327087.issue26143@psf.upfronthosting.co.za> Message-ID: <1493563581.39.0.223002583292.issue26143@psf.upfronthosting.co.za> Changes by Louie Lu : ---------- pull_requests: +1474 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 10:48:48 2017 From: report at bugs.python.org (mahboubi) Date: Sun, 30 Apr 2017 14:48:48 +0000 Subject: [issue30195] writing non-ascii characters in xml file using python code embedded in C In-Reply-To: <1493374492.88.0.89710812833.issue30195@psf.upfronthosting.co.za> Message-ID: <1493563728.93.0.670631184551.issue30195@psf.upfronthosting.co.za> mahboubi added the comment: Thank you xiang zhang for your reply. I think that the problem is not in xml_file.write(doc.toprettyxml()) because it works using python only, and the C problem dosen't work since you didn't get any 'alerte' balise. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 10:51:11 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 30 Apr 2017 14:51:11 +0000 Subject: [issue26143] Ensure that IDLE's stdlib imports are from the stdlib In-Reply-To: <1453089950.28.0.356846327087.issue26143@psf.upfronthosting.co.za> Message-ID: <1493563871.84.0.759107879612.issue26143@psf.upfronthosting.co.za> Louie Lu added the comment: Because sys module is correctly imported, we can modify sys.path to change the import behave. Add new PR 1364 for this. This add a new private function `_fix_import_path` that will remove the local import path `''`, when running IDLE from command line, it will recover the import path at the end of the argparse part. So no need to worry about user to import other local modules. That also mean, if our user has the same name file, they will not be able to import it anymore. (cause IDLE import it first). ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 10:51:56 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 30 Apr 2017 14:51:56 +0000 Subject: [issue30195] writing non-ascii characters in xml file using python code embedded in C In-Reply-To: <1493374492.88.0.89710812833.issue30195@psf.upfronthosting.co.za> Message-ID: <1493563916.71.0.379364201044.issue30195@psf.upfronthosting.co.za> Xiang Zhang added the comment: But I didn't see any crash either. You'd better provide a simple reproduce program, not involving so much logic. Or could you debug it and provide a crash backtrace? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 11:03:16 2017 From: report at bugs.python.org (mahboubi) Date: Sun, 30 Apr 2017 15:03:16 +0000 Subject: [issue30195] writing non-ascii characters in xml file using python code embedded in C In-Reply-To: <1493374492.88.0.89710812833.issue30195@psf.upfronthosting.co.za> Message-ID: <1493564596.45.0.0562948639205.issue30195@psf.upfronthosting.co.za> mahboubi added the comment: Also, using codecs.open(encoding='utf8') gives unhadled exception in C? but no problem using python code only. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 11:46:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Apr 2017 15:46:33 +0000 Subject: [issue30216] xdrlib.Unpacker.unpack_string returns bytes (docs say should be str) In-Reply-To: <1493550769.45.0.572734600084.issue30216@psf.upfronthosting.co.za> Message-ID: <1493567193.62.0.574240400497.issue30216@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The term "string" in names like "pack_string" refers to the XDR standard (RFC 1014). They have to stay, but the documentation must be updated to make clear that they work with bytes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 11:57:25 2017 From: report at bugs.python.org (Xiang Zhang) Date: Sun, 30 Apr 2017 15:57:25 +0000 Subject: [issue30216] xdrlib.Unpacker.unpack_string returns bytes (docs say should be str) In-Reply-To: <1493550769.45.0.572734600084.issue30216@psf.upfronthosting.co.za> Message-ID: <1493567845.4.0.414399860954.issue30216@psf.upfronthosting.co.za> Changes by Xiang Zhang : ---------- stage: -> needs patch versions: +Python 3.5, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 13:06:31 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 30 Apr 2017 17:06:31 +0000 Subject: [issue19903] Idle: Use inspect.signature for calltips In-Reply-To: <1386289306.22.0.0855188637089.issue19903@psf.upfronthosting.co.za> Message-ID: <1493571991.56.0.698568324255.issue19903@psf.upfronthosting.co.za> Louie Lu added the comment: I'm now testing to change getfullargspect to signature. It came out that signature can't accept bound method with only _VAR_KEYWORD. This test case will gave a ValueError: >>> class C: def m2(**kw): pass >>> c = C() >>> ip.signature(c.m2) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/inspect.py", line 3002, in signature return Signature.from_callable(obj, follow_wrapped=follow_wrapped) File "/usr/lib/python3.6/inspect.py", line 2752, in from_callable follow_wrapper_chains=follow_wrapped) File "/usr/lib/python3.6/inspect.py", line 2169, in _signature_from_callable return _signature_bound_method(sig) File "/usr/lib/python3.6/inspect.py", line 1759, in _signature_bound_method raise ValueError('invalid method signature') ValueError: invalid method signature ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 13:11:33 2017 From: report at bugs.python.org (Louie Lu) Date: Sun, 30 Apr 2017 17:11:33 +0000 Subject: [issue20401] inspect.signature removes initial starred method params (bug) In-Reply-To: <1390788993.17.0.660022728639.issue20401@psf.upfronthosting.co.za> Message-ID: <1493572293.31.0.175007854103.issue20401@psf.upfronthosting.co.za> Louie Lu added the comment: Is there any reason that the second case Terry provide still will failed with ValueError? class C: def meth2(**kwds): pass ip.signature(C().meth2) Traceback (most recent call last): File "/home/linux/Python/cpython/Lib/idlelib/idle_test/test_calltips.py", line 139, in test_starred_parameter self.assertEqual(signature(meth), mtip) File "/home/linux/Python/cpython/Lib/idlelib/calltips.py", line 149, in get_argspec argspec = str(inspect.signature(fob)) File "/home/linux/Python/cpython/Lib/inspect.py", line 3028, in signature return Signature.from_callable(obj, follow_wrapped=follow_wrapped) File "/home/linux/Python/cpython/Lib/inspect.py", line 2778, in from_callable follow_wrapper_chains=follow_wrapped) File "/home/linux/Python/cpython/Lib/inspect.py", line 2195, in _signature_from_callable return _signature_bound_method(sig) File "/home/linux/Python/cpython/Lib/inspect.py", line 1785, in _signature_bound_method raise ValueError('invalid method signature') ValueError: invalid method signature ---------- nosy: +louielu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 13:14:36 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 30 Apr 2017 17:14:36 +0000 Subject: [issue30145] Create a How to or Tutorial documentation for asyncio In-Reply-To: <1492960602.26.0.461554169011.issue30145@psf.upfronthosting.co.za> Message-ID: <1493572476.03.0.591393936565.issue30145@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: I think it will still be useful to have an authoritative tutorial within CPython docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 14:51:38 2017 From: report at bugs.python.org (mahboubi) Date: Sun, 30 Apr 2017 18:51:38 +0000 Subject: [issue30195] writing non-ascii characters in xml file using python code embedded in C In-Reply-To: <1493374492.88.0.89710812833.issue30195@psf.upfronthosting.co.za> Message-ID: <1493578298.89.0.168553699177.issue30195@psf.upfronthosting.co.za> mahboubi added the comment: Probably it's my fault to use the word 'crash', what I mean is that generated report by python program contains the right result(the 'alerte' balise is added) but the other report generated by the same python program embedde in C didn't give the right result (report is created but no 'alerte' balise is added) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 14:59:04 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Apr 2017 18:59:04 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493578744.82.0.402288093063.issue30200@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Frank, bigger is not better for demonstrating a problem. The only thing needed for this issue is a tk window with two list boxes. Having to click twice to get a window with more than just the two Listboxes is just noise. Anyway, I downloaded the file as tem.py into a directory on the path and ran "py -x.y -m tem" with the 3 x,y pairs. For 3.6 I see the traceback Louie Lu posted -- **for 2.7**. Since clicking in box 2 after clicking in box 1 changes the selection set in *both* boxes, on all 3 versions, there should a <> event for both, on all 3 versions, as specified in the tcl/tk doc that I quoted. I believe it was a bug when the deselect event did not happen. On Windows, 2.7.13 uses tk 8.5.15, 3.5.z uses tk 8.6.4, and 3.6.z uses tk 8.6.6. My hypothesis is that the bug of not raising an event for the deselect, at least on Windows, was fixed in tk in 8.6.5/6. If so, this should be closed as 'not a bug'. Louie, what tk x.y.z do you have on your linux? Serhiy, did you change anything in tkinter for 8.6 that could have affected <> events? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 15:56:00 2017 From: report at bugs.python.org (Eric O. LEBIGOT) Date: Sun, 30 Apr 2017 19:56:00 +0000 Subject: [issue30217] Missing entry for the tilde (~) operator in the Index Message-ID: <1493582160.76.0.882487661277.issue30217@psf.upfronthosting.co.za> New submission from Eric O. LEBIGOT: The index (https://docs.python.org/3.6/genindex-Symbols.html) is missing an entry for the tilde operator ~ (there is also no entry under "tilde"). A relevant pointer could be to object.__invert__ (https://docs.python.org/3.6/reference/datamodel.html#object.__invert__). ---------- assignee: docs at python components: Documentation messages: 292641 nosy: docs at python, lebigot priority: normal severity: normal status: open title: Missing entry for the tilde (~) operator in the Index type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 16:17:12 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sun, 30 Apr 2017 20:17:12 +0000 Subject: [issue28556] typing.py upgrades In-Reply-To: <1477756009.46.0.442279756181.issue28556@psf.upfronthosting.co.za> Message-ID: <1493583432.93.0.860250102577.issue28556@psf.upfronthosting.co.za> Changes by Ivan Levkivskyi : ---------- pull_requests: +1475 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 17:50:48 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 30 Apr 2017 21:50:48 +0000 Subject: [issue30218] shutil.unpack_archive doesn't support PathLike Message-ID: <1493589048.1.0.871428133703.issue30218@psf.upfronthosting.co.za> New submission from Jelle Zijlstra: According to PEP 519, it should. I'll submit a PR soon. ---------- components: Library (Lib) messages: 292642 nosy: Jelle Zijlstra, brett.cannon, tarek priority: normal severity: normal status: open title: shutil.unpack_archive doesn't support PathLike versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 18:00:11 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 30 Apr 2017 22:00:11 +0000 Subject: [issue30218] shutil.unpack_archive doesn't support PathLike In-Reply-To: <1493589048.1.0.871428133703.issue30218@psf.upfronthosting.co.za> Message-ID: <1493589611.3.0.710337760361.issue30218@psf.upfronthosting.co.za> Changes by Jelle Zijlstra : ---------- pull_requests: +1476 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 18:01:40 2017 From: report at bugs.python.org (Frank Pae) Date: Sun, 30 Apr 2017 22:01:40 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493589700.45.0.246838289802.issue30200@psf.upfronthosting.co.za> Frank Pae added the comment: I am not a profi, just a normal user, i do what i can so good i can I would like to thank all python developers (AND: I think your last question ist the right question) ---------- resolution: -> not a bug stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 18:27:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Sun, 30 Apr 2017 22:27:57 +0000 Subject: [issue30145] Create a How to or Tutorial documentation for asyncio In-Reply-To: <1493572476.03.0.591393936565.issue30145@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Mariatta Wijaya added the comment: I think it will still be useful to have an authoritative tutorial within CPython docs. The problem is that Python stdlib is quite limited: no HTTP, no SQL client, etc. An external tutorial can use 3rd party modules like aiohttp. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 18:30:32 2017 From: report at bugs.python.org (Yury Selivanov) Date: Sun, 30 Apr 2017 22:30:32 +0000 Subject: [issue30145] Create a How to or Tutorial documentation for asyncio In-Reply-To: <1492960602.26.0.461554169011.issue30145@psf.upfronthosting.co.za> Message-ID: <1493591432.69.0.444740565249.issue30145@psf.upfronthosting.co.za> Yury Selivanov added the comment: > The problem is that Python stdlib is quite limited: no HTTP, no SQL client, etc. An external tutorial can use 3rd party modules like aiohttp. Even without aiohttp we can show how to use asyncio correctly. I agree with Mariatta that we should have a tutorial etc. Working on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 21:01:27 2017 From: report at bugs.python.org (Louie Lu) Date: Mon, 01 May 2017 01:01:27 +0000 Subject: [issue30200] tkinter ListboxSelect In-Reply-To: <1493394127.57.0.90610531486.issue30200@psf.upfronthosting.co.za> Message-ID: <1493600487.67.0.524508213311.issue30200@psf.upfronthosting.co.za> Louie Lu added the comment: ah, I think Terry point out the problem behind why my 2.7 and Frank's 2.7 have different behavior. I'm using tk 8.6.6-1 on Linux, and it may be the problem from tk version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 21:26:00 2017 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 01 May 2017 01:26:00 +0000 Subject: [issue29679] Add @contextlib.asynccontextmanager In-Reply-To: <1488324069.16.0.696570474408.issue29679@psf.upfronthosting.co.za> Message-ID: <1493601960.53.0.889257720143.issue29679@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset 2e624690bd74071358566300b7ef0bc45f444a30 by Yury Selivanov (Jelle Zijlstra) in branch 'master': bpo-29679: Implement @contextlib.asynccontextmanager (#360) https://github.com/python/cpython/commit/2e624690bd74071358566300b7ef0bc45f444a30 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 22:48:05 2017 From: report at bugs.python.org (Tim Chase) Date: Mon, 01 May 2017 02:48:05 +0000 Subject: [issue26362] Approved API for creating a temporary file path In-Reply-To: <1455502271.6.0.558905453707.issue26362@psf.upfronthosting.co.za> Message-ID: <1493606885.95.0.919205719406.issue26362@psf.upfronthosting.co.za> Tim Chase added the comment: As requested by Ben Finney[1], adding my use-case here. I'm attempting to make a hard-link from "a" to "b", but if "b" exists, os.link() will fail with an EEXISTS. I don't want to do os.unlink("b") # power-outage here means "b" is gone os.link("a", "b") I can do something like temp_name = tempfile.mktemp(dir=".") os.link("a", temp_name) try: os.rename(temp_name, "b") # docs guarantee this is atomic except OSError: os.unlink(temp_name) but mktemp() is marked as deprecated. I'm okay with the stray temp-file floating around to clean up in the event of power-loss after the os.link() but before the os.unlink() call, as is new info, not disposing of existing file-names [1] https://mail.python.org/pipermail/python-list/2017-April/721641.html ---------- nosy: +gumnos _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 30 23:30:25 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 01 May 2017 03:30:25 +0000 Subject: [issue30196] Add __matmul__ to collections.Counter In-Reply-To: <1493374760.56.0.320449301178.issue30196@psf.upfronthosting.co.za> Message-ID: <1493609425.28.0.722113603072.issue30196@psf.upfronthosting.co.za> Changes by Raymond Hettinger : ---------- resolution: -> rejected stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________