From report at bugs.python.org Wed Nov 1 00:06:40 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 01 Nov 2017 04:06:40 +0000 Subject: [issue31454] Include "import as" in tutorial In-Reply-To: <1505317940.24.0.986048971751.issue31454@psf.upfronthosting.co.za> Message-ID: <1509509200.74.0.213398074469.issue31454@psf.upfronthosting.co.za> Berker Peksag added the comment: I just reviewed Mario's pull request. Should we mention the "from fibo import fib as fibonacci" syntax too? ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 01:09:27 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 01 Nov 2017 05:09:27 +0000 Subject: [issue31908] trace module cli does not write cover files In-Reply-To: <1509418506.94.0.213398074469.issue31908@psf.upfronthosting.co.za> Message-ID: <1509512967.49.0.213398074469.issue31908@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 01:13:18 2017 From: report at bugs.python.org (Chi Hsuan Yen) Date: Wed, 01 Nov 2017 05:13:18 +0000 Subject: [issue31916] ensurepip not honoring value of $(DESTDIR) - pip not installed In-Reply-To: <1509502125.3.0.213398074469.issue31916@psf.upfronthosting.co.za> Message-ID: <1509513198.56.0.213398074469.issue31916@psf.upfronthosting.co.za> Chi Hsuan Yen added the comment: This is a pip bug https://github.com/pypa/pip/issues/3063 ---------- nosy: +Chi Hsuan Yen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 01:18:09 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 01 Nov 2017 05:18:09 +0000 Subject: [issue30824] Add mimetype for extension .json In-Reply-To: <1498937496.5.0.283718177471.issue30824@psf.upfronthosting.co.za> Message-ID: <1509513489.99.0.213398074469.issue30824@psf.upfronthosting.co.za> Berker Peksag added the comment: 3.5 is now in security-fix-only mode so I'm closing this one as 'fixed'. Thank you, all. ---------- nosy: +berker.peksag resolution: -> fixed stage: backport needed -> resolved status: open -> closed versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 01:31:38 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 01 Nov 2017 05:31:38 +0000 Subject: [issue31298] Error when calling numpy.astype In-Reply-To: <1503972629.82.0.848961693934.issue31298@psf.upfronthosting.co.za> Message-ID: <1509514298.64.0.213398074469.issue31298@psf.upfronthosting.co.za> Berker Peksag added the comment: Chris is right. Please report this to numpy developers. We can always reopen this issue if they decide that this is an issue in Python. Thank you. By the way, I cannot reproduce the crash with numpy 1.13.3. ---------- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 03:51:22 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 01 Nov 2017 07:51:22 +0000 Subject: [issue31390] pydoc.Helper.keywords missing async and await In-Reply-To: <1504830840.14.0.251676747088.issue31390@psf.upfronthosting.co.za> Message-ID: <1509522682.03.0.213398074469.issue31390@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for your report. Prior to Python 3.7, async and await keywords have had special meanings and they weren't treated as normal keywords. They are now in Python 3.7: >>> async = 42 File "", line 1 async = 42 ^ SyntaxError: invalid syntax And they are listed as keywords: $ ./python -m pydoc keywords Here is a list of the Python keywords. Enter any keyword to get more help. False class from or None continue global pass True def if raise and del import return as elif in try assert else is while async except lambda with await finally nonlocal yield break for not So I don't think we should modify pydoc to list them as keywords in Python 3.6. ---------- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 04:14:56 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 01 Nov 2017 08:14:56 +0000 Subject: [issue31412] wave.open does not accept PathLike objects In-Reply-To: <1505068863.95.0.795471770388.issue31412@psf.upfronthosting.co.za> Message-ID: <1509524096.22.0.213398074469.issue31412@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 05:01:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 09:01:18 +0000 Subject: [issue31412] wave.open does not accept PathLike objects In-Reply-To: <1505068863.95.0.795471770388.issue31412@psf.upfronthosting.co.za> Message-ID: <1509526878.63.0.213398074469.issue31412@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: wave is a one of three audio file modules (aifc, sunau, wave) that should have the same interface. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 05:55:52 2017 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0LDRgiDQndCw0LPQsNC10LI=?=) Date: Wed, 01 Nov 2017 09:55:52 +0000 Subject: [issue31918] D Message-ID: <1509530152.12.0.213398074469.issue31918@psf.upfronthosting.co.za> Change by ????? ?????? : ---------- nosy: ????? ?????? priority: normal severity: normal status: open title: D type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 05:58:59 2017 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0LDRgiDQndCw0LPQsNC10LI=?=) Date: Wed, 01 Nov 2017 09:58:59 +0000 Subject: [issue31918] Don't let all python code modify modules Message-ID: <1509530339.62.0.213398074469.issue31918@psf.upfronthosting.co.za> New submission from ????? ?????? : import os os="os" #I think it's bad, os and other modules constants ---------- title: D -> Don't let all python code modify modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:00:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 10:00:37 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1509530437.17.0.213398074469.issue31626@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:01:00 2017 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0LDRgiDQndCw0LPQsNC10LI=?=) Date: Wed, 01 Nov 2017 10:01:00 +0000 Subject: [issue31918] Don't let all python code modify modules In-Reply-To: <1509530339.62.0.213398074469.issue31918@psf.upfronthosting.co.za> Message-ID: <1509530460.86.0.213398074469.issue31918@psf.upfronthosting.co.za> Change by ????? ?????? : ---------- components: +Extension Modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:03:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 10:03:10 +0000 Subject: [issue31918] Don't let all python code modify modules In-Reply-To: <1509530339.62.0.213398074469.issue31918@psf.upfronthosting.co.za> Message-ID: <1509530590.44.0.213398074469.issue31918@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: You haven't modified the os module. You have just binded a new value to the os variable. You can assign arbitrary values to your variables, this is a feature of Python. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:03:59 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 01 Nov 2017 10:03:59 +0000 Subject: [issue9674] make install DESTDIR=/home/blah fails when the prefix specified is / In-Reply-To: <1282677588.85.0.771807305266.issue9674@psf.upfronthosting.co.za> Message-ID: <1509530639.92.0.213398074469.issue9674@psf.upfronthosting.co.za> Xavier de Gaye added the comment: The problem is that the build system , Py_GetPath() and the distutils module do not handle correctly the case where the configure prefix is '/'. Closing as a duplicate of issue 31114. ---------- resolution: -> duplicate stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:20:24 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 01 Nov 2017 10:20:24 +0000 Subject: [issue30442] Skip test_xml_etree under coverage In-Reply-To: <1495562562.53.0.327833904863.issue30442@psf.upfronthosting.co.za> Message-ID: <1509531624.46.0.213398074469.issue30442@psf.upfronthosting.co.za> Berker Peksag added the comment: All PRs have been merged and 3.5 is now in security-fix-only mode. Closing this as 'fixed'. ---------- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:41:48 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 01 Nov 2017 10:41:48 +0000 Subject: [issue18835] Add PyMem_AlignedAlloc() In-Reply-To: <1377484371.18.0.399621580043.issue18835@psf.upfronthosting.co.za> Message-ID: <1509532908.51.0.213398074469.issue18835@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I agree, if the two primary users say they won't use it, it doesn't make sense for us to maintain 600 hundred lines of low-level C code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:50:25 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 01 Nov 2017 10:50:25 +0000 Subject: [issue31908] trace module cli does not write cover files In-Reply-To: <1509418506.94.0.213398074469.issue31908@psf.upfronthosting.co.za> Message-ID: <1509533425.99.0.213398074469.issue31908@psf.upfronthosting.co.za> Berker Peksag added the comment: I think the first part of your patch also fixes issue 26818. Could you adapt the test there and add a test case for the problem in this issue? ---------- nosy: +berker.peksag versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:53:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 10:53:38 +0000 Subject: [issue31919] Make curses compiling on OpenIndiana and tests passing Message-ID: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The proposed PR makes curses compiling on OpenIndiana (2017.04) and fixes tests. I suppose it fixes issues on Solaris too. ---------- assignee: serhiy.storchaka components: Extension Modules messages: 305368 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Make curses compiling on OpenIndiana and tests passing type: compile error versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 07:02:12 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 01 Nov 2017 11:02:12 +0000 Subject: [issue28791] update sqlite to latest version before beta 1 In-Reply-To: <1480017928.89.0.263397799958.issue28791@psf.upfronthosting.co.za> Message-ID: <1509534132.34.0.213398074469.issue28791@psf.upfronthosting.co.za> Berker Peksag added the comment: > In an effort to not forget about this, I'm setting it to deferred blocker. Should we mark issue 30952 'deferred blocker' too? ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 07:46:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 11:46:47 +0000 Subject: [issue31919] Make curses compiling on OpenIndiana and tests passing In-Reply-To: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> Message-ID: <1509536807.24.0.213398074469.issue31919@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4180 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:05:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 12:05:28 +0000 Subject: [issue25720] Fix curses module compilation with ncurses6 In-Reply-To: <1448365148.0.0.732837314732.issue25720@psf.upfronthosting.co.za> Message-ID: <1509537928.96.0.213398074469.issue25720@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8bc7d63560024681dce9f40445f2877b2987e92c by Serhiy Storchaka (Masayuki Yamamoto) in branch 'master': bpo-25720: Fix the method for checking pad state of curses WINDOW (#4164) https://github.com/python/cpython/commit/8bc7d63560024681dce9f40445f2877b2987e92c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:06:34 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 01 Nov 2017 12:06:34 +0000 Subject: [issue25720] Fix curses module compilation with ncurses6 In-Reply-To: <1448365148.0.0.732837314732.issue25720@psf.upfronthosting.co.za> Message-ID: <1509537994.64.0.213398074469.issue25720@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4181 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:07:34 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 01 Nov 2017 12:07:34 +0000 Subject: [issue25720] Fix curses module compilation with ncurses6 In-Reply-To: <1448365148.0.0.732837314732.issue25720@psf.upfronthosting.co.za> Message-ID: <1509538054.71.0.213398074469.issue25720@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:34:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 12:34:22 +0000 Subject: [issue31919] Make curses compiling on OpenIndiana and tests passing In-Reply-To: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> Message-ID: <1509539662.96.0.213398074469.issue31919@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 894ebd065e02debf20c0657d26020ecc42b7534f by Serhiy Storchaka in branch 'master': bpo-31919: Fix building the curses module on OpenIndiana. (#4211) https://github.com/python/cpython/commit/894ebd065e02debf20c0657d26020ecc42b7534f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:35:32 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 01 Nov 2017 12:35:32 +0000 Subject: [issue31919] Make curses compiling on OpenIndiana and tests passing In-Reply-To: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> Message-ID: <1509539732.11.0.213398074469.issue31919@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4183 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:35:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 12:35:43 +0000 Subject: [issue25720] Fix curses module compilation with ncurses6 In-Reply-To: <1448365148.0.0.732837314732.issue25720@psf.upfronthosting.co.za> Message-ID: <1509539743.44.0.213398074469.issue25720@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset ff6ae4de3874f4922a5883f08bb661c93834b060 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-25720: Fix the method for checking pad state of curses WINDOW (GH-4164) (#4212) https://github.com/python/cpython/commit/ff6ae4de3874f4922a5883f08bb661c93834b060 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:36:29 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 01 Nov 2017 12:36:29 +0000 Subject: [issue31919] Make curses compiling on OpenIndiana and tests passing In-Reply-To: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> Message-ID: <1509539789.55.0.213398074469.issue31919@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:36:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 12:36:50 +0000 Subject: [issue25720] Fix curses module compilation with ncurses6 In-Reply-To: <1448365148.0.0.732837314732.issue25720@psf.upfronthosting.co.za> Message-ID: <1509539810.93.0.213398074469.issue25720@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6ba0b583d6785a256b17d27431908d67015eeeb6 by Serhiy Storchaka (Miss Islington (bot)) in branch '2.7': bpo-25720: Fix the method for checking pad state of curses WINDOW (GH-4164) (#4213) https://github.com/python/cpython/commit/6ba0b583d6785a256b17d27431908d67015eeeb6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:38:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 12:38:50 +0000 Subject: [issue25720] Fix curses module compilation with ncurses6 In-Reply-To: <1448365148.0.0.732837314732.issue25720@psf.upfronthosting.co.za> Message-ID: <1509539930.88.0.213398074469.issue25720@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your contribution Masayuki! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 08:44:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 12:44:14 +0000 Subject: [issue14598] _cursesmodule.c fails with ncurses-5.9 on Linux In-Reply-To: <1334593853.62.0.710921461264.issue14598@psf.upfronthosting.co.za> Message-ID: <1509540254.85.0.213398074469.issue14598@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is this issue superseded by issue25720? ---------- nosy: +serhiy.storchaka status: open -> pending versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:07:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Nov 2017 13:07:27 +0000 Subject: [issue31910] test_socket.test_create_connection() failed with EADDRNOTAVAIL (err 99) In-Reply-To: <1509469522.6.0.213398074469.issue31910@psf.upfronthosting.co.za> Message-ID: <1509541647.39.0.213398074469.issue31910@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 89b84b026b389f3c61cbbc5ee89afd8248721b0d by Victor Stinner (Miss Islington (bot)) in branch '3.6': Fix test_socket.test_create_connection() (GH-4206) (#4208) https://github.com/python/cpython/commit/89b84b026b389f3c61cbbc5ee89afd8248721b0d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:08:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 Nov 2017 13:08:42 +0000 Subject: [issue31910] test_socket.test_create_connection() failed with EADDRNOTAVAIL (err 99) In-Reply-To: <1509469522.6.0.213398074469.issue31910@psf.upfronthosting.co.za> Message-ID: <1509541722.17.0.213398074469.issue31910@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4b73a79e796c3832be0cfd45bc27f15aea32b621 by Victor Stinner (Miss Islington (bot)) in branch '2.7': Fix test_socket.test_create_connection() (GH-4206) (#4209) https://github.com/python/cpython/commit/4b73a79e796c3832be0cfd45bc27f15aea32b621 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:11:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 13:11:14 +0000 Subject: [issue31919] Make curses compiling on OpenIndiana and tests passing In-Reply-To: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> Message-ID: <1509541874.68.0.213398074469.issue31919@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 2be9a31213e93e26a71150efaef1a975f8b9afec by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4215) https://github.com/python/cpython/commit/2be9a31213e93e26a71150efaef1a975f8b9afec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:11:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 13:11:20 +0000 Subject: [issue31919] Make curses compiling on OpenIndiana and tests passing In-Reply-To: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> Message-ID: <1509541880.41.0.213398074469.issue31919@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 87c66e46ce2c929540a9a91bbe25d1840d194475 by Serhiy Storchaka (Miss Islington (bot)) in branch '2.7': bpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4216) https://github.com/python/cpython/commit/87c66e46ce2c929540a9a91bbe25d1840d194475 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:11:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 13:11:41 +0000 Subject: [issue31919] Make curses compiling on OpenIndiana and tests passing In-Reply-To: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> Message-ID: <1509541901.13.0.213398074469.issue31919@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:19:31 2017 From: report at bugs.python.org (Christian Heimes) Date: Wed, 01 Nov 2017 13:19:31 +0000 Subject: [issue31892] ssl.get_server_certificate should allow specifying certificate / key type In-Reply-To: <1509271146.03.0.213398074469.issue31892@psf.upfronthosting.co.za> Message-ID: <1509542371.7.0.213398074469.issue31892@psf.upfronthosting.co.za> Christian Heimes added the comment: Thanks for your feature request, Hanno. It's fairly easy to implement with current API for TLS protocols up to TLS 1.2, e.g. cipher suite "DEFAULT:!aRSA:!aDSS" or "aECDSA:!NULL" for ECDSA certs. However TLS 1.3 cipher suites no longer specify authentication and KE/KX algorithms, e.g. TLS13-AES-256-GCM-SHA384. I have to find a way to force OpenSSL's state machine to establish a connection with a specific authentication algorithm. Memo to me: TLS 1.3 also has EdDSA. ---------- nosy: +alex, dstufft, janssen versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:47:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 13:47:04 +0000 Subject: [issue31680] Expose curses library name and version on Python level In-Reply-To: <1507059542.78.0.213398074469.issue31680@psf.upfronthosting.co.za> Message-ID: <1509544024.34.0.213398074469.issue31680@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4185 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:51:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 13:51:09 +0000 Subject: [issue31680] Expose curses library name and version on Python level In-Reply-To: <1507059542.78.0.213398074469.issue31680@psf.upfronthosting.co.za> Message-ID: <1509544269.26.0.213398074469.issue31680@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 4217 adds a named tuple curses.ncurses_version containing the three components of the ncurses library version: major, minor, and patch. >>> curses.ncurses_version curses.ncurses_version(major=6, minor=0, patch=20160625) Other curses implementation don't provide a version programmically. ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 09:54:48 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 01 Nov 2017 13:54:48 +0000 Subject: [issue30423] [asyncio] orphan future close loop and cause "RuntimeError: Event loop stopped before Future completed." In-Reply-To: <1495374268.18.0.469758871331.issue30423@psf.upfronthosting.co.za> Message-ID: <1509544488.09.0.213398074469.issue30423@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset d1e34031f68a3c7523a5376575c87cd0fea2425c by Andrew Svetlov (jimmylai) in branch 'master': [asyncio] bpo-30423: add regression test for orphan future causes "RuntimeError: Event loop stopped before Future completed." (#3295) https://github.com/python/cpython/commit/d1e34031f68a3c7523a5376575c87cd0fea2425c ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 10:03:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 14:03:42 +0000 Subject: [issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier In-Reply-To: <1339171712.6.0.747270716657.issue15037@psf.upfronthosting.co.za> Message-ID: <1509545022.77.0.213398074469.issue15037@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7e68790f3db75a893d5dd336e6201a63bc70212b by Serhiy Storchaka in branch 'master': bpo-15037: Add a workaround for getkey() in curses for ncurses 5.7 and earlier. (#3826) https://github.com/python/cpython/commit/7e68790f3db75a893d5dd336e6201a63bc70212b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 10:04:48 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 01 Nov 2017 14:04:48 +0000 Subject: [issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier In-Reply-To: <1339171712.6.0.747270716657.issue15037@psf.upfronthosting.co.za> Message-ID: <1509545088.84.0.213398074469.issue15037@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 10:37:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 14:37:27 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1509547047.16.0.213398074469.issue31893@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 10:38:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 14:38:37 +0000 Subject: [issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier In-Reply-To: <1339171712.6.0.747270716657.issue15037@psf.upfronthosting.co.za> Message-ID: <1509547117.6.0.213398074469.issue15037@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 1f81ea85e8e20347ec396001e5b869d36fe38398 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-15037: Add a workaround for getkey() in curses for ncurses 5.7 and earlier. (GH-3826) (#4218) https://github.com/python/cpython/commit/1f81ea85e8e20347ec396001e5b869d36fe38398 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 11:43:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 15:43:13 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1509550993.55.0.213398074469.issue31893@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset ce51890894be46f8f9d991a1d0ea1455fc41ccdc by Serhiy Storchaka in branch '2.7': bpo-31893: Fix a backporting error in 8cbf4e10646c3f5b8f0d274c2d7dea5bb6305f57. (#4219) https://github.com/python/cpython/commit/ce51890894be46f8f9d991a1d0ea1455fc41ccdc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 12:54:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 16:54:43 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1509555283.97.0.213398074469.issue27666@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4188 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 13:01:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 17:01:54 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1509555714.81.0.213398074469.issue27666@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your patch Steve. It is better to use PyCurses_ConvertToChtype() which is used for parsing all chtype arguments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 13:02:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 17:02:05 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1509555725.8.0.213398074469.issue27666@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 13:23:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 17:23:58 +0000 Subject: [issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier In-Reply-To: <1339171712.6.0.747270716657.issue15037@psf.upfronthosting.co.za> Message-ID: <1509557038.22.0.213398074469.issue15037@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 13:31:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 17:31:00 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1509557460.1.0.213398074469.issue8243@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- type: behavior -> enhancement versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 13:44:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 17:44:52 +0000 Subject: [issue10598] Add test for curses haskey replacement In-Reply-To: <1291234378.99.0.641306252968.issue10598@psf.upfronthosting.co.za> Message-ID: <1509558292.44.0.213398074469.issue10598@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 13:54:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 17:54:25 +0000 Subject: [issue3786] _curses, _curses_panel & _multiprocessing can't be build in 2.6b3 w/ SunStudio 12 In-Reply-To: <1220608521.1.0.66106932182.issue3786@psf.upfronthosting.co.za> Message-ID: <1509558865.88.0.213398074469.issue3786@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Issue31919 have made _curses be built on OpenIndiana with the default curses library. I suppose this have fixed this issue on Solaris too. But configuring _curses to use XPG4 curses is a different issue. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:03:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:03:03 +0000 Subject: [issue15852] typos in curses argument error messages In-Reply-To: <1346622102.83.0.795568790125.issue15852@psf.upfronthosting.co.za> Message-ID: <1509559383.5.0.213398074469.issue15852@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Do you mind to create a pull request on GitHub Chris? In general the patch LGTM, but I don't think this minor typo fix needs tests for exact error messages. Adding new tests is good, but I think it is enough to test that corresponding functions accept the correct number of arguments and raise TypeError on incorrect number of arguments. ---------- nosy: +serhiy.storchaka versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:03:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:03:59 +0000 Subject: [issue1723038] Curses Menu Message-ID: <1509559439.77.0.213398074469.issue1723038@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka versions: +Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:04:46 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:04:46 +0000 Subject: [issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions In-Reply-To: <1235583031.0.0.493464972804.issue5368@psf.upfronthosting.co.za> Message-ID: <1509559486.27.0.213398074469.issue5368@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:16:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:16:08 +0000 Subject: [issue9667] NetBSD curses KEY_* constants In-Reply-To: <1282644914.67.0.328045909398.issue9667@psf.upfronthosting.co.za> Message-ID: <1509560168.97.0.213398074469.issue9667@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Currently the default curses library on NetBSD provides all guarded functions. All these guards no longer needed. And they were removed in issue31891. ---------- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed superseder: -> Make curses compiling on NetBSD 7.1 and tests passing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:17:44 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 01 Nov 2017 18:17:44 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1509560264.41.0.213398074469.issue31630@psf.upfronthosting.co.za> Mark Dickinson added the comment: The big mystery for me is not "Why this is occurring in the first place?" but "What should we do about it?" I'm really reluctant to (even conditionally) skip the test, because it's doing exactly what it's designed to do, namely detecting and reporting that Python is giving poor results in this corner case on this platform. As developers, we can blame the poor results on the platform's libm, but that doesn't help the user. If we can find combinations of compiler flags that fix the issue for this platform, then I guess that's a solution. But what if we can't? Do we simply accept that the test suite will fail on this platform (and perhaps add a visible comment somewhere that this is a known issue, with a link to this bpo issue)? We can certainly hack together a tan implementation that behaves better in these corner cases; it's not totally trivial, but not all that hard, either (I suspect that simply using `sin / cos` would already be an improvement.) But if we do this every time we encounter a platform-specific libm corner case, we'll end up with a maze of twisty windy workarounds in mathmodule.c ... Or we could drop the fine-grained math library tests altogether: if the purpose of the math module is to wrap the platform libm and return the results it's returning, then we're already doing that perfectly well, so the tests are at best useless, and at worst problematic in cases like this. But I'm not so happy with that solution either. Thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:17:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:17:57 +0000 Subject: [issue3949] curses' sigwinch handler isn't visible from python In-Reply-To: <1222204708.76.0.512730295083.issue3949@psf.upfronthosting.co.za> Message-ID: <1509560277.84.0.213398074469.issue3949@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +haypo, serhiy.storchaka versions: +Python 3.6, Python 3.7 -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:47:11 2017 From: report at bugs.python.org (Stefan Krah) Date: Wed, 01 Nov 2017 18:47:11 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1509560264.41.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <20171101184700.GA10587@bytereef.org> Stefan Krah added the comment: On Wed, Nov 01, 2017 at 06:17:44PM +0000, Mark Dickinson wrote: > I'm really reluctant to (even conditionally) skip the test, because it's doing exactly what it's designed to do, namely detecting and reporting that Python is giving poor results in this corner case on this platform. As developers, we can blame the poor results on the platform's libm, but that doesn't help the user. I would want the tests to fail, especially if it can occur on Linux (though I still suspect an i686 router in the reported case). Perhaps hide them behind -uall, so that *we* see the result but just executing ./python -m test passes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:49:58 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 01 Nov 2017 18:49:58 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1509562198.41.0.213398074469.issue27666@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:50:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:50:53 +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: <1509562253.31.0.213398074469.issue18669@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: docs at python -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:51:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:51:18 +0000 Subject: [issue1751519] curses - new window methods: addchstr and addchnstr Message-ID: <1509562278.1.0.213398074469.issue1751519@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:52:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:52:54 +0000 Subject: [issue1751519] curses - new window methods: addchstr and addchnstr Message-ID: <1509562374.59.0.213398074469.issue1751519@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.7 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:55:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 18:55:37 +0000 Subject: [issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions In-Reply-To: <1235583031.0.0.493464972804.issue5368@psf.upfronthosting.co.za> Message-ID: <1509562537.52.0.213398074469.issue5368@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.7 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 14:57:32 2017 From: report at bugs.python.org (Masayuki Yamamoto) Date: Wed, 01 Nov 2017 18:57:32 +0000 Subject: [issue14598] _cursesmodule.c fails with ncurses-5.9 on Linux In-Reply-To: <1334593853.62.0.710921461264.issue14598@psf.upfronthosting.co.za> Message-ID: <1509562652.11.0.213398074469.issue14598@psf.upfronthosting.co.za> Masayuki Yamamoto added the comment: Probably, yes. ncurses on Cygwin has provided is_pad() [*]. In addition, the old version of Cygwin will become to not define WINDOW_HAS_FLAGS by issue25720. [*] newer version than patchlevel 20090906 was provided on Cygwin in 2009. https://sourceware.org/ml/cygwin-announce/2009-11/msg00025.html ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 15:17:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 19:17:48 +0000 Subject: [issue21457] NetBSD curses support improvements In-Reply-To: <1399625880.63.0.0407983839036.issue21457@psf.upfronthosting.co.za> Message-ID: <1509563868.48.0.213398074469.issue21457@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Guards around functions have been removed in issue31891. But could you please explain why changes in py_curses.h are needed? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 15:23:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 19:23:52 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1509564232.33.0.213398074469.issue27666@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset aad7ac10af6ed40fc21b842e04be0b04b2915d4a by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (GH-4220) (#4221) https://github.com/python/cpython/commit/aad7ac10af6ed40fc21b842e04be0b04b2915d4a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 15:24:02 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 01 Nov 2017 19:24:02 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1509564242.39.0.213398074469.issue27666@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4190 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 15:24:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 19:24:02 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1509564242.64.0.213398074469.issue27666@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b694770a2b23cd485c98bf673a8b2dc1a865d9df by Serhiy Storchaka (Miss Islington (bot)) in branch '2.7': bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (GH-4220) (#4222) https://github.com/python/cpython/commit/b694770a2b23cd485c98bf673a8b2dc1a865d9df ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 15:26:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 19:26:21 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1509564381.87.0.213398074469.issue27666@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 16:42:47 2017 From: report at bugs.python.org (Tim Peters) Date: Wed, 01 Nov 2017 20:42:47 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1509568967.01.0.213398074469.issue31630@psf.upfronthosting.co.za> Tim Peters added the comment: Since fdlibm uses tan(x) ~= -1/(x-pi/2) in this range, and the reciprocals of the bad results have a whole of bunch of trailing zero bits, my guess is that argument reduction (the "x-pi/2" part) is screwing up (losing bits of pi/2 beyond the long string of initial bits that cancel out). In which case it's likely sin(x) will return a poor result too, for the same reason (while cos(x) will return 1.0). IOW, I'd be surprised if sin(x)/cos(x) were materially better. If so, it's not just tan() that's flawed. That can be checked easily enough (e.g., change the Python program I posted to use sin() instead of tan()). Regardless, assuming we don't want to write our own libm, it's highly desirable that platform experts be aware of the flaw(s) on platforms where it occurs. Otherwise they'll never make the noise needed to get it fixed. OTOH, it's not an error _in_ Python if we don't supply libm, so the Python test suite really shouldn't fail on these. Spray warnings to stderr? Create a new "platform (lack of) quality" class of soft failure? "Pass or fail, period" misses the mark here :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 17:09:32 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Wed, 01 Nov 2017 21:09:32 +0000 Subject: [issue28643] Broken makefile depends for profile-opt target In-Reply-To: <1478634995.26.0.389156722395.issue28643@psf.upfronthosting.co.za> Message-ID: <1509570572.05.0.213398074469.issue28643@psf.upfronthosting.co.za> Change by Neil Schemenauer : ---------- keywords: +patch pull_requests: +4191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 17:21:00 2017 From: report at bugs.python.org (Stefan Krah) Date: Wed, 01 Nov 2017 21:21:00 +0000 Subject: [issue18835] Add PyMem_AlignedAlloc() In-Reply-To: <1377484371.18.0.399621580043.issue18835@psf.upfronthosting.co.za> Message-ID: <1509571260.76.0.213398074469.issue18835@psf.upfronthosting.co.za> Stefan Krah added the comment: Yes, it may be better not to add it. To summarize the problems again: -------------------------------- - C11 aligned_alloc() / free() would be more comfortable but isn't available on MSVC. - posix_memalign() performance isn't that great. - hand-rolled aligned_calloc() is the fastest. The feature could still be useful for fixing #31912 and #27987, *if* someone has an idea how to integrate the aligned version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 17:36:08 2017 From: report at bugs.python.org (Tim Peters) Date: Wed, 01 Nov 2017 21:36:08 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1509572168.79.0.213398074469.issue31630@psf.upfronthosting.co.za> Tim Peters added the comment: Oops! I mixed up `sin` and `cos` in that comment. If it's argument reduction that's broken, then for x near pi/2 cos(x) will be evaluated as -sin(x - pi/2), which is approximately -(x - pi/2), and so error in argument reduction (the "x - pi/2" part) will show up directly in the cos() result. So to confirm or refute that, you could replace `tan` by `cos` in the Python program I posted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 17:54:00 2017 From: report at bugs.python.org (Thomas Klausner) Date: Wed, 01 Nov 2017 21:54:00 +0000 Subject: [issue21457] NetBSD curses support improvements In-Reply-To: <1399625880.63.0.0407983839036.issue21457@psf.upfronthosting.co.za> Message-ID: <1509573240.06.0.213398074469.issue21457@psf.upfronthosting.co.za> Thomas Klausner added the comment: Thanks for looking at this. I looked at the patch again, and I can't make sense of the py_curses.h part either - I've removed it from pkgsrc with a request for information if it's still needed. Btw, thanks for working on NetBSD curses support in Python. You should really try out on a NetBSD 8 (or -current) snapshot as well, since the curses library was improved for better support especially for python curses in the last year. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 19:19:54 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 01 Nov 2017 23:19:54 +0000 Subject: [issue31913] forkserver could warn if several threads are running In-Reply-To: <1509473546.78.0.213398074469.issue31913@psf.upfronthosting.co.za> Message-ID: <1509578394.68.0.213398074469.issue31913@psf.upfronthosting.co.za> Gregory P. Smith added the comment: If we do this, I think we should aim for the complete solution on the most common posix platforms (Linux and MacOS) as C/C++ extensions are just as happy to create threads these days. (but if you want to start with a simple python threads only warning, i'm not going to stop you) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 19:22:22 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 01 Nov 2017 23:22:22 +0000 Subject: [issue31913] forkserver could warn if several threads are running In-Reply-To: <1509473546.78.0.213398074469.issue31913@psf.upfronthosting.co.za> Message-ID: <1509578542.3.0.213398074469.issue31913@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Yeah... We might replicate the psutil source code doing that. On Linux, it involves parsing /proc/{pid}/status (which may not be available on some restricted execution environments?). Haven't looked what it does on macOS. ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 20:24:53 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 02 Nov 2017 00:24:53 +0000 Subject: [issue31356] Add context manager to temporarily disable GC In-Reply-To: <1504655244.01.0.877867263237.issue31356@psf.upfronthosting.co.za> Message-ID: <1509582293.62.0.213398074469.issue31356@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +4192 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 20:26:33 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 02 Nov 2017 00:26:33 +0000 Subject: [issue31356] Add context manager to temporarily disable GC In-Reply-To: <1504655244.01.0.877867263237.issue31356@psf.upfronthosting.co.za> Message-ID: <1509582393.33.0.213398074469.issue31356@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I have prepared a PR in GitHub with an initial implementation of the context manager trying to fulfil the discussed requirements: https://github.com/python/cpython/pull/3980 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 22:10:11 2017 From: report at bugs.python.org (Masayuki Yamamoto) Date: Thu, 02 Nov 2017 02:10:11 +0000 Subject: [issue8548] Building on CygWin 1.7: PATH_MAX redefined In-Reply-To: <1272386591.01.0.834578637911.issue8548@psf.upfronthosting.co.za> Message-ID: <1509588611.58.0.213398074469.issue8548@psf.upfronthosting.co.za> Masayuki Yamamoto added the comment: This issue has been out-of-date since Python 3.4 maintenance became security status. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 22:11:08 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Thu, 02 Nov 2017 02:11:08 +0000 Subject: [issue31872] SSL BIO is broken for internationalized domains In-Reply-To: <1509012559.64.0.213398074469.issue31872@psf.upfronthosting.co.za> Message-ID: <1509588668.96.0.213398074469.issue31872@psf.upfronthosting.co.za> Nathaniel Smith added the comment: I believe https://github.com/python/cpython/pull/3010 is the fix you're looking for. ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 04:33:30 2017 From: report at bugs.python.org (Tim Chambers) Date: Thu, 02 Nov 2017 08:33:30 +0000 Subject: [issue18304] ElementTree -- provide a way to ignore namespace in tags and searches In-Reply-To: <1372218497.28.0.26294900817.issue18304@psf.upfronthosting.co.za> Message-ID: <1509611610.98.0.213398074469.issue18304@psf.upfronthosting.co.za> Tim Chambers added the comment: I suggest adding the option to keep the namespace prefixes in the tree when reading in (will it need to set a tree wide variable for the instance?). I haven't looked at the etree internals in detail. Add a function to ElementTree that returns the tag using the namespace prefix (eg. treenode.tagpre). Namespaces and prefixes are cached and used to expand the prefix only when absolutely required. Some XML/xpath search operations currently assume the full expanded namespaces not prefixes which may lead to side-effects. You can leave the default behaviour for compatibility. Using prefixes in the tree storage and searches would reduce memory and CPU time (when no expansion is required). ---------- nosy: +Tim Chambers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 04:37:20 2017 From: report at bugs.python.org (Oleg Krasnikov) Date: Thu, 02 Nov 2017 08:37:20 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument Message-ID: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> New submission from Oleg Krasnikov : This happens because pygettext's `getFilesForName` calls `os.walk` as if it was `os.path.walk`. But the `walk` function has changed signature when moved from `os.path` to `os`. So now `_visit_pyfiles` is passed to `walk` as `topdown` argument which is obviously wrong and therefore `_visit_pyfiles` is never called. ---------- components: Demos and Tools messages: 305406 nosy: Oleg Krasnikov priority: normal severity: normal status: open title: pygettext ignores directories as inputfile argument type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 04:50:30 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 02 Nov 2017 08:50:30 +0000 Subject: [issue31872] SSL BIO is broken for internationalized domains In-Reply-To: <1509012559.64.0.213398074469.issue31872@psf.upfronthosting.co.za> Message-ID: <1509612630.9.0.213398074469.issue31872@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Duplicate of #28414 Nathaniel thanks for Pull Request! ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> SSL match_hostname fails for internationalized domain names _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 04:55:34 2017 From: report at bugs.python.org (Oleg Krasnikov) Date: Thu, 02 Nov 2017 08:55:34 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1509612934.85.0.213398074469.issue31920@psf.upfronthosting.co.za> Change by Oleg Krasnikov : ---------- keywords: +patch pull_requests: +4193 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 05:56:19 2017 From: report at bugs.python.org (pdox) Date: Thu, 02 Nov 2017 09:56:19 +0000 Subject: [issue31921] Bring together logic for entering/leaving a frame in frameobject.c Message-ID: <1509616579.32.0.213398074469.issue31921@psf.upfronthosting.co.za> New submission from pdox : This is a refactor to move all the code involved in entering a frame (making it the active frame for the current tstate) and leaving a frame (removing it as an active frame, possibly destructing it or making it GC tracked) into private functions in frameobject.c. The underlying goal of this change is to make it possible to add (as a performance feature) stack-allocated frames, in addition to the usual heap-allocated ones. ---------- components: Interpreter Core messages: 305408 nosy: pdox priority: normal severity: normal status: open title: Bring together logic for entering/leaving a frame in frameobject.c type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:00:47 2017 From: report at bugs.python.org (pdox) Date: Thu, 02 Nov 2017 10:00:47 +0000 Subject: [issue31921] Bring together logic for entering/leaving a frame in frameobject.c In-Reply-To: <1509616579.32.0.213398074469.issue31921@psf.upfronthosting.co.za> Message-ID: <1509616847.73.0.213398074469.issue31921@psf.upfronthosting.co.za> Change by pdox : ---------- keywords: +patch pull_requests: +4195 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:11:55 2017 From: report at bugs.python.org (Tal Einat) Date: Thu, 02 Nov 2017 10:11:55 +0000 Subject: [issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files In-Reply-To: <1389140162.94.0.578256004005.issue20180@psf.upfronthosting.co.za> Message-ID: <1509617515.61.0.213398074469.issue20180@psf.upfronthosting.co.za> Tal Einat added the comment: To enable progressing with this in smaller steps, I created PR 4170 which converts only itertools.groupby and the intertnal _grouper with minimal required changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:16:33 2017 From: report at bugs.python.org (Tal Einat) Date: Thu, 02 Nov 2017 10:16:33 +0000 Subject: [issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files In-Reply-To: <1389140257.44.0.42523119139.issue20182@psf.upfronthosting.co.za> Message-ID: <1509617793.31.0.213398074469.issue20182@psf.upfronthosting.co.za> Tal Einat added the comment: I have a complete, up-to-date AC conversion of Modules/selectmodule.c ready on a branch in my GitHub CPython fork: https://github.com/taleinat/cpython/tree/bpo-20182_AC_selectmodule I haven't created a PR because there's currently an issue with the generated selectmodule.c.h missing a few "safety" #defines, causing compilation errors e.g. on Windows where poll is unavailable. Any help resolving this issue would be welcome! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:20:49 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 02 Nov 2017 10:20:49 +0000 Subject: [issue8548] Building on CygWin 1.7: PATH_MAX redefined In-Reply-To: <1272386591.01.0.834578637911.issue8548@psf.upfronthosting.co.za> Message-ID: <1509618049.65.0.213398074469.issue8548@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for doing issue triage, Masayuki! ---------- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:33:00 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 02 Nov 2017 10:33:00 +0000 Subject: [issue23699] Add a macro to ease writing rich comparisons In-Reply-To: <1426686202.27.0.781464549576.issue23699@psf.upfronthosting.co.za> Message-ID: <1509618780.89.0.213398074469.issue23699@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset e8b19656396381407ad91473af5da8b0d4346e88 by Nick Coghlan (stratakis) in branch 'master': bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793) https://github.com/python/cpython/commit/e8b19656396381407ad91473af5da8b0d4346e88 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:33:57 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 02 Nov 2017 10:33:57 +0000 Subject: [issue23699] Add a macro to ease writing rich comparisons In-Reply-To: <1426686202.27.0.781464549576.issue23699@psf.upfronthosting.co.za> Message-ID: <1509618837.23.0.213398074469.issue23699@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:34:07 2017 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 02 Nov 2017 10:34:07 +0000 Subject: [issue31907] Clarify error message when attempting to call function via str.format() In-Reply-To: <1509410120.18.0.213398074469.issue31907@psf.upfronthosting.co.za> Message-ID: <1509618847.43.0.213398074469.issue31907@psf.upfronthosting.co.za> Eric V. Smith added the comment: Guido's suggestion in https://mail.python.org/pipermail/python-dev/2017-October/150055.html is to not change anything. Assuming we do that, it's still an open issue as to if/how we should document and test the current behavior. I'd be surprised if it's tested, but I haven't looked. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:51:04 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 02 Nov 2017 10:51:04 +0000 Subject: [issue31892] ssl.get_server_certificate should allow specifying certificate / key type In-Reply-To: <1509271146.03.0.213398074469.issue31892@psf.upfronthosting.co.za> Message-ID: <1509619864.87.0.213398074469.issue31892@psf.upfronthosting.co.za> Christian Heimes added the comment: Example implementation of get_server_certificate() with cert type: https://gist.github.com/tiran/6e7a5b00483376e164c951730db7d4e5 TLS 1.3 has a signature_algorithms extension that allows a client to have even more control over the selected certificate and signature algorithms. It defines authentication algorithm (RSA, ECDSA, EdDSA), signature scheme (PKCS#1 v1.5 or PKCS#1 v2.1 aka RSA-PSS for RSA, curve for ECDSA), and hashing algorithm (SHA-1, SHA-2 256/384/512). https://tools.ietf.org/html/draft-ietf-tls-tls13-21#section-4.2.3 I've contacted openssl maintainers and asked them for advice: https://mta.openssl.org/pipermail/openssl-users/2017-November/006834.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:51:16 2017 From: report at bugs.python.org (Vincent Michel) Date: Thu, 02 Nov 2017 10:51:16 +0000 Subject: [issue31922] Can't receive replies from multicast UDP with asyncio Message-ID: <1509619876.25.0.213398074469.issue31922@psf.upfronthosting.co.za> New submission from Vincent Michel : It's currently not possible to receive replies from multicast UDP with asyncio, as reported in the following issue: https://github.com/python/asyncio/issues/480 That's because asyncio connects the UDP socket to the broadcast address, causing all traffic from the receivers to be be dropped, as explained in this comment: https://github.com/python/asyncio/issues/480#issuecomment-278703828 I already submitted a PR on the cpython repository: https://github.com/python/cpython/pull/423 I figured it was better to report the issue here for better tracking. ---------- components: asyncio messages: 305415 nosy: vxgmichel, yselivanov priority: normal pull_requests: 4196 severity: normal status: open title: Can't receive replies from multicast UDP with asyncio type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 07:17:48 2017 From: report at bugs.python.org (Piotr Dobrogost) Date: Thu, 02 Nov 2017 11:17:48 +0000 Subject: [issue1553375] Add traceback.print_full_exception() Message-ID: <1509621468.34.0.213398074469.issue1553375@psf.upfronthosting.co.za> Change by Piotr Dobrogost : ---------- nosy: +piotr.dobrogost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 07:19:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 11:19:24 +0000 Subject: [issue31917] Add time.CLOCK_PROF constant In-Reply-To: <1509503220.89.0.213398074469.issue31917@psf.upfronthosting.co.za> Message-ID: <1509621564.03.0.213398074469.issue31917@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a64ce973a3ad90e4f4a93c402e946c132f647a63 by Victor Stinner in branch 'master': bpo-31917: Add 3 new clock identifiers (#4207) https://github.com/python/cpython/commit/a64ce973a3ad90e4f4a93c402e946c132f647a63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 07:19:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 11:19:44 +0000 Subject: [issue31917] Add time.CLOCK_PROF constant In-Reply-To: <1509503220.89.0.213398074469.issue31917@psf.upfronthosting.co.za> Message-ID: <1509621584.69.0.213398074469.issue31917@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 07:37:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 11:37:03 +0000 Subject: [issue18835] Add PyMem_AlignedAlloc() In-Reply-To: <1377484371.18.0.399621580043.issue18835@psf.upfronthosting.co.za> Message-ID: <1509622623.33.0.213398074469.issue18835@psf.upfronthosting.co.za> STINNER Victor added the comment: "C11 aligned_alloc() / free() would be more comfortable but isn't available on MSVC." Is it common to require the allocated memory block to be filled with zeros? In Python, calloc() is not the most common allocator. I only found 5 places where calloc is used: Modules/_ssl.c:5172: _ssl_locks = PyMem_Calloc(_ssl_locks_count, Modules/gcmodule.c:1689: g = (PyGC_Head *)PyObject_Calloc(1, size); Modules/gcmodule.c:1717:_PyObject_GC_Calloc(size_t basicsize) Objects/bytesobject.c:83: op = (PyBytesObject *)PyObject_Calloc(1, PyBytesObject_SIZE + size); Objects/listobject.c:176: op->ob_item = (PyObject **) PyMem_Calloc(size, sizeof(PyObject *)); "posix_memalign() performance isn't that great. hand-rolled aligned_calloc() is the fastest." I'm not sure that the cost of the memory allocator itself defeats the gain of aligned memory on algorithms. I expect data processing to be much more expensive than the memory allocation, no? Again, the unknown remains the benchmark result. Can anyone write a quick benchmark to measure the gain of aligned memory? 4 years ago, Raymond Hettinger wanted to use it for the set and collection.deque types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 07:40:59 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 11:40:59 +0000 Subject: [issue18835] Add PyMem_AlignedAlloc() In-Reply-To: <1377484371.18.0.399621580043.issue18835@psf.upfronthosting.co.za> Message-ID: <1509622859.69.0.213398074469.issue18835@psf.upfronthosting.co.za> STINNER Victor added the comment: About the API itself, I'm not sure that PyMem_AlignedAlloc(alignment, size) is flexible enough. If we want to get *data* aligned in a Python object, we would have to pass an offset to the data, since Python objects have headers of variable size (depending on the type). Windows has such API: void * _aligned_offset_malloc( size_t size, size_t alignment, size_t offset ); This function is based on malloc, so likely adds padding bytes for you depending on size, alignment and offset. https://msdn.microsoft.com/fr-fr/library/ec852tkw.aspx See bpo-27987: "obmalloc's 8-byte alignment causes undefined behavior". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 07:42:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 11:42:38 +0000 Subject: [issue3949] curses' sigwinch handler isn't visible from python In-Reply-To: <1222204708.76.0.512730295083.issue3949@psf.upfronthosting.co.za> Message-ID: <1509622958.84.0.213398074469.issue3949@psf.upfronthosting.co.za> STINNER Victor added the comment: > The signal(SIGWINCH, SIG_IGN) call doesn't return the old, working signal handler; it returns 0 See bpo-13285: "signal module ignores external signal changes". By the way, I recently modified test_curses to save/restore signal handlers: see bpo-31629. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 08:21:30 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 02 Nov 2017 12:21:30 +0000 Subject: [issue31892] ssl.get_server_certificate should allow specifying certificate / key type In-Reply-To: <1509271146.03.0.213398074469.issue31892@psf.upfronthosting.co.za> Message-ID: <1509625290.22.0.213398074469.issue31892@psf.upfronthosting.co.za> Christian Heimes added the comment: Matt suggested to use https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html The SSL_CTX_set1_sigalgs_list() function takes a string of colon-separated algorithms, e.g. "ECDSA+SHA256:RSA+SHA256" for ECDSA and PKCS#1 v1.5 RSA with both SHA256 as hashing algorithm. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 08:47:07 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 02 Nov 2017 12:47:07 +0000 Subject: [issue31307] ConfigParser.read silently fails if filenames argument is a byte string In-Reply-To: <1504102547.11.0.362577067596.issue31307@psf.upfronthosting.co.za> Message-ID: <1509626827.01.0.213398074469.issue31307@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset e314853d57450b2b9523157eebd405289a795a0e by Berker Peksag (Vincent Michel) in branch 'master': bpo-31307: Make ConfigParser.read() accept bytes objects (GH-3420) https://github.com/python/cpython/commit/e314853d57450b2b9523157eebd405289a795a0e ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 08:49:05 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 02 Nov 2017 12:49:05 +0000 Subject: [issue31307] ConfigParser.read silently fails if filenames argument is a byte string In-Reply-To: <1504102547.11.0.362577067596.issue31307@psf.upfronthosting.co.za> Message-ID: <1509626945.4.0.213398074469.issue31307@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks! I went ahead and merged PR 3420 since ?ukasz (the configparser maintainer) has accepted the idea. ---------- resolution: -> fixed stage: -> resolved status: open -> closed type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 09:09:07 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 02 Nov 2017 13:09:07 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509628147.09.0.213398074469.issue21423@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 09:52:26 2017 From: report at bugs.python.org (Davy Wybiral) Date: Thu, 02 Nov 2017 13:52:26 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py Message-ID: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> New submission from Davy Wybiral : Line #14 of Doc/includes/sqlite3/load_extension.py reads: # disable extension laoding again ---------- assignee: docs at python components: Documentation messages: 305423 nosy: davywtf, docs at python priority: normal severity: normal status: open title: Misspelled "loading" in Doc/includes/sqlite3/load_extension.py versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 09:57:26 2017 From: report at bugs.python.org (Davy Wybiral) Date: Thu, 02 Nov 2017 13:57:26 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py In-Reply-To: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> Message-ID: <1509631046.8.0.213398074469.issue31923@psf.upfronthosting.co.za> Change by Davy Wybiral : ---------- keywords: +patch pull_requests: +4197 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 10:01:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 14:01:32 +0000 Subject: [issue31924] Fix test_curses on NetBSD 8 Message-ID: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The NetBSD curses library in NetBSD 8 provides the panel extension. compatible with ncurses. But a panel can not be created from stdscr. This causes failing two tests in test_curses. These tests were added not long time ago, and there are not reasons to create panels from stdscr instead of other windows. Hence the proposed PR just makes these two tests creating panels from new windows, as in other two tests. ---------- assignee: serhiy.storchaka components: Tests messages: 305424 nosy: serhiy.storchaka, twouters priority: normal severity: normal status: open title: Fix test_curses on NetBSD 8 type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 10:02:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 14:02:52 +0000 Subject: [issue31924] Fix test_curses on NetBSD 8 In-Reply-To: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> Message-ID: <1509631372.73.0.213398074469.issue31924@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4198 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 10:16:31 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 14:16:31 +0000 Subject: [issue31925] test_socket creates too much locks Message-ID: <1509632190.98.0.213398074469.issue31925@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : test_socket creates a lock in the constructor of ThreadSafeCleanupTestCase. But since unittest creates an instance of test class for every test method, it creates around 400 locks. This exceeds the limit of 200 locks in NetBSD 8 and causes a failure. 0:00:00 load avg: 0.00 [1/1] test_socket sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 Traceback (most recent call last): File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 176, in runtest_inner sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 5801, in test_main sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/support/__init__.py", line 1934, in run_unittest sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/unittest/loader.py", line 503, in makeSuite sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/unittest/loader.py", line 92, in loadTestsFromTestCase sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/unittest/suite.py", line 24, in __init__ sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/unittest/suite.py", line 57, in addTests sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 544, in __init__ sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 144, in __init__ sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/threading.py", line 86, in RLock sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 RuntimeError: can't allocate lock During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/serhiy/py/cpython3.7/Lib/runpy.py", line 193, in _run_module_as_main sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/runpy.py", line 85, in _run_code sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/__main__.py", line 2, in sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 585, in main sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 510, in main sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 536, in _main sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 458, in run_tests sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 379, in run_tests_sequential sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 140, in runtest sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 200, in runtest_inner sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 163, in format_exc sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 117, in format_exception sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 496, in __init__ sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 357, in extract sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 281, in line sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 16, in getline sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 47, in getlines sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 136, in updatecache sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/tokenize.py", line 447, in open sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 RuntimeError: can't allocate read lock ---------- components: Tests messages: 305425 nosy: ezio.melotti, michael.foord, rbcollins, serhiy.storchaka priority: normal severity: normal status: open title: test_socket creates too much locks type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 10:28:30 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 14:28:30 +0000 Subject: [issue31784] Implementation of the PEP 564: Add time.time_ns() In-Reply-To: <1507930455.75.0.213398074469.issue31784@psf.upfronthosting.co.za> Message-ID: <1509632910.14.0.213398074469.issue31784@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c29b585fd4b5a91d17fc5dd41d86edff28a30da3 by Victor Stinner in branch 'master': bpo-31784: Implement PEP 564: add time.time_ns() (#3989) https://github.com/python/cpython/commit/c29b585fd4b5a91d17fc5dd41d86edff28a30da3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:13:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 15:13:05 +0000 Subject: [issue31784] Implementation of the PEP 564: Add time.time_ns() In-Reply-To: <1507930455.75.0.213398074469.issue31784@psf.upfronthosting.co.za> Message-ID: <1509635585.43.0.213398074469.issue31784@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:13:55 2017 From: report at bugs.python.org (Tal Einat) Date: Thu, 02 Nov 2017 15:13:55 +0000 Subject: [issue31926] compile error when converting selectmodule to AC due to missing #define-s Message-ID: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> New submission from Tal Einat : I'm converting Modules/selectmodule.c.h as part of issue #20182. After converting the code and running Tools/clinic/clinic.py, compilation is failing on Windows due to the following block *not* being generated by in the Modules/clinic/selectmodule.c.h file: #ifndef SELECT_POLL_METHODDEF #define SELECT_POLL_METHODDEF #endif /* !defined(SELECT_POLL_METHODDEF) */ Adding the block manually fixes the issue. This seems to be caused by a bug in clinic.py. Attaching PR fix a fix immediately. ---------- components: Argument Clinic messages: 305427 nosy: larry, taleinat priority: normal severity: normal status: open title: compile error when converting selectmodule to AC due to missing #define-s type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:18:54 2017 From: report at bugs.python.org (Tal Einat) Date: Thu, 02 Nov 2017 15:18:54 +0000 Subject: [issue31926] compile error when converting selectmodule to AC due to missing #define-s In-Reply-To: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> Message-ID: <1509635934.67.0.213398074469.issue31926@psf.upfronthosting.co.za> Change by Tal Einat : ---------- keywords: +patch pull_requests: +4199 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:19:47 2017 From: report at bugs.python.org (Tal Einat) Date: Thu, 02 Nov 2017 15:19:47 +0000 Subject: [issue31926] compile error when converting selectmodule to AC due to missing #define-s In-Reply-To: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> Message-ID: <1509635987.34.0.213398074469.issue31926@psf.upfronthosting.co.za> Tal Einat added the comment: See PR 4230. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:30:06 2017 From: report at bugs.python.org (Tal Einat) Date: Thu, 02 Nov 2017 15:30:06 +0000 Subject: [issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files In-Reply-To: <1389140257.44.0.42523119139.issue20182@psf.upfronthosting.co.za> Message-ID: <1509636606.12.0.213398074469.issue20182@psf.upfronthosting.co.za> Tal Einat added the comment: See issue #31926 and PR 4230 regarding the aforementioned argument clinic bug and a fix for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:34:54 2017 From: report at bugs.python.org (Josh Cullum) Date: Thu, 02 Nov 2017 15:34:54 +0000 Subject: =?utf-8?q?=5Bissue23644=5D_g++_module_compile_fails_with_=E2=80=98=5FAtom?= =?utf-8?q?ic=E2=80=99_does_not_name_a_type?= In-Reply-To: <1426172340.82.0.788562357439.issue23644@psf.upfronthosting.co.za> Message-ID: <1509636894.21.0.213398074469.issue23644@psf.upfronthosting.co.za> Josh Cullum added the comment: Interestingly, I get the error with Python 3.6.3 build from source, where I include the path to the g++ binary. Python builds without the g++ option, but then _Tkinter fails to build - see issue31817 ---------- nosy: +jpc2350 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:45:58 2017 From: report at bugs.python.org (Josh Cullum) Date: Thu, 02 Nov 2017 15:45:58 +0000 Subject: [issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter In-Reply-To: <1508407674.96.0.213398074469.issue31817@psf.upfronthosting.co.za> Message-ID: <1509637558.66.0.213398074469.issue31817@psf.upfronthosting.co.za> Josh Cullum added the comment: LD_LIBRARY_PATH includes /tools/apps/tk/8.6.7/lib/:/tools/apps/tcl/8.6.7/lib/ and several other library paths that are required. Why would I be getting an undefined symbol error on this module? _tkinter.cpython-36m-x86_64-linux-gnu.so: undefined symbol: Tcl_GetCharLength I've even tried added g++ as an option, but Python fails to be against this: issue23644 I'm stuck now, and this is causing real problems for some pipelines that I'm trying to get running. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:48:27 2017 From: report at bugs.python.org (Vladimir Magamedov) Date: Thu, 02 Nov 2017 15:48:27 +0000 Subject: [issue27456] asyncio: set TCP_NODELAY flag by default In-Reply-To: <1467732468.65.0.201519937735.issue27456@psf.upfronthosting.co.za> Message-ID: <1509637707.62.0.213398074469.issue27456@psf.upfronthosting.co.za> Vladimir Magamedov added the comment: Seems like this fix is incomplete. It contains this check: sock.type == socket.SOCK_STREAM But sock.type is not only a type (at least in Linux and FreeBSD), it also may contain SOCK_NONBLOCK and SOCK_CLOEXEC flags. So I'm hitting the same problem: on the Linux in asyncio I have: > sock.type == socket.SOCK_STREAM | socket.SOCK_NONBLOCK == 2049 True So this check isn't working and TCP_NODELAY still disabled by default. Links: - http://man7.org/linux/man-pages/man2/socket.2.html - https://github.com/torvalds/linux/blob/v4.13/include/linux/net.h#L77 - https://github.com/freebsd/freebsd/blob/stable/11/sys/sys/socket.h#L110 Linux has SOCK_TYPE_MASK definition equal to 0xf, but I can't find such definition in the FreeBSD sources. And I don't know how to reliably and with forward compatibility check sock.type without calling getsockopt() syscall. Currently I have a fix in my project, where: _sock_type_mask = 0xf if hasattr(socket, 'SOCK_NONBLOCK') else 0xffffffff And then in my own _set_nodelay(sock) function: sock.type & _sock_type_mask == socket.SOCK_STREAM Should I make a pull request or someone knows more reliable check? Or it is ok to add one more syscall? sock.getsockopt(socket.SOL_SOCKET, socket.SO_TYPE) == socket.SOCK_STREAM ---------- nosy: +vmagamedov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:50:10 2017 From: report at bugs.python.org (Anselm Kruis) Date: Thu, 02 Nov 2017 15:50:10 +0000 Subject: [issue31890] Please define the flag METH_STACKLESS for Stackless Python In-Reply-To: <1509210414.45.0.213398074469.issue31890@psf.upfronthosting.co.za> Message-ID: <1509637810.46.0.213398074469.issue31890@psf.upfronthosting.co.za> Anselm Kruis added the comment: Hi Victor, The project is still somewhat alive, because the software, that is used to control a large percentage of the CAE simulation jobs of large German automakers, requires Stackless Python, especially the option to serialize tasklets and move them around between different computers. The Stackless project recently released Stackless Python 3.5.4 and 2.7.14 and C-Python is merged up to 3.6.1. See https://github.com/stackless-dev/stackless/tree/3.6-slp and https://bitbucket.org/stackless-dev/stackless/wiki/Download. Under the hood we fixed the reference counting (2016) and migrated from bitbucket/hg to github/git. Regards Anselm ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:54:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 15:54:34 +0000 Subject: [issue30844] selectors: Add urgent data to read event In-Reply-To: <1499154602.34.0.512316587852.issue30844@psf.upfronthosting.co.za> Message-ID: <1509638074.05.0.213398074469.issue30844@psf.upfronthosting.co.za> STINNER Victor added the comment: It seems like kqueue supports urgent data: "EV_OOBAND: Read filter on socket may set this flag to indicate the presence of out of band data on the descriptor." Example: https://github.com/daurnimator/cqueues/commit/52baaf1c25bc7e6f7cb4685cb05f4ed47a3f404a Be careful, I also found: // Older versions of Mac OS X may not define EV_OOBAND. #if !defined(EV_OOBAND) # define EV_OOBAND EV_FLAG1 #endif // !defined(EV_OOBAND) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:57:01 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 02 Nov 2017 15:57:01 +0000 Subject: [issue27456] asyncio: set TCP_NODELAY flag by default In-Reply-To: <1467732468.65.0.201519937735.issue27456@psf.upfronthosting.co.za> Message-ID: <1509638221.83.0.213398074469.issue27456@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- pull_requests: +4200 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:58:37 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 02 Nov 2017 15:58:37 +0000 Subject: [issue27456] asyncio: set TCP_NODELAY flag by default In-Reply-To: <1467732468.65.0.201519937735.issue27456@psf.upfronthosting.co.za> Message-ID: <1509638317.59.0.213398074469.issue27456@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Seems like this fix is incomplete. It contains this check: > > sock.type == socket.SOCK_STREAM > > But sock.type is not only a type Good catch. I made a PR to fix this. ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:04:24 2017 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 02 Nov 2017 16:04:24 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1509638664.85.0.213398074469.issue31630@psf.upfronthosting.co.za> Mark Dickinson added the comment: > I'd be surprised if sin(x)/cos(x) were materially better. Yep. I made the same assumption as you, but then "realised" that to get to the tan tests, we must already have passed all the cos tests, so cos must be okay. I thought I'd written cos tests near pi/2 as well as tan ones, but unfortunately it turns out that's not true. My bad. Those tests should probably be added to cmath_testcases.txt. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:09:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 16:09:36 +0000 Subject: [issue27456] asyncio: set TCP_NODELAY flag by default In-Reply-To: <1467732468.65.0.201519937735.issue27456@psf.upfronthosting.co.za> Message-ID: <1509638976.63.0.213398074469.issue27456@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:11:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 16:11:27 +0000 Subject: [issue27456] asyncio: set TCP_NODELAY flag by default In-Reply-To: <1467732468.65.0.201519937735.issue27456@psf.upfronthosting.co.za> Message-ID: <1509639087.7.0.213398074469.issue27456@psf.upfronthosting.co.za> STINNER Victor added the comment: > sock.type == socket.SOCK_STREAM Oh, right. I wrote PR 4233 to fix the code. Yury: "Good catch. I made a PR to fix this." Oops. If you wrote a PR, would it mind to compare it with mine, please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:13:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 16:13:23 +0000 Subject: [issue27456] asyncio: set TCP_NODELAY flag by default In-Reply-To: <1467732468.65.0.201519937735.issue27456@psf.upfronthosting.co.za> Message-ID: <1509639203.54.0.213398074469.issue27456@psf.upfronthosting.co.za> STINNER Victor added the comment: _ipaddr_info() also uses "type == socket.SOCK_STREAM". Is it ok? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:15:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 16:15:22 +0000 Subject: [issue31927] Fix compiling the socket module on NetBSD 8 and other issues Message-ID: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : NetBSD 8 adds support of AF_CAN (previously it was supported only on Linux). This causes a compilation error in socketmodule.c, because AF_CAN is defined in sys/socket.h, but sys/socket.h itself doesn't contain all necessary definitions for handling AF_CAN addresses. This also exposed other errors. The braces are not balanced if AF_CAN is defined, but CAN_RAW and CAN_BCM are not. PyBytes_AS_STRING() is called for non-bytes. The proposed patch balances #ifdef/#endif with braces, undefines AF_CAN if it is not usable (following the practice for other AF_* constants), separates support of CAN_RAW and CAN_BCM (only the former is defined on NetBSD 8), adds comments to #endif for helping with navigation, adds the const qualifier to char pointers that always point to constant data, fixes indentation. This fixed a compilation on NetBSD 8, and I hope this will fix a compilation on other platforms that will add AF_CAN. In a separate issue I'll add a support of AF_CAN on NetBSD (in 3.7 only). ---------- assignee: serhiy.storchaka components: Extension Modules messages: 305439 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Fix compiling the socket module on NetBSD 8 and other issues type: compile error versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:31:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 16:31:02 +0000 Subject: [issue31927] Fix compiling the socket module on NetBSD 8 and other issues In-Reply-To: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> Message-ID: <1509640262.02.0.213398074469.issue31927@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4202 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:34:21 2017 From: report at bugs.python.org (Aaron Hall) Date: Thu, 02 Nov 2017 16:34:21 +0000 Subject: [issue30670] pprint for dict in sorted order or insert order? In-Reply-To: <1497492955.33.0.313949068523.issue30670@psf.upfronthosting.co.za> Message-ID: <1509640461.53.0.213398074469.issue30670@psf.upfronthosting.co.za> Aaron Hall added the comment: If/when order is guaranteed (3.7?) we should have a pprint that respects current order, -or- we should get an improved pprint (maybe named pp or print?) that understands mappings and other abstract data types. I had a conversation about pprint at the Python meetup last night. It kinda went like this: https://www.youtube.com/watch?v=NpYEJx7PkWE Maybe now's the time for improved behavior? ---------- nosy: +Aaron Hall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:37:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 16:37:13 +0000 Subject: [issue30512] CAN Socket support for NetBSD In-Reply-To: <1496155843.0.0.360939407267.issue30512@psf.upfronthosting.co.za> Message-ID: <1509640633.81.0.213398074469.issue30512@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The compilation will be fixed in issue31927. I have wrote similar patch for adding CAN Socket support on NetBSD. I'll combine the patches later. This is a new feature and can be added only in 3.7. ---------- assignee: -> serhiy.storchaka components: +Extension Modules -Build dependencies: +Fix compiling the socket module on NetBSD 8 and other issues nosy: +serhiy.storchaka type: compile error -> enhancement versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 13:02:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 17:02:35 +0000 Subject: [issue30670] pprint for dict in sorted order or insert order? In-Reply-To: <1497492955.33.0.313949068523.issue30670@psf.upfronthosting.co.za> Message-ID: <1509642155.11.0.213398074469.issue30670@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: A year ago I proposed to add a method for detecting whether a dict preserves an order and in what sense. [1] But this idea was rejected. [1] https://mail.python.org/pipermail/python-dev/2016-October/146597.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 13:46:04 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 02 Nov 2017 17:46:04 +0000 Subject: [issue28643] Broken makefile depends for profile-opt target In-Reply-To: <1478634995.26.0.389156722395.issue28643@psf.upfronthosting.co.za> Message-ID: <1509644764.23.0.213398074469.issue28643@psf.upfronthosting.co.za> Neil Schemenauer added the comment: New changeset 4e38d71a2b7b606fb1b0078c2d7014fc24044dac by Neil Schemenauer in branch 'master': bpo-28643: Record profile-opt build progress with stamp files (#4223) https://github.com/python/cpython/commit/4e38d71a2b7b606fb1b0078c2d7014fc24044dac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 13:57:10 2017 From: report at bugs.python.org (Lele Gaifax) Date: Thu, 02 Nov 2017 17:57:10 +0000 Subject: [issue27645] Supporting native backup facility of SQLite In-Reply-To: <1469728098.24.0.732586701981.issue27645@psf.upfronthosting.co.za> Message-ID: <1509645430.35.0.213398074469.issue27645@psf.upfronthosting.co.za> Change by Lele Gaifax : ---------- pull_requests: +4203 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 13:59:01 2017 From: report at bugs.python.org (Lele Gaifax) Date: Thu, 02 Nov 2017 17:59:01 +0000 Subject: [issue27645] Supporting native backup facility of SQLite In-Reply-To: <1469728098.24.0.732586701981.issue27645@psf.upfronthosting.co.za> Message-ID: <1509645541.59.0.213398074469.issue27645@psf.upfronthosting.co.za> Lele Gaifax added the comment: As suggested by Brett Cannon, I closed the original PR#377 and opened a new one against a rebased version of the implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 15:12:23 2017 From: report at bugs.python.org (Zachary Ware) Date: Thu, 02 Nov 2017 19:12:23 +0000 Subject: [issue30952] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1509649943.36.0.213398074469.issue30952@psf.upfronthosting.co.za> Zachary Ware added the comment: Would you like to supply a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 15:21:45 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 02 Nov 2017 19:21:45 +0000 Subject: [issue31928] DOC: Show sys.version_info as a named tuple Message-ID: <1509650505.83.0.213398074469.issue31928@psf.upfronthosting.co.za> New submission from Cheryl Sabella : Invoking sys.version_info displays results as a named tuple, but the documentation shows the results as a tuple. ---------- assignee: docs at python components: Documentation messages: 305446 nosy: csabella, docs at python priority: normal severity: normal status: open title: DOC: Show sys.version_info as a named tuple versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 15:26:21 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 02 Nov 2017 19:26:21 +0000 Subject: [issue31928] DOC: Show sys.version_info as a named tuple In-Reply-To: <1509650505.83.0.213398074469.issue31928@psf.upfronthosting.co.za> Message-ID: <1509650781.74.0.213398074469.issue31928@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- keywords: +patch pull_requests: +4204 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 16:43:25 2017 From: report at bugs.python.org (Big Stone) Date: Thu, 02 Nov 2017 20:43:25 +0000 Subject: [issue30952] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1509655405.99.0.213398074469.issue30952@psf.upfronthosting.co.za> Big Stone added the comment: Sorry, I'm not skilled enough to do PR on Python core. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 17:20:51 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 02 Nov 2017 21:20:51 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509657651.39.0.213398074469.issue31415@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- pull_requests: +4205 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 17:26:43 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 02 Nov 2017 21:26:43 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509658003.54.0.213398074469.issue21423@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +4206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 17:27:46 2017 From: report at bugs.python.org (Barry) Date: Thu, 02 Nov 2017 21:27:46 +0000 Subject: [issue31929] Raw strings create syntax error when last character is a single backslash Message-ID: <1509658066.58.0.213398074469.issue31929@psf.upfronthosting.co.za> New submission from Barry : Raw strings create syntax error when last character is a backslash (\). This problem seems to exist across all versions of python (that I have access to) Sample Code: ------------------------------------------------------------- Under Windows Python 2.7.3 Works Correctly: >>> test = r'C:\Program Files\^%(x86)\Internet Explorer\iexplore.exe' >>> print test C:\Program Files\^%(x86)\Internet Explorer\iexplore.exe Fails because last character is backslash >>> test = r'C:\Program Files\^%(x86)\Internet Explorer\' SyntaxError: EOL while scanning string literal ------------------------------------------------------------- Under Linux Python 2.7.12 Works Correctly >>> j=r"\n" >>> print j \n Fails because last character is backslash >>> j=r"n\" SyntaxError: EOL while scanning string literal Works correctly: >>> j=r"n\n" >>> print j n\n Works correctly: >>> j=r"n\\" >>> print j n\\ ------------------------------------------------------------- Under Linux Python 3.5.2 Fails because last character is backslash >>> j=r"\' File "", line 1 j=r"\' ^ SyntaxError: EOL while scanning string literal ------------------------------------------------------------- ---------- components: Interpreter Core messages: 305448 nosy: mezzzmer priority: normal severity: normal status: open title: Raw strings create syntax error when last character is a single backslash type: compile error versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 17:27:52 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 02 Nov 2017 21:27:52 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509658072.95.0.213398074469.issue31415@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I like this a lot and while the issue is still open, I'm piggybacking my PR 4240 on this one. I have a use case for enabling this feature via environment variable, so PR 4240 adds PYTHONPROFILEIMPORTTIME which also enables this feature. We build our tools using pex, which hardcodes the shebang at the top of the zip file. This isn't easily changed, and clearly we wouldn't want to enable -X importtime everywhere. When we have startup performance issues, I want to be able to tell people (or set it up in our CI) to set the environment variable and collect the data for analysis. This is much easier than tweaking the shebang or invoking the zip with an explicit command. Also, there are potential gotchas with loading too much up on the shebang line (IIRC, there are line length limits and/or multiple option limits for shebangs, e.g. if we wanted to have both -I and -X). I haven't fixed the initialization check problem that serhiy.storchaka points out, since that's addressed by PR 4138. But maybe I should fold that change into mine. ---------- nosy: +barry stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 17:28:23 2017 From: report at bugs.python.org (Antony Lee) Date: Thu, 02 Nov 2017 21:28:23 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509658103.15.0.213398074469.issue21423@psf.upfronthosting.co.za> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 17:33:20 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 02 Nov 2017 21:33:20 +0000 Subject: [issue31929] Raw strings create syntax error when last character is a single backslash In-Reply-To: <1509658066.58.0.213398074469.issue31929@psf.upfronthosting.co.za> Message-ID: <1509658400.53.0.213398074469.issue31929@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: This is defined behavior, not a bug. See the end of the section on string literals: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals ---------- nosy: +barry resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 17:36:02 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 02 Nov 2017 21:36:02 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509658562.07.0.213398074469.issue21423@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I've opened a PR for this at https://github.com/python/cpython/pull/4241, loosely based on Dan's last patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 18:09:41 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 02 Nov 2017 22:09:41 +0000 Subject: [issue31930] IDLE: Pressing "Home" on Windows places cursor before ">>>" Message-ID: <1509660581.35.0.213398074469.issue31930@psf.upfronthosting.co.za> New submission from Terry J. Reedy : If one enters text in Shell after a '>>> ' prompt, Home should initially send the cursor between the prompt and entered text and then to the beginning of the line, and so on as a toggle. On all current releases (and the final 3.5.4), on my Win10 machine, the cursor goes to the beginning of the line and stays there. This is nearly the same as #3851, which patched EditorWindow.home_callback on 2011-3-21 and -25. The problem then only affected Windows, because it involved event.state for keypresses, which is set differently on Windows and *nix. This issue is slightly different in that the Numlock key no longer matters. (See KBK's 2009-04-04 02:51 message.) Cherl or Louie, is this one also Windows-only or does it occur on Linux? According to hg annotate, the only subsequent patch to .home_callback before the git switch was 2012-12-24 for #16511. It changed the part of the function that adjusted selection, after moving the cursor, if Shift-Home was pressed. When the cursor moves to the beginning of the line, the selection includes the prompt. 3.5 has not been patched since the switch to git, so the problem must predate the switch. 2.7 on Windows runs with tk 8.5.15, so a later tk change cannot be the problem. So I suspect that the 'culprit' is either an earlier 'fix' to tk or a patch to tkinter since 2011, combined with the absence of a test in IDLE for correct behavior. Serhiy, do you have any ideas? ---------- assignee: terry.reedy components: IDLE messages: 305452 nosy: csabella, louielu, serhiy.storchaka, terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: Pressing "Home" on Windows places cursor before ">>>" type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 18:11:50 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 02 Nov 2017 22:11:50 +0000 Subject: [issue3851] IDLE: Pressing "Home" on Windows places cursor before ">>>" instead of after. Solution offered. In-Reply-To: <1221250835.7.0.322524713176.issue3851@psf.upfronthosting.co.za> Message-ID: <1509660710.02.0.213398074469.issue3851@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The problem is back, at least on Windows, in 2.7.14, 3.5.4, 3.6.3, and 3.7.0. Numlock has no effect. I open #31930 for this. ---------- resolution: accepted -> fixed stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 18:43:48 2017 From: report at bugs.python.org (ppperry) Date: Thu, 02 Nov 2017 22:43:48 +0000 Subject: [issue31925] test_socket creates too many locks In-Reply-To: <1509632190.98.0.213398074469.issue31925@psf.upfronthosting.co.za> Message-ID: <1509662628.38.0.213398074469.issue31925@psf.upfronthosting.co.za> Change by ppperry : ---------- title: test_socket creates too much locks -> test_socket creates too many locks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 18:55:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 02 Nov 2017 22:55:03 +0000 Subject: [issue31890] Please define the flag METH_STACKLESS for Stackless Python In-Reply-To: <1509210414.45.0.213398074469.issue31890@psf.upfronthosting.co.za> Message-ID: <1509663303.41.0.213398074469.issue31890@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9e3397333278f973a11d933c27a69af250e4acf0 by Victor Stinner (Anselm Kruis) in branch 'master': bpo-31890: define METH_STACKLESS (#4159) https://github.com/python/cpython/commit/9e3397333278f973a11d933c27a69af250e4acf0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 18:55:23 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 02 Nov 2017 22:55:23 +0000 Subject: [issue25293] Hooking Thread/Process instantiation in concurrent.futures. In-Reply-To: <1443737352.06.0.289026067314.issue25293@psf.upfronthosting.co.za> Message-ID: <1509663323.03.0.213398074469.issue25293@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'd rather close this in favour of issue21423. ---------- nosy: +pitrou resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 18:56:04 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 02 Nov 2017 22:56:04 +0000 Subject: [issue31700] one-argument version for Generator.typing In-Reply-To: <1507192517.86.0.213398074469.issue31700@psf.upfronthosting.co.za> Message-ID: <1509663364.71.0.213398074469.issue31700@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Since there is no response for few weeks I assume this works for you. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 19:01:21 2017 From: report at bugs.python.org (Antony Lee) Date: Thu, 02 Nov 2017 23:01:21 +0000 Subject: [issue25293] Hooking Thread/Process instantiation in concurrent.futures. In-Reply-To: <1443737352.06.0.289026067314.issue25293@psf.upfronthosting.co.za> Message-ID: <1509663681.68.0.213398074469.issue25293@psf.upfronthosting.co.za> Antony Lee added the comment: I can't say I *really* need this anymore, but note that https://bugs.python.org/issue21423 is less general as it does not handle the case of a finalizer as proposed here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 19:13:39 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 02 Nov 2017 23:13:39 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509664419.9.0.213398074469.issue31415@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: New changeset 700d2e4755921d6c339ff20dacecde1aea64de34 by Barry Warsaw in branch 'master': bpo-31415: Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime (#4240) https://github.com/python/cpython/commit/700d2e4755921d6c339ff20dacecde1aea64de34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 19:55:09 2017 From: report at bugs.python.org (Sebastian Rittau) Date: Thu, 02 Nov 2017 23:55:09 +0000 Subject: [issue31700] one-argument version for Generator.typing In-Reply-To: <1507192517.86.0.213398074469.issue31700@psf.upfronthosting.co.za> Message-ID: <1509666909.58.0.213398074469.issue31700@psf.upfronthosting.co.za> Sebastian Rittau added the comment: Sorry for not responding, but I didn't know what I could have added that I didn't already say in the opening post. Of course, you can use workaround like using the three-argument version or creating aliases. Using Iterator is of course not a real solution for the general case. I still believe that Generator should be usable with just one argument or typing should provide such an alias. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 19:56:22 2017 From: report at bugs.python.org (Thomas Moreau) Date: Thu, 02 Nov 2017 23:56:22 +0000 Subject: [issue22281] ProcessPoolExecutor/ThreadPoolExecutor should provide introspection APIs In-Reply-To: <1409104603.02.0.0732918756664.issue22281@psf.upfronthosting.co.za> Message-ID: <1509666982.09.0.213398074469.issue22281@psf.upfronthosting.co.za> Change by Thomas Moreau : ---------- pull_requests: +4207 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 20:40:49 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 03 Nov 2017 00:40:49 +0000 Subject: [issue30806] netrc.__repr__() is broken for writing to file In-Reply-To: <1498763541.77.0.380552653426.issue30806@psf.upfronthosting.co.za> Message-ID: <1509669649.22.0.213398074469.issue30806@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4208 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 21:08:11 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 03 Nov 2017 01:08:11 +0000 Subject: [issue31928] DOC: Show sys.version_info as a named tuple In-Reply-To: <1509650505.83.0.213398074469.issue31928@psf.upfronthosting.co.za> Message-ID: <1509671291.4.0.213398074469.issue31928@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 23:16:57 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 03 Nov 2017 03:16:57 +0000 Subject: [issue28791] update sqlite to latest version before beta 1 In-Reply-To: <1480017928.89.0.263397799958.issue28791@psf.upfronthosting.co.za> Message-ID: <1509679017.89.0.213398074469.issue28791@psf.upfronthosting.co.za> Change by Mariatta Wijaya : ---------- keywords: +patch pull_requests: +4209 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 23:22:07 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 03 Nov 2017 03:22:07 +0000 Subject: [issue31921] Bring together logic for entering/leaving a frame in frameobject.c In-Reply-To: <1509616579.32.0.213398074469.issue31921@psf.upfronthosting.co.za> Message-ID: <1509679327.47.0.213398074469.issue31921@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I don't think we should be re-arranging the core of the language to facilitate your language experiments. We need to know that is this is valuable for other people, not just you. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 23:32:47 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 03 Nov 2017 03:32:47 +0000 Subject: [issue28791] update sqlite to latest version before beta 1 In-Reply-To: <1480017928.89.0.263397799958.issue28791@psf.upfronthosting.co.za> Message-ID: <1509679967.89.0.213398074469.issue28791@psf.upfronthosting.co.za> Change by Mariatta Wijaya : ---------- pull_requests: +4210 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 01:36:48 2017 From: report at bugs.python.org (INADA Naoki) Date: Fri, 03 Nov 2017 05:36:48 +0000 Subject: [issue30806] netrc.__repr__() is broken for writing to file In-Reply-To: <1498763541.77.0.380552653426.issue30806@psf.upfronthosting.co.za> Message-ID: <1509687408.64.0.213398074469.issue30806@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 5fbe5e161c969bc8a0d44a301152f8bf5afe0fc7 by INADA Naoki (Miss Islington (bot)) in branch '3.6': bpo-30806: Fix netrc.__repr__() format (GH-2491) https://github.com/python/cpython/commit/5fbe5e161c969bc8a0d44a301152f8bf5afe0fc7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 01:37:21 2017 From: report at bugs.python.org (INADA Naoki) Date: Fri, 03 Nov 2017 05:37:21 +0000 Subject: [issue30806] netrc.__repr__() is broken for writing to file In-Reply-To: <1498763541.77.0.380552653426.issue30806@psf.upfronthosting.co.za> Message-ID: <1509687441.6.0.213398074469.issue30806@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 01:37:32 2017 From: report at bugs.python.org (INADA Naoki) Date: Fri, 03 Nov 2017 05:37:32 +0000 Subject: [issue30806] netrc.__repr__() is broken for writing to file In-Reply-To: <1498763541.77.0.380552653426.issue30806@psf.upfronthosting.co.za> Message-ID: <1509687452.78.0.213398074469.issue30806@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 01:50:50 2017 From: report at bugs.python.org (INADA Naoki) Date: Fri, 03 Nov 2017 05:50:50 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509688250.68.0.213398074469.issue31415@psf.upfronthosting.co.za> INADA Naoki added the comment: When adding environment variable option, it should be documented in man page and `python -h`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 02:42:11 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 03 Nov 2017 06:42:11 +0000 Subject: [issue31370] Remove support for threads-less builds In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za> Message-ID: <1509691331.91.0.213398074469.issue31370@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- Removed message: https://bugs.python.org/msg302490 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 02:42:40 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 03 Nov 2017 06:42:40 +0000 Subject: [issue31370] Remove support for threads-less builds In-Reply-To: <1504732249.83.0.180664230366.issue31370@psf.upfronthosting.co.za> Message-ID: <1509691360.34.0.213398074469.issue31370@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 05:02:51 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 09:02:51 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509699771.31.0.213398074469.issue21423@psf.upfronthosting.co.za> Antoine Pitrou added the comment: By the way, the submitted PR follows Dan's argument about the initializer's argument: the actual call is `initializer(*initargs)`. If someone wants to know about the current thread or process, it's trivial to call `thread.current_thread()` or `multiprocessing.current_process()` (and I don't it's a bad idiom in itself :-)). If you want to comment on the PR, I would recommend doing it quick, as I plan to merge in a day or two :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 05:09:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 09:09:06 +0000 Subject: [issue31926] compile error when converting selectmodule to AC due to missing #define-s In-Reply-To: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> Message-ID: <1509700146.2.0.213398074469.issue31926@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 4f57409a2f7bdf8fb559cddc7c6533ca2c471c67 by Serhiy Storchaka (Tal Einat) in branch 'master': bpo-31926: fix missing *_METHODDEF statements by argument clinic (#4230) https://github.com/python/cpython/commit/4f57409a2f7bdf8fb559cddc7c6533ca2c471c67 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 05:46:26 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 03 Nov 2017 09:46:26 +0000 Subject: [issue31930] IDLE: Pressing "Home" on Windows places cursor before ">>>" In-Reply-To: <1509660581.35.0.213398074469.issue31930@psf.upfronthosting.co.za> Message-ID: <1509702386.63.0.213398074469.issue31930@psf.upfronthosting.co.za> Cheryl Sabella added the comment: On Ubuntu, HOME initially goes to between the text and >>>. Pressing it again moves it before the >>> and then it toggles between the two. So, it appears to be working as expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 05:53:27 2017 From: report at bugs.python.org (Stefan Krah) Date: Fri, 03 Nov 2017 09:53:27 +0000 Subject: [issue18835] Add PyMem_AlignedAlloc() In-Reply-To: <1377484371.18.0.399621580043.issue18835@psf.upfronthosting.co.za> Message-ID: <1509702807.12.0.213398074469.issue18835@psf.upfronthosting.co.za> Stefan Krah added the comment: > I'm not sure that the cost of the memory allocator itself defeats the gain of aligned memory on algorithms. I expect data processing to be much more expensive than the memory allocation, no? I guess this issue isn't easy to focus due to the vast variety of use cases. So the is only about numpy/ndtypes: What you write is true, but I'm simply getting cold feet w.r.t locking myself into memset(). calloc() uses mmap() for large allocations, so I think one can happily allocate a large number of huge arrays without any cost on Linux, as long as they're not accessed. At least that's what my tests indicate. Couple that with the fact that one has to use aligned_free() anyway, and that posix_memalign() isn't that great, and the use case seems less solid **for scientific computing**. So I rather waste a couple of bytes per allocation and deal with some Valgrind macros to get proper bounds checking. Note that CPython still knows any allocation from ndtypes, because ndt_callocfunc will be set to PyMem_Calloc() [1] and the custom ndt_aligned_calloc() uses ndt_callocfunc. [1] If #31912 is solved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 06:07:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 10:07:27 +0000 Subject: [issue31890] Please define the flag METH_STACKLESS for Stackless Python In-Reply-To: <1509210414.45.0.213398074469.issue31890@psf.upfronthosting.co.za> Message-ID: <1509703647.37.0.213398074469.issue31890@psf.upfronthosting.co.za> STINNER Victor added the comment: Anselm Kruis: Python 3.7 now has your METH_STACKLESS flag. Enjoy ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 06:14:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 10:14:38 +0000 Subject: [issue31931] test_concurrent_futures: ProcessPoolSpawnExecutorTest.test_shutdown_race_issue12456() leaked dangling process on x86 Tiger 3.x Message-ID: <1509704078.7.0.213398074469.issue31931@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/30/builds/109/steps/4/logs/stdio 0:24:58 load avg: 2.01 [274/407/1] test_concurrent_futures failed (env changed) (279 sec) (...) test_shutdown_race_issue12456 (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 7.42s Warning -- reap_children() reaped child process 3411 ok (...) Warning -- multiprocessing.process._dangling was modified by test_concurrent_futures Before: <_weakrefset.WeakSet object at 0x269fd54> After: <_weakrefset.WeakSet object at 0x26a64cc> ---------- components: Tests keywords: buildbot messages: 305468 nosy: haypo priority: normal severity: normal status: open title: test_concurrent_futures: ProcessPoolSpawnExecutorTest.test_shutdown_race_issue12456() leaked dangling process on x86 Tiger 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 06:23:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 10:23:55 +0000 Subject: [issue31931] test_concurrent_futures: ProcessPoolSpawnExecutorTest.test_shutdown_race_issue12456() leaked dangling process on x86 Tiger 3.x In-Reply-To: <1509704078.7.0.213398074469.issue31931@psf.upfronthosting.co.za> Message-ID: <1509704635.49.0.213398074469.issue31931@psf.upfronthosting.co.za> STINNER Victor added the comment: More context: test_correct_timeout_exception_msg (test.test_concurrent_futures.ProcessPoolSpawnAsCompletedTests) ... 2.66s ok test_duplicate_futures (test.test_concurrent_futures.ProcessPoolSpawnAsCompletedTests) ... 4.64s ok test_free_reference_yielded_future (test.test_concurrent_futures.ProcessPoolSpawnAsCompletedTests) ... 2.69s ok test_no_timeout (test.test_concurrent_futures.ProcessPoolSpawnAsCompletedTests) ... 2.80s ok test_zero_timeout (test.test_concurrent_futures.ProcessPoolSpawnAsCompletedTests) ... 4.72s ok test_free_reference (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 9.49s ok test_killed_child (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 2.44s ok test_map (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 2.71s ok test_map_chunksize (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 2.69s ok test_map_exception (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 2.65s ok test_map_timeout (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 8.65s ok test_max_workers_negative (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 2.64s ok test_no_stale_references (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 2.66s ok test_ressources_gced_in_workers (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 4.75s ok test_shutdown_race_issue12456 (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 7.42s Warning -- reap_children() reaped child process 3411 ok test_submit (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 2.97s ok test_submit_keyword (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 3.03s ok test_traceback (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 2.92s ok test_context_manager_shutdown (test.test_concurrent_futures.ProcessPoolSpawnShutdownTest) ... 2.95s ok test_del_shutdown (test.test_concurrent_futures.ProcessPoolSpawnShutdownTest) ... 2.74s ok test_hang_issue12364 (test.test_concurrent_futures.ProcessPoolSpawnShutdownTest) ... 3.65s ok test_interpreter_shutdown (test.test_concurrent_futures.ProcessPoolSpawnShutdownTest) ... 7.00s ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 06:44:13 2017 From: report at bugs.python.org (Hugh Fisher) Date: Fri, 03 Nov 2017 10:44:13 +0000 Subject: [issue31932] setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData Message-ID: <1509705853.38.0.213398074469.issue31932@psf.upfronthosting.co.za> New submission from Hugh Fisher : This was raised in issue #23246 but apparently not addressed at the time. The Visual C for Python 2.7 tools on my MS Windows 8.1 system installed themselves under the invisible AppData directory because I did not do so as Administrator. Running setup.py to build a (2.7) native extension then fails because it can't find VCVERSALL.BAT. Fix is a couple of extra lines in find_vcvarsall in msvc9compiler.py to search under AppData if it can't be found in the system location. I will submit a pull request. ---------- components: Distutils messages: 305470 nosy: dstufft, eric.araujo, laranzu priority: normal severity: normal status: open title: setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 07:15:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 11:15:49 +0000 Subject: [issue31911] Use malloc_usable_size() in pymalloc for realloc In-Reply-To: <1509472664.46.0.213398074469.issue31911@psf.upfronthosting.co.za> Message-ID: <1509707749.16.0.213398074469.issue31911@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Use malloc_usable_size() is pymalloc for realloc -> Use malloc_usable_size() in pymalloc for realloc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:11:38 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 12:11:38 +0000 Subject: [issue31308] forkserver process isn't re-launched if it died In-Reply-To: <1504103235.79.0.43802074293.issue31308@psf.upfronthosting.co.za> Message-ID: <1509711098.53.0.213398074469.issue31308@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Davin, I think I'm going to merge the PR for this. If you object it, it can still be reverted later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:23:02 2017 From: report at bugs.python.org (Ned Deily) Date: Fri, 03 Nov 2017 12:23:02 +0000 Subject: [issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter In-Reply-To: <1508407674.96.0.213398074469.issue31817@psf.upfronthosting.co.za> Message-ID: <1509711782.99.0.213398074469.issue31817@psf.upfronthosting.co.za> Ned Deily added the comment: Josh, sorry I don't have any further ideas off the top of my head and I likely won't have time for several weeks to try to reproduce this myself. Have you tried renaming the _tkinter extension back, doing a "make install", and seeing whether it imports properly from the installed python? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:27:26 2017 From: report at bugs.python.org (Jack O'Connor) Date: Fri, 03 Nov 2017 12:27:26 +0000 Subject: [issue31933] some Blake2 parameters are encoded backwards on big-endian platforms Message-ID: <1509712046.35.0.213398074469.issue31933@psf.upfronthosting.co.za> New submission from Jack O'Connor : See https://github.com/BLAKE2/libb2/issues/12. All Blake2 params have to be encoded in little-endian byte order. For the two multi-byte integer params, leaf_length and node_offset, that means that assigning a native-endian integer to them appears to work on little-endian platforms, but gives the wrong result on big-endian. The current libb2 API doesn't make that very clear, and @sneves is working on new API functions in the GH issue above. In the meantime, we can work around the problem by explicitly assigning little-endian values to the parameter block. ---------- messages: 305473 nosy: oconnor663 priority: normal severity: normal status: open title: some Blake2 parameters are encoded backwards on big-endian platforms type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:29:46 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 03 Nov 2017 12:29:46 +0000 Subject: [issue31933] some Blake2 parameters are encoded backwards on big-endian platforms In-Reply-To: <1509712046.35.0.213398074469.issue31933@psf.upfronthosting.co.za> Message-ID: <1509712186.59.0.213398074469.issue31933@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4211 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:30:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 12:30:33 +0000 Subject: [issue20171] Derby #2: Convert 115 sites to Argument Clinic in Modules/_cursesmodule.c In-Reply-To: <1389138236.79.0.916600121015.issue20171@psf.upfronthosting.co.za> Message-ID: <1509712233.25.0.213398074469.issue20171@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4213 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:34:25 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 12:34:25 +0000 Subject: [issue31308] forkserver process isn't re-launched if it died In-Reply-To: <1504103235.79.0.43802074293.issue31308@psf.upfronthosting.co.za> Message-ID: <1509712465.12.0.213398074469.issue31308@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset fc6b348b12ad401cab0261b7b71a65c60a08c0a8 by Antoine Pitrou in branch 'master': bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary (#3246) https://github.com/python/cpython/commit/fc6b348b12ad401cab0261b7b71a65c60a08c0a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:41:35 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 12:41:35 +0000 Subject: [issue31308] forkserver process isn't re-launched if it died In-Reply-To: <1504103235.79.0.43802074293.issue31308@psf.upfronthosting.co.za> Message-ID: <1509712895.42.0.213398074469.issue31308@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +4214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:43:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 12:43:22 +0000 Subject: [issue20171] Derby #2: Convert 115 sites to Argument Clinic in Modules/_cursesmodule.c In-Reply-To: <1389138236.79.0.916600121015.issue20171@psf.upfronthosting.co.za> Message-ID: <1509713002.57.0.213398074469.issue20171@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 4251 converts most of functions in the _curses and _curses_panel modules (around 130 functions) to Argument Clinic. Many functions didn't have docstrings, the PR adds them. You can test new signatures and docstrings by the following commands: ./python -m pydoc curses ./python -m pydoc curses.window ./python -m pydoc curses.panel ./python -m pydoc curses.panel.panel 3 functions can't be converted. The initial versions of Argument Clinic supported such declarations, but now it doesn't support them. Will try to fix Argument Clinic in other issue. Yet 35 generated window methods have not been converted because I'm too tired by this patch. They will be converted by other patches. I tried to make new and existing docstrings short and clear, but I think many docstrings still need editing. ---------- versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:52:05 2017 From: report at bugs.python.org (Christian Heimes) Date: Fri, 03 Nov 2017 12:52:05 +0000 Subject: [issue31933] some Blake2 parameters are encoded backwards on big-endian platforms In-Reply-To: <1509712046.35.0.213398074469.issue31933@psf.upfronthosting.co.za> Message-ID: <1509713525.19.0.213398074469.issue31933@psf.upfronthosting.co.za> Christian Heimes added the comment: Good work, thanks for your PR! ---------- assignee: -> christian.heimes components: +Extension Modules nosy: +christian.heimes versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:59:48 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 12:59:48 +0000 Subject: [issue31308] forkserver process isn't re-launched if it died In-Reply-To: <1504103235.79.0.43802074293.issue31308@psf.upfronthosting.co.za> Message-ID: <1509713988.85.0.213398074469.issue31308@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 019c99f325287741d1e0eefeef2b75c8e00b884f by Antoine Pitrou in branch '3.6': [3.6] bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary (GH-3246) (#4252) https://github.com/python/cpython/commit/019c99f325287741d1e0eefeef2b75c8e00b884f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:00:04 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 13:00:04 +0000 Subject: [issue31308] forkserver process isn't re-launched if it died In-Reply-To: <1504103235.79.0.43802074293.issue31308@psf.upfronthosting.co.za> Message-ID: <1509714004.91.0.213398074469.issue31308@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:10:17 2017 From: report at bugs.python.org (Tal Einat) Date: Fri, 03 Nov 2017 13:10:17 +0000 Subject: [issue31926] compile error when converting selectmodule to AC due to missing #define-s In-Reply-To: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> Message-ID: <1509714617.26.0.213398074469.issue31926@psf.upfronthosting.co.za> Change by Tal Einat : ---------- pull_requests: +4215 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:14:42 2017 From: report at bugs.python.org (Pim Klanke) Date: Fri, 03 Nov 2017 13:14:42 +0000 Subject: [issue30844] selectors: Add urgent data to read event In-Reply-To: <1509638074.05.0.213398074469.issue30844@psf.upfronthosting.co.za> Message-ID: <427c9b5b-a289-d2f3-056f-3355245f5ab1@protonic.nl> Pim Klanke added the comment: On 02-11-17 16:54, STINNER Victor wrote: > STINNER Victor added the comment: > > It seems like kqueue supports urgent data: > > "EV_OOBAND: Read filter on socket may set this flag to indicate the presence of out of band data on the descriptor." > > Example: https://github.com/daurnimator/cqueues/commit/52baaf1c25bc7e6f7cb4685cb05f4ed47a3f404a Looks promising. I will have to look into this. > Be careful, I also found: > > // Older versions of Mac OS X may not define EV_OOBAND. > #if !defined(EV_OOBAND) > # define EV_OOBAND EV_FLAG1 > #endif // !defined(EV_OOBAND) > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:15:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 13:15:42 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1509714942.17.0.213398074469.issue31920@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your patch Oleg. 3.4 and 3.5 are in security fixes only mode now. Good catch, the usage of os.walk() in pygettext.py is incorrect. But your change is not enough. In _visit_pyfiles() the name 'CVS' is removed from the names list. If names is a list of directories emitted by os.walk(), this would exclude the whole directory CVS from searching. But if it is a new list "dirs + files", this doesn't have any effect. And directories with the ".py" extension shouldn't be added to the list of Python files. Hence _visit_pyfiles should take two separate lists for directories and files. And since it no longer is a callback, it would be better to inline its code. There are tests for pygettext in Lib/test/test_tools/test_i18n.py. It would be nice to add a new test for the fixed feature. ---------- nosy: +serhiy.storchaka stage: patch review -> needs patch versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:17:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 13:17:47 +0000 Subject: [issue31926] compile error when converting selectmodule to AC due to missing #define-s In-Reply-To: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> Message-ID: <1509715067.16.0.213398074469.issue31926@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:31:40 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 13:31:40 +0000 Subject: [issue31310] semaphore tracker isn't protected against crashes In-Reply-To: <1504108352.86.0.17423028145.issue31310@psf.upfronthosting.co.za> Message-ID: <1509715900.29.0.213398074469.issue31310@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset cbe1756e3ecefc0e24a5d0a4b8663db9b6d0cc52 by Antoine Pitrou in branch 'master': bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed (#3247) https://github.com/python/cpython/commit/cbe1756e3ecefc0e24a5d0a4b8663db9b6d0cc52 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:32:36 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 13:32:36 +0000 Subject: [issue31310] semaphore tracker isn't protected against crashes In-Reply-To: <1504108352.86.0.17423028145.issue31310@psf.upfronthosting.co.za> Message-ID: <1509715956.45.0.213398074469.issue31310@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +4216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:43:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 13:43:18 +0000 Subject: [issue31926] compile error when converting selectmodule to AC due to missing #define-s In-Reply-To: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> Message-ID: <1509716598.23.0.213398074469.issue31926@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f8b3f6b178e48773cd7298141cbaf408c6917e41 by Victor Stinner (Tal Einat) in branch '3.6': [3.6] bpo-31926: fix missing *_METHODDEF statements by argument clinic (GH-4230) (#4253) https://github.com/python/cpython/commit/f8b3f6b178e48773cd7298141cbaf408c6917e41 ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:46:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 13:46:37 +0000 Subject: [issue31926] compile error when converting selectmodule to AC due to missing #define-s In-Reply-To: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> Message-ID: <1509716797.05.0.213398074469.issue31926@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you Tal Einat for your bug report and your fix. It's now merged into 3.6 and master (future 3.7). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:49:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 13:49:53 +0000 Subject: [issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files In-Reply-To: <1389140257.44.0.42523119139.issue20182@psf.upfronthosting.co.za> Message-ID: <1509716993.87.0.213398074469.issue20182@psf.upfronthosting.co.za> STINNER Victor added the comment: I really hate the title of these issues "Derby #13: Convert 50 sites to Argument Clinic across 5 files". I would prefer to have one issue per file. Would it possible to close this one and open a new issue once someone has a PR for one file? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:54:28 2017 From: report at bugs.python.org (Tal Einat) Date: Fri, 03 Nov 2017 13:54:28 +0000 Subject: [issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files In-Reply-To: <1389140257.44.0.42523119139.issue20182@psf.upfronthosting.co.za> Message-ID: <1509717268.96.0.213398074469.issue20182@psf.upfronthosting.co.za> Tal Einat added the comment: As the author of all of the updated patches, I wouldn't mind opening new issues separately for each of the remaining modules. Actually I would prefer it :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:58:40 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 13:58:40 +0000 Subject: [issue31310] semaphore tracker isn't protected against crashes In-Reply-To: <1504108352.86.0.17423028145.issue31310@psf.upfronthosting.co.za> Message-ID: <1509717520.08.0.213398074469.issue31310@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset b5f09acf0a0219cec32b7eba3acdcb573fc74ab5 by Antoine Pitrou in branch '3.6': [3.6] bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed (GH-3247) (#4254) https://github.com/python/cpython/commit/b5f09acf0a0219cec32b7eba3acdcb573fc74ab5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 09:58:55 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 13:58:55 +0000 Subject: [issue31310] semaphore tracker isn't protected against crashes In-Reply-To: <1504108352.86.0.17423028145.issue31310@psf.upfronthosting.co.za> Message-ID: <1509717535.65.0.213398074469.issue31310@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 10:10:57 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 03 Nov 2017 14:10:57 +0000 Subject: [issue31934] Failure to build out of source from a not clean source Message-ID: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> New submission from Xavier de Gaye : The error message when building out of a not clean source tree: renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7 renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7 gcc -pthread -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.7m.a -lpthread -ldl -lutil -lm gcc: error: Programs/_testembed.o: No such file or directory make[1]: *** [Makefile:707: Programs/_testembed] Error 1 ---------- components: Build messages: 305486 nosy: xdegaye priority: normal severity: normal status: open title: Failure to build out of source from a not clean source type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 10:24:41 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 03 Nov 2017 14:24:41 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1509719081.43.0.213398074469.issue31934@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +4217 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 11:00:35 2017 From: report at bugs.python.org (Zachary Ware) Date: Fri, 03 Nov 2017 15:00:35 +0000 Subject: [issue31932] setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData In-Reply-To: <1509705853.38.0.213398074469.issue31932@psf.upfronthosting.co.za> Message-ID: <1509721235.84.0.213398074469.issue31932@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 11:01:32 2017 From: report at bugs.python.org (Martin Ritter) Date: Fri, 03 Nov 2017 15:01:32 +0000 Subject: [issue31935] subprocess.run() timeout not working with grandchildren and stdout=PIPE Message-ID: <1509721292.04.0.213398074469.issue31935@psf.upfronthosting.co.za> New submission from Martin Ritter : Hi, I tried to use subprocess.run(..., stdout=subprocess.PIPE, timeout=N) to run some test scripts with a given timeout. This works as expected with simple scripts. However if the script itself creates other children which write to stdout then `subprocess.run()` seems to wait for all of the children to finish. I've attached a minimal example. I looked into subprocess.py and `subprocess.run()` calls `process.communicate()` again without timeout when handling the TimeoutExpired exception which then in turn waits for the pipes to be closed by all children. If communicate() would check if the process is still alive while waiting for output and close the pipes once the process has finished the timeout feature should work as expected and descendants would get a SIGPIPE when writing to stdout/stderr. ---------- components: Library (Lib) files: test_killsub.py messages: 305487 nosy: Martin Ritter priority: normal severity: normal status: open title: subprocess.run() timeout not working with grandchildren and stdout=PIPE type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47251/test_killsub.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 11:14:48 2017 From: report at bugs.python.org (Thomas Moreau) Date: Fri, 03 Nov 2017 15:14:48 +0000 Subject: [issue31699] Deadlocks in `concurrent.futures.ProcessPoolExecutor` with pickling error In-Reply-To: <1507189305.87.0.213398074469.issue31699@psf.upfronthosting.co.za> Message-ID: <1509722088.98.0.213398074469.issue31699@psf.upfronthosting.co.za> Change by Thomas Moreau : ---------- keywords: +patch pull_requests: +4218 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 11:36:15 2017 From: report at bugs.python.org (Oleg Krasnikov) Date: Fri, 03 Nov 2017 15:36:15 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1509723375.74.0.213398074469.issue31920@psf.upfronthosting.co.za> Oleg Krasnikov added the comment: Thanks for quite sensible notes Serhiy. I've fixed all that in recent commit and added a regression test. Still not sure about "testing conventions" here cause this is my first PR to python repository, so please let me know if something is wrong and I'll fix that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 13:12:10 2017 From: report at bugs.python.org (Stefan Krah) Date: Fri, 03 Nov 2017 17:12:10 +0000 Subject: [issue31932] setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData In-Reply-To: <1509705853.38.0.213398074469.issue31932@psf.upfronthosting.co.za> Message-ID: <1509729130.71.0.213398074469.issue31932@psf.upfronthosting.co.za> Change by Stefan Krah : ---------- nosy: +jyrkih _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 13:12:46 2017 From: report at bugs.python.org (Stefan Krah) Date: Fri, 03 Nov 2017 17:12:46 +0000 Subject: [issue28706] msvc9compiler does not find a vcvarsall.bat of Visual C++ for Python 9.0 In-Reply-To: <1479244110.83.0.177633464347.issue28706@psf.upfronthosting.co.za> Message-ID: <1509729166.12.0.213398074469.issue28706@psf.upfronthosting.co.za> Change by Stefan Krah : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 13:19:46 2017 From: report at bugs.python.org (Daniel U. Thibault) Date: Fri, 03 Nov 2017 17:19:46 +0000 Subject: [issue31936] "5. The import system" grammatical error Message-ID: <1509729586.08.0.213398074469.issue31936@psf.upfronthosting.co.za> New submission from Daniel U. Thibault : https://docs.python.org/3/reference/import.html#importsystem "Other mechanisms for invoking the import system (such as importlib.import_module()) may choose to subvert __import__() and use its own solution to implement import semantics." should be "Other mechanisms for invoking the import system (such as importlib.import_module()) may choose to subvert __import__() and use their own solution to implement import semantics." ---------- assignee: docs at python components: Documentation messages: 305489 nosy: Daniel.U..Thibault, docs at python priority: normal severity: normal status: open title: "5. The import system" grammatical error type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 13:20:09 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 17:20:09 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1509688250.68.0.213398074469.issue31415@psf.upfronthosting.co.za> Message-ID: Barry A. Warsaw added the comment: On Nov 2, 2017, at 22:50, INADA Naoki wrote: > > When adding environment variable option, it should be documented in > man page and `python -h`. I thought about that, but the problem is that none of the -X options are documented in the ?help output. So do we only document the ones (e.g. importtime) that have an environment variable version, or do we now have to document them all? I opted to document PYTHONPROFILEIMPORTTIME only in the cmdline documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 13:29:28 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 17:29:28 +0000 Subject: [issue31936] "5. The import system" grammatical error In-Reply-To: <1509729586.08.0.213398074469.issue31936@psf.upfronthosting.co.za> Message-ID: <1509730168.43.0.213398074469.issue31936@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry versions: +Python 3.7 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 13:36:11 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 17:36:11 +0000 Subject: [issue31936] "5. The import system" grammatical error In-Reply-To: <1509729586.08.0.213398074469.issue31936@psf.upfronthosting.co.za> Message-ID: <1509730571.05.0.213398074469.issue31936@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- keywords: +patch pull_requests: +4219 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 13:37:24 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 17:37:24 +0000 Subject: [issue31936] "5. The import system" grammatical error In-Reply-To: <1509729586.08.0.213398074469.issue31936@psf.upfronthosting.co.za> Message-ID: <1509730644.95.0.213398074469.issue31936@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Re-reading the paragraph now, it also parsed weirdly for me. See the linked PR for a suggested improvement, along with your change. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:03:02 2017 From: report at bugs.python.org (Brett Cannon) Date: Fri, 03 Nov 2017 18:03:02 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1509732182.02.0.213398074469.issue31934@psf.upfronthosting.co.za> Brett Cannon added the comment: What's "unclean" in this case? I mean you can always re-run Make after making changes and the build succeeds, so I'm not quite sure what leads to this state. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:05:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 18:05:03 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509732303.61.0.213398074469.issue31415@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > I didn't think it's worth enough because import will be much slower than one dict lookup. I agree. The main value of my patch is handling possible (but very unlike) errors. Implementing negative value caching adds not many lines to the existing code and additional error handling. But now, after adding the environment variable, do we still need the -X option? From a user side I don't see much difference between specifying an option and an environment variable, but the code for handling the environment variable is much simpler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:13:33 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 18:13:33 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1509732813.15.0.213398074469.issue30057@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thanks for the report! I will push your patch soon. ---------- versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:14:44 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 18:14:44 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1509732884.77.0.213398074469.issue30057@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +4220 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:26:21 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 03 Nov 2017 18:26:21 +0000 Subject: [issue31898] Add a `recommended-packages.txt` file In-Reply-To: <1509340647.27.0.213398074469.issue31898@psf.upfronthosting.co.za> Message-ID: <1509733581.27.0.213398074469.issue31898@psf.upfronthosting.co.za> Change by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:29:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 18:29:36 +0000 Subject: [issue31924] Fix test_curses on NetBSD 8 In-Reply-To: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> Message-ID: <1509733776.0.0.213398074469.issue31924@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a7723d8b09f516a2b75837a3527b8cc7bee89fad by Serhiy Storchaka in branch 'master': bpo-31924: Fix test_curses on NetBSD 8. (#4228) https://github.com/python/cpython/commit/a7723d8b09f516a2b75837a3527b8cc7bee89fad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:29:44 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 03 Nov 2017 18:29:44 +0000 Subject: [issue31924] Fix test_curses on NetBSD 8 In-Reply-To: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> Message-ID: <1509733784.5.0.213398074469.issue31924@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4221 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:30:42 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 03 Nov 2017 18:30:42 +0000 Subject: [issue31924] Fix test_curses on NetBSD 8 In-Reply-To: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> Message-ID: <1509733842.89.0.213398074469.issue31924@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4222 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:53:37 2017 From: report at bugs.python.org (mickey695) Date: Fri, 03 Nov 2017 18:53:37 +0000 Subject: [issue31907] Clarify error message when attempting to call function via str.format() In-Reply-To: <1509410120.18.0.213398074469.issue31907@psf.upfronthosting.co.za> Message-ID: <1509735217.9.0.213398074469.issue31907@psf.upfronthosting.co.za> mickey695 added the comment: I think it should be documented properly. In roughly two weeks I will have some time to look into it. So I could probably document the current behaviour by the start of December(unless someone beats me to it) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:58:49 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 18:58:49 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1509735529.5.0.213398074469.issue30057@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset f6f90ff079a22b79a58d47b6117cc8a8c7d366f3 by Antoine Pitrou in branch 'master': bpo-30057: Fix potential missed signal in signal.signal(). (#4258) https://github.com/python/cpython/commit/f6f90ff079a22b79a58d47b6117cc8a8c7d366f3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 14:59:54 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 03 Nov 2017 18:59:54 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1509735594.94.0.213398074469.issue30057@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4223 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 15:02:44 2017 From: report at bugs.python.org (Christian Heimes) Date: Fri, 03 Nov 2017 19:02:44 +0000 Subject: [issue31933] some Blake2 parameters are encoded backwards on big-endian platforms In-Reply-To: <1509712046.35.0.213398074469.issue31933@psf.upfronthosting.co.za> Message-ID: <1509735764.05.0.213398074469.issue31933@psf.upfronthosting.co.za> Christian Heimes added the comment: New changeset dcfb0e3c04f1b29a0d09bb0a81dcd5ee5a5fef1a by Christian Heimes (Jack O'Connor) in branch 'master': bpo-31933: fix blake2 multi-byte params on big endian platforms (#4250) https://github.com/python/cpython/commit/dcfb0e3c04f1b29a0d09bb0a81dcd5ee5a5fef1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 15:03:50 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 03 Nov 2017 19:03:50 +0000 Subject: [issue31933] some Blake2 parameters are encoded backwards on big-endian platforms In-Reply-To: <1509712046.35.0.213398074469.issue31933@psf.upfronthosting.co.za> Message-ID: <1509735830.86.0.213398074469.issue31933@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4224 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 15:10:00 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 19:10:00 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1509736200.01.0.213398074469.issue30057@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +4225 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 15:23:14 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 19:23:14 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1509736994.67.0.213398074469.issue30057@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset ea80ae04e2ec68c7e289048d3224a24b3c3fb107 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6': bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4261) https://github.com/python/cpython/commit/ea80ae04e2ec68c7e289048d3224a24b3c3fb107 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 15:29:34 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Fri, 03 Nov 2017 19:29:34 +0000 Subject: [issue31914] Document Pool.(star)map return type In-Reply-To: <1509482713.68.0.213398074469.issue31914@psf.upfronthosting.co.za> Message-ID: <1509737374.95.0.213398074469.issue31914@psf.upfronthosting.co.za> ????? ???????? added the comment: If the idea is one day to switch the return type to an iterable/generator, returning from starmap() before all parallel executions have completed, this needs to be documented and the typeshed adjusted accordingly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 15:36:41 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 19:36:41 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1509737801.8.0.213398074469.issue30057@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset c713837e91f39dc18740c74729cb7cebcf54fe6e by Antoine Pitrou in branch '2.7': [2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4263) https://github.com/python/cpython/commit/c713837e91f39dc18740c74729cb7cebcf54fe6e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 15:36:58 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 03 Nov 2017 19:36:58 +0000 Subject: [issue30057] signal.signal should check tripped signals In-Reply-To: <1492012349.83.0.519367248904.issue30057@psf.upfronthosting.co.za> Message-ID: <1509737818.78.0.213398074469.issue30057@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 15:55:57 2017 From: report at bugs.python.org (Christian Heimes) Date: Fri, 03 Nov 2017 19:55:57 +0000 Subject: [issue31933] some Blake2 parameters are encoded backwards on big-endian platforms In-Reply-To: <1509712046.35.0.213398074469.issue31933@psf.upfronthosting.co.za> Message-ID: <1509738957.35.0.213398074469.issue31933@psf.upfronthosting.co.za> Christian Heimes added the comment: New changeset a512493371a073e252a2e52b445aa2d66ddca7cb by Christian Heimes (Miss Islington (bot)) in branch '3.6': bpo-31933: fix blake2 multi-byte params on big endian platforms (GH-4250) (#4262) https://github.com/python/cpython/commit/a512493371a073e252a2e52b445aa2d66ddca7cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:08:26 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 03 Nov 2017 20:08:26 +0000 Subject: [issue31889] difflib SequenceMatcher ratio() still have unpredictable behavior In-Reply-To: <1509185013.27.0.213398074469.issue31889@psf.upfronthosting.co.za> Message-ID: <1509739706.89.0.213398074469.issue31889@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- nosy: +tim.peters versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:10:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 20:10:32 +0000 Subject: [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1509739832.41.0.213398074469.issue9678@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4226 status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:11:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 20:11:11 +0000 Subject: [issue31924] Fix test_curses on NetBSD 8 In-Reply-To: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> Message-ID: <1509739871.12.0.213398074469.issue31924@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8ce98543ef959bb65da2fb57b0d442b3b6e8a087 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-31924: Fix test_curses on NetBSD 8. (GH-4228) (#4259) https://github.com/python/cpython/commit/8ce98543ef959bb65da2fb57b0d442b3b6e8a087 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:11:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 20:11:14 +0000 Subject: [issue31924] Fix test_curses on NetBSD 8 In-Reply-To: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> Message-ID: <1509739874.43.0.213398074469.issue31924@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6a9a331b34f39a3df1c3a91ffcac12a9608b1e57 by Serhiy Storchaka (Miss Islington (bot)) in branch '2.7': bpo-31924: Fix test_curses on NetBSD 8. (GH-4228) (#4260) https://github.com/python/cpython/commit/6a9a331b34f39a3df1c3a91ffcac12a9608b1e57 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:12:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 20:12:27 +0000 Subject: [issue31924] Fix test_curses on NetBSD 8 In-Reply-To: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> Message-ID: <1509739947.56.0.213398074469.issue31924@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:12:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 20:12:44 +0000 Subject: [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1509739964.93.0.213398074469.issue9678@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:34:17 2017 From: report at bugs.python.org (Christian Heimes) Date: Fri, 03 Nov 2017 20:34:17 +0000 Subject: [issue31933] some Blake2 parameters are encoded backwards on big-endian platforms In-Reply-To: <1509712046.35.0.213398074469.issue31933@psf.upfronthosting.co.za> Message-ID: <1509741257.27.0.213398074469.issue31933@psf.upfronthosting.co.za> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:38:15 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 20:38:15 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1509732303.61.0.213398074469.issue31415@psf.upfronthosting.co.za> Message-ID: <2670D8E0-49E7-4BAE-8D88-42C126A3E0E9@python.org> Barry A. Warsaw added the comment: On Nov 3, 2017, at 11:05, Serhiy Storchaka wrote: > > But now, after adding the environment variable, do we still need the -X option? From a user side I don't see much difference between specifying an option and an environment variable, but the code for handling the environment variable is much simpler. It?s a good question. I guess in the limited amount of time I?ve used the feature so far, I find it kind of nice to be able to type `python -X importtime` when doing general import profiling. The use case for the environment variable is more compelling IMHO which is why I really wanted to add it. I suppose typing `PYTHONPROFILEIMPORTTIME=x python` isn?t *too* onerous, even if it is kind of a weird long mashed together word. I suppose I?m -0 on removing the -X option, and +0 on adding the negative cache. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:45:48 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 20:45:48 +0000 Subject: [issue31936] "5. The import system" grammatical error In-Reply-To: <1509729586.08.0.213398074469.issue31936@psf.upfronthosting.co.za> Message-ID: <1509741948.57.0.213398074469.issue31936@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: New changeset 93952f881500053057c2e08c4b253ac61233d7db by Barry Warsaw in branch 'master': Fix a grammatical problem and reword for clarity. (#4257) https://github.com/python/cpython/commit/93952f881500053057c2e08c4b253ac61233d7db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:46:04 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 20:46:04 +0000 Subject: [issue31936] "5. The import system" grammatical error In-Reply-To: <1509729586.08.0.213398074469.issue31936@psf.upfronthosting.co.za> Message-ID: <1509741964.96.0.213398074469.issue31936@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:51:07 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 03 Nov 2017 20:51:07 +0000 Subject: [issue31895] Native hijri calendar support In-Reply-To: <1509325061.68.0.213398074469.issue31895@psf.upfronthosting.co.za> Message-ID: <1509742267.72.0.213398074469.issue31895@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Haneef, thank you for the explanation. Any such addition would need a PEP. But I agree with Marc-Andre that supporting the multitude of calendars is out of scope for the stdlib. So I suspect such a PEP would be rejected, with the suggestion already given here, that this belongs on PyPI. An existing example is the time module of the astropy module, http://docs.astropy.org/en/stable/time/index.html . I could be wrong, but I have a vague impression that expanding calendar support has been requested and rejected before. We have enough to do properly supporting the existing time, datetime, and calendar modules. ---------- nosy: +terry.reedy resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:57:01 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 03 Nov 2017 20:57:01 +0000 Subject: [issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory In-Reply-To: <1509335619.79.0.213398074469.issue31896@psf.upfronthosting.co.za> Message-ID: <1509742621.08.0.213398074469.issue31896@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The tracker is for patching CPython. Please consider closing this and asking your question on python-list. When you post code, do so only once, and without line numbers, so it can be copied and run as is. Do include data on the ref leaks. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:57:49 2017 From: report at bugs.python.org (Brett Cannon) Date: Fri, 03 Nov 2017 20:57:49 +0000 Subject: [issue31937] Add the term "dunder" to the glossary Message-ID: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> New submission from Brett Cannon : The term "dunder" is used out in the community regularly, but if you have never been exposed to it before it can seem a little odd without context. ---------- assignee: docs at python components: Documentation messages: 305509 nosy: brett.cannon, docs at python priority: normal severity: normal status: open title: Add the term "dunder" to the glossary _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:59:17 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 20:59:17 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1509742757.07.0.213398074469.issue31937@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: -1 until we have something we can call a "mifflin". (Kidding of course!) ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:01:04 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 03 Nov 2017 21:01:04 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1509742864.97.0.213398074469.issue31904@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The following might be relevant to this issue: https://www.python.org/dev/peps/pep-0011/#supporting-platforms ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:02:03 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 03 Nov 2017 21:02:03 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1509742923.34.0.213398074469.issue31937@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: > until we have something we can call a "mifflin". Name of next GitHub bot? :P ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:03:36 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Fri, 03 Nov 2017 21:03:36 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1509743016.04.0.213398074469.issue31937@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Anyway, +1 to adding dunder to glossary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:20:30 2017 From: report at bugs.python.org (Tal Einat) Date: Fri, 03 Nov 2017 21:20:30 +0000 Subject: [issue31938] Convert selectmodule.c to Argument Clinic Message-ID: <1509744030.41.0.213398074469.issue31938@psf.upfronthosting.co.za> New submission from Tal Einat : Continuing the work begun as part of issue #20182, this is regarding the Argument Clinic conversion of Modules/selectmodule.c.h. I have a complete conversion ready and will create a PR momentarily. ---------- components: Argument Clinic messages: 305514 nosy: haypo, larry, serhiy.storchaka, taleinat priority: normal severity: normal status: open title: Convert selectmodule.c to Argument Clinic type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:23:12 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 03 Nov 2017 21:23:12 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509744192.87.0.213398074469.issue31415@psf.upfronthosting.co.za> Terry J. Reedy added the comment: > `PYTHONPROFILEIMPORTTIME=x python` isn?t *too* onerous It does not work on Windows. C:\Users\Terry>PYTHONPROFILEIMPORTTIME=x python 'PYTHONPROFILEIMPORTTIME' is not recognized as an internal or external command, operable program or batch file. Does it set the EV for the entire session (which one likely would not want), or just the one command (which has no Windows equivalent that I know of)? Please leave the easily remembered and typed option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:41:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 21:41:40 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509745300.34.0.213398074469.issue31415@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Note that with environment variable you get more information. $ ./python -X importtime -c pass import time: self [us] | cumulative | imported package import time: 88 | 88 | _codecs import time: 789 | 876 | codecs import time: 602 | 602 | encodings.aliases import time: 809 | 2287 | encodings ... $ PYTHONPROFILEIMPORTTIME=1 ./python -c pass import time: self [us] | cumulative | imported package import time: 3133 | 3133 | _frozen_importlib_external import time: 371 | 371 | zipimport import time: 327 | 327 | _codecs import time: 2656 | 2982 | codecs import time: 1821 | 1821 | encodings.aliases import time: 2604 | 7406 | encodings ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:44:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 03 Nov 2017 21:44:04 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509745444.94.0.213398074469.issue31415@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: On Windows you can create a 2-line bat-file that sets the environment variable and runs Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:45:32 2017 From: report at bugs.python.org (Hugh Fisher) Date: Fri, 03 Nov 2017 21:45:32 +0000 Subject: [issue31932] setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData In-Reply-To: <1509705853.38.0.213398074469.issue31932@psf.upfronthosting.co.za> Message-ID: <1509745532.01.0.213398074469.issue31932@psf.upfronthosting.co.za> Change by Hugh Fisher : ---------- keywords: +patch pull_requests: +4227 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:50:08 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 03 Nov 2017 21:50:08 +0000 Subject: [issue4356] Add "key" argument to "bisect" module functions In-Reply-To: <1227115048.67.0.318831592843.issue4356@psf.upfronthosting.co.za> Message-ID: <1509745808.93.0.213398074469.issue4356@psf.upfronthosting.co.za> Gregory P. Smith added the comment: obviously didn't make it in 3.6 but this still seems desirable. I just saw someone at work propose a trivial port of golang's sort.Search - https://golang.org/pkg/sort/#Search - in Python which caused me to hunt for an issue on bisect key= support. ---------- nosy: +gregory.p.smith versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:50:38 2017 From: report at bugs.python.org (Christian Heimes) Date: Fri, 03 Nov 2017 21:50:38 +0000 Subject: [issue31870] add timeout parameter for get_server_certificate in ssl.py In-Reply-To: <1508991085.56.0.213398074469.issue31870@psf.upfronthosting.co.za> Message-ID: <1509745838.83.0.213398074469.issue31870@psf.upfronthosting.co.za> Change by Christian Heimes : ---------- assignee: -> christian.heimes components: +SSL -Library (Lib) nosy: +alex, christian.heimes, dstufft, janssen stage: -> patch review versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:58:15 2017 From: report at bugs.python.org (Tal Einat) Date: Fri, 03 Nov 2017 21:58:15 +0000 Subject: [issue31938] Convert selectmodule.c to Argument Clinic In-Reply-To: <1509744030.41.0.213398074469.issue31938@psf.upfronthosting.co.za> Message-ID: <1509746295.04.0.213398074469.issue31938@psf.upfronthosting.co.za> Change by Tal Einat : ---------- keywords: +patch pull_requests: +4228 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:58:15 2017 From: report at bugs.python.org (Tal Einat) Date: Fri, 03 Nov 2017 21:58:15 +0000 Subject: [issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files In-Reply-To: <1389140257.44.0.42523119139.issue20182@psf.upfronthosting.co.za> Message-ID: <1509746295.15.0.00913614298617.issue20182@psf.upfronthosting.co.za> Change by Tal Einat : ---------- pull_requests: +4229 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:59:53 2017 From: report at bugs.python.org (Tal Einat) Date: Fri, 03 Nov 2017 21:59:53 +0000 Subject: [issue20182] Derby #13: Convert 50 sites to Argument Clinic across 5 files In-Reply-To: <1389140257.44.0.42523119139.issue20182@psf.upfronthosting.co.za> Message-ID: <1509746393.75.0.213398074469.issue20182@psf.upfronthosting.co.za> Tal Einat added the comment: See issue #31938 regarding Modules/selectmodule.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 18:00:23 2017 From: report at bugs.python.org (Tal Einat) Date: Fri, 03 Nov 2017 22:00:23 +0000 Subject: [issue31938] Convert selectmodule.c to Argument Clinic In-Reply-To: <1509744030.41.0.213398074469.issue31938@psf.upfronthosting.co.za> Message-ID: <1509746423.16.0.213398074469.issue31938@psf.upfronthosting.co.za> Tal Einat added the comment: See PR 4265. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:11:14 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 03 Nov 2017 23:11:14 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1509750674.25.0.213398074469.issue31934@psf.upfronthosting.co.za> Xavier de Gaye added the comment: When you build out of the source tree and this source tree has been built previously (by running 'make' in the source tree), then you get the error msg printed in msg305486 when you try to build *out* of this not clean source tree. The solution is to run 'make clean' in the source tree first. The reason that one must use a clean source tree is that otherwise 'make' finds an existing Programs/_testembed.o file in the source tree as the prerequisite to the Programs/_testembed target, but cannot build this target since Programs/_testembed.o does not exist locally. It is not obvious from the error message to understand the reason for the build failure and one can waste quite some time finding the solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:11:21 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 23:11:21 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1509745300.34.0.213398074469.issue31415@psf.upfronthosting.co.za> Message-ID: <34E73AE6-86E1-4DBA-9C14-F51A148A4F41@python.org> Barry A. Warsaw added the comment: On Nov 3, 2017, at 14:41, Serhiy Storchaka wrote: > > Note that with environment variable you get more information. Fun! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:12:43 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 03 Nov 2017 23:12:43 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1509744192.87.0.213398074469.issue31415@psf.upfronthosting.co.za> Message-ID: Barry A. Warsaw added the comment: On Nov 3, 2017, at 14:23, Terry J. Reedy wrote: > > Does it set the EV for the entire session (which one likely would not want), or just the one command (which has no Windows equivalent that I know of)? Please leave the easily remembered and typed option. On *nix, this sets the environment variable for just this process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:24:09 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 03 Nov 2017 23:24:09 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1509751449.82.0.213398074469.issue31934@psf.upfronthosting.co.za> Xavier de Gaye added the comment: To build out of the 'src' source tree (a subdirectory of the current directory) in a 'build' subdirectory: $ ls -ld src drwxr-xr-x 21 xavier xavier 4.0K Nov 3 23:50 src/ $ mkdir build $ cd build $ $(cd ../src && pwd)/configure && make This is useful when you build for multiple platform configurations. For example on Android one can build for multiple API versions and multiple architectures (x86_64, armv7, aarch64, ...). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:31:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 23:31:32 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic Message-ID: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> New submission from STINNER Victor : Argument Clinic supports a few return types like NoneType, int, bool, etc. But the return type is omitted in the private docstring used to build the __text_signature__, finally used to build a Signature object in inspect.signature(). For example, os.dup() is declared in Modules/posixmodule.c with: /*[clinic input] os.dup -> int fd: int / Return a duplicate of a file descriptor. [clinic start generated code]*/ Currently, Argument Clinic generates: PyDoc_STRVAR(os_dup__doc__, "dup($module, fd, /)\n" "--\n" "\n" "Return a duplicate of a file descriptor."); The return type is omitted in the first line. Finally, the return type is not documented in the signature: haypo at selma$ ./python -c "import os,inspect; print(inspect.signature(os.dup))" (fd, /) I noticed this limitation while reviewing the PR 4265 which converts the select module to Argument Clinic. Previously, the return type like "-> None" or "-> int" was documented. With Argument Clinic, it's not documented nor generated in the signature, the information is lost. ---------- messages: 305525 nosy: brett.cannon, haypo, larry, ncoghlan, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Support return annotation in signature for Argument Clinic type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:33:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 23:33:09 +0000 Subject: [issue31938] Convert selectmodule.c to Argument Clinic In-Reply-To: <1509744030.41.0.213398074469.issue31938@psf.upfronthosting.co.za> Message-ID: <1509751989.98.0.213398074469.issue31938@psf.upfronthosting.co.za> STINNER Victor added the comment: While reviewing PR 4265, I noticed that the return type like "-> None" or "-> int" is removed from the function definition, so the PR removes this information. But it seems to be a limitation of Argument Clinic: I opened the issue #31939. IHMO it's not a blocker issue. We can add it back later, once the issue #31939 is implemented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:51:13 2017 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 03 Nov 2017 23:51:13 +0000 Subject: [issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation? Message-ID: <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za> New submission from Anthony Sottile : Fortunately, this can be reproduced with the testsuite: ``` ====================================================================== ERROR: test_copystat_symlinks (__main__.TestShutil) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python3.6/test/test_shutil.py", line 366, in test_copystat_symlinks os.lchmod(src_link, stat.S_IRWXO) OSError: [Errno 95] Not supported: '/tmp/tmplfli9msi/baz' ``` My simplest reproduction involves docker: ```dockerfile FROM alpine RUN apk update && apk add curl python3 RUN mkdir foo && ln -s /dev/null foo/bar CMD [ \ "python3", "-c", \ "import shutil; shutil.copytree('foo', 'bar', symlinks=True)" \ ] ``` ``` Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/shutil.py", line 359, in copytree raise Error(errors) shutil.Error: [('foo/bar', 'bar/bar', "[Errno 95] Not supported: 'bar/bar'")] ``` By looking at pyconfig, I get the following: ``` / # grep -E '(HAVE_FCHMODAT|HAVE_LCHMOD)' /usr/include/python3.6m/pyconfig.h #define HAVE_FCHMODAT 1 #define HAVE_LCHMOD 1 ``` But it seems lchmod is actually nonfunctional in this case. I think the fix is to augment `configure` to detect faulty `lchmod` and not set `HAVE_LCHMOD`? I'm not terribly familiar with the autotools pipeline but that's where I'm going to take a stab at it! I'm originally finding this issue via https://github.com/pre-commit/pre-commit/issues/655 ---------- components: Build, Library (Lib), Tests messages: 305527 nosy: Anthony Sottile priority: normal severity: normal status: open title: copystat on symlinks fails for alpine -- faulty lchmod implementation? versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 20:14:49 2017 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 04 Nov 2017 00:14:49 +0000 Subject: [issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation? In-Reply-To: <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za> Message-ID: <1509754489.15.0.213398074469.issue31940@psf.upfronthosting.co.za> Anthony Sottile added the comment: Here's one idea for a patch (inspired by the rest of the function): ``` diff --git a/Lib/shutil.py b/Lib/shutil.py index 464ee91..2099289 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -213,6 +213,13 @@ def copystat(src, dst, *, follow_symlinks=True): # symlink. give up, suppress the error. # (which is what shutil always did in this circumstance.) pass + except OSError as why: + # lchmod on alpine will raise this with symlinks: #31940 + for err in 'EOPNOTSUPP', 'ENOTSUP': + if hasattr(errno, err) and why.errno == getattr(errno, err): + break + else: + raise if hasattr(st, 'st_flags'): try: lookup("chflags")(dst, st.st_flags, follow_symlinks=follow) ``` However lchmod seems to be just broken on alpine so the tests continue to fail (however my usecase is fixed) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 20:44:19 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 04 Nov 2017 00:44:19 +0000 Subject: [issue31935] subprocess.run() timeout not working with grandchildren and stdout=PIPE In-Reply-To: <1509721292.04.0.213398074469.issue31935@psf.upfronthosting.co.za> Message-ID: <1509756259.63.0.213398074469.issue31935@psf.upfronthosting.co.za> Martin Panter added the comment: This proposal sounds like a race condition. Closing the output pipe as a child exits means you risk missing recent output. On the other hand, if you don?t care about the output any more, close the pipe first and then wait for the child. Related discussions: Issue 30154: Similar problem, but the grandchild does not write any output Issue 26534: kill_group=True option for timeout Issue 31447: Windows-specific (?) ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 21:42:35 2017 From: report at bugs.python.org (Tim Peters) Date: Sat, 04 Nov 2017 01:42:35 +0000 Subject: [issue31889] difflib SequenceMatcher ratio() still have unpredictable behavior In-Reply-To: <1509185013.27.0.213398074469.issue31889@psf.upfronthosting.co.za> Message-ID: <1509759755.3.0.213398074469.issue31889@psf.upfronthosting.co.za> Tim Peters added the comment: Pass "autojunk=False" to your SequenceMatcher constructor and the ratio you get back will continue to increase as `i` increases. The docs: """ Automatic junk heuristic: SequenceMatcher supports a heuristic that automatically treats certain sequence items as junk. The heuristic counts how many times each individual item appears in the sequence. If an item?s duplicates (after the first one) account for more than 1% of the sequence and the sequence is at least 200 items long, this item is marked as ?popular? and is treated as junk for the purpose of sequence matching. This heuristic can be turned off by setting the autojunk argument to False when creating the SequenceMatcher. """ Note in particular the "at least 200 items long" there. That's why you see a change in behavior at i == 200. Before then, the autojunk heuristic is not triggered. If we had it all to do over again, I'd make autojunk=False the default. But - for backward compatibility - it's too late to change that now. As to quick_ratio() and real_quick_ratio(), NOTHING about them is defined - or intended to be defined - beyond what the docs already say: """ quick_ratio() Return an upper bound on ratio() relatively quickly. real_quick_ratio() Return an upper bound on ratio() very quickly. """ Nothing in the code you posted violates those promises (e.g., 0.99 is certainly an upper bound with respect to 0.0). If they always returned 1.0, regardless of inputs, that would meet the docs' promises too. Only the result of ratio() is defined. As to why they exist, the docs explain that: """ ratio() Return a measure of the sequences? similarity as a float in the range [0, 1]. ... This is expensive to compute if get_matching_blocks() or get_opcodes() hasn?t already been called, in which case you may want to try quick_ratio() or real_quick_ratio() first to get an upper bound. """ So if the expense of calling ratio() isn't a concern in your context, there's no reason to call quick_ratio() or real_quick_ratio(). They exist so it's possible to code a cheap "early out" path in contexts where calling ratio() all the time may be prohibitively expensive. For example, consider an app that has no use at all for a ratio < 0.5. If quick_ratio() (or real_quick_ratio()) return something less than 0.5, then it's guaranteed that ratio() would too, since the quicker versions return upper bounds on what ratio() would return. This is valuable where it matters, and completely useless where it doesn't matter ;-) In any case, since `autojunk=False` repairs the behavior you pointed out, I'm closing this as Won't-Fix. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 22:26:04 2017 From: report at bugs.python.org (xoviat) Date: Sat, 04 Nov 2017 02:26:04 +0000 Subject: [issue31941] ImportError: DLL Load Failure: The specified module cannot be found Message-ID: <1509762364.94.0.213398074469.issue31941@psf.upfronthosting.co.za> New submission from xoviat : Yes, I know that this isn't Python's fault. I know how to resolve the problem. But what's frustrating is that this error message is totally unhelpful, because it doesn't contain the DLL that Python is looking for. Yes, I know that the error message is just directly from windows. But there has to be some way to make this error message more helpful. There has to be some way to tell the user what the name of the DLL is. Because the current state of this error message is sad. ---------- messages: 305531 nosy: xoviat priority: normal severity: normal status: open title: ImportError: DLL Load Failure: The specified module cannot be found type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 22:32:58 2017 From: report at bugs.python.org (R. David Murray) Date: Sat, 04 Nov 2017 02:32:58 +0000 Subject: [issue31941] ImportError: DLL Load Failure: The specified module cannot be found In-Reply-To: <1509762364.94.0.213398074469.issue31941@psf.upfronthosting.co.za> Message-ID: <1509762778.96.0.213398074469.issue31941@psf.upfronthosting.co.za> R. David Murray added the comment: Duplicate of #25655. Any concrete proposals for how to make this better are welcome. ---------- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python errors related to failures loading DLL's lack information _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 23:19:40 2017 From: report at bugs.python.org (INADA Naoki) Date: Sat, 04 Nov 2017 03:19:40 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: Message-ID: INADA Naoki added the comment: I'm +1 to remove -X option. Supporting both form makes code ugly and benefit is too small. And +1 to negative cache too. It's simple for environment varianle. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 23:24:12 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 04 Nov 2017 03:24:12 +0000 Subject: [issue31898] Add a `recommended-packages.txt` file In-Reply-To: <1509340647.27.0.213398074469.issue31898@psf.upfronthosting.co.za> Message-ID: <1509765852.32.0.213398074469.issue31898@psf.upfronthosting.co.za> Nick Coghlan added the comment: In https://mail.python.org/pipermail/python-ideas/2017-October/047599.html, Guido suggested managing this as an occasionally updated Informational PEP (somewhat akin to PEP 394), and I think that will actually work fairly well: * it clearly gives the information PEP level status (which merely being in the developer guide wouldn't) * it means the guidance can be mostly version independent (which would be a source of irritation if the list was in the reference documentation) * it means we can use the same process for amendments as we do for other informational PEPs (a combination of python-dev discussions, bugs.python.org issues, and specific PR reviews) My current thoughts on structuring that: Title: Recommended Independently Updated Python Packages Tone/Audience: I'll aim the PEP primarily at answering the "Why isn't in the standard library?" question, as that helps us keep the list focused on python-dev specific concerns and avoid turning it into a general categorised list of Python library recommendations like https://github.com/vinta/awesome-python The key criterion for something being mentioned will be when the standard library *already* contains comparable functionality, but there's a language version independent third party alternative that even core developers will often use instead. That list is currently: urllib.requests -> requests (pace of change in web standards) re -> regex (technical challenges with backend migration) datetime.timezone -> pytz.timezone (updates driven by IANA timezone database) ctypes -> cffi (build tools should be version independent) distutils -> setuptools (build tools should be version independent) I'll likely also include a list of libraries where version independence is a key feature, so they've never even been proposed for stdlib inclusion, despite their broad popularity: - the six compatibility module - various backport libraries (e.g. importlib2, contextlib2, unittest2) - third party libraries like lxml I'm not sure if or how I'll cover the scientific Python stack (especially NumPy.ndarray being the reference implementation for multi-dimensional arrays), but Nathaniel Smith has some interesting thoughts on that in https://mail.python.org/pipermail/python-ideas/2017-November/047636.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 00:39:30 2017 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 04 Nov 2017 04:39:30 +0000 Subject: [issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation? In-Reply-To: <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za> Message-ID: <1509770370.11.0.213398074469.issue31940@psf.upfronthosting.co.za> Change by Anthony Sottile : ---------- keywords: +patch pull_requests: +4230 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 02:23:55 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 04 Nov 2017 06:23:55 +0000 Subject: [issue31887] docs for email.generator are missing a comment on special multipart/signed handling In-Reply-To: <1509125027.89.0.213398074469.issue31887@psf.upfronthosting.co.za> Message-ID: <1509776635.77.0.213398074469.issue31887@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4231 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 02:44:49 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 04 Nov 2017 06:44:49 +0000 Subject: [issue28340] [py2] TextIOWrapper.tell extremely slow In-Reply-To: <1475423487.6.0.338998508065.issue28340@psf.upfronthosting.co.za> Message-ID: <1509777889.05.0.213398074469.issue28340@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Anyone here capable of reviewing the PR? ---------- nosy: +Mariatta stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 03:37:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 07:37:38 +0000 Subject: [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1509781058.71.0.213398074469.issue9678@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset ee1a9a2b78d5b6bb1a8148fc5fcf365e6d4e9e67 by Serhiy Storchaka in branch 'master': bpo-9678: Fix determining the MAC address in the uuid module. (#4264) https://github.com/python/cpython/commit/ee1a9a2b78d5b6bb1a8148fc5fcf365e6d4e9e67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 03:37:45 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 04 Nov 2017 07:37:45 +0000 Subject: [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1509781065.73.0.213398074469.issue9678@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4232 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 03:37:59 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 07:37:59 +0000 Subject: [issue28340] [py2] TextIOWrapper.tell extremely slow In-Reply-To: <1475423487.6.0.338998508065.issue28340@psf.upfronthosting.co.za> Message-ID: <1509781079.38.0.213398074469.issue28340@psf.upfronthosting.co.za> Berker Peksag added the comment: >From the original report: > This problem did not exist in version 2.7.1 [...] We usually don't treat performance improvements as bug fixes unless it was introduced in a bug fix release (or it needs to be explicitly approved by the BDFL or the 2.7 release manager) If TextIOWrapper.tell() performance got worse after 2.7.1, there might be a chance to backport issue 11114 to 2.7. Adding Antoine (author of the patch) and Benjamin (2.7. release manager) to get their opinion. ---------- nosy: +benjamin.peterson, berker.peksag, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:10:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:10:32 +0000 Subject: [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1509783032.43.0.213398074469.issue9678@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4233 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:11:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:11:22 +0000 Subject: [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1509783082.96.0.213398074469.issue9678@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset ec2b2dcdd664d35753e471429872b2d6ff74a644 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-9678: Fix determining the MAC address in the uuid module. (GH-4264) (#4269) https://github.com/python/cpython/commit/ec2b2dcdd664d35753e471429872b2d6ff74a644 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:13:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:13:19 +0000 Subject: [issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future? In-Reply-To: <1376092118.24.0.585945689562.issue18699@psf.upfronthosting.co.za> Message-ID: <1509783199.39.0.213398074469.issue18699@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b838cc3ff4e039af949c6a19bd896e98e944dcbe by Serhiy Storchaka (Chillar Anand) in branch 'master': bpo-18699: Corrected documentation for window.chgat in curses module (#1430) https://github.com/python/cpython/commit/b838cc3ff4e039af949c6a19bd896e98e944dcbe ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:14:25 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 04 Nov 2017 08:14:25 +0000 Subject: [issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future? In-Reply-To: <1376092118.24.0.585945689562.issue18699@psf.upfronthosting.co.za> Message-ID: <1509783265.87.0.213398074469.issue18699@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4234 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:23:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:23:11 +0000 Subject: [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1509783791.42.0.213398074469.issue9678@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset f72ad2d363311b8b0f79aba5236094f9d74d1b2a by Serhiy Storchaka in branch '2.7': [2.7] bpo-9678: Fix determining the MAC address in the uuid module. (GH-4264) (#4270) https://github.com/python/cpython/commit/f72ad2d363311b8b0f79aba5236094f9d74d1b2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:23:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:23:50 +0000 Subject: [issue9678] uuid._ifconfig_getnode can't work on NetBSD In-Reply-To: <1282705798.9.0.0619423981288.issue9678@psf.upfronthosting.co.za> Message-ID: <1509783830.56.0.213398074469.issue9678@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:26:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:26:10 +0000 Subject: [issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future? In-Reply-To: <1376092118.24.0.585945689562.issue18699@psf.upfronthosting.co.za> Message-ID: <1509783970.92.0.213398074469.issue18699@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4235 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:26:46 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:26:46 +0000 Subject: [issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future? In-Reply-To: <1376092118.24.0.585945689562.issue18699@psf.upfronthosting.co.za> Message-ID: <1509784006.81.0.213398074469.issue18699@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6dbecd2cd9c9448b34e1a632509220f3c4cf7587 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430) (#4271) https://github.com/python/cpython/commit/6dbecd2cd9c9448b34e1a632509220f3c4cf7587 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:41:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:41:22 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1509784882.0.0.213398074469.issue31937@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think it shouldn't be added as a separate entry, but just mentioned in [1] and [2], and added to the index. [1] https://docs.python.org/3/glossary.html#term-special-method [2] https://docs.python.org/3/reference/datamodel.html#specialnames ---------- keywords: +easy nosy: +serhiy.storchaka stage: -> needs patch type: -> enhancement versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:43:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:43:00 +0000 Subject: [issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future? In-Reply-To: <1376092118.24.0.585945689562.issue18699@psf.upfronthosting.co.za> Message-ID: <1509784980.93.0.213398074469.issue18699@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset fd38819497fd2a52ada674f0c890f5b414d0e87f by Serhiy Storchaka in branch '2.7': [2.7] bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430). (#4272) https://github.com/python/cpython/commit/fd38819497fd2a52ada674f0c890f5b414d0e87f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:45:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:45:58 +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: <1509785158.16.0.213398074469.issue18669@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:47:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:47:28 +0000 Subject: [issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future? In-Reply-To: <1376092118.24.0.585945689562.issue18699@psf.upfronthosting.co.za> Message-ID: <1509785248.11.0.213398074469.issue18699@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Wrong issue number. All this is related to issue18669 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:49:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:49:25 +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: <1509785365.12.0.213398074469.issue18669@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b838cc3ff4e039af949c6a19bd896e98e944dcbe by Serhiy Storchaka (Chillar Anand) in branch 'master': bpo-18699: Corrected documentation for window.chgat in curses module (#1430) https://github.com/python/cpython/commit/b838cc3ff4e039af949c6a19bd896e98e944dcbe New changeset 6dbecd2cd9c9448b34e1a632509220f3c4cf7587 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430) (#4271) https://github.com/python/cpython/commit/6dbecd2cd9c9448b34e1a632509220f3c4cf7587 New changeset fd38819497fd2a52ada674f0c890f5b414d0e87f by Serhiy Storchaka in branch '2.7': [2.7] bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430). (#4272) https://github.com/python/cpython/commit/fd38819497fd2a52ada674f0c890f5b414d0e87f There is a typo in the issue number in commit messages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:54:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:54:41 +0000 Subject: [issue21457] NetBSD curses support improvements In-Reply-To: <1399625880.63.0.0407983839036.issue21457@psf.upfronthosting.co.za> Message-ID: <1509785681.92.0.213398074469.issue21457@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I see, the curses library takes a large progress. On NetBSD 8 just two previously tests should be fixed (issue31924). Many previously skipped tests are passed now. ---------- resolution: -> out of date stage: -> resolved status: open -> closed superseder: -> Make curses compiling on NetBSD 7.1 and tests passing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 04:56:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 08:56:21 +0000 Subject: [issue14598] _cursesmodule.c fails with ncurses-5.9 on Linux In-Reply-To: <1334593853.62.0.710921461264.issue14598@psf.upfronthosting.co.za> Message-ID: <1509785781.0.0.213398074469.issue14598@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Fix curses module compilation with ncurses6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 05:10:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 09:10:01 +0000 Subject: [issue31942] Document that support of start and stop parameters in the Sequence's index() is optional Message-ID: <1509786601.53.0.213398074469.issue31942@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Parameters start and stop were added to the Sequence.index() mixin method in 3.5 (see issue23086). But not all concrete implementations of the Sequence ABC support them (for example range.index() doesn't, see issue28197). This should be explicitly documented (including the docstring of Sequence.index). ---------- assignee: docs at python components: Documentation keywords: easy messages: 305547 nosy: docs at python, rhettinger, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Document that support of start and stop parameters in the Sequence's index() is optional type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 05:11:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 09:11:00 +0000 Subject: [issue28197] Add start and stop parameters to the range.index() ABC method In-Reply-To: <1474231832.91.0.157673750963.issue28197@psf.upfronthosting.co.za> Message-ID: <1509786660.03.0.213398074469.issue28197@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Interpreter Core -Documentation, Library (Lib) keywords: +easy (C) title: range.index mismatch with documentation -> Add start and stop parameters to the range.index() ABC method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 05:12:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 09:12:02 +0000 Subject: [issue28197] Add start and stop parameters to the range.index() ABC method In-Reply-To: <1474231832.91.0.157673750963.issue28197@psf.upfronthosting.co.za> Message-ID: <1509786722.68.0.213398074469.issue28197@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Opened issue31942 for the documenting part. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 05:12:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 09:12:26 +0000 Subject: [issue31942] Document that support of start and stop parameters in the Sequence's index() is optional In-Reply-To: <1509786601.53.0.213398074469.issue31942@psf.upfronthosting.co.za> Message-ID: <1509786746.4.0.213398074469.issue31942@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +Devin Jeanpierre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 05:14:43 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 09:14:43 +0000 Subject: [issue17852] Built-in module _io can lose data from buffered files at exit In-Reply-To: <1367048010.96.0.3580561262.issue17852@psf.upfronthosting.co.za> Message-ID: <1509786883.36.0.213398074469.issue17852@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- stage: needs patch -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 05:19:57 2017 From: report at bugs.python.org (Pierre Quentel) Date: Sat, 04 Nov 2017 09:19:57 +0000 Subject: [issue30406] async and await should be keywords in 3.7 In-Reply-To: <1495229262.01.0.300246152317.issue30406@psf.upfronthosting.co.za> Message-ID: <1509787197.61.0.213398074469.issue30406@psf.upfronthosting.co.za> Pierre Quentel added the comment: According to PEP 492, async and await should have been deprecated in 3.5 and 3.6, but I don't think they have been : await = 1 def f(async=True): ... don't raise any deprecation warning in 3.6. Since version 3.7 will break existing code with a SyntaxError, could it be possible to have something explicit in the SyntaxError message for these new keywords, for instance SyntaxError : 'async' is a keyword I don't speack C so I can't provide a patch, sorry. ---------- nosy: +quentel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 05:25:27 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 09:25:27 +0000 Subject: [issue31604] unittest.TestLoader().loadTestsFromTestCase(...) fails when adding test cases with the expectedFailure decorator In-Reply-To: <1506500204.85.0.154975027568.issue31604@psf.upfronthosting.co.za> Message-ID: <1509787527.49.0.213398074469.issue31604@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +ezio.melotti, michael.foord, rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 06:05:54 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 04 Nov 2017 10:05:54 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509789954.25.0.213398074469.issue21423@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 63ff4131af86e8a48cbedb9fbba95bd65ca90061 by Antoine Pitrou in branch 'master': bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor (#4241) https://github.com/python/cpython/commit/63ff4131af86e8a48cbedb9fbba95bd65ca90061 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 06:06:08 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 04 Nov 2017 10:06:08 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509789968.75.0.213398074469.issue21423@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 06:19:15 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 04 Nov 2017 10:19:15 +0000 Subject: [issue28340] [py2] TextIOWrapper.tell extremely slow In-Reply-To: <1475423487.6.0.338998508065.issue28340@psf.upfronthosting.co.za> Message-ID: <1509790755.62.0.213398074469.issue28340@psf.upfronthosting.co.za> Antoine Pitrou added the comment: The original patch is quite delicate and I'm not comfortable backporting to 2.7. This is why it was pushed to 3.3 but not backported to 3.2.x (AFAIR). 2.7 has existed with this issue for years, now, and is slowly nearing end-of-life. I'll let Benjamin make the final decision. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 06:39:47 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 10:39:47 +0000 Subject: [issue31678] Incorrect C Function name for timedelta In-Reply-To: <1507038462.28.0.213398074469.issue31678@psf.upfronthosting.co.za> Message-ID: <1509791987.62.0.213398074469.issue31678@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 82cd3cede804ca694fb0657fd985d5eff84a414f by Berker Peksag (Phobosmir) in branch 'master': bpo-31678: Fix typo in PyDateTime_DELTA_GET_MICROSECONDS (GH-3869) https://github.com/python/cpython/commit/82cd3cede804ca694fb0657fd985d5eff84a414f ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 06:40:57 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 04 Nov 2017 10:40:57 +0000 Subject: [issue31678] Incorrect C Function name for timedelta In-Reply-To: <1507038462.28.0.213398074469.issue31678@psf.upfronthosting.co.za> Message-ID: <1509792057.47.0.213398074469.issue31678@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4236 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 06:45:53 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 10:45:53 +0000 Subject: [issue31678] Incorrect C Function name for timedelta In-Reply-To: <1507038462.28.0.213398074469.issue31678@psf.upfronthosting.co.za> Message-ID: <1509792353.9.0.213398074469.issue31678@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset f9387469e82eccb6e0471037033f921be7f59909 by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-31678: Fix typo in PyDateTime_DELTA_GET_MICROSECONDS (GH-3869) https://github.com/python/cpython/commit/f9387469e82eccb6e0471037033f921be7f59909 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 06:46:51 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 10:46:51 +0000 Subject: [issue31678] Incorrect C Function name for timedelta In-Reply-To: <1507038462.28.0.213398074469.issue31678@psf.upfronthosting.co.za> Message-ID: <1509792411.53.0.213398074469.issue31678@psf.upfronthosting.co.za> Berker Peksag added the comment: Good catch, thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 07:17:18 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 11:17:18 +0000 Subject: [issue31668] "fixFirefoxAnchorBug" function in doctools.js causes navigating problem in Py3 doc in Chrome In-Reply-To: <1507005320.05.0.213398074469.issue31668@psf.upfronthosting.co.za> Message-ID: <1509794238.94.0.213398074469.issue31668@psf.upfronthosting.co.za> Berker Peksag added the comment: This is indeed an annoying bug. Turns out there is already a compatibility shim for $.browser in doctools.js: https://github.com/sphinx-doc/sphinx/commit/c608af4babe140626877be08535af095ff633c00 I've opened https://github.com/sphinx-doc/sphinx/pull/4216 to add the "$.browser.firefox" check back. There is nothing we can do here because we don't maintain a copy of doctools.js in Python codebase: $ git ls-files | grep doctools.js Thank you for your report. ---------- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 08:16:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 12:16:38 +0000 Subject: [issue28564] shutil.rmtree is inefficient due to listdir() instead of scandir() In-Reply-To: <1477857759.23.0.231777495226.issue28564@psf.upfronthosting.co.za> Message-ID: <1509797798.7.0.213398074469.issue28564@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d4d79bc1ff91b04625c312f0219c89aabcd19ce4 by Serhiy Storchaka in branch 'master': bpo-28564: Use os.scandir() in shutil.rmtree(). (#4085) https://github.com/python/cpython/commit/d4d79bc1ff91b04625c312f0219c89aabcd19ce4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 08:35:26 2017 From: report at bugs.python.org (Steven Loria) Date: Sat, 04 Nov 2017 12:35:26 +0000 Subject: [issue30806] netrc.__repr__() is broken for writing to file In-Reply-To: <1498763541.77.0.380552653426.issue30806@psf.upfronthosting.co.za> Message-ID: <1509798926.15.0.213398074469.issue30806@psf.upfronthosting.co.za> Change by Steven Loria : ---------- pull_requests: +4237 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 08:46:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 12:46:52 +0000 Subject: [issue28564] shutil.rmtree is inefficient due to listdir() instead of scandir() In-Reply-To: <1477857759.23.0.231777495226.issue28564@psf.upfronthosting.co.za> Message-ID: <1509799612.22.0.213398074469.issue28564@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 09:08:23 2017 From: report at bugs.python.org (Tal Einat) Date: Sat, 04 Nov 2017 13:08:23 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509800902.99.0.213398074469.issue31939@psf.upfronthosting.co.za> Tal Einat added the comment: I'm not sure that the current concept of return converters in AC is can be used for specifying return value annotations. For example, what if I want to annotate the return value type with using a return converter? Another example: The current doc-string for select.select() begins with: select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist) I can't see how describing the return type being a 3-tuple of lists would work with return converters. ---------- components: +Argument Clinic nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 09:17:31 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 04 Nov 2017 13:17:31 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509801451.17.0.213398074469.issue31415@psf.upfronthosting.co.za> Antoine Pitrou added the comment: One benefit (or drawback, depending on how you see it) of the -X option is that it wouldn't propagate to child processes spawned by multiprocessing. See _args_from_interpreter_flags() in Lib/subprocess.py. More generally, the idea that we should remove a command line option because there's an environment variable sounds dubious to me. Should we do the same for all command-line options? The faulthandler module can be enabled either using the `PYTHONFAULTHANDLER` environment variable or by specifying `-X faulthandler` on the command line. The only serious reason I can imagine would be that the -X option has a significant maintenance cost. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 09:21:15 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 04 Nov 2017 13:21:15 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509801675.38.0.213398074469.issue31415@psf.upfronthosting.co.za> Antoine Pitrou added the comment: (and Terry is right that environment variables can be significantly more annoying on Windows) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 09:27:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 13:27:13 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509802033.5.0.213398074469.issue31939@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Argument Clinic doesn't have any relations to annotations. It is just by accident use the syntax similar to the syntax of annotations in its declarations (and actually use Python parser for parsing them as anotations, but this is an implementation detail). It doesn't set argument annotations in signatures. For example, chr() is declared with: /*[clinic input] chr as builtin_chr i: int / Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff. [clinic start generated code]*/ Argument Clinic generates: PyDoc_STRVAR(builtin_chr__doc__, "chr($module, i, /)\n" "--\n" "\n" "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."); I think it could be possible to make Argument Clinic generating argument annotations basing on the accepted by converters types, but we are far from this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 14:10:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 04 Nov 2017 18:10:32 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509800902.99.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: I am not asking for a full support of return type annotation. Just export what is already supported in AC, export it in the signature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 14:21:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 18:21:56 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509819716.01.0.213398074469.issue31939@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Currently nothing is supported Argument Clinic. Return converters don't contain information that can be used in return type annotation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 13:45:18 2017 From: report at bugs.python.org (Chi Hsuan Yen) Date: Sat, 04 Nov 2017 17:45:18 +0000 Subject: [issue26467] Add async magic method support to unittest.mock.Mock In-Reply-To: <1456872706.59.0.97059255221.issue26467@psf.upfronthosting.co.za> Message-ID: <1509817518.76.0.213398074469.issue26467@psf.upfronthosting.co.za> Change by Chi Hsuan Yen : ---------- nosy: +Chi Hsuan Yen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 12:27:05 2017 From: report at bugs.python.org (Marat Sharafutdinov) Date: Sat, 04 Nov 2017 16:27:05 +0000 Subject: [issue31943] Add asyncio.Handle.cancelled() and asyncio.TimerHandle.when Message-ID: <1509812825.97.0.213398074469.issue31943@psf.upfronthosting.co.za> New submission from Marat Sharafutdinov : It would be handy to access the loop's time the Handle's callback will be called at if you are using delayed calls with "delay" (not "when") argument. Also it is useful to know whether the call was cancelled through the special attribute. ---------- assignee: docs at python components: Documentation, Library (Lib), asyncio messages: 305561 nosy: decaz, docs at python, yselivanov priority: normal pull_requests: 4238 severity: normal status: open title: Add asyncio.Handle.cancelled() and asyncio.TimerHandle.when type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 12:50:17 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 04 Nov 2017 16:50:17 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509814217.95.0.213398074469.issue31415@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Okay, given the non-propagation and Windows issues. I'm -1 on removing -X, +1 on fixing the negative cache. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 15:59:30 2017 From: report at bugs.python.org (Nitish) Date: Sat, 04 Nov 2017 19:59:30 +0000 Subject: [issue31942] Document that support of start and stop parameters in the Sequence's index() is optional In-Reply-To: <1509786601.53.0.213398074469.issue31942@psf.upfronthosting.co.za> Message-ID: <1509825570.52.0.213398074469.issue31942@psf.upfronthosting.co.za> Change by Nitish : ---------- keywords: +patch pull_requests: +4239 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 16:10:42 2017 From: report at bugs.python.org (Nitish) Date: Sat, 04 Nov 2017 20:10:42 +0000 Subject: [issue31942] Document that support of start and stop parameters in the Sequence's index() is optional In-Reply-To: <1509786601.53.0.213398074469.issue31942@psf.upfronthosting.co.za> Message-ID: <1509826242.95.0.213398074469.issue31942@psf.upfronthosting.co.za> Change by Nitish : ---------- nosy: +nitishch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 17:29:15 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 04 Nov 2017 21:29:15 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1509830955.78.0.213398074469.issue31415@psf.upfronthosting.co.za> Terry J. Reedy added the comment: > with environment variable you get more information. For timing package import time, such as for idlelib.pyshell, rather than bare python startup time, the extra information is just a bit more noise to ignore. The importtime output is sent to stderr. Should this be documented? It is important because displaying results immediately on command prompt rather than redirecting to a file adds about .07 seconds to the total time reported for pyshell, whether I use debug or normal binaries. The relative variation between repeated runs (about 1%) also seems less with redirection to a file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 17:40:03 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 21:40:03 +0000 Subject: [issue31932] setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData In-Reply-To: <1509705853.38.0.213398074469.issue31932@psf.upfronthosting.co.za> Message-ID: <1509831603.2.0.213398074469.issue31932@psf.upfronthosting.co.za> Steve Dower added the comment: Duplicate of issue23246. AFAIK, nothing has changed since then. The PR in its current form is not acceptable - there is a totally reliable registry key for finding the compiler, which is better than guessing a path. See the code in setuptools (and also make the case for why we should help people to build extensions without the fixes provided by setuptools, but do it on the existing issue). ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> distutils fails to locate vcvarsall with Visual C++ Compiler for Python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 17:40:52 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 21:40:52 +0000 Subject: [issue31546] PyOS_InputHook is not called when waiting for input() in Windows In-Reply-To: <1506010382.42.0.274746719926.issue31546@psf.upfronthosting.co.za> Message-ID: <1509831652.84.0.213398074469.issue31546@psf.upfronthosting.co.za> Steve Dower added the comment: The fix is simple, just need someone to do a PR. (I might get to it eventually, but I'm working on other things right now.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 17:41:03 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 21:41:03 +0000 Subject: [issue31546] PyOS_InputHook is not called when waiting for input() in Windows In-Reply-To: <1506010382.42.0.274746719926.issue31546@psf.upfronthosting.co.za> Message-ID: <1509831663.25.0.213398074469.issue31546@psf.upfronthosting.co.za> Steve Dower added the comment: And yes, I think this is fine for 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 17:45:55 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 21:45:55 +0000 Subject: [issue31523] Windows build file fixes In-Reply-To: <1505862497.47.0.608465001142.issue31523@psf.upfronthosting.co.za> Message-ID: <1509831955.5.0.213398074469.issue31523@psf.upfronthosting.co.za> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 17:52:59 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 04 Nov 2017 21:52:59 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1509832379.52.0.213398074469.issue31937@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I would rather not clutter the glossary with this sort of entry. Already, it has clutter that should probably be removed so that once again it becomes a worthwhile read rather than turning into a dictionary of random terms (such as meta-path-finder, module spec, and regular-package). Instead, there should probably be a FAQ entry or wiki entry on the ever evolving spoken cultural terminology: dunder --> double underscore stir --> __str__ repper --> __repr__ rest --> .rst files or representational-state-transfer sequel -> sql gwid -> globally unique indentifier inker and decker -> incref and decef (larry hastings pronunciation) ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:21:07 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 22:21:07 +0000 Subject: [issue31944] Windows Apps and Features items only have "Uninstall" Message-ID: <1509834067.47.0.213398074469.issue31944@psf.upfronthosting.co.za> New submission from Steve Dower : The installed item entries on Windows (since some recent update, I believe) only display "Uninstall" and do not let you select "Modify". This is because we enabled the setting that used to display "Uninstall/Modify" as a single button. Clicking the Uninstall button (and confirming it) lets you modify or repair. We should just enable both buttons so it isn't so scary to repair/modify an install. ---------- assignee: steve.dower components: Windows messages: 305570 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Windows Apps and Features items only have "Uninstall" type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:31:02 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 22:31:02 +0000 Subject: [issue31944] Windows Apps and Features items only have "Uninstall" In-Reply-To: <1509834067.47.0.213398074469.issue31944@psf.upfronthosting.co.za> Message-ID: <1509834662.1.0.213398074469.issue31944@psf.upfronthosting.co.za> Change by Steve Dower : ---------- keywords: +patch pull_requests: +4240 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:32:30 2017 From: report at bugs.python.org (Nir Soffer) Date: Sat, 04 Nov 2017 22:32:30 +0000 Subject: [issue31945] Configurable blocksize in HTTP(S)Connection Message-ID: <1509834750.61.0.213398074469.issue31945@psf.upfronthosting.co.za> New submission from Nir Soffer : blocksize is hardcoded to 8192 in send() and _read_readable(), preventing efficient upload when using file-like body. Users of the module that are not interested in chunked encoding can rewrite the copy loop using HTTPConnection.send(): conn = HTTPSConnection(...) conn.putrequest(...) conn.putheader(...) conn.endheaders() while True: chunk = file.read(512*1024) if not chunk: break conn.send(chunk) But fixing send() to use a configurable blocksize seems more useful. Also, users of requests do not have access the underlying connection, so they cannot use preferred buffer size. When reading from /dev/zero and uploading to server that drop the received data, larger buffer size gives 3X more throughput *and* 1/3 of cpu time. With real storage and network, the effect will probably be much smaller. ---------- components: Library (Lib) messages: 305571 nosy: brett.cannon, haypo, nirs, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Configurable blocksize in HTTP(S)Connection versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:34:44 2017 From: report at bugs.python.org (Nir Soffer) Date: Sat, 04 Nov 2017 22:34:44 +0000 Subject: [issue31945] Configurable blocksize in HTTP(S)Connection In-Reply-To: <1509834750.61.0.213398074469.issue31945@psf.upfronthosting.co.za> Message-ID: <1509834884.71.0.213398074469.issue31945@psf.upfronthosting.co.za> Change by Nir Soffer : ---------- keywords: +patch pull_requests: +4241 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:39:46 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 22:39:46 +0000 Subject: [issue31609] PCbuild\clean.bat fails if the path contains whitespaces In-Reply-To: <1506509366.56.0.154975027568.issue31609@psf.upfronthosting.co.za> Message-ID: <1509835186.14.0.213398074469.issue31609@psf.upfronthosting.co.za> Change by Steve Dower : ---------- keywords: +patch pull_requests: +4242 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:41:58 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 22:41:58 +0000 Subject: [issue31609] PCbuild\clean.bat fails if the path contains whitespaces In-Reply-To: <1506509366.56.0.154975027568.issue31609@psf.upfronthosting.co.za> Message-ID: <1509835318.11.0.213398074469.issue31609@psf.upfronthosting.co.za> Change by Steve Dower : ---------- assignee: -> steve.dower versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:55:29 2017 From: report at bugs.python.org (Shai Berger) Date: Sat, 04 Nov 2017 22:55:29 +0000 Subject: [issue31946] mailbox.MH.add loses status info from other formats Message-ID: <1509836129.85.0.213398074469.issue31946@psf.upfronthosting.co.za> New submission from Shai Berger : In mailbox.py in the stdlib, the functions MH.add and MH.__setitem__ take a message object and dump it to a file in the MH folder, which is good and well. However, they only call self._dump_sequences() if the message was already an MHMessage. Since in the MH format, status details (whether the message was read, replied or flagged) are saved in these sequences, this effectively loses this information. This means that, if "folder" is an MH folder and "message" is a message of any class other than MHMessage, folder.add(message) loses the information, while folder.add(MHMEssage(message)) retains it. This seems surprising and suboptimal. ---------- components: Library (Lib), email messages: 305572 nosy: barry, r.david.murray, shai priority: normal severity: normal status: open title: mailbox.MH.add loses status info from other formats type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:00:53 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 23:00:53 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py In-Reply-To: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> Message-ID: <1509836453.93.0.213398074469.issue31923@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset aafece7a9e010075fff4420cfbb16f1ec0342698 by Berker Peksag (davy wybiral) in branch 'master': bpo-31923: Fix spelling in sqlite3 docs (GH-4227) https://github.com/python/cpython/commit/aafece7a9e010075fff4420cfbb16f1ec0342698 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:01:30 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 23:01:30 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py In-Reply-To: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> Message-ID: <1509836490.28.0.213398074469.issue31923@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- type: -> behavior versions: +Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:02:01 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 04 Nov 2017 23:02:01 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py In-Reply-To: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> Message-ID: <1509836521.98.0.213398074469.issue31923@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4243 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:03:01 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 04 Nov 2017 23:03:01 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py In-Reply-To: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> Message-ID: <1509836581.15.0.213398074469.issue31923@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4244 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:11:03 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 23:11:03 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py In-Reply-To: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> Message-ID: <1509837063.66.0.213398074469.issue31923@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 5c0100aec014b9e0a66884468cbfa3ac01e4bfbb by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-31923: Fix spelling in sqlite3 docs (GH-4227) https://github.com/python/cpython/commit/5c0100aec014b9e0a66884468cbfa3ac01e4bfbb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:11:27 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 23:11:27 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py In-Reply-To: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> Message-ID: <1509837087.71.0.213398074469.issue31923@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 4376a2275967971a2f9586028347d6ed4ed6ef13 by Berker Peksag (Miss Islington (bot)) in branch '2.7': bpo-31923: Fix spelling in sqlite3 docs (GH-4227) https://github.com/python/cpython/commit/4376a2275967971a2f9586028347d6ed4ed6ef13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:12:02 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 04 Nov 2017 23:12:02 +0000 Subject: [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py In-Reply-To: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> Message-ID: <1509837122.83.0.213398074469.issue31923@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks, Davy! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:24:24 2017 From: report at bugs.python.org (Stuart Berg) Date: Sat, 04 Nov 2017 23:24:24 +0000 Subject: [issue25942] subprocess.call SIGKILLs too liberally In-Reply-To: <1451006108.23.0.113868196098.issue25942@psf.upfronthosting.co.za> Message-ID: <1509837864.13.0.213398074469.issue25942@psf.upfronthosting.co.za> Change by Stuart Berg : ---------- pull_requests: +4245 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:25:53 2017 From: report at bugs.python.org (Hugh Fisher) Date: Sat, 04 Nov 2017 23:25:53 +0000 Subject: [issue31932] setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData In-Reply-To: <1509705853.38.0.213398074469.issue31932@psf.upfronthosting.co.za> Message-ID: <1509837953.9.0.213398074469.issue31932@psf.upfronthosting.co.za> Hugh Fisher added the comment: The registry key is not totally reliable for finding the compiler. What I did: my system is Windows 8.1 64 bit with Python 2.7 64 bit installed. I'd been testing a setup.py on Linux, time to try on MSWin. So I downloaded VCForPython27.msi as recommended by the Python docs, ran it, tried python setup.py build_ext. Failed because could not find VCVARSALL.BAT. Standard MSWin troubleshooting first step: restart. Still no. Search turned up a freshly installed dir under AppData. After searching through distutils code, stepping through it, and poking around with RegEdit it turned out that while my system has various registry keys for Visual Studio versions from 7.1 through 12.0, even keys for 9.0, but not the particular one that find_vcvarsall wants. Why not? How can I know? I added two lines of code to msvc9compiler.py and my extension now compiled. To me, only the file system can be a totally reliable guide as to whether a particular path exists. I agree that it's not practical to wildly guess, or to search everywhere. But this is for Python 2.7, where the configuration has been frozen for all time. There's only a couple of places these files could be. The additional code I've proposed will make Python continue to work even if the registry is clobbered. It will also make Python continue to work if the user copies the files from another system instead of running the installer. I think this is worthwhile, so ask that you reopen this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:28:49 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 23:28:49 +0000 Subject: [issue31944] Windows Apps and Features items only have "Uninstall" In-Reply-To: <1509834067.47.0.213398074469.issue31944@psf.upfronthosting.co.za> Message-ID: <1509838129.13.0.213398074469.issue31944@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset 0d2a9088d16826343344b04461c8be44b4008710 by Steve Dower in branch 'master': bpo-31944: Fixes build and Modify button (#4278) https://github.com/python/cpython/commit/0d2a9088d16826343344b04461c8be44b4008710 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:29:05 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 23:29:05 +0000 Subject: [issue31609] PCbuild\clean.bat fails if the path contains whitespaces In-Reply-To: <1506509366.56.0.154975027568.issue31609@psf.upfronthosting.co.za> Message-ID: <1509838145.61.0.213398074469.issue31609@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset aed08562220974b5c67371b908f23caa1be07e38 by Steve Dower in branch 'master': bpo-31609: Fixes quotes in PCbuild/clean.bat (#4280) https://github.com/python/cpython/commit/aed08562220974b5c67371b908f23caa1be07e38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:29:55 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 04 Nov 2017 23:29:55 +0000 Subject: [issue31944] Windows Apps and Features items only have "Uninstall" In-Reply-To: <1509834067.47.0.213398074469.issue31944@psf.upfronthosting.co.za> Message-ID: <1509838195.56.0.213398074469.issue31944@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4246 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 19:30:55 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 04 Nov 2017 23:30:55 +0000 Subject: [issue31609] PCbuild\clean.bat fails if the path contains whitespaces In-Reply-To: <1506509366.56.0.154975027568.issue31609@psf.upfronthosting.co.za> Message-ID: <1509838255.54.0.213398074469.issue31609@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4247 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 20:07:34 2017 From: report at bugs.python.org (Steve Dower) Date: Sun, 05 Nov 2017 00:07:34 +0000 Subject: [issue31944] Windows Apps and Features items only have "Uninstall" In-Reply-To: <1509834067.47.0.213398074469.issue31944@psf.upfronthosting.co.za> Message-ID: <1509840454.26.0.213398074469.issue31944@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset 40708cc7d2361518a2784afedf495eafcc099de5 by Steve Dower (Miss Islington (bot)) in branch '3.6': bpo-31944: Fixes build and Modify button (GH-4278) (#4284) https://github.com/python/cpython/commit/40708cc7d2361518a2784afedf495eafcc099de5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 20:25:11 2017 From: report at bugs.python.org (Steve Dower) Date: Sun, 05 Nov 2017 00:25:11 +0000 Subject: [issue31609] PCbuild\clean.bat fails if the path contains whitespaces In-Reply-To: <1506509366.56.0.154975027568.issue31609@psf.upfronthosting.co.za> Message-ID: <1509841511.41.0.213398074469.issue31609@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset f4443562345130c991fded3dc3b02b94aee0f362 by Steve Dower (Miss Islington (bot)) in branch '3.6': bpo-31609: Fixes quotes in PCbuild/clean.bat (GH-4280) (#4285) https://github.com/python/cpython/commit/f4443562345130c991fded3dc3b02b94aee0f362 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 20:25:32 2017 From: report at bugs.python.org (Steve Dower) Date: Sun, 05 Nov 2017 00:25:32 +0000 Subject: [issue31944] Windows Apps and Features items only have "Uninstall" In-Reply-To: <1509834067.47.0.213398074469.issue31944@psf.upfronthosting.co.za> Message-ID: <1509841532.02.0.213398074469.issue31944@psf.upfronthosting.co.za> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 20:25:42 2017 From: report at bugs.python.org (Steve Dower) Date: Sun, 05 Nov 2017 00:25:42 +0000 Subject: [issue31609] PCbuild\clean.bat fails if the path contains whitespaces In-Reply-To: <1506509366.56.0.154975027568.issue31609@psf.upfronthosting.co.za> Message-ID: <1509841542.28.0.213398074469.issue31609@psf.upfronthosting.co.za> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 23:56:49 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 05 Nov 2017 03:56:49 +0000 Subject: [issue25942] subprocess.call SIGKILLs too liberally In-Reply-To: <1451006108.23.0.113868196098.issue25942@psf.upfronthosting.co.za> Message-ID: <1509854209.53.0.213398074469.issue25942@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 23:57:22 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 05 Nov 2017 03:57:22 +0000 Subject: [issue25942] subprocess.call SIGKILLs too liberally In-Reply-To: <1451006108.23.0.113868196098.issue25942@psf.upfronthosting.co.za> Message-ID: <1509854242.5.0.213398074469.issue25942@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 00:26:51 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 05 Nov 2017 04:26:51 +0000 Subject: [issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect In-Reply-To: <1508757930.52.0.213398074469.issue31845@psf.upfronthosting.co.za> Message-ID: <1509856011.81.0.213398074469.issue31845@psf.upfronthosting.co.za> Nick Coghlan added the comment: Cross-linking to the work-in-progress RFE that introduced the error: https://bugs.python.org/issue22257 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 00:37:09 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 05 Nov 2017 04:37:09 +0000 Subject: [issue22257] PEP 432: Redesign the interpreter startup sequence In-Reply-To: <1408789351.84.0.0171822343712.issue22257@psf.upfronthosting.co.za> Message-ID: <1509856629.8.0.213398074469.issue22257@psf.upfronthosting.co.za> Nick Coghlan added the comment: Bug report (since resolved) that highlighted our general lack of test coverage for the interactions between environment variable based configuration and command line based configuration: https://bugs.python.org/issue31845 This work revealed the absence, since the refactoring changes the order in which we check environment variables and the command line (we used to check the command line first, and then env vars later during Py_Initialize, now we check env vars in _Py_InitializeCore, and the command line afterwards). Something I'd also forgotten is that I'd switched the PEP to use "_Py_InitializeRuntime" and "_Py_ConfigureMainInterpreter", but the draft implementation is currently still using "_Py_InitializeCore" and "_Py_InitializeMainInterpreter". For that last point, it's probably easier to change the PEP back than it is to tinker with the implementation - those specific API names are pretty arbitrary anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 00:49:12 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 05 Nov 2017 04:49:12 +0000 Subject: [issue22257] PEP 432: Redesign the interpreter startup sequence In-Reply-To: <1408789351.84.0.0171822343712.issue22257@psf.upfronthosting.co.za> Message-ID: <1509857352.13.0.213398074469.issue22257@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- pull_requests: +4248 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 00:49:12 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 05 Nov 2017 04:49:12 +0000 Subject: [issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect In-Reply-To: <1508757930.52.0.213398074469.issue31845@psf.upfronthosting.co.za> Message-ID: <1509857352.41.0.00913614298617.issue31845@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- pull_requests: +4249 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 00:58:48 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 05 Nov 2017 04:58:48 +0000 Subject: [issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect In-Reply-To: <1508757930.52.0.213398074469.issue31845@psf.upfronthosting.co.za> Message-ID: <1509857928.56.0.213398074469.issue31845@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 1b46131ae423f43d45947bb48844cf82f6fd82b8 by Nick Coghlan in branch 'master': bpo-22257: Mention startup refactoring in What's New (GH-4286) https://github.com/python/cpython/commit/1b46131ae423f43d45947bb48844cf82f6fd82b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 00:58:48 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 05 Nov 2017 04:58:48 +0000 Subject: [issue22257] PEP 432: Redesign the interpreter startup sequence In-Reply-To: <1408789351.84.0.0171822343712.issue22257@psf.upfronthosting.co.za> Message-ID: <1509857928.66.0.912454111764.issue22257@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 1b46131ae423f43d45947bb48844cf82f6fd82b8 by Nick Coghlan in branch 'master': bpo-22257: Mention startup refactoring in What's New (GH-4286) https://github.com/python/cpython/commit/1b46131ae423f43d45947bb48844cf82f6fd82b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 01:55:41 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 05 Nov 2017 05:55:41 +0000 Subject: [issue30744] Local variable assignment is broken when combined with threads + tracing + closures In-Reply-To: <1498277129.07.0.940069687434.issue30744@psf.upfronthosting.co.za> Message-ID: <1509861341.56.0.213398074469.issue30744@psf.upfronthosting.co.za> Nick Coghlan added the comment: Starting to make some progress on an implementation, and it occurs to me that if this approach does work out, it should make Python level trace functions *much* faster. Right now, the call to the Python function in call_trampoline is bracketed by PyFrame_FastToLocals() and PyFrame_LocalsToFast(), even if the trace function never accesses frame.f_locals. By contrast, with the proposed design, PyFrame_LocalsToFast() never gets called anywhere (I've actually replaced the entire body with a PyErr_SetString call), and PyFrame_FastTo_Locals will only be called in the frame.f_locals descriptor implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 03:09:46 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 05 Nov 2017 08:09:46 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1509869386.87.0.213398074469.issue11063@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +4250 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 03:12:48 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 05 Nov 2017 08:12:48 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1509869568.41.0.213398074469.issue11063@psf.upfronthosting.co.za> Berker Peksag added the comment: I've followed Stefan's suggestion and opened PR 4287 (tested on 10.10.5) ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 04:27:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Nov 2017 09:27:53 +0000 Subject: [issue28994] Misc fixes and cleanups in error handling C code In-Reply-To: <1481931496.89.0.341758339319.issue28994@psf.upfronthosting.co.za> Message-ID: <1509874073.38.0.213398074469.issue28994@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset cf296537f164abeacd83011239881f75f290ed31 by Serhiy Storchaka in branch 'master': bpo-28994: PyErr_NormalizeException() no longer use C stack for recursion. (#2035) https://github.com/python/cpython/commit/cf296537f164abeacd83011239881f75f290ed31 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 05:25:08 2017 From: report at bugs.python.org (Stefan Krah) Date: Sun, 05 Nov 2017 10:25:08 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1509877508.94.0.213398074469.issue11063@psf.upfronthosting.co.za> Stefan Krah added the comment: Berker's latest patch looks good to me. Unrelated to the patch (same before and after), this looks odd to me: >>> import uuid >>> uuid._has_uuid_generate_time_safe is None True >>> >>> import _uuid >>> _uuid.has_uuid_generate_time_safe 1 [Also, I thought we weren't supposed to use ctypes in the stdlib.] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 05:51:18 2017 From: report at bugs.python.org (pdox) Date: Sun, 05 Nov 2017 10:51:18 +0000 Subject: [issue31921] Bring together logic for entering/leaving a frame in frameobject.c In-Reply-To: <1509616579.32.0.213398074469.issue31921@psf.upfronthosting.co.za> Message-ID: <1509879078.71.0.213398074469.issue31921@psf.upfronthosting.co.za> pdox added the comment: Raymond, this is not an experiment, but the beginning of a sustained effort to improve locality during execution, to make more effective use of CPU cache lines. Rather than discuss the details of this change one PR at a time, I will close this issue for now, and open a discussion on python-dev. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 05:51:52 2017 From: report at bugs.python.org (pdox) Date: Sun, 05 Nov 2017 10:51:52 +0000 Subject: [issue31921] Bring together logic for entering/leaving a frame in frameobject.c In-Reply-To: <1509616579.32.0.213398074469.issue31921@psf.upfronthosting.co.za> Message-ID: <1509879112.09.0.213398074469.issue31921@psf.upfronthosting.co.za> Change by pdox : ---------- resolution: -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 06:21:06 2017 From: report at bugs.python.org (Paul) Date: Sun, 05 Nov 2017 11:21:06 +0000 Subject: [issue31947] names=None case is not handled by EnumMeta._create_ method Message-ID: <1509880866.58.0.213398074469.issue31947@psf.upfronthosting.co.za> New submission from Paul : It seems to me that this method should not have names=None default value in signature, because that case is not handled, nor is it described as a possible value in the docstring. Seems like maybe a copy and paste from __call__, which has basically same signature, but names=None is valid and handled there. ---------- messages: 305591 nosy: anentropic priority: normal pull_requests: 4251 severity: normal status: open title: names=None case is not handled by EnumMeta._create_ method type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 06:31:40 2017 From: report at bugs.python.org (Tal Einat) Date: Sun, 05 Nov 2017 11:31:40 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509881500.46.0.213398074469.issue31939@psf.upfronthosting.co.za> Tal Einat added the comment: Argument Clinic currently doesn't support input parameter type annotations either, though for this it has more relevant information in many cases. I think it would be a great boon for AC to enable declaring type annotations, both for input parameters and for return values. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 06:49:27 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 05 Nov 2017 11:49:27 +0000 Subject: [issue31948] Broken MSDN links in msilib docs Message-ID: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> New submission from Berker Peksag : Most of the MSDN links in Doc/library/msilib.rst are broken: https://docs.python.org/3/library/msilib.html For example, the UuidToString link goes to https://msdn.microsoft.com/library?url=/library/en-us/rpc/rpc/uuidtostring.asp But I believe the correct link should be https://msdn.microsoft.com/en-us/library/windows/desktop/aa379352(v=vs.85).aspx ---------- assignee: docs at python components: Documentation keywords: easy messages: 305593 nosy: berker.peksag, docs at python priority: normal severity: normal stage: needs patch status: open title: Broken MSDN links in msilib docs type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 06:55:10 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 05 Nov 2017 11:55:10 +0000 Subject: [issue31454] Include "import as" in tutorial In-Reply-To: <1505317940.24.0.986048971751.issue31454@psf.upfronthosting.co.za> Message-ID: <1509882910.83.0.213398074469.issue31454@psf.upfronthosting.co.za> Berker Peksag added the comment: PR 4041 looks good to me. Mariatta, do you have time to look at Mario's patch? Sarthak, thank you for your PR, but a PR was opened 12 days before yours (sorry, I missed it earlier) Would you like to work on another issue? I've just opened bpo-31948 and I'd be happy to review/merge a PR if you have time. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 09:06:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Nov 2017 14:06:35 +0000 Subject: [issue31949] Bugs in PyTraceBack_Print() Message-ID: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : 0fbab7ff8d2efd92e222fcc13c0aff0998c3c158 changed the semantic of PyTraceBack_Print and sys.tracebacklimit. It no longer match the documentation and the behavior of the traceback module. Setting sys.tracebacklimit to 0 or less no longer suppress printing tracebacks in PyTraceBack_Print(). Setting sys.tracebacklimit to None (as at shutdown stage) no longer makes PyTraceBack_Print() using default limit, but suppress printing tracebacks and sets a TypeError without returning failure from PyTraceBack_Print(). The proposed PR restores the initial purposed semantic and fixes several other bugs in PyTraceBack_Print(). * Setting sys.tracebacklimit to 0 or less now suppress printing tracebacks. * Setting sys.tracebacklimit to None now causes using the default limit. * Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using the limit LONG_MAX rather than the default limit. * Fixed integer overflows in the case of more than 2**31 items on Windows. * Fixed output errors handling. ---------- assignee: serhiy.storchaka components: Interpreter Core messages: 305595 nosy: christian.heimes, serhiy.storchaka priority: normal severity: normal status: open title: Bugs in PyTraceBack_Print() type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 09:16:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Nov 2017 14:16:19 +0000 Subject: [issue31949] Bugs in PyTraceBack_Print() In-Reply-To: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> Message-ID: <1509891379.56.0.213398074469.issue31949@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4252 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 09:23:50 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 05 Nov 2017 14:23:50 +0000 Subject: [issue31949] Bugs in PyTraceBack_Print() In-Reply-To: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> Message-ID: <1509891830.52.0.213398074469.issue31949@psf.upfronthosting.co.za> Berker Peksag added the comment: > Setting sys.tracebacklimit to 0 or less no longer suppress printing > tracebacks in PyTraceBack_Print(). This was also reported in issue 12276. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 09:55:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Nov 2017 14:55:19 +0000 Subject: [issue12276] 3.x ignores sys.tracebacklimit=0 In-Reply-To: <1307436501.83.0.59684150491.issue12276@psf.upfronthosting.co.za> Message-ID: <1509893719.47.0.213398074469.issue12276@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Do you mind to create a pull request on GitHub Anand? Issue31949 fixes this and several other bugs in PyTraceBack_Print(), but it may be worth to fix this bug first, especially if the patch contains tests. ---------- assignee: docs at python -> serhiy.storchaka components: -Documentation nosy: +serhiy.storchaka versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 10:08:20 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 05 Nov 2017 15:08:20 +0000 Subject: [issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows In-Reply-To: <1508860013.85.0.213398074469.issue31863@psf.upfronthosting.co.za> Message-ID: <1509894500.66.0.213398074469.issue31863@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I would like to know what our resident Windows users think about this (Paul, Steve, Zach). Reading the above arguments, I'd be inclined to settle on 15 (that is, the non-negative "signal" number). While it is not consistent with what "taskkill" or other APIs do, it makes it clear that the process was terminated in a certain way. Certainly, there is a slight chance that 15 is a legitimate error code returned by the process, but that is far less likely than returning 1 as a legitimate error code, which I presume is extremely common. In any case, this can't go in a bugfix release, so marking as 3.7-only. ---------- versions: -Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 10:11:51 2017 From: report at bugs.python.org (Stefan Krah) Date: Sun, 05 Nov 2017 15:11:51 +0000 Subject: [issue27359] OrderedDict pseudo-literals (WIP) In-Reply-To: <1466475427.25.0.285635253324.issue27359@psf.upfronthosting.co.za> Message-ID: <1509894711.47.0.213398074469.issue27359@psf.upfronthosting.co.za> Stefan Krah added the comment: It looks like guaranteed ordered literals are going to happen (yay!): https://mail.python.org/pipermail/python-dev/2017-November/150144.html ---------- nosy: +skrah resolution: later -> out of date stage: -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 11:05:04 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 05 Nov 2017 16:05:04 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509897904.71.0.213398074469.issue31939@psf.upfronthosting.co.za> R. David Murray added the comment: I believe we currently have a policy that the python standard library will not include type annotations, that those are provided by typeshed. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 12:13:23 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Nov 2017 17:13:23 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509902003.1.0.213398074469.issue21423@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: test_concurrent_futures now produces too much output on stderr. $ ./python -m test test_concurrent_futures >/dev/null Exception in initializer: Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/concurrent/futures/process.py", line 170, in _process_worker initializer(*initargs) File "/home/serhiy/py/cpython/Lib/test/test_concurrent_futures.py", line 66, in init_fail raise ValueError('error in initializer') ValueError: error in initializer Exception in initializer: Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/concurrent/futures/process.py", line 170, in _process_worker initializer(*initargs) File "/home/serhiy/py/cpython/Lib/test/test_concurrent_futures.py", line 66, in init_fail raise ValueError('error in initializer') ValueError: error in initializer ... What is worse, this output looks as errors report. ---------- nosy: +serhiy.storchaka resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 12:14:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Nov 2017 17:14:45 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509902085.27.0.213398074469.issue21423@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: And please don't forget to edit a commit message when merge a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 12:40:50 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 05 Nov 2017 17:40:50 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1509830955.78.0.213398074469.issue31415@psf.upfronthosting.co.za> Message-ID: <9440F248-4045-4D7F-BF7A-B33A1ED2B611@python.org> Barry A. Warsaw added the comment: On Nov 4, 2017, at 14:29, Terry J. Reedy wrote: > The importtime output is sent to stderr. Should this be documented? Yes. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 12:44:11 2017 From: report at bugs.python.org (Paul Moore) Date: Sun, 05 Nov 2017 17:44:11 +0000 Subject: [issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows In-Reply-To: <1508860013.85.0.213398074469.issue31863@psf.upfronthosting.co.za> Message-ID: <1509903851.29.0.213398074469.issue31863@psf.upfronthosting.co.za> Paul Moore added the comment: I'm not actually sure what the proposal here is. Are we suggesting that all Python's means of terminating a process should use the same exit code? Note that doing so would be a backward compatibility break, as os.kill() is documented as having the behaviour seen here (it's just that SIGTERM isn't a particularly meaningful value to use on Windows). subprocess terminate() doesn't document the exit code sent on Windows, and maybe should - but 1 seems a reasonable value (it's the C EXIT_FAILURE code after all). I don't fully understand the issue multiprocessing is trying to solve, but it seems to be around signals, which are very different between Windows and Unix anyway. So, in summary - I'd need to see a specific proposal, but my instinct is that this is only an issue if you're trying to cover over the differences between Unix and Windows, and this isn't a case where I think that's advisable (the current situation is "good enough" if you don't care, and if you do, you have the means to do it right, you just need to cater for the platform differences yourself, in a way that suits your application.). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 12:45:57 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 05 Nov 2017 17:45:57 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1509903957.49.0.213398074469.issue21423@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Unfortunately, there is no obvious way to capture the output of the child process here, short of running the entire test under a subprocess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 12:58:02 2017 From: report at bugs.python.org (Brett Cannon) Date: Sun, 05 Nov 2017 17:58:02 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509904682.69.0.213398074469.issue31939@psf.upfronthosting.co.za> Brett Cannon added the comment: R. David is correct that currently the policy is there are no type hints in the stdlib. Now the interesting thing about AC is the type hint info could be kept just in the docstring and not added to __annotations__ which somewhat goes around this restriction. Plus I think Victor is only talking about the docstring ATM anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 13:16:09 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 05 Nov 2017 18:16:09 +0000 Subject: [issue31950] Default event loop policy doc lacks precision Message-ID: <1509905769.74.0.213398074469.issue31950@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The doc for the default event loop policy states that """the default policy defines context as the current thread, and manages an event loop per thread that interacts with asyncio""". What it doesn't mention, though, is that you get a RuntimeError if you call get_event_loop() in a non-main thread -- you first have to call set_event_loop(new_event_loop()) in that thread. This wasn't expected by me. As a side note, customizing the event loop policy isn't trivial either: it seems it's best to subclass DefaultEventLoopPolicy and make adjustments by overriding the API methods. Writing your own wouldn't work, as e.g. the Unix default policy has custom initialization code for child watchers. ---------- assignee: docs at python components: Documentation, asyncio messages: 305607 nosy: docs at python, giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov priority: normal severity: normal status: open title: Default event loop policy doc lacks precision type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 13:45:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Nov 2017 18:45:36 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509907536.54.0.213398074469.issue31939@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Victor is talking about inspect.signature(). In Python 3.5+ the result is "(fd, /)". In older versions it raises a ValueError. The docstring in 3.4 is 'dup(fd) -> fd2\n\nReturn a duplicate of a file descriptor.' It doesn't contain information that dup() returns int. It contains implicit information that dup() perhaps returns other file descriptor, but this is already explicitly documented by words. I don't see a loss of information here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 14:07:21 2017 From: report at bugs.python.org (Mario Corchero) Date: Sun, 05 Nov 2017 19:07:21 +0000 Subject: [issue30548] typo in documentation for create_autospec In-Reply-To: <1496394381.09.0.91116482689.issue30548@psf.upfronthosting.co.za> Message-ID: <1509908841.96.0.213398074469.issue30548@psf.upfronthosting.co.za> Mario Corchero added the comment: I've always understood instance as a way to say "I am passing this class but I want to force the autospec on the instance" For example, given ``` class X: def __init__(self): raise ``` You can do `unittest.mock.create_autospec(X, instance=True)` to set a spec of the instance rather than the class. Also quite often you do autospec on a class but you want the interface of the instance. This parameter allows you to do so. Basically, `unittest.mock.create_autospec(X, instance=True)` will produce a non callable mock. I think the docs are correct, maybe misleading ---------- nosy: +mariocj89 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 14:57:17 2017 From: report at bugs.python.org (Mario Corchero) Date: Sun, 05 Nov 2017 19:57:17 +0000 Subject: [issue30699] Misleading class names in datetime.tzinfo usage examples In-Reply-To: <1497824156.09.0.152108719585.issue30699@psf.upfronthosting.co.za> Message-ID: <1509911837.71.0.213398074469.issue30699@psf.upfronthosting.co.za> Change by Mario Corchero : ---------- keywords: +patch pull_requests: +4253 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 14:58:56 2017 From: report at bugs.python.org (Mario Corchero) Date: Sun, 05 Nov 2017 19:58:56 +0000 Subject: [issue30699] Misleading class names in datetime.tzinfo usage examples In-Reply-To: <1497824156.09.0.152108719585.issue30699@psf.upfronthosting.co.za> Message-ID: <1509911936.08.0.213398074469.issue30699@psf.upfronthosting.co.za> Change by Mario Corchero : ---------- nosy: +mariocj89 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 17:23:24 2017 From: report at bugs.python.org (Tom Viner) Date: Sun, 05 Nov 2017 22:23:24 +0000 Subject: [issue28140] Attempt to give better errors for pip commands typed into the REPL In-Reply-To: <1473828003.51.0.301742763108.issue28140@psf.upfronthosting.co.za> Message-ID: <1509920604.98.0.213398074469.issue28140@psf.upfronthosting.co.za> Change by Tom Viner : ---------- nosy: +tomviner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 17:55:53 2017 From: report at bugs.python.org (joe m) Date: Sun, 05 Nov 2017 22:55:53 +0000 Subject: [issue31951] import curses is broken on windows Message-ID: <1509922553.69.0.213398074469.issue31951@psf.upfronthosting.co.za> New submission from joe m : Importing curses on Windows install calls the following: Traceback (most recent call last): File "", line 1, in File "C:\Users\user name\AppData\Local\Programs\Python\Python36-32\lib\curses\__init__.py", line 13, in from _curses import * ModuleNotFoundError: No module named '_curses' Importing curses as "_curses" does the same thing. I have tried the "repair" function and it has not worked. ---------- components: Windows messages: 305610 nosy: joe m2, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: import curses is broken on windows versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 18:21:38 2017 From: report at bugs.python.org (Eric Wieser) Date: Sun, 05 Nov 2017 23:21:38 +0000 Subject: [issue28716] Fractions instantiation revisited In-Reply-To: <1479319587.68.0.845103759053.issue28716@psf.upfronthosting.co.za> Message-ID: <1509924098.68.0.213398074469.issue28716@psf.upfronthosting.co.za> Eric Wieser added the comment: > allows Fraction instantiation from duck-typing classes that provide as_integer_ratio This would allow the numpy `np.floating` types to take part in `Fraction` conversion as well, which would be great. As far as I can tell, `Decimal` already follows this duck-typing, so it would be a shame for other modules not to. Perhaps an `num, den = operator.rational(x)` is needed to unify this code across the places that coerce rational numbers. ---------- nosy: +Eric.Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 18:28:20 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 05 Nov 2017 23:28:20 +0000 Subject: [issue21790] Change blocksize in http.client to the value of resource.getpagesize In-Reply-To: <1403019624.98.0.809499942301.issue21790@psf.upfronthosting.co.za> Message-ID: <1509924500.49.0.213398074469.issue21790@psf.upfronthosting.co.za> Martin Panter added the comment: Issue 31945 proposes adding a ?blocksize? parameter to HTTPConnection objects, so I suggest to closing in favour of that one. ---------- resolution: -> rejected superseder: -> Configurable blocksize in HTTP(S)Connection _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 21:26:35 2017 From: report at bugs.python.org (Lucas Bertoldo) Date: Mon, 06 Nov 2017 02:26:35 +0000 Subject: [issue31952] Weird behavior on tupple item assignment Message-ID: <1509935195.34.0.213398074469.issue31952@psf.upfronthosting.co.za> New submission from Lucas Bertoldo : Basically, I typed: >>> m = (list(), list()) then I got, this, as expected: >>> m[0] += [1] Traceback (most recent call last): File "", line 1, in m[0] += [1] TypeError: 'tuple' object does not support item assignment but, when I checked the variable... >>> m ([1], []) --------------------------------- Saying the least, one can kind of assing a value to a tuple of lists and get the expected result, but with the trackback still showing up. ---------- components: Interpreter Core files: python bug.png messages: 305613 nosy: Lucas Bertoldo priority: normal severity: normal status: open title: Weird behavior on tupple item assignment type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47252/python bug.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 21:26:50 2017 From: report at bugs.python.org (Jean-Philippe Ouellet) Date: Mon, 06 Nov 2017 02:26:50 +0000 Subject: [issue31953] Dedicated place for security announcements? Message-ID: <1509935210.34.0.213398074469.issue31953@psf.upfronthosting.co.za> New submission from Jean-Philippe Ouellet : Hello, My apologies if this is not the right place to discus this. I would like to ensure that I stay informed of any potential future security issues in python (specifically at least the cpython runtime and standard library, although select very-popular 3rd party libraries wouldn't hurt). I cannot find a single place where such announcements are guaranteed to land. Good examples of the type of thing I am looking for are the openssl-announce list [1][2] and the golang-announce list [3], where the projects pre-announce "Hey, we're going to have a release on which addresses a security issue in ." and then announces again when patches are available such that responsible maintainers (such as I am trying to be) can ensure that updates are available to our users ASAP. The python-announce-list [4] does not serve this purpose because it has lots of noise from initial release announcements about random 3rd party stuff, and the "security news" page [5] is really just a "how to disclose vulns" page. Note that I'm *not* advocating for the creation of a pre-disclosure list! Python is such a ubiquitous piece of software that I don't think it's reasonable to expect that such a list could contain all affected parties without also leaking details to those who would cause harm. I'm only asking for something public that I can subscribe to in order to be sure I'll have a heads up of when patching is imminently required. Regards, Jean-Philippe (a contributor to the Qubes OS project [6] whose security relies mostly on Python's and Xen's - and is on Xen's pre-disclosure list) [1]: https://mta.openssl.org/pipermail/openssl-announce/2017-October/thread.html [2]: https://mta.openssl.org/pipermail/openssl-announce/2017-November/thread.html [3]: https://groups.google.com/forum/#!forum/golang-announce [4]: https://mail.python.org/mailman/listinfo/python-announce-list [5]: https://www.python.org/news/security/ [6]: https://www.qubes-os.org/ ---------- assignee: docs at python components: Documentation, email messages: 305614 nosy: barry, docs at python, jpo, r.david.murray priority: normal severity: normal status: open title: Dedicated place for security announcements? type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 21:40:55 2017 From: report at bugs.python.org (Lucas Bertoldo) Date: Mon, 06 Nov 2017 02:40:55 +0000 Subject: [issue31952] Weird behavior on tupple item assignment In-Reply-To: <1509935195.34.0.213398074469.issue31952@psf.upfronthosting.co.za> Message-ID: <1509936055.37.0.213398074469.issue31952@psf.upfronthosting.co.za> Change by Lucas Bertoldo : ---------- versions: +Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 21:52:33 2017 From: report at bugs.python.org (Emanuel Barry) Date: Mon, 06 Nov 2017 02:52:33 +0000 Subject: [issue31952] Weird behavior on tupple item assignment In-Reply-To: <1509935195.34.0.213398074469.issue31952@psf.upfronthosting.co.za> Message-ID: <1509936753.64.0.213398074469.issue31952@psf.upfronthosting.co.za> Emanuel Barry added the comment: This is a known issue, and is properly explained here: https://docs.python.org/3/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works ---------- nosy: +ebarry resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 21:58:35 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 06 Nov 2017 02:58:35 +0000 Subject: [issue29710] Incorrect representation caveat on bitwise operation docs In-Reply-To: <1488551919.31.0.20533072889.issue29710@psf.upfronthosting.co.za> Message-ID: <1509937115.24.0.213398074469.issue29710@psf.upfronthosting.co.za> Martin Panter added the comment: I find the model in terms of ?bit_length? hard to understand. You have to understand what bit_length returns, and why you added 1. Bit_length is awkward for negative numbers. It only uses the absolute value, which would give off-by-one problems with negative values, so I guess you added 1 to compensate. I understand the bitwise operations as using two?s complement extended to an unlimited width, so that negative values have a series of ones for the most-significant bits. I presume this is what your ?2-adic representation? is. Having this spelled out may have helped when I was learning Python. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 22:14:15 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 06 Nov 2017 03:14:15 +0000 Subject: [issue31953] Dedicated place for security announcements? In-Reply-To: <1509935210.34.0.213398074469.issue31953@psf.upfronthosting.co.za> Message-ID: <1509938055.74.0.213398074469.issue31953@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: There is Security SIG mailing list, please check it out: https://mail.python.org/mm3/archives/list/security-sig at python.org/ ---------- nosy: +Mariatta resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 23:03:28 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 06 Nov 2017 04:03:28 +0000 Subject: [issue29710] Incorrect representation caveat on bitwise operation docs In-Reply-To: <1488551919.31.0.20533072889.issue29710@psf.upfronthosting.co.za> Message-ID: <1509941008.01.0.213398074469.issue29710@psf.upfronthosting.co.za> Nick Coghlan added the comment: Right, and that's why I think we're better off focusing on the arithmetic explanations wherever they apply. The problem is that for "x | y" and "x & y" there's no avoiding discussing the 2's complement representation. Martin, would you find the reference to `bit_length()` in the current PR easier to follow if it had a second follow-up sentence like the one below: === Bitwise binary operations are semantically equivalent to calculations using 2's complement in a bit-width of ``1 + max(x.bit_length(), y .bit_length()``. This choice of bit-width ensures there is sufficient space for the absolute value of both operands, while also providing space for an explicit sign bit (representing the conceptually infinite series of zeros or ones at the left of a 2's complement value). === That retains the precision of the currently suggested definition (for the benefit of language implementors), but also spells out the rationale for that definition (the "1 +" is for the sign bit, while the abs() is implicit in the fact that bit_length() assumes 2's complement and hence doesn't allow space for an explicit sign bit). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 23:59:43 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 06 Nov 2017 04:59:43 +0000 Subject: [issue25942] subprocess.call SIGKILLs too liberally In-Reply-To: <1451006108.23.0.113868196098.issue25942@psf.upfronthosting.co.za> Message-ID: <1509944383.4.0.213398074469.issue25942@psf.upfronthosting.co.za> Martin Panter added the comment: https://github.com/python/cpython/pull/4283 adds a secondary timeout, which defaults to 1 s when there is no main timeout. But this seems complicated and arbitrary. As I understand, the main use case discussed here was waiting without a timeout for a child that exits soon after the interrupt. But are there any practical use cases or demand for: * Limiting the wait time after the interrupt (despite no timeout before the interrupt)? * Customizing this additional timeout? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 02:10:12 2017 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 06 Nov 2017 07:10:12 +0000 Subject: [issue30434] multiprocessing AuthenticationError "digest sent was rejected" In-Reply-To: <1495484655.04.0.0387717474918.issue30434@psf.upfronthosting.co.za> Message-ID: <1509952212.47.0.213398074469.issue30434@psf.upfronthosting.co.za> Xiang Zhang added the comment: I can't reproduce the failure with 2.7.13 but I do encounter the same failure just now, much same as yours, 2.7.5 and 2.7.13. I'd like to describe my situation. I have one client process started by 2.7.13(I build it from source) and one server process started by the system Python 2.7.5. I then get the same error as yours, failing at connect() and the authkey doesn't matter. The reason I find is that the system Python is patched by the OS vendor, changing the default MD5 algorithm to SHA256. So they can't communicate. Patching the source or syncing the version works for me. ---------- components: +Library (Lib) nosy: +xiang.zhang stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 03:56:31 2017 From: report at bugs.python.org (Jean-Philippe Ouellet) Date: Mon, 06 Nov 2017 08:56:31 +0000 Subject: [issue31953] Dedicated place for security announcements? In-Reply-To: <1509935210.34.0.213398074469.issue31953@psf.upfronthosting.co.za> Message-ID: <1509958591.91.0.213398074469.issue31953@psf.upfronthosting.co.za> Jean-Philippe Ouellet added the comment: Ah, I now see there actually *is* a security-announce list [1]! Unless one happens to already know that Python has two concurrent mailman instances hosting different lists [2][3], it's easy to miss. Thanks, and sorry for the noise! [1]: https://mail.python.org/mm3/archives/list/security-announce at python.org/ [2]: https://mail.python.org/mm3/archives/ [3]: https://mail.python.org/mailman/listinfo ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 04:38:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 09:38:01 +0000 Subject: [issue31954] Don't prevent dict optimization by coupling with OrderedDict Message-ID: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently OrderedDict uses a table of nodes that mirrors the dict table. For keeping it in sync it saves the size and address of the dict table. There are two issues with this. First, this prevent some kind of dict optimization. When dict is resized (after exhausting usable entries at the end of table) it should allocate a new table even if it's size isn't changed. Second, this doesn't guarantees that both tables are in sync. If the dict table was reallocated twice before using OrderedDict methods, it can have the same size and address, but totally different layout of elements. Proposed PR adds a new flag to dict object. It is set when OrderedDict creates its table, and is cleared when dict reallocates its table or moves items in the same table. ---------- components: Interpreter Core messages: 305623 nosy: inada.naoki, rhettinger, serhiy.storchaka, tim.peters priority: normal severity: normal status: open title: Don't prevent dict optimization by coupling with OrderedDict type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 04:40:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 09:40:47 +0000 Subject: [issue31954] Don't prevent dict optimization by coupling with OrderedDict In-Reply-To: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za> Message-ID: <1509961247.62.0.213398074469.issue31954@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4254 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 04:57:49 2017 From: report at bugs.python.org (Nir Soffer) Date: Mon, 06 Nov 2017 09:57:49 +0000 Subject: [issue31945] Configurable blocksize in HTTP(S)Connection In-Reply-To: <1509834750.61.0.213398074469.issue31945@psf.upfronthosting.co.za> Message-ID: <1509962269.15.0.213398074469.issue31945@psf.upfronthosting.co.za> Nir Soffer added the comment: When using highlevel request() api, users can control the block size by wrapping the file object with an iterator: class FileIter: def __init__(self, file, blocksize): self.file = file self.blocksize = blocksize def __iter__(self): while True: datablock = self.file.read(self.blocksize) if not datablock: break yield datablock Adding configurable block size will avoid this workaround. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 05:11:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 10:11:21 +0000 Subject: [issue29659] Expose the `length` arg from shutil.copyfileobj for public use In-Reply-To: <1488157044.73.0.933925559387.issue29659@psf.upfronthosting.co.za> Message-ID: <1509963081.51.0.213398074469.issue29659@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could you please provide any benchmarks Tyler? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 05:24:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 10:24:11 +0000 Subject: [issue31954] Don't prevent dict optimization by coupling with OrderedDict In-Reply-To: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za> Message-ID: <1509963851.27.0.213398074469.issue31954@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Later I'm going to add a flag that will allow regular dicts reuse holes when delete items, while keep OrderedDict and dicts used as class namespace ordered. I'm not sure there will be a benefit, but at least this will open an option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 05:34:35 2017 From: report at bugs.python.org (Dee Mee) Date: Mon, 06 Nov 2017 10:34:35 +0000 Subject: [issue31955] set_executables() incorrectly parse values with spaces Message-ID: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> New submission from Dee Mee : Function set_executable() in ccompiler.py does the following check: def set_executable(self, key, value): if isinstance(value, str): setattr(self, key, split_quoted(value)) else: setattr(self, key, value) The check "if isinstance(value, str)" is incorrect, because type of value can be unicode, while it should be splitted as well. ---------- components: Distutils messages: 305627 nosy: Dee Mee, dstufft, eric.araujo priority: normal severity: normal status: open title: set_executables() incorrectly parse values with spaces type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 05:37:48 2017 From: report at bugs.python.org (Russell Keith-Magee) Date: Mon, 06 Nov 2017 10:37:48 +0000 Subject: [issue23670] Modifications to support iOS as a cross-compilation target In-Reply-To: <1426400747.11.0.0527548590348.issue23670@psf.upfronthosting.co.za> Message-ID: <1509964668.33.0.213398074469.issue23670@psf.upfronthosting.co.za> Russell Keith-Magee added the comment: For those interested, I've started tracking these patches on Github: https://github.com/freakboy3742/cpython The 3.4, 3.5 and 3.6 branches are tested and compile as of the time of this comment; the master branch has also been updated, in preparation for the release of 3.7. I haven't submitted pull requests because there are still some issues that Ned raised in discussions at PyCon US. ---------- versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:13:47 2017 From: report at bugs.python.org (=?utf-8?b?0J3QuNC60L7Qu9Cw0Lkg0KHQv9Cw0YXQuNC10LI=?=) Date: Mon, 06 Nov 2017 11:13:47 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() Message-ID: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> New submission from ??????? ??????? : Sequence protocol specifies 2 optional argument for index method: seq.index(value, [start, [stop]]) array.index(value) needs start and stop arguments too. ---------- components: Library (Lib) messages: 305629 nosy: ??????? ??????? priority: normal severity: normal status: open title: Add start and stop parameters to the array.index() versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:14:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 11:14:06 +0000 Subject: [issue31851] test_subprocess hangs randomly on Windows with Python 3.x In-Reply-To: <1508781289.15.0.213398074469.issue31851@psf.upfronthosting.co.za> Message-ID: <1509966846.41.0.213398074469.issue31851@psf.upfronthosting.co.za> STINNER Victor added the comment: Sadly, the AMD64 Windows10 3.x buildbot worker is also sick: http://buildbot.python.org/all/#/builders/3/builds/117 1:15:30 [405/407] test_urllibnet passed -- running: test_subprocess (3338 sec) 1:15:52 [406/407] test_bytes passed -- running: test_subprocess (3361 sec) command timed out: 1200 seconds without output running ['Tools\\buildbot\\test.bat', '-x64', '-j2', '--timeout', '900'], attempting to kill program finished with exit code 1 elapsedTime=5757.133000 ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware title: test_subprocess hangs randomly on x86 Windows7 3.x -> test_subprocess hangs randomly on Windows with Python 3.x _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:17:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 11:17:26 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted Message-ID: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/58/builds/110 Build started 11/4/2017 7:30:21 PM. Project "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\pythoncore.vcxproj" on node 1 (KillPython target(s)). D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\python.props(77,31): error MSB4086: A numeric comparison was attempted on "$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 at ProductVersion)" that evaluates to "" instead of a number, in condition "$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 at ProductVersion) >= '10.0.15063'". [D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\pythoncore.vcxproj] Done Building Project "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\pythoncore.vcxproj" (KillPython target(s)) -- FAILED. Build FAILED. It's likely a regression caused by one of these commits: * 0d2a9088d16826343344b04461c8be44b4008710 * aed08562220974b5c67371b908f23caa1be07e38 ---------- components: Build, Windows messages: 305631 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] PCbuild error: A numeric comparison was attempted versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:18:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 11:18:11 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted In-Reply-To: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> Message-ID: <1509967091.27.0.213398074469.issue31957@psf.upfronthosting.co.za> STINNER Victor added the comment: Compilation also failed on AMD64 Windows8 3.x: http://buildbot.python.org/all/#/builders/32/builds/118 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:18:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 11:18:34 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted In-Reply-To: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> Message-ID: <1509967114.12.0.213398074469.issue31957@psf.upfronthosting.co.za> STINNER Victor added the comment: Windows8 error: D:\buildarea\3.x.bolen-windows8\build\PCbuild\python.props(76,31): error MSB4086: A numeric comparison was attempted on "$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0 at ProductVersion)" that evaluates to "" instead of a number, in condition "$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0 at ProductVersion) >= '10.0.15063'". [D:\buildarea\3.x.bolen-windows8\build\PCbuild\pythoncore.vcxproj] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:20:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 11:20:34 +0000 Subject: [issue30406] async and await should be keywords in 3.7 In-Reply-To: <1495229262.01.0.300246152317.issue30406@psf.upfronthosting.co.za> Message-ID: <1509967234.17.0.213398074469.issue30406@psf.upfronthosting.co.za> STINNER Victor added the comment: > (...) don't raise any deprecation warning in 3.6. python3 requires -Wd to display DeprecationWarning: https://mail.python.org/pipermail/python-dev/2017-November/150149.html Yury Selivanov: "We had PendingDeprecationWarning for async/await names in 3.5, and DeprecationWarning in 3.6." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:27:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 11:27:44 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1509967664.14.0.213398074469.issue11063@psf.upfronthosting.co.za> STINNER Victor added the comment: """ Unrelated to the patch (same before and after), this looks odd to me: >>> import uuid >>> uuid._has_uuid_generate_time_safe is None True >>> >>> import _uuid >>> _uuid.has_uuid_generate_time_safe 1 """ None means "not initialized yet". It's initialized on demand, at the first call of uuid1() or get_node(): $ python3 Python 3.7.0a2+ (heads/master:a5293b4ff2, Nov 6 2017, 12:22:04) >>> import uuid >>> uuid._has_uuid_generate_time_safe # == None >>> uuid.uuid1() UUID('3e5a7628-c2e5-11e7-adc1-3ca9f4650c0c') >>> uuid._has_uuid_generate_time_safe 1 > [Also, I thought we weren't supposed to use ctypes in the stdlib.] Antoine's commit a106aec2ed6ba171838ca7e6ba43c4e722bbecd1 avoids ctypes when libuuid is available. For the other systems without libuuid, well, it was probably simpler to use ctypes. ctypes was more popular a few years ago. The code "just works" and I guess that nobody wants to touch it :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:31:27 2017 From: report at bugs.python.org (David MacIver) Date: Mon, 06 Nov 2017 11:31:27 +0000 Subject: [issue31958] UUID Message-ID: <1509967887.83.0.213398074469.issue31958@psf.upfronthosting.co.za> New submission from David MacIver : The documentation for the UUID module says the UUID.version field is "The UUID version number (1 through 5, meaningful only when the variant is RFC_4122)". However, the UUID constructor doesn't actually validate that the version lies in that range if you don't pass a version to the constructor and, as a result, this isn't actually true - the version number can be anything between 0 and 15. For an example consider the following: >>> from uuid import UUID >>> u = UUID(int=1133377179260751706062848) >>> u.variant 'specified in RFC 4122' >>> u.version 15 I have only actually run this example on Python 3.6, but inspection of the code suggests that it's been like this since its introduction. ---------- components: Library (Lib) messages: 305636 nosy: David MacIver priority: normal severity: normal status: open title: UUID versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:32:04 2017 From: report at bugs.python.org (David MacIver) Date: Mon, 06 Nov 2017 11:32:04 +0000 Subject: [issue31958] UUID versions are not validated to lie in the documented range In-Reply-To: <1509967887.83.0.213398074469.issue31958@psf.upfronthosting.co.za> Message-ID: <1509967924.07.0.213398074469.issue31958@psf.upfronthosting.co.za> Change by David MacIver : ---------- title: UUID -> UUID versions are not validated to lie in the documented range _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 07:05:51 2017 From: report at bugs.python.org (Adam Dangoor) Date: Mon, 06 Nov 2017 12:05:51 +0000 Subject: [issue31959] Directory at `TemporaryDirectory().name` does not exist Message-ID: <1509969951.64.0.213398074469.issue31959@psf.upfronthosting.co.za> New submission from Adam Dangoor : Sample code: ``` import os from tempfile import TemporaryDirectory name = TemporaryDirectory().name print(os.path.exists(name)) # prints False td = TemporaryDirectory() name_2 = td.name print(os.path.exists(name_2)) # prints True ``` Expected behavior: `True` is printed for both print statements. I have run this example on: * CPython 3.6.3 * CPython 3.5.3 * pypy 3.5.3 The unexpected behavior occurs on CPython 3.5.3 and CPython 3.6.X but not on pypy. (bug found with Tim Weidner https://github.com/timaa2k). ---------- components: Library (Lib) messages: 305637 nosy: Adam Dangoor priority: normal severity: normal status: open title: Directory at `TemporaryDirectory().name` does not exist type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 07:15:26 2017 From: report at bugs.python.org (Adam Dangoor) Date: Mon, 06 Nov 2017 12:15:26 +0000 Subject: [issue31959] Directory at `TemporaryDirectory().name` does not exist In-Reply-To: <1509969951.64.0.213398074469.issue31959@psf.upfronthosting.co.za> Message-ID: <1509970526.0.0.213398074469.issue31959@psf.upfronthosting.co.za> Adam Dangoor added the comment: > The unexpected behavior occurs on CPython 3.5.3 and CPython 3.6.X but not on pypy. This suggests that it is something to do with garbage collection. Upon further thought, maybe this is by design, but I still was surprised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 07:38:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 12:38:04 +0000 Subject: [issue31959] Directory at `TemporaryDirectory().name` does not exist In-Reply-To: <1509969951.64.0.213398074469.issue31959@psf.upfronthosting.co.za> Message-ID: <1509971884.5.0.213398074469.issue31959@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is by design. The first TemporaryDirectory object is destroyed before the first print statement. For not be surprised use TemporaryDirectory with the "with" statement. with TemporaryDirectory() as td: name = td.name print(os.path.exists(name)) # prints True print(os.path.exists(name)) # prints False ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 07:43:25 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 06 Nov 2017 12:43:25 +0000 Subject: [issue31959] Directory at `TemporaryDirectory().name` does not exist In-Reply-To: <1509969951.64.0.213398074469.issue31959@psf.upfronthosting.co.za> Message-ID: <1509972205.18.0.213398074469.issue31959@psf.upfronthosting.co.za> Martin Panter added the comment: The documentation says ?On . . . destruction of the temporary directory object the newly created temporary directory and all its contents are removed?. If you had enabled warnings, you may have seen a hint: $ python -Wdefault -c 'import tempfile; print(tempfile.TemporaryDirectory().name)' /usr/lib/python3.5/tempfile.py:788: ResourceWarning: Implicitly cleaning up _warnings.warn(warn_message, ResourceWarning) /tmp/tmpj6100h57 This is similar in spirit to earlier bug reports where workarounds were added, but to avoid this instance of the problem the string object returned by the ?name? attribute would have to hold a reference back to the directory object. * Issue 23700: iter(NamedTemporaryFile()) * Issue 18879: NamedTemporaryFile().write(...) ---------- nosy: +martin.panter -serhiy.storchaka resolution: not a bug -> wont fix stage: resolved -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 07:44:57 2017 From: report at bugs.python.org (Martin Panter) Date: Mon, 06 Nov 2017 12:44:57 +0000 Subject: [issue31959] Directory at `TemporaryDirectory().name` does not exist In-Reply-To: <1509969951.64.0.213398074469.issue31959@psf.upfronthosting.co.za> Message-ID: <1509972297.2.0.213398074469.issue31959@psf.upfronthosting.co.za> Change by Martin Panter : ---------- nosy: +serhiy.storchaka resolution: wont fix -> not a bug stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 08:06:34 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 06 Nov 2017 13:06:34 +0000 Subject: [issue13777] socket: communicating with Mac OS X KEXT controls In-Reply-To: <1326392192.39.0.824287439397.issue13777@psf.upfronthosting.co.za> Message-ID: <1509973594.29.0.213398074469.issue13777@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 08:10:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 13:10:16 +0000 Subject: [issue25942] Add a new optional cleanup_timeout parameter to subprocess.call() In-Reply-To: <1451006108.23.0.113868196098.issue25942@psf.upfronthosting.co.za> Message-ID: <1509973816.41.0.213398074469.issue25942@psf.upfronthosting.co.za> STINNER Victor added the comment: I changed the issue title to "Add a new optional cleanup_timeout parameter to subprocess.call()" to make it more positive and update it to the currently proposed change ;-) ---------- title: subprocess.call SIGKILLs too liberally -> Add a new optional cleanup_timeout parameter to subprocess.call() type: behavior -> enhancement versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 08:17:22 2017 From: report at bugs.python.org (Dee Mee) Date: Mon, 06 Nov 2017 13:17:22 +0000 Subject: [issue31955] set_executables() incorrectly parse values with spaces In-Reply-To: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> Message-ID: <1509974242.81.0.213398074469.issue31955@psf.upfronthosting.co.za> Change by Dee Mee : ---------- keywords: +patch pull_requests: +4256 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 08:29:46 2017 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 06 Nov 2017 13:29:46 +0000 Subject: [issue29710] Incorrect representation caveat on bitwise operation docs In-Reply-To: <1488551919.31.0.20533072889.issue29710@psf.upfronthosting.co.za> Message-ID: <1509974986.43.0.213398074469.issue29710@psf.upfronthosting.co.za> Mark Dickinson added the comment: > ?Bitwise operations have the same result as calculations using two?s complement with a bit-width large enough to avoid overflows.? That sounds fine to me, but then, the original wording sounds fine to me now that I know how to read it. :-) The main issue here is making it clear that in "avoid overflow", we're talking about overflow incurred in representing a value in two's complement in the first place, as opposed to overflow of the operation itself. I'd go with something like the following (which evolved by successive refinement from Martin's suggestion): "Each bitwise operation has the same result as though carried out in two's complement using a bit-width that's large enough to represent the inputs." > I presume this is what your ?2-adic representation? is. Yes, exactly. Without invoking 2-adic numbers, which is a bit of overkill, there's a natural one-to-one correspondence between (a) integers, and (b) (singly) infinite bit strings, extending infinitely to the left, in which either all but finitely many bits are zero, or all but finitely many bits are one. In the domain (b), the bitwise operations have their obvious bitwise meanings; translating via the correspondence gives us the corresponding definitions of the bitwise operations on (a). For the correspondence: going from (a) to (b): take an integer n, then for each k >= 0 reduce n modulo 2^k to get a length-k bit string. Now it's easy to see that the length-k bit strings are all compatible with one another, in the sense that they all agree with each other when right-aligned, so you naturally get an infinite-length bit string that's eventually either all 1s (for negative n) or all zeros (for nonnegative n). Going back from (b) to (a): it's not hard to convince yourself that the map above is one-to-one and onto, but then you miss out on a beautiful description of the inverse map: given an infinite bit-string indexed as below, with b_0 the least significant bit: ... b_{k+1} b_k b_{k-1} ... b_2 b_1 b_0 we simply map that bit string to the integer n = sum_{i>=0} b_i * 2**i Of course the RHS of the above is an infinite sum, so a priori doesn't make sense. If almost all the bits are zeros, it becomes a finite sum and everything's okay. If almost all the bits are ones, you can either (i) introduce the 2-adic topology on the integers and point out that it still converges in that topology, so that everything has a sound mathematical footing, or (ii) just use the "trick" that 1 + 2 + 4 + 8 + 16 + ... = -1, which more-or-less amounts to the same thing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 08:47:34 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 06 Nov 2017 13:47:34 +0000 Subject: [issue30699] Misleading class names in datetime.tzinfo usage examples In-Reply-To: <1497824156.09.0.152108719585.issue30699@psf.upfronthosting.co.za> Message-ID: <1509976054.64.0.213398074469.issue30699@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +belopolsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 09:41:02 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 06 Nov 2017 14:41:02 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1509979262.28.0.213398074469.issue21862@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 10:12:03 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 06 Nov 2017 15:12:03 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1509981123.78.0.213398074469.issue31956@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 10:36:01 2017 From: report at bugs.python.org (Adam Dangoor) Date: Mon, 06 Nov 2017 15:36:01 +0000 Subject: [issue31959] Directory at `TemporaryDirectory().name` does not exist In-Reply-To: <1509969951.64.0.213398074469.issue31959@psf.upfronthosting.co.za> Message-ID: <1509982561.79.0.213398074469.issue31959@psf.upfronthosting.co.za> Adam Dangoor added the comment: Thank you for clearing this up for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 10:38:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 15:38:36 +0000 Subject: [issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces In-Reply-To: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> Message-ID: <1509982716.1.0.213398074469.issue31955@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: set_executables() incorrectly parse values with spaces -> distutils C compiler: set_executables() incorrectly parse values with spaces _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 10:43:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 15:43:31 +0000 Subject: [issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces In-Reply-To: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> Message-ID: <1509983011.44.0.213398074469.issue31955@psf.upfronthosting.co.za> STINNER Victor added the comment: > The check "if isinstance(value, str)" is incorrect, because type of value can be unicode, while it should be splitted as well. Your pull request is for Python 3, but the type of paths is expected to be str on Python 3, no? For Python 2, you can use isinstance(value, basestring). ---------- nosy: +haypo versions: +Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 10:45:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 15:45:00 +0000 Subject: [issue31958] UUID versions are not validated to lie in the documented range In-Reply-To: <1509967887.83.0.213398074469.issue31958@psf.upfronthosting.co.za> Message-ID: <1509983100.34.0.213398074469.issue31958@psf.upfronthosting.co.za> STINNER Victor added the comment: What do you propose? Raise an exception in the constructor if the version is not in the range 1..5? Or just modify the variant value? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 10:45:59 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 15:45:59 +0000 Subject: [issue31951] import curses is broken on windows In-Reply-To: <1509922553.69.0.213398074469.issue31951@psf.upfronthosting.co.za> Message-ID: <1509983159.87.0.213398074469.issue31951@psf.upfronthosting.co.za> STINNER Victor added the comment: The curses module is not supported on Windows. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:00:05 2017 From: report at bugs.python.org (Paul Moore) Date: Mon, 06 Nov 2017 16:00:05 +0000 Subject: [issue31951] import curses is broken on windows In-Reply-To: <1509922553.69.0.213398074469.issue31951@psf.upfronthosting.co.za> Message-ID: <1509984005.95.0.213398074469.issue31951@psf.upfronthosting.co.za> Paul Moore added the comment: The docs for the curses module say "While curses is most widely used in the Unix environment, versions are available for Windows, DOS, and possibly other systems as well." This is the only mention of platform support I can see. It might be worth making the platform support explicit in the docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:12:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:12:43 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509984763.45.0.213398074469.issue31939@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm sorry, I'm confused between docstrings and annotations. My first goal is to not loose the return type from the docstring when the select module is converted to Argument Clinic, at least for the simplest return types. Complex return types can be documented manually in the body of a docstring. Return *annotation* would be nice to have, but it seems to be opposed to the current policy. I started a discussion on python-dev to ask if we should modify this policy :-) "[Python-Dev] Allow annotations using basic types in the stdlib?" https://mail.python.org/pipermail/python-dev/2017-November/150233.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:22:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:22:06 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1509985326.17.0.213398074469.issue31956@psf.upfronthosting.co.za> STINNER Victor added the comment: ??????? ???????: Are you only asking for the feature, or are you interested to work on a concrete patch? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:24:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:24:33 +0000 Subject: [issue28140] Attempt to give better errors for pip commands typed into the REPL In-Reply-To: <1473828003.51.0.301742763108.issue28140@psf.upfronthosting.co.za> Message-ID: <1509985473.7.0.213398074469.issue28140@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:30:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:30:38 +0000 Subject: [issue31948] [EASY] Broken MSDN links in msilib docs In-Reply-To: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> Message-ID: <1509985838.98.0.213398074469.issue31948@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Broken MSDN links in msilib docs -> [EASY] Broken MSDN links in msilib docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:33:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:33:04 +0000 Subject: [issue31942] Document that support of start and stop parameters in the Sequence's index() is optional In-Reply-To: <1509786601.53.0.213398074469.issue31942@psf.upfronthosting.co.za> Message-ID: <1509985984.79.0.213398074469.issue31942@psf.upfronthosting.co.za> STINNER Victor added the comment: See also bpo-31956: "Add start and stop parameters to the array.index()". ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:36:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 16:36:43 +0000 Subject: [issue31949] Bugs in PyTraceBack_Print() In-Reply-To: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> Message-ID: <1509986203.01.0.213398074469.issue31949@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4257 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:37:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:37:21 +0000 Subject: [issue28340] [py2] TextIOWrapper.tell extremely slow In-Reply-To: <1475423487.6.0.338998508065.issue28340@psf.upfronthosting.co.za> Message-ID: <1509986241.09.0.213398074469.issue28340@psf.upfronthosting.co.za> STINNER Victor added the comment: Berker Peksag, Antoine Pitrou (who implemented the discussed change) and me are opposed to backporting this optimization, so I close the issue as WONTFIX. The only known workaround is to upgrade to Python 3, sorry! Benjamin: Please speakup if you want this optimization in the next Python 2.7 release ;-) > The original patch is quite delicate and I'm not comfortable backporting to 2.7. Oh, the "byte/character ratio" "hack"... I'm not confortable with this one neither, even if it seems like it works on Python 3 (I didn't recall any bug report related to this). ---------- nosy: +haypo resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:38:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:38:23 +0000 Subject: [issue17852] Built-in module _io can lose data from buffered files at exit In-Reply-To: <1367048010.96.0.3580561262.issue17852@psf.upfronthosting.co.za> Message-ID: <1509986303.96.0.213398074469.issue17852@psf.upfronthosting.co.za> STINNER Victor added the comment: Neil pushed the commit 0a1ff24acfc15d8c7f2dc41000a6f3d9a31e7480. What is the status of this issue? Can we now close it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:42:15 2017 From: report at bugs.python.org (Zachary Ware) Date: Mon, 06 Nov 2017 16:42:15 +0000 Subject: [issue31951] import curses is broken on windows In-Reply-To: <1509922553.69.0.213398074469.issue31951@psf.upfronthosting.co.za> Message-ID: <1509986535.35.0.213398074469.issue31951@psf.upfronthosting.co.za> Zachary Ware added the comment: Curses is available for Windows from Christopher Gohlke's site: https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses We should clean up this situation, though, either by making the state of Windows curses support explicit in the docs or by actually adding support for it in the default distribution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:51:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:51:22 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1509987082.0.0.213398074469.issue31934@psf.upfronthosting.co.za> STINNER Victor added the comment: Note for myself: Xavier proposed PR 4255 fix :-) ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:52:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:52:32 +0000 Subject: [issue31935] subprocess.run() timeout not working with grandchildren and stdout=PIPE In-Reply-To: <1509721292.04.0.213398074469.issue31935@psf.upfronthosting.co.za> Message-ID: <1509987152.14.0.213398074469.issue31935@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:52:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 16:52:39 +0000 Subject: [issue31951] import curses is broken on windows In-Reply-To: <1509922553.69.0.213398074469.issue31951@psf.upfronthosting.co.za> Message-ID: <1509987159.71.0.213398074469.issue31951@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There are two open issues for adding support of the curses module on Windows: issue1005895 and issue2889. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:55:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 16:55:23 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1509987323.64.0.213398074469.issue31904@psf.upfronthosting.co.za> STINNER Victor added the comment: To support a new platform, you need a developer who can support this platform next years, a working buildbot, etc. You can start a discussion on python-dev to get a first feedback. Without a strong support, this issue should be fixed a REJECTED and a patch should be maintainted out of the tree. Since the PR seems small, it should be "easy" to keep a fork of CPython up to date. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:59:14 2017 From: report at bugs.python.org (Tal Einat) Date: Mon, 06 Nov 2017 16:59:14 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509987554.25.0.213398074469.issue31939@psf.upfronthosting.co.za> Tal Einat added the comment: My apologies, I seem to have been the source of the confusion. I misunderstood your original meaning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 11:59:38 2017 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 06 Nov 2017 16:59:38 +0000 Subject: [issue31939] Support return annotation in signature for Argument Clinic In-Reply-To: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> Message-ID: <1509987578.39.0.213398074469.issue31939@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- nosy: -yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:00:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 17:00:45 +0000 Subject: [issue31925] [NetBSD] test_socket creates too many locks In-Reply-To: <1509632190.98.0.213398074469.issue31925@psf.upfronthosting.co.za> Message-ID: <1509987645.77.0.213398074469.issue31925@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: test_socket creates too many locks -> [NetBSD] test_socket creates too many locks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:01:12 2017 From: report at bugs.python.org (Marat Sharafutdinov) Date: Mon, 06 Nov 2017 17:01:12 +0000 Subject: [issue31943] Add asyncio.Handle.cancelled() method In-Reply-To: <1509812825.97.0.213398074469.issue31943@psf.upfronthosting.co.za> Message-ID: <1509987672.19.0.213398074469.issue31943@psf.upfronthosting.co.za> Change by Marat Sharafutdinov : ---------- title: Add asyncio.Handle.cancelled() and asyncio.TimerHandle.when -> Add asyncio.Handle.cancelled() method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:05:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 17:05:57 +0000 Subject: [issue31925] [NetBSD] test_socket creates too many locks In-Reply-To: <1509632190.98.0.213398074469.issue31925@psf.upfronthosting.co.za> Message-ID: <1509987957.18.0.213398074469.issue31925@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: test_socket creates many locks on all platforms. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:09:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 17:09:05 +0000 Subject: [issue30952] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1509988145.01.0.213398074469.issue30952@psf.upfronthosting.co.za> STINNER Victor added the comment: > I would be interested in having SQLite shipped with the math extension Python uses the SQLite library installed on the system, at least on Linux. To load an extension, I found: https://sqlite.org/loadext.html https://sqlite.org/c3ref/load_extension.html How am I supposed the math extension? The CLI ".load" command requires the name or even the full path to a shared library (".so" file on Linux). I see that the issue was tagged as Windows. Are you talking about the SQLite bundled with Python installer on Windows? ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:20:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 17:20:06 +0000 Subject: [issue28643] Broken makefile depends for profile-opt target In-Reply-To: <1478634995.26.0.389156722395.issue28643@psf.upfronthosting.co.za> Message-ID: <1509988806.22.0.213398074469.issue28643@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, I had this bug and I'm quite sure that I reported it, but I cannot find it anymore :-) ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:24:09 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 06 Nov 2017 17:24:09 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await Message-ID: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> New submission from Antoine Pitrou : If you await a Future with another loop than a loop at instance creation (this is trivial to do accidentally when using threads), asyncio raises a RuntimeError. But if you use another part of the Future API, such as add_done_callback(), the situation isn't detected. For example, this snippet will run indefinitely: import asyncio import threading fut = asyncio.Future() async def coro(loop): fut.add_done_callback(lambda _: loop.stop()) loop.call_later(1, fut.set_result, None) while True: await asyncio.sleep(100000) def run(): loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) loop.run_until_complete(coro(loop)) loop.close() t = threading.Thread(target=run) t.start() t.join() ---------- components: asyncio messages: 305662 nosy: giampaolo.rodola, haypo, pitrou, yselivanov priority: normal severity: normal status: open title: Protection against using a Future with another loop only works with await type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:27:25 2017 From: report at bugs.python.org (Roy Williams) Date: Mon, 06 Nov 2017 17:27:25 +0000 Subject: [issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args Message-ID: <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> New submission from Roy Williams : Repro: ```python from pathlib import Path import subprocess subprocess.run([Path('/bin/ls')]) # Works Fine subprocess.run(Path('/bin/ls')) # Fails ``` The problem seems to originate from here: https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1237-L1240 This file auspiciously avoids importing pathlib, which I'm guessing is somewhat intentional? Would the correct fix be to check for the existence of a `__fspath__` attribute as per https://www.python.org/dev/peps/pep-0519/ ? ---------- components: Library (Lib) messages: 305663 nosy: Roy Williams priority: normal severity: normal status: open title: subprocess._execute_child doesn't accept a single PathLike argument for args versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:38:43 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 17:38:43 +0000 Subject: [issue28643] Broken makefile depends for profile-opt target In-Reply-To: <1478634995.26.0.389156722395.issue28643@psf.upfronthosting.co.za> Message-ID: <1509989923.19.0.213398074469.issue28643@psf.upfronthosting.co.za> Neil Schemenauer added the comment: The previous behavior nearly drove me to drink. At least on my machine (and I have a relatively fast one), the profile-opt build takes a long time. After running "make" and checking things over, running "make install" will cause the whole process (make clean, make with -fprofile-generate, run unit tests, make clean, make with -fprofile-use) to happen again. The profile-opt build is significantly faster so I like to use it. Maybe I'm an odd duck in that I usually compile Python myself rather than using distro packaged versions. Current behavior is much better I think. You have to know to manually remove "profile-run-stamp" if you want the -fprofile-generate + unittest to run again. "make clean" does not remove it. I don't know if that should be documented somewhere besides in the Makefile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:41:04 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 17:41:04 +0000 Subject: [issue17852] Built-in module _io can lose data from buffered files at exit In-Reply-To: <1367048010.96.0.3580561262.issue17852@psf.upfronthosting.co.za> Message-ID: <1509990064.1.0.213398074469.issue17852@psf.upfronthosting.co.za> Neil Schemenauer added the comment: Yes, my bad. I thought that accepting the pull would close the bug. ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 13:13:47 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Mon, 06 Nov 2017 18:13:47 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1509992027.8.0.213398074469.issue21862@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Hey, seems like this bug is not updated for a while. Can I work on this? ---------- nosy: +CuriousLearner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 13:17:19 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 06 Nov 2017 18:17:19 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1509992239.16.0.213398074469.issue21862@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Sanyam, you definitely can. Step #1 would probably be to port the patch to git master and turn it into a GitHub PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 13:22:10 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Mon, 06 Nov 2017 18:22:10 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1509992530.48.0.213398074469.issue21862@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Thanks for the heads up! I'll do that ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 13:31:29 2017 From: report at bugs.python.org (Roy Williams) Date: Mon, 06 Nov 2017 18:31:29 +0000 Subject: [issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args In-Reply-To: <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> Message-ID: <1509993089.5.0.213398074469.issue31961@psf.upfronthosting.co.za> Roy Williams added the comment: Ignore my comment re: pathlib, it looks like PathLike is defined in `os` and not `pathlib`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 13:44:09 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 06 Nov 2017 18:44:09 +0000 Subject: [issue31681] pkgutil.get_data() leaks open files in Python 2.7 In-Reply-To: <1507059584.22.0.213398074469.issue31681@psf.upfronthosting.co.za> Message-ID: <1509993849.2.0.213398074469.issue31681@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: -4016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:30:12 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 19:30:12 +0000 Subject: [issue31028] test_pydoc fails when run directly In-Reply-To: <1500985258.67.0.797354625815.issue31028@psf.upfronthosting.co.za> Message-ID: <1509996612.34.0.213398074469.issue31028@psf.upfronthosting.co.za> Change by Neil Schemenauer : ---------- pull_requests: +4258 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:31:42 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 19:31:42 +0000 Subject: [issue28907] test_pydoc fails if build is in sub-directory In-Reply-To: <1481224218.05.0.36648491601.issue28907@psf.upfronthosting.co.za> Message-ID: <1509996702.08.0.213398074469.issue28907@psf.upfronthosting.co.za> Neil Schemenauer added the comment: Pretty sure the fix for bug 31028 also fixed this. Closing. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> test_pydoc fails when run directly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:39:22 2017 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Nov 2017 19:39:22 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted In-Reply-To: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> Message-ID: <1509997162.25.0.213398074469.issue31957@psf.upfronthosting.co.za> Change by Steve Dower : ---------- assignee: -> steve.dower stage: -> needs patch type: -> compile error versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:42:34 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Mon, 06 Nov 2017 19:42:34 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1509997354.32.0.213398074469.issue21862@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- pull_requests: +4259 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:45:00 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Mon, 06 Nov 2017 19:45:00 +0000 Subject: [issue19982] Add a "target" parameter to runpy.run_path and runpy.run_module In-Reply-To: <1387027323.14.0.795736210788.issue19982@psf.upfronthosting.co.za> Message-ID: <1509997500.9.0.213398074469.issue19982@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Hey ncoghlan, Does this issue makes sense to be worked on for Python 3.7? ---------- nosy: +CuriousLearner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:48:06 2017 From: report at bugs.python.org (desbma) Date: Mon, 06 Nov 2017 19:48:06 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1509997686.67.0.213398074469.issue28708@psf.upfronthosting.co.za> desbma added the comment: I just want to say that I strongly support either bumping the value of FD_SETSIZE to something a lot higher than 512, or making it configurable from Python code. I am the author of a program that makes heavy use of asyncio. Some Windows users have reported errors when using big directory trees, that I could not reproduce on Linux. Then I found the note about the SelectorEventLoop limitation in the doc https://docs.python.org/3/library/asyncio-eventloops.html#windows I can't use ProactorEventLoop because I support Python 3.4 which does not have it. I had to work around this limitation by calling run_until_complete periodically to limit the number of pending tasks. I sincerely think this the kind of thing that can hurt the global usage of asyncio. Hell I can do 600 IO tasks in parallel if I want to with concurrent.futures.ThreadPoolExecutor, why can't I do the same with asyncio? ---------- nosy: +desbma _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:50:59 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 19:50:59 +0000 Subject: [issue27169] __debug__ is not optimized out at compile time for anything but `if:` and `while:` blocks In-Reply-To: <1464720658.3.0.0366082537286.issue27169@psf.upfronthosting.co.za> Message-ID: <1509997859.45.0.213398074469.issue27169@psf.upfronthosting.co.za> Change by Neil Schemenauer : ---------- nosy: +nascheme _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:51:18 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 19:51:18 +0000 Subject: [issue24340] co_stacksize estimate can be highly off In-Reply-To: <1433096994.94.0.20833461119.issue24340@psf.upfronthosting.co.za> Message-ID: <1509997878.14.0.213398074469.issue24340@psf.upfronthosting.co.za> Change by Neil Schemenauer : ---------- nosy: +nascheme _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:51:38 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 19:51:38 +0000 Subject: [issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler. In-Reply-To: <1364833880.2.0.617388686213.issue17611@psf.upfronthosting.co.za> Message-ID: <1509997898.19.0.213398074469.issue17611@psf.upfronthosting.co.za> Change by Neil Schemenauer : _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:54:48 2017 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Nov 2017 19:54:48 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted In-Reply-To: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> Message-ID: <1509998088.59.0.213398074469.issue31957@psf.upfronthosting.co.za> Change by Steve Dower : ---------- keywords: +patch pull_requests: +4260 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 14:56:22 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 06 Nov 2017 19:56:22 +0000 Subject: [issue31843] sqlite3.connect() should accept PathLike objects In-Reply-To: <1508717625.1.0.213398074469.issue31843@psf.upfronthosting.co.za> Message-ID: <1509998182.82.0.213398074469.issue31843@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4261 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 15:02:11 2017 From: report at bugs.python.org (Anders Lorentsen) Date: Mon, 06 Nov 2017 20:02:11 +0000 Subject: [issue31843] sqlite3.connect() should accept PathLike objects In-Reply-To: <1508717625.1.0.213398074469.issue31843@psf.upfronthosting.co.za> Message-ID: <1509998531.5.0.213398074469.issue31843@psf.upfronthosting.co.za> Anders Lorentsen added the comment: Had my first go at a python patch. Added a test case for it, and all tests passing when I test with `./python -bb -E -Wd -m test -v test.test_sqlite -r -w -uall -R 3:2` ---------- nosy: +Phaqui _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 15:52:11 2017 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Nov 2017 20:52:11 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted In-Reply-To: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> Message-ID: <1510001531.91.0.213398074469.issue31957@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset 30f4fa456ef626ad7a92759f492ec7a268f7af4e by Steve Dower in branch 'master': bpo-31957: Fixes version detection. (#4298) https://github.com/python/cpython/commit/30f4fa456ef626ad7a92759f492ec7a268f7af4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 15:52:23 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 06 Nov 2017 20:52:23 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted In-Reply-To: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> Message-ID: <1510001543.47.0.213398074469.issue31957@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4263 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 15:56:32 2017 From: report at bugs.python.org (Thomas Knox) Date: Mon, 06 Nov 2017 20:56:32 +0000 Subject: [issue31962] test_importlib double free or corruption Message-ID: <1510001792.72.0.213398074469.issue31962@psf.upfronthosting.co.za> New submission from Thomas Knox : On a Raspberry Pi 3 running Linux pi3 4.9.58-v7+ #1046 SMP Tue Oct 24 17:07:15 BST 2017 armv7l GNU/Linux C(PP)FLAGS="-O6 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -ftree-vectorize" Built with ./configure --enable-loadable-sqlite-extensions --enable-optimizations --disable-shared --with-lto --enable-ipv6 --with-threads When the build phase is ... Running code to generate profile data (this can take a while): make run_profile_task make[1]: Entering directory '/home/pi/Downloads/Python-3.6.3' : # FIXME: can't run for a cross build ./python -m test.regrtest --pgo || true Run tests sequentially ... It errors and dies with 0:23:56 load avg: 0.87 [176/405] test_importlib *** Error in `./python': double free or corruption (!prev): 0x014166e0 *** Fatal Python error: Aborted Thread 0x685ff460 (most recent call first): File "", line 98 in acquire File "/home/pi/Downloads/Python-3.6.3/Lib/test/test_importlib/test_locks.py", line 83 in _acquire File "/home/pi/Downloads/Python-3.6.3/Lib/test/test_importlib/test_locks.py", line 93 in f File "/home/pi/Downloads/Python-3.6.3/Lib/test/lock_tests.py", line 38 in task Thread 0x76f04000 (most recent call first): File "/home/pi/Downloads/Python-3.6.3/Lib/test/lock_tests.py", line 17 in _wait File "/home/pi/Downloads/Python-3.6.3/Lib/test/lock_tests.py", line 56 in wait_for_finished File "/home/pi/Downloads/Python-3.6.3/Lib/test/test_importlib/test_locks.py", line 99 in run_deadlock_avoidance_test File "/home/pi/Downloads/Python-3.6.3/Lib/test/test_importlib/test_locks.py", line 113 in test_no_deadlock File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/case.py", line 605 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/case.py", line 653 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/test/support/__init__.py", line 1765 in run File "/home/pi/Downloads/Python-3.6.3/Lib/test/support/__init__.py", line 1889 in _run_suite File "/home/pi/Downloads/Python-3.6.3/Lib/test/support/__init__.py", line 1933 in run_unittest File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/runtest.py", line 172 in test_runner File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/runtest.py", line 173 in runtest_inner File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/runtest.py", line 137 in runtest File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 378 in run_tests_sequential File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 457 in run_tests File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 535 in _main File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 509 in main File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 584 in main File "/home/pi/Downloads/Python-3.6.3/Lib/test/regrtest.py", line 46 in _main File "/home/pi/Downloads/Python-3.6.3/Lib/test/regrtest.py", line 50 in File "/home/pi/Downloads/Python-3.6.3/Lib/runpy.py", line 85 in _run_code File "/home/pi/Downloads/Python-3.6.3/Lib/runpy.py", line 193 in _run_module_as_main Aborted Every time. These exact same parameters and flags worked with 3.6.2 with no issue, but they die on 3.6.3 ---------- components: Build messages: 305676 nosy: DNSGeek priority: normal severity: normal status: open title: test_importlib double free or corruption type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 15:58:04 2017 From: report at bugs.python.org (Thomas Knox) Date: Mon, 06 Nov 2017 20:58:04 +0000 Subject: [issue31962] test_importlib double free or corruption In-Reply-To: <1510001792.72.0.213398074469.issue31962@psf.upfronthosting.co.za> Message-ID: <1510001884.88.0.213398074469.issue31962@psf.upfronthosting.co.za> Change by Thomas Knox : ---------- components: +Tests _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 16:03:15 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 21:03:15 +0000 Subject: [issue24340] co_stacksize estimate can be highly off In-Reply-To: <1433096994.94.0.20833461119.issue24340@psf.upfronthosting.co.za> Message-ID: <1510002195.15.0.213398074469.issue24340@psf.upfronthosting.co.za> Neil Schemenauer added the comment: The WIP pull request PR# 2827 seems to help. The following code prints 86 on python3.6 and 25 with PR 2827 applied. def g(): try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: pass try: pass except ImportError as e: pass print(g.__code__.co_stacksize) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 16:15:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 21:15:53 +0000 Subject: [issue31945] Configurable blocksize in HTTP(S)Connection In-Reply-To: <1509834750.61.0.213398074469.issue31945@psf.upfronthosting.co.za> Message-ID: <1510002953.27.0.213398074469.issue31945@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- type: -> enhancement versions: -Python 2.7, Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 16:16:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 21:16:39 +0000 Subject: [issue31945] Configurable blocksize in HTTP(S)Connection In-Reply-To: <1509834750.61.0.213398074469.issue31945@psf.upfronthosting.co.za> Message-ID: <1510002999.66.0.213398074469.issue31945@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ad455cd9243319b896c86074ffeb3bf78a82f4ec by Victor Stinner (Nir Soffer) in branch 'master': bpo-31945: Configurable blocksize in HTTP(S)Connection (#4279) https://github.com/python/cpython/commit/ad455cd9243319b896c86074ffeb3bf78a82f4ec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 16:18:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 21:18:07 +0000 Subject: [issue31945] Configurable blocksize in HTTP(S)Connection In-Reply-To: <1509834750.61.0.213398074469.issue31945@psf.upfronthosting.co.za> Message-ID: <1510003087.27.0.213398074469.issue31945@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you Nir Soffer for this nice enhancement. Sadly, since it's a new feature, it cannot be backport to Python 3.6 nor 2.7, since it's a new feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 16:21:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 21:21:57 +0000 Subject: [issue31945] Configurable blocksize in HTTP(S)Connection In-Reply-To: <1509834750.61.0.213398074469.issue31945@psf.upfronthosting.co.za> Message-ID: <1510003317.95.0.213398074469.issue31945@psf.upfronthosting.co.za> STINNER Victor added the comment: The commit message contains much more information than the NEWS and What's New entries. Maybe the What's New entry can be completed, I don't know. In the meanwhile, I close the issue :-) Nir: Feel free to create a new PR if you want to complete the What's New entry ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 16:29:37 2017 From: report at bugs.python.org (Big Stone) Date: Mon, 06 Nov 2017 21:29:37 +0000 Subject: [issue30952] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1510003777.53.0.213398074469.issue30952@psf.upfronthosting.co.za> Big Stone added the comment: Hi Victor, I would like to use math functions, specifically "exp(sum(log(x)))", on the Sqlite motor shipped embedded with Python on Windows. It's an important corner case of what I miss in Sqlite motor, that forced me to (wait to) rely on SQLServer (or other big iron). In my other hobby of Python-in-Scientific-cursus of France, having not a fully enabled SQLite (in its mathematic abilities) is also a problem. Maybe there are other more important outstanding issues about embedded-SQlite integration with Python, but that one is hard to workaround. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 16:57:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 21:57:41 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge Message-ID: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/47/builds/127 (...) gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Objects/setobject.o Objects/setobject.c Objects/setobject.c: In function ?PySet_Clear?: Objects/setobject.c:2579:1: internal compiler error: in create_edge, at cgraph.c:850 }; ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Makefile:1584: recipe for target 'Objects/setobject.o' failed make[1]: Leaving directory '/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build' make[1]: *** [Objects/setobject.o] Error 1 pythoninfo from the previous build: * GCC 6.3.0 20170516 * os.uname: posix.uname_result(sysname='Linux', nodename='enable-optimizations-bot', release='4.9.0-3-amd64', version='#1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26)', machine='x86_64') * platform.platform: Linux-4.9.0-3-amd64-x86_64-with-debian-9.1 http://buildbot.python.org/all/#/builders/47/builds/126/steps/3/logs/stdio ---------- components: Build messages: 305682 nosy: gregory.p.smith, haypo, nascheme priority: normal severity: normal status: open title: AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 17:03:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 22:03:18 +0000 Subject: [issue30952] [Windows] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1510005798.65.0.213398074469.issue30952@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: include Math extension in SQlite -> [Windows] include Math extension in SQlite _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 17:16:16 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 06 Nov 2017 22:16:16 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510006576.71.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'm not sure what the desired semantics for Futures and multiple loops is. On the one hand, there is little point in having two event loops in the same thread at once (except for testing purposes). On the other hand, the Future implementation is entirely not thread-safe (btw, the constructor optimistically claims the done callbacks are scheduled using call_soon_threadsafe(), but the implementation actually calls call_soon()). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 17:41:04 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 22:41:04 +0000 Subject: [issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler. In-Reply-To: <1364833880.2.0.617388686213.issue17611@psf.upfronthosting.co.za> Message-ID: <1510008064.77.0.213398074469.issue17611@psf.upfronthosting.co.za> Neil Schemenauer added the comment: The attached pyperformance report compares cpython:master to nascheme:unwind_stack. If I've done the tests correctly, the unwind_stack version is slightly faster. ---------- Added file: https://bugs.python.org/file47253/perf_unwind_stack.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 18:05:00 2017 From: report at bugs.python.org (Steve Dower) Date: Mon, 06 Nov 2017 23:05:00 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted In-Reply-To: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> Message-ID: <1510009500.81.0.213398074469.issue31957@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset a6ffec2e88437ed4fecb10cb359cf2fb64781e9a by Steve Dower (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31957: Fixes version detection. (GH-4298) (#4300) https://github.com/python/cpython/commit/a6ffec2e88437ed4fecb10cb359cf2fb64781e9a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 18:07:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 23:07:35 +0000 Subject: [issue28791] update sqlite to latest version before beta 1 In-Reply-To: <1480017928.89.0.263397799958.issue28791@psf.upfronthosting.co.za> Message-ID: <1510009655.91.0.213398074469.issue28791@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh wow, I didn't even know that Python included a copy of SQLite for Windows and macOS installers! I added it to my list of "embedded libraries" :-) http://haypo-notes.readthedocs.io/cpython.html#embedded-libraries ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 18:11:06 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 06 Nov 2017 23:11:06 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge In-Reply-To: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> Message-ID: <20171106231103.refkipssrsss5dsp@python.ca> Neil Schemenauer added the comment: Hi Victor, My first guess is that the build bot is not cleaning the fprofile information after updating the source tree. A few options: - remove the profile-run-stamp file after checking out new code - call "make profile-removal" after checkout of new code - I can try to modify the makefile so that profile-run-stamp depends on the source files (.h, .c, etc). I think that would make it re-generate automatically if the sources change. On 2017-11-06, STINNER Victor wrote: > > New submission from STINNER Victor : > > http://buildbot.python.org/all/#/builders/47/builds/127 > > (...) > gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Objects/setobject.o Objects/setobject.c > Objects/setobject.c: In function ?PySet_Clear?: > Objects/setobject.c:2579:1: internal compiler error: in create_edge, at cgraph.c:850 > }; > ^ > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. > Makefile:1584: recipe for target 'Objects/setobject.o' failed > make[1]: Leaving directory '/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build' > make[1]: *** [Objects/setobject.o] Error 1 > > > pythoninfo from the previous build: > > * GCC 6.3.0 20170516 > * os.uname: posix.uname_result(sysname='Linux', nodename='enable-optimizations-bot', release='4.9.0-3-amd64', version='#1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26)', machine='x86_64') > * platform.platform: Linux-4.9.0-3-amd64-x86_64-with-debian-9.1 > > http://buildbot.python.org/all/#/builders/47/builds/126/steps/3/logs/stdio > > ---------- > components: Build > messages: 305682 > nosy: gregory.p.smith, haypo, nascheme > priority: normal > severity: normal > status: open > title: AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge > type: performance > versions: Python 3.7 > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 18:27:12 2017 From: report at bugs.python.org (Peter Otten) Date: Mon, 06 Nov 2017 23:27:12 +0000 Subject: [issue30952] [Windows] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1510010832.4.0.213398074469.issue30952@psf.upfronthosting.co.za> Peter Otten <__peter__ at web.de> added the comment: A possible workaround is to use create_function(): >>> import sqlite3, math >>> db = sqlite3.connect(":memory:") >>> db.execute("select sin(?);", (math.pi,)).fetchone() Traceback (most recent call last): File "", line 1, in sqlite3.OperationalError: no such function: sin >>> db.create_function("sin", 1, math.sin) >>> db.execute("select sin(?);", (math.pi,)).fetchone() (1.2246467991473532e-16,) ---------- nosy: +peter.otten _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 18:29:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 23:29:50 +0000 Subject: [issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation? In-Reply-To: <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za> Message-ID: <1510010990.38.0.213398074469.issue31940@psf.upfronthosting.co.za> STINNER Victor added the comment: I would prefer to catch os.lchmod() exception and reminds that lchmod() doesn't work. Search for _O_TMPFILE_WORKS in Lib/tempfile.py for a Python example of code trying to use a function, or falls back on something else. (I gave other examples for C code in a comment on PR 4267.) ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 18:39:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 23:39:06 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1510011546.0.0.213398074469.issue31904@psf.upfronthosting.co.za> STINNER Victor added the comment: FYI I already started a thread on python-dev: [Python-Dev] Partial support of a platform https://mail.python.org/pipermail/python-dev/2017-November/150238.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 18:45:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 23:45:00 +0000 Subject: [issue31884] [Windows] subprocess set priority on windows Message-ID: <1510011900.11.0.213398074469.issue31884@psf.upfronthosting.co.za> New submission from STINNER Victor : Please describe the issue. ---------- nosy: +haypo title: subprocess set priority on windows -> [Windows] subprocess set priority on windows versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:01:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:01:49 +0000 Subject: [issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once In-Reply-To: <1507796316.87.0.213398074469.issue31770@psf.upfronthosting.co.za> Message-ID: <1510012909.0.0.213398074469.issue31770@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e56ab746a965277ffcc4396d8a0902b6e072d049 by Victor Stinner (Oren Milman) in branch 'master': bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (#3968) https://github.com/python/cpython/commit/e56ab746a965277ffcc4396d8a0902b6e072d049 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:02:46 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 00:02:46 +0000 Subject: [issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once In-Reply-To: <1507796316.87.0.213398074469.issue31770@psf.upfronthosting.co.za> Message-ID: <1510012966.62.0.213398074469.issue31770@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:03:45 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 00:03:45 +0000 Subject: [issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once In-Reply-To: <1507796316.87.0.213398074469.issue31770@psf.upfronthosting.co.za> Message-ID: <1510013025.88.0.213398074469.issue31770@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4265 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:09:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:09:51 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510013391.77.0.213398074469.issue31764@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset edb13ae48c17210fa4b2d40a6833ca09db5c121b by Victor Stinner (Oren Milman) in branch 'master': bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (#3958) https://github.com/python/cpython/commit/edb13ae48c17210fa4b2d40a6833ca09db5c121b ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:12:07 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 00:12:07 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510013527.58.0.213398074469.issue31764@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4266 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:13:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:13:37 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510013617.09.0.213398074469.issue31764@psf.upfronthosting.co.za> STINNER Victor added the comment: @Oren: The 2.7 backport is not straighforward. Would you mind to backport the fix to 2.7, please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:17:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:17:56 +0000 Subject: [issue31271] an assertion failure in io.TextIOWrapper.write In-Reply-To: <1503597989.21.0.785820469546.issue31271@psf.upfronthosting.co.za> Message-ID: <1510013876.11.0.213398074469.issue31271@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 30537698b607d53fa9ce18522abb88469d5814b6 by Victor Stinner (Oren Milman) in branch '2.7': [2.7] bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. (GH-3201) (#3951) https://github.com/python/cpython/commit/30537698b607d53fa9ce18522abb88469d5814b6 ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:19:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:19:47 +0000 Subject: [issue31271] an assertion failure in io.TextIOWrapper.write In-Reply-To: <1503597989.21.0.785820469546.issue31271@psf.upfronthosting.co.za> Message-ID: <1510013987.82.0.213398074469.issue31271@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: "You are right. But in any case the test should be fixed for 2.7." Done: I merged Oren's PR 3951. It seems like the bug was fixed in all (maintained) branches, so I close the issue. Thank you again Oren Milman for *reporting* and *fixing* the bug! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:35:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:35:43 +0000 Subject: [issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation? In-Reply-To: <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za> Message-ID: <1510014943.46.0.213398074469.issue31940@psf.upfronthosting.co.za> STINNER Victor added the comment: If lchmod() fails with [Errno 95] Not supported, IMHO chmod(path, mode, follow_symlinks=False) should behaves as lchmod() doesn't exist and falls back to the next case, as if HAVE_LCHMOD wasn't defined, but implement such falls back at runtime. So the "broken" lchmod() issue should be fixed a multiple places: * os.lchmod() * os.chmod() * shutil.copymode() * pathlib.Path.lchmod() Oh wow, this issue impacts much more functions than what I expected. Maybe the compromise of a configure check avoids to overengineer this issue :-) Antoine: What do you think? Should we check if lchmod() works in configure (as already implemented in the PR 4267), or implement a runtime check as I proposed. pathlib has an interesting long comment: # Some platforms don't support lchmod(). Often the function exists # anyway, as a stub that always returns ENOSUP or perhaps EOPNOTSUPP. # (No, I don't know why that's a good design.) ./configure will detect # this and reject it--so HAVE_LCHMOD still won't be defined on such # platforms. This is Very Helpful. # # However, sometimes platforms without a working lchmod() *do* have # fchmodat(). (Examples: Linux kernel 3.2 with glibc 2.15, # OpenIndiana 3.x.) And fchmodat() has a flag that theoretically makes # it behave like lchmod(). So in theory it would be a suitable # replacement for lchmod(). But when lchmod() doesn't work, fchmodat()'s # flag doesn't work *either*. Sadly ./configure isn't sophisticated # enough to detect this condition--it only determines whether or not # fchmodat() minimally works. # # Therefore we simply ignore fchmodat() when deciding whether or not # os.chmod supports follow_symlinks. Just checking lchmod() is # sufficient. After all--if you have a working fchmodat(), your # lchmod() almost certainly works too. # # _add("HAVE_FCHMODAT", "chmod") _add("HAVE_FCHOWNAT", "chown") ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:44:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:44:21 +0000 Subject: [issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once In-Reply-To: <1507796316.87.0.213398074469.issue31770@psf.upfronthosting.co.za> Message-ID: <1510015461.44.0.213398074469.issue31770@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4b544aadd54fd2337d2ab5c137389cae8d1fd781 by Victor Stinner (Miss Islington (bot)) in branch '2.7': bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (GH-3968) (#4302) https://github.com/python/cpython/commit/4b544aadd54fd2337d2ab5c137389cae8d1fd781 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:44:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:44:25 +0000 Subject: [issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once In-Reply-To: <1507796316.87.0.213398074469.issue31770@psf.upfronthosting.co.za> Message-ID: <1510015465.6.0.213398074469.issue31770@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9684cf69e32ae442c7be54521073ac78557f3bbf by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (GH-3968) (#4301) https://github.com/python/cpython/commit/9684cf69e32ae442c7be54521073ac78557f3bbf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:45:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:45:03 +0000 Subject: [issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once In-Reply-To: <1507796316.87.0.213398074469.issue31770@psf.upfronthosting.co.za> Message-ID: <1510015503.52.0.213398074469.issue31770@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you Oren Milman for your bug report and the bug fix! I merged your PR and backported it Python 3.6 and 2.7. ---------- versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:45:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:45:21 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510015521.55.0.213398074469.issue31764@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b0331c94c2a210d50e43d99b249ec83ee165e70c by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (GH-3958) (#4303) https://github.com/python/cpython/commit/b0331c94c2a210d50e43d99b249ec83ee165e70c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:45:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:45:46 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510015546.36.0.213398074469.issue31764@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:47:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:47:45 +0000 Subject: [issue31843] sqlite3.connect() should accept PathLike objects In-Reply-To: <1508717625.1.0.213398074469.issue31843@psf.upfronthosting.co.za> Message-ID: <1510015665.91.0.213398074469.issue31843@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a22a127458d75b9b7e65e058f5db5ff705df5696 by Victor Stinner (Anders Lorentsen) in branch 'master': bpo-31843: sqlite3.connect() now accepts PathLike objects as database name (#4299) https://github.com/python/cpython/commit/a22a127458d75b9b7e65e058f5db5ff705df5696 ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:49:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:49:11 +0000 Subject: [issue31843] sqlite3.connect() should accept PathLike objects In-Reply-To: <1508717625.1.0.213398074469.issue31843@psf.upfronthosting.co.za> Message-ID: <1510015751.48.0.213398074469.issue31843@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you Allen Li for your feature request. Thank you very much Anders Lorentsen for addressing all my annoying comments on the pull request, and congratulations for your first contribution to CPython! It's a nice once ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 19:50:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 00:50:13 +0000 Subject: [issue31770] crash and refleaks when calling sqlite3.Cursor.__init__() more than once In-Reply-To: <1507796316.87.0.213398074469.issue31770@psf.upfronthosting.co.za> Message-ID: <1510015813.0.0.213398074469.issue31770@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 20:03:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 01:03:45 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1510016625.08.0.213398074469.issue27666@psf.upfronthosting.co.za> STINNER Victor added the comment: The Python 2.7 backport (commit b694770a2b23cd485c98bf673a8b2dc1a865d9df) is wrong. The _curses module cannot be compiled anymore: Example of compilation errors: /home/haypo/prog/python/2.7/Modules/_cursesmodule.c: In function 'PyCursesWindow_Box': /home/haypo/prog/python/2.7/Modules/_cursesmodule.c:649:39: warning: passing argument 1 of 'PyCurses_ConvertToChtype' from incompatible pointer type [-Wincompatible-pointer-types] if (!PyCurses_ConvertToChtype(self, temp1, &ch1)) { ^~~~ /home/haypo/prog/python/2.7/Modules/_cursesmodule.c:195:1: note: expected 'PyObject * {aka struct _object *}' but argument is of type 'PyCursesWindowObject * {aka struct *}' PyCurses_ConvertToChtype(PyObject *obj, chtype *ch) ^~~~~~~~~~~~~~~~~~~~~~~~ /home/haypo/prog/python/2.7/Modules/_cursesmodule.c:649:45: warning: passing argument 2 of 'PyCurses_ConvertToChtype' from incompatible pointer type [-Wincompatible-pointer-types] if (!PyCurses_ConvertToChtype(self, temp1, &ch1)) { ^~~~~ /home/haypo/prog/python/2.7/Modules/_cursesmodule.c:195:1: note: expected 'chtype * {aka unsigned int *}' but argument is of type 'PyObject * {aka struct _object *}' PyCurses_ConvertToChtype(PyObject *obj, chtype *ch) ^~~~~~~~~~~~~~~~~~~~~~~~ /home/haypo/prog/python/2.7/Modules/_cursesmodule.c:649:14: error: too many arguments to function 'PyCurses_ConvertToChtype' if (!PyCurses_ConvertToChtype(self, temp1, &ch1)) { ^~~~~~~~~~~~~~~~~~~~~~~~ /home/haypo/prog/python/2.7/Modules/_cursesmodule.c:195:1: note: declared here PyCurses_ConvertToChtype(PyObject *obj, chtype *ch) ^~~~~~~~~~~~~~~~~~~~~~~~ ---------- nosy: +haypo resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 20:09:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 01:09:44 +0000 Subject: [issue31964] [3.4][3.5] pyexpat: compilaton of libexpat fails with: ISO C90 forbids mixed declarations and code Message-ID: <1510016984.72.0.213398074469.issue31964@psf.upfronthosting.co.za> New submission from STINNER Victor : /home/haypo/prog/python/3.5/Modules/expat/xmltok.c: In function 'utf8_toUtf8': /home/haypo/prog/python/3.5/Modules/expat/xmltok.c:408:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const char * const fromLimBefore = fromLim; ^~~~~ /home/haypo/prog/python/3.5/Modules/expat/xmltok.c:414:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const ptrdiff_t bytesToCopy = fromLim - *fromP; ^~~~~ cc1: some warnings being treated as errors *** WARNING: renaming "_elementtree" since importing it failed: PyCapsule_Import could not import module "pyexpat" It's probably a regression caused by: * Python 3.5: commit f2492bb6aae061aea47e21fc7e56b7ab9bfdf543 * Python 3.4: commit 86a713cb0c110b6798ca7f9e630fc511ee0a4028 I don't understand why the issue wasn't catched before. Maybe test_xml_etree is simply skipped if pyexpat compilation fails on Linux. Or buildbots and Travis CI uses ./configure --with-system-expat on Linux. ---------- components: Build messages: 305705 nosy: haypo priority: normal severity: normal status: open title: [3.4][3.5] pyexpat: compilaton of libexpat fails with: ISO C90 forbids mixed declarations and code type: security versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 20:13:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 01:13:04 +0000 Subject: [issue31964] [3.4][3.5] pyexpat: compilaton of libexpat fails with: ISO C90 forbids mixed declarations and code In-Reply-To: <1510016984.72.0.213398074469.issue31964@psf.upfronthosting.co.za> Message-ID: <1510017184.25.0.213398074469.issue31964@psf.upfronthosting.co.za> STINNER Victor added the comment: Python 3.6 is not affected since it uses ISO C99 which allows "mixed declarations and code". Python 2.7 is not affected since it doesn't use -Werror=declaration-after-statement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 20:14:47 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 07 Nov 2017 01:14:47 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge In-Reply-To: <20171106231103.refkipssrsss5dsp@python.ca> Message-ID: Gregory P. Smith added the comment: On Mon, Nov 6, 2017 at 3:11 PM Neil Schemenauer wrote: > > Neil Schemenauer added the comment: > > Hi Victor, > > My first guess is that the build bot is not cleaning the fprofile > information after updating the source tree. A few options: > But it is. I actually looked at what the buildbots did before the PR to change the Makefile.pre.in for profile_opt builds went in. Here's what happens: http://buildbot.python.org/all/#/builders/47/builds/127/steps/2/logs/stdio Notice the "make clean profile-removal" on line 17. -gps ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 20:31:33 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 07 Nov 2017 01:31:33 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge In-Reply-To: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> Message-ID: <1510018293.91.0.213398074469.issue31963@psf.upfronthosting.co.za> Neil Schemenauer added the comment: Oh I see. I'm at a loss then as to why the build is failing. A possible clue is the errors like: profiling:/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Objects/setobject.gcda:Merge mismatch for function 10 A Google search brings up this Stackoverflow page: https://stackoverflow.com/questions/2590794/gcov-warning-merge-mismatch-for-summaries To me, that implies that there are compiler outputs (.o, .a, etc) that were build from a previous version source code. However, the first part of the log shows that the build does "make clean" so I don't see how that is possible. Is there a way to run "git show 4e38d71a2b7 | git apply -R" on the built host and then try to re-build? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 22:31:55 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 07 Nov 2017 03:31:55 +0000 Subject: [issue28791] update sqlite to latest version before beta 1 In-Reply-To: <1480017928.89.0.263397799958.issue28791@psf.upfronthosting.co.za> Message-ID: <1510025515.77.0.213398074469.issue28791@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 31af650ee25f65794b75d4dfefed6fe4758781c1 by Mariatta in branch 'master': bpo-28791: Update Windows builds to use SQLite 3.21.0. (GH-4246) https://github.com/python/cpython/commit/31af650ee25f65794b75d4dfefed6fe4758781c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 22:52:42 2017 From: report at bugs.python.org (Anders Lorentsen) Date: Tue, 07 Nov 2017 03:52:42 +0000 Subject: [issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args In-Reply-To: <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> Message-ID: <1510026762.49.0.213398074469.issue31961@psf.upfronthosting.co.za> Anders Lorentsen added the comment: I was able to make a test that reproduces your code, and expectedly fails. Also implemented a fix for it. See a temporary diff here: https://pastebin.com/C9JWkg0i However, there is also a specific MS Windows version of _execute_child() (a phrase only computer-folks can say out loud without feeling very...wrong...). It uses a different method to extract and parse arguments, and it should be corrected and tested under windows, before I submit a PR for this. Also, my test messes up the formatting. Instead of saying "....ok", they both say "... total 0\nok". I have no idea why. ---------- nosy: +Phaqui _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 00:36:04 2017 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 07 Nov 2017 05:36:04 +0000 Subject: [issue31950] Default event loop policy doc lacks precision In-Reply-To: <1509905769.74.0.213398074469.issue31950@psf.upfronthosting.co.za> Message-ID: <1510032964.1.0.213398074469.issue31950@psf.upfronthosting.co.za> Guido van Rossum added the comment: Agreed that this needs more clarification. Is something stopping you from submitting a PR? Note that the thing about non-main-threads is mentioned in the docstring for BaseDefaultEventLoopPolicy. I agree that the best way to create a new policy is to study the existing code and subclass DefaultEventLoopPolicy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 01:55:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 06:55:41 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1510037741.71.0.213398074469.issue31415@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 088929cf62fa22c06f6a44e25915abce9048a545 by Serhiy Storchaka in branch 'master': bpo-31415: Improve error handling and caching of the importtime option. (#4138) https://github.com/python/cpython/commit/088929cf62fa22c06f6a44e25915abce9048a545 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:00:44 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 07 Nov 2017 07:00:44 +0000 Subject: [issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener} Message-ID: <1510038044.25.0.213398074469.issue31965@psf.upfronthosting.co.za> New submission from Jelle Zijlstra : https://docs.python.org/3/library/multiprocessing.html#multiprocessing.connection.Client claims that there is an "authenticate" argument, but it does not exist in the implementation (https://github.com/python/cpython/blob/master/Lib/multiprocessing/connection.py#L487). ---------- assignee: Jelle Zijlstra components: Documentation messages: 305713 nosy: Jelle Zijlstra, davin, pitrou priority: normal pull_requests: 4267 severity: normal status: open title: Incorrect documentation for multiprocessing.connection.{Client,Listener} versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:09:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 07:09:06 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1510038546.66.0.213398074469.issue27666@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4268 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:48:46 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 07 Nov 2017 07:48:46 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1510040926.78.0.213398074469.issue21862@psf.upfronthosting.co.za> Nick Coghlan added the comment: Interesting - I'd never looked at how cProfile works before, and the fact it already doesn't support the "-i" (interactive) switch makes it much simpler to handle than the pdb case. So from a runpy perspective, this approach gets a +1 from me, but I'd prefer if there was someone more familiar with the cProfile module that was willing to handle the merge. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:54:46 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 07 Nov 2017 07:54:46 +0000 Subject: [issue31954] Don't prevent dict optimization by coupling with OrderedDict In-Reply-To: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za> Message-ID: <1510041286.33.0.213398074469.issue31954@psf.upfronthosting.co.za> INADA Naoki added the comment: Quick microbench: ``` $ ./python -m perf timeit --compare-to=`pwd`/python.master -s 'd = dict.fromkeys(range(1000))' -- "for i in range(1000): del d[i] d[i]=i " python.master: ..................... 124 us +- 9 us python: ..................... 116 us +- 0 us Mean +- std dev: [python.master] 124 us +- 9 us -> [python] 116 us +- 0 us: 1.06x faster (-6%) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:55:02 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 07 Nov 2017 07:55:02 +0000 Subject: [issue9325] Add an option to pdb/trace/profile to run library module as a script In-Reply-To: <1279743902.96.0.66207849175.issue9325@psf.upfronthosting.co.za> Message-ID: <1510041302.44.0.213398074469.issue9325@psf.upfronthosting.co.za> Nick Coghlan added the comment: Issue 21862 is a related issue specifically for the cProfile module. In that case, cProfile's command line invocation *doesn't* use the main module, so the patch is able to just create a synthetic call to runpy.run_module as a string and compile that as the code to be profiled. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:55:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 07:55:40 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1510041340.88.0.213398074469.issue27666@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 69ea4b4deb123c9a3c986b7afb85183732784f4f by Serhiy Storchaka in branch '2.7': Fix bpo-27666 backporting error in _cursesmodule.c (#4305) https://github.com/python/cpython/commit/69ea4b4deb123c9a3c986b7afb85183732784f4f ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:56:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 07:56:22 +0000 Subject: [issue27666] "stack smashing detected" in PyCursesWindow_Box In-Reply-To: <1470095550.97.0.482934277649.issue27666@psf.upfronthosting.co.za> Message-ID: <1510041382.63.0.213398074469.issue27666@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for catching this Victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:57:38 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 07 Nov 2017 07:57:38 +0000 Subject: [issue19982] Add a "target" parameter to runpy.run_path and runpy.run_module In-Reply-To: <1387027323.14.0.795736210788.issue19982@psf.upfronthosting.co.za> Message-ID: <1510041458.69.0.213398074469.issue19982@psf.upfronthosting.co.za> Nick Coghlan added the comment: See issue 21862 and issue 9325 as potential use cases for this feature. While it looks like issue 21862 (-m switch support in cProfile) can be implemented just fine without it, this feature will be needed for the modules that execute the given scripts directly in __main__.__dict__ (e.g. pdb). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:57:46 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 07 Nov 2017 07:57:46 +0000 Subject: [issue19982] Add a "target" parameter to runpy.run_path and runpy.run_module In-Reply-To: <1387027323.14.0.795736210788.issue19982@psf.upfronthosting.co.za> Message-ID: <1510041466.1.0.213398074469.issue19982@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 03:29:07 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 08:29:07 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1510040926.78.0.213398074469.issue21862@psf.upfronthosting.co.za> Message-ID: <83816de8-73ad-7811-9043-ff5d0d13c237@free.fr> Antoine Pitrou added the comment: Le 07/11/2017 ? 08:48, Nick Coghlan a ?crit?: > > So from a runpy perspective, this approach gets a +1 from me, but I'd prefer if there was someone more familiar with the cProfile module that was willing to handle the merge. Thanks Nick. Can you confirm the runpy invocation in the PR is sane? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 03:44:51 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 08:44:51 +0000 Subject: [issue31950] Default event loop policy doc lacks precision In-Reply-To: <1509905769.74.0.213398074469.issue31950@psf.upfronthosting.co.za> Message-ID: <1510044291.15.0.213398074469.issue31950@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +4269 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 03:51:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 08:51:15 +0000 Subject: [issue31954] Don't prevent dict optimization by coupling with OrderedDict In-Reply-To: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za> Message-ID: <1510044675.53.0.213398074469.issue31954@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your microbenchmark Inada. The difference is small, but repeating it with different modifications almost always show small speedup. The only problem is that this change increases the size of dict object by one word (up to 3% for small dicts). I don't know what is better place for this flag, the dict object itself or the dict keys object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:11:08 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 07 Nov 2017 09:11:08 +0000 Subject: [issue31954] Don't prevent dict optimization by coupling with OrderedDict In-Reply-To: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za> Message-ID: <1510045868.67.0.213398074469.issue31954@psf.upfronthosting.co.za> INADA Naoki added the comment: I don't know why dk_lookup is in dictkeys object. But I think it's because sharing 1 word from all key-sharing dict. So ma_clean flag can be in dictkeys object for same reason. BTW, We use dk_lookup function pointer and it tooks 1 word. But PyPy use flags for it. So they can pack other informations into same word. static dict_lookup_func lookup_funcs = {lookdict_unicode_nodummy, lookdict_unicode, lookdict_split, lookdict}; ... unsigned int ma_clean:1; unsigned int ma_lookup_func:2; // lookup_funcs[ma_lookup_func] ... In this way, we can have more flags for future optimization. (e.g. "all keys are interned string and comparing pointer is enough for searching interned key" flag). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:26:39 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 09:26:39 +0000 Subject: [issue31950] Default event loop policy doc lacks precision In-Reply-To: <1509905769.74.0.213398074469.issue31950@psf.upfronthosting.co.za> Message-ID: <1510046799.93.0.213398074469.issue31950@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 4135c89395726024abddb7340a0c7a42c801f616 by Antoine Pitrou in branch 'master': bpo-31950: Improve event loop policy doc (#4306) https://github.com/python/cpython/commit/4135c89395726024abddb7340a0c7a42c801f616 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:26:47 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 09:26:47 +0000 Subject: [issue31950] Default event loop policy doc lacks precision In-Reply-To: <1509905769.74.0.213398074469.issue31950@psf.upfronthosting.co.za> Message-ID: <1510046807.34.0.213398074469.issue31950@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4270 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:34:49 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 09:34:49 +0000 Subject: [issue31950] Default event loop policy doc lacks precision In-Reply-To: <1509905769.74.0.213398074469.issue31950@psf.upfronthosting.co.za> Message-ID: <1510047289.63.0.213398074469.issue31950@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset e65617f65e203a2a6d3e3100d0d6fed0ffa0613d by Antoine Pitrou (Miss Islington (bot)) in branch '3.6': bpo-31950: Improve event loop policy doc (GH-4306) (#4307) https://github.com/python/cpython/commit/e65617f65e203a2a6d3e3100d0d6fed0ffa0613d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:35:23 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 09:35:23 +0000 Subject: [issue31950] Default event loop policy doc lacks precision In-Reply-To: <1509905769.74.0.213398074469.issue31950@psf.upfronthosting.co.za> Message-ID: <1510047323.21.0.213398074469.issue31950@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thank you Guido. This is fixed now. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:40:05 2017 From: report at bugs.python.org (Guillaume Aldebert) Date: Tue, 07 Nov 2017 09:40:05 +0000 Subject: [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u Message-ID: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> New submission from Guillaume Aldebert : noticed on windows10, 3.6.3-64 and 3.7.0a2-64: using this test.py file: #!/usr/bin/env python3 print('hello\n', end='', flush=True) and running it in unbuffered mode: C:\Dev>py -u test.py hello Traceback (most recent call last): File "test.py", line 2, in print('hello\n', end='', flush=True) OSError: [WinError 87] The parameter is incorrect Note that (still using py -u): print('hello', end='', flush=True) # works fine print('', end='', flush=True) # raises OSError as well ---------- components: Windows messages: 305726 nosy: Guillaume Aldebert, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: print('hello\n', end='', flush=True) raises OSError when ran with py -u type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:44:57 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 09:44:57 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510047897.63.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Guido, Yury, what is your take on this? Do you think it would be fine for Future._schedule_callbacks() to check the event loop is the current one, or do you think it would impact performance too much (or perhaps it is simply not desirable)? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:53:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 09:53:23 +0000 Subject: [issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' Message-ID: <1510048403.67.0.213398074469.issue31967@psf.upfronthosting.co.za> New submission from STINNER Victor : test_distutils failed on AMD64 Windows10 3.x buildbot: http://buildbot.python.org/all/#/builders/3/builds/128 0:19:07 [165/407/1] test_distutils failed -- running: test_multiprocessing_spawn (377 sec) xxmodule.c xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; using first specification Creating library d:\temp\tmp4zg7rpix\Debug\temp\tmp4zg7rpix\xx_d.cp37-win_amd64.lib and object d:\temp\tmp4zg7rpix\Debug\temp\tmp4zg7rpix\xx_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' foo.c Creating library d:\temp\tmpy79shh6o\tempt\temp\tmpl63x182t\foo_d.cp37-win_amd64.lib and object d:\temp\tmpy79shh6o\tempt\temp\tmpl63x182t\foo_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' xxmodule.c xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; using first specification Creating library d:\temp\tmpkb4gpfw9\Debug\temp\tmpkb4gpfw9\xx_d.cp37-win_amd64.lib and object d:\temp\tmpkb4gpfw9\Debug\temp\tmpkb4gpfw9\xx_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' foo.c Creating library d:\temp\tmppmjpg5zh\tempt\temp\tmpi1x5uxdd\foo_d.cp37-win_amd64.lib and object d:\temp\tmppmjpg5zh\tempt\temp\tmpi1x5uxdd\foo_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' xxmodule.c xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; using first specification Creating library build\temp.win-amd64-3.7-pydebug\Debug\xx_d.cp37-win_amd64.lib and object build\temp.win-amd64-3.7-pydebug\Debug\xx_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' D:\buildarea\3.x.bolen-windows10\build\build\test_python_2228>exit 1 D:\buildarea\3.x.bolen-windows10\build\build\test_python_2228>exit 0 (...) ====================================================================== ERROR: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\_msvccompiler.py", line 519, in link self.spawn([self.linker] + ld_args) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\_msvccompiler.py", line 542, in spawn return super().spawn(cmd) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\spawn.py", line 81, in _spawn_nt "command %r failed with exit status %d" % (cmd, rc)) distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\tests\test_build_ext.py", line 82, in test_build_ext cmd.run() File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\command\build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\command\build_ext.py", line 558, in build_extension target_lang=language) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\ccompiler.py", line 717, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\_msvccompiler.py", line 522, in link raise LinkError(msg) distutils.errors.LinkError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158 ---------- components: Tests, Windows messages: 305728 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:55:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 09:55:01 +0000 Subject: [issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' In-Reply-To: <1510048403.67.0.213398074469.issue31967@psf.upfronthosting.co.za> Message-ID: <1510048501.37.0.213398074469.issue31967@psf.upfronthosting.co.za> STINNER Victor added the comment: Similar error on AMD64 Windows8 3.x: http://buildbot.python.org/all/#/builders/32/builds/127 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:58:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 09:58:26 +0000 Subject: [issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' In-Reply-To: <1510048403.67.0.213398074469.issue31967@psf.upfronthosting.co.za> Message-ID: <1510048706.24.0.213398074469.issue31967@psf.upfronthosting.co.za> STINNER Victor added the comment: I don't think that it's related, but a recent change in PCbuild is: bpo-31957. IMHO it's more something that changed on the two buildbots. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:59:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 09:59:03 +0000 Subject: [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u In-Reply-To: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> Message-ID: <1510048743.12.0.213398074469.issue31966@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +IO nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:59:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 09:59:52 +0000 Subject: [issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' In-Reply-To: <1510048403.67.0.213398074469.issue31967@psf.upfronthosting.co.za> Message-ID: <1510048792.9.0.213398074469.issue31967@psf.upfronthosting.co.za> STINNER Victor added the comment: Hi David Bolen: Would you mind to look at this bug, please? thank you in advance ;-) ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:05:42 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 10:05:42 +0000 Subject: [issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation? In-Reply-To: <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za> Message-ID: <1510049142.2.0.213398074469.issue31940@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I don't have any strong opinion, but I think doing the check at runtime is better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:12:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 10:12:35 +0000 Subject: [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u In-Reply-To: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> Message-ID: <1510049555.92.0.213398074469.issue31966@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The problem is with _WindowsConsoleIO. C:\py\cpython>python.bat -u -c "import sys; sys.stdout.buffer.write(b'')" Running Release|Win32 interpreter... Traceback (most recent call last): File "", line 1, in OSError: [WinError 87] The parameter is incorrect ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:13:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 10:13:49 +0000 Subject: [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u In-Reply-To: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> Message-ID: <1510049629.67.0.213398074469.issue31966@psf.upfronthosting.co.za> STINNER Victor added the comment: Once the bug will be fixed, it would be nice to test this simple case :-) ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:17:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 10:17:15 +0000 Subject: [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u In-Reply-To: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> Message-ID: <1510049835.63.0.213398074469.issue31966@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +easy (C) stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:26:15 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 07 Nov 2017 10:26:15 +0000 Subject: [issue31808] tarfile.extractall fails to overwrite symlinks In-Reply-To: <1508315375.63.0.213398074469.issue31808@psf.upfronthosting.co.za> Message-ID: <1510050375.07.0.213398074469.issue31808@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:31:17 2017 From: report at bugs.python.org (David Bolen) Date: Tue, 07 Nov 2017 10:31:17 +0000 Subject: [issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' In-Reply-To: <1510048403.67.0.213398074469.issue31967@psf.upfronthosting.co.za> Message-ID: <1510050677.1.0.213398074469.issue31967@psf.upfronthosting.co.za> David Bolen added the comment: This seems to correlate with my upgrading to the latest Win10 SDK on those workers (Steve pointed out I was still getting ucrt warnings during compilation). So they both jumped from like 10240 up to 16299. But that's all I changed. Interestingly I only had to fix 8.1 and 10, as 7 already had a version (15063) avoiding the warning, and it's tedious to change. But it's not experiencing the linking problem. I could swear I recall past link/rc problems, but my searching (and memory) are failing me at the moment. But I wonder if that's why I had left these two workers back at 10240, or if I had some local fix in place. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:46:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 10:46:45 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1510051605.25.0.213398074469.issue31626@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3cc4c53a64bdcf21431ad306eca0e568f88735a2 by Serhiy Storchaka in branch 'master': bpo-31626: Mark ends of the reallocated block in debug build. (#4210) https://github.com/python/cpython/commit/3cc4c53a64bdcf21431ad306eca0e568f88735a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:48:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 10:48:42 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1510051722.48.0.213398074469.issue31626@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There are large discussions at PR 3844 and PR 4210. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:57:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 10:57:05 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1510052225.58.0.213398074469.issue31626@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4271 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 05:57:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 10:57:27 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1510052247.18.0.213398074469.issue31626@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yet one issue is left. In debug mode two debug allocators are used, the one is nested in the other. Is it correct? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 06:42:35 2017 From: report at bugs.python.org (David Bolen) Date: Tue, 07 Nov 2017 11:42:35 +0000 Subject: [issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' In-Reply-To: <1510048403.67.0.213398074469.issue31967@psf.upfronthosting.co.za> Message-ID: <1510054955.22.0.213398074469.issue31967@psf.upfronthosting.co.za> David Bolen added the comment: Ok, so rc.exe appears truly not to be found when the test runs. The binary is a bit buried in the Windows Kit directory tree, and I'm guessing something is off after the upgrade (I'm not sure where it was in the tree before). I manually placed a copy in a directory I know is on the path and that seems to have resolved it. I also found a similar copy of rc.exe from the SDK to a local directory on my Windows 7 worker, so I suspect that was what I was remembering, and I probably hit the same thing when updating the SDK on that worker previously. Not sure if there's some better way it should work, but at least this resolves the issue from the SDK update - builds are currently in progress, but both workers passed test_distutils. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:05:04 2017 From: report at bugs.python.org (Simon Descarpentries) Date: Tue, 07 Nov 2017 12:05:04 +0000 Subject: [issue31889] difflib SequenceMatcher ratio() still have unpredictable behavior In-Reply-To: <1509185013.27.0.213398074469.issue31889@psf.upfronthosting.co.za> Message-ID: <1510056304.36.0.213398074469.issue31889@psf.upfronthosting.co.za> Simon Descarpentries added the comment: Hi, I missed the part of the doc you pointed out, being focused on ratio() function family. Thanks for your gentle reply. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:07:22 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 07 Nov 2017 12:07:22 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1510056442.21.0.213398074469.issue21862@psf.upfronthosting.co.za> Nick Coghlan added the comment: I added an inline comment on the PR - I think what's there now would work fine, but I also suggested a slightly shorter and clearer (at least to me) alternative. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:08:20 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 07 Nov 2017 12:08:20 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1510056500.59.0.213398074469.issue21862@psf.upfronthosting.co.za> Nick Coghlan added the comment: Also, based on reviewing this, I suspect the same approach would also work for the pure Python profile module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:31:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 12:31:41 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1510057901.68.0.213398074469.issue31626@psf.upfronthosting.co.za> STINNER Victor added the comment: For allocations larger than 512 bytes, PyObject_Malloc() calls PyMem_RawMalloc(). When debug hooks are installed, PyObject_Malloc() calls a debug hook which calls PyMem_RawMalloc() which calls another debug hook. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:35:08 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 12:35:08 +0000 Subject: [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u In-Reply-To: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> Message-ID: <1510058108.23.0.213398074469.issue31966@psf.upfronthosting.co.za> STINNER Victor added the comment: serhiy.storchaka: "keywords: + easy (C)" For easy issue, you should explain how do you want the issue to be fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:36:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 12:36:19 +0000 Subject: [issue28791] update sqlite to latest version before beta 1 In-Reply-To: <1480017928.89.0.263397799958.issue28791@psf.upfronthosting.co.za> Message-ID: <1510058179.14.0.213398074469.issue28791@psf.upfronthosting.co.za> STINNER Victor added the comment: > sqlite-3.15.1 fixes an old annoying bug (hidden since 3.8.0) Since the bug seems to be important, maybe it's worth it to backport the commit upgrading SQLite to Python 2.7 and 3.6? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:49:16 2017 From: report at bugs.python.org (Ilya Polyakovskiy) Date: Tue, 07 Nov 2017 12:49:16 +0000 Subject: [issue31968] exec(): method's default arguments from dict-inherited globals Message-ID: <1510058956.93.0.213398074469.issue31968@psf.upfronthosting.co.za> New submission from Ilya Polyakovskiy : I'm using exec() to run code with globals object inherited from dict. The problem is overloaded __getitem__ doesn't called to load default argument for class methods. Here the example. Let's assume we create some variable storage for code execution class Env(dict): def __init__(self, external_storage): super().__init__() self._external_storage = external_storage def __setitem__(self, key, value): print('__setitem__: {}'.format(key)) self._external_storage[key] = value def __getitem__(self, key): print('__getitem__: {}'.format(key)) return self._external_storage[key] storage = {} env = Env(storage) env['var'] = 2 exec(""" class A: def foo(self, x=var): print('foo(): {}'.format(x)) a = A() a.foo() """, env) This code will fail with output: __setitem__: var Traceback (most recent call last): File "inheri-test.py", line 29, in """, env) File "", line 2, in File "", line 3, in A NameError: name 'var' is not defined As far as I understand the problem is Python/ceval.c:2120. There is only PyDict_GetItem used to load variable from f_globals, instead of PyObject_GetItem in case of f_globals is not exact dict. ---------- components: Interpreter Core messages: 305746 nosy: Ilya Polyakovskiy priority: normal severity: normal status: open title: exec(): method's default arguments from dict-inherited globals versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:49:54 2017 From: report at bugs.python.org (Ilya Polyakovskiy) Date: Tue, 07 Nov 2017 12:49:54 +0000 Subject: [issue31968] exec(): method's default arguments from dict-inherited globals In-Reply-To: <1510058956.93.0.213398074469.issue31968@psf.upfronthosting.co.za> Message-ID: <1510058994.31.0.213398074469.issue31968@psf.upfronthosting.co.za> Change by Ilya Polyakovskiy : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:57:38 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 07 Nov 2017 12:57:38 +0000 Subject: [issue31968] exec(): method's default arguments from dict-inherited globals In-Reply-To: <1510058956.93.0.213398074469.issue31968@psf.upfronthosting.co.za> Message-ID: <1510059458.28.0.213398074469.issue31968@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, that's the way it works (and is intended to work, for performance reasons). The documentation on this could be improved...while it does say globals must be a dict and that locals can be any mapping object, it does it in a sentence that is a bit confusing in this context, and it doesn't make it clear that it has to be a "real" dict, not a subclass. (I wouldn't be surprised if that sentence was written back when you couldn't subclass dict.) ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, r.david.murray versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:58:55 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 07 Nov 2017 12:58:55 +0000 Subject: [issue20486] msilib: can't close opened database In-Reply-To: <1391355449.68.0.999858284587.issue20486@psf.upfronthosting.co.za> Message-ID: <1510059535.33.0.213398074469.issue20486@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset a935654f0613640535fbf0ba190f81d02a63d35c by Berker Peksag in branch 'master': bpo-20486: Implement Database.Close() method in msilib (GH-4141) https://github.com/python/cpython/commit/a935654f0613640535fbf0ba190f81d02a63d35c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:01:57 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 07 Nov 2017 13:01:57 +0000 Subject: [issue20486] msilib: can't close opened database In-Reply-To: <1391355449.68.0.999858284587.issue20486@psf.upfronthosting.co.za> Message-ID: <1510059717.62.0.213398074469.issue20486@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you, all. The OP's snippet should work now: >>> import msilib as m >>> db = m.OpenDatabase('py33.msi', m.MSIDBOPEN_TRANSACT) >>> db.Commit() >>> db2 = m.OpenDatabase('py33.msi', m.MSIDBOPEN_TRANSACT) Traceback (most recent call last): File "", line 1, in _msi.MSIError: 1: 2203 2: py33.msi 3: -2147287008 >>> db.Close() >>> db2 = m.OpenDatabase('py33.msi', m.MSIDBOPEN_TRANSACT) I didn't backport this to bugfix branches since we added a new public function to the API. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:04:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 13:04:56 +0000 Subject: [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u In-Reply-To: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> Message-ID: <1510059896.19.0.213398074469.issue31966@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't know which part of _WindowsConsoleIO.write() fails to handle empty bytes string, but the simplest and the most efficient way to fix this bug it to add an explicit check for zero length at the begin of this method and return Python integer 0 in this case. The test should check that sys.stdout.buffer.write(b''), sys.stdout.buffer.write(b'') and sys.stdout.buffer.raw.write(b'') return 0 (the latter to checks should be performed only if the corresponding buffer and raw attributes exist). There are special tests for WindowsConsoleIO, it would be nice to add an explicit test here too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:14:30 2017 From: report at bugs.python.org (Narendra) Date: Tue, 07 Nov 2017 13:14:30 +0000 Subject: [issue31969] re.groups() is not checking the arguments Message-ID: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> New submission from Narendra : Hi Team, I have observed a bug in re.groups() function behavior in Python as below: Issue: re.groups() is not validating the arguments Example: >>> m = re.match(r'(\w+)@(\w+)\.(\w+)','username at hackerrank.com') >>> m.groups() ('username', 'hackerrank', 'com') >>> m.groups(1) ('username', 'hackerrank', 'com') >>> m.groups(100000000000) ('username', 'hackerrank', 'com') >>> >From the above, its clear that re.groups() and re.groups() both are same. I think re.groups() is not validating the arguments. Please review the same and provide your comments whether my views are correct or wrong ---------- components: Regular Expressions messages: 305751 nosy: ezio.melotti, mrabarnett, narendrac priority: normal severity: normal status: open title: re.groups() is not checking the arguments type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:15:04 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 13:15:04 +0000 Subject: [issue31970] asyncio debug mode is very slow Message-ID: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Each time a new future, handle or task is created, asyncio with debug mode enabled will parse the whole call stack and create a StackSummary object for it. Imagine a recursive coroutine: with N nested calls, you get O(N**2) performance. Ideally debug mode wouldn't slow things too much, at least for development and testing setups. ---------- components: Library (Lib), asyncio messages: 305752 nosy: giampaolo.rodola, haypo, pitrou, yselivanov priority: normal severity: normal status: open title: asyncio debug mode is very slow type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:15:48 2017 From: report at bugs.python.org (Ilya Polyakovskiy) Date: Tue, 07 Nov 2017 13:15:48 +0000 Subject: [issue31968] exec(): method's default arguments from dict-inherited globals In-Reply-To: <1510058956.93.0.213398074469.issue31968@psf.upfronthosting.co.za> Message-ID: <1510060548.68.0.213398074469.issue31968@psf.upfronthosting.co.za> Change by Ilya Polyakovskiy : ---------- keywords: +patch pull_requests: +4272 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:19:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 13:19:20 +0000 Subject: [issue31969] re.groups() is not checking the arguments In-Reply-To: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> Message-ID: <1510060760.25.0.213398074469.issue31969@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: All work as designed. In your example you don't see a difference because all groups are defined. Look at other example: >>> import re >>> m = re.match(r'(?:(\w+)@)?(\w+)\.(\w+)', 'hackerrank.com') >>> m.groups() (None, 'hackerrank', 'com') >>> m.groups(1) (1, 'hackerrank', 'com') >>> m.groups(100000000000) (100000000000, 'hackerrank', 'com') ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:21:42 2017 From: report at bugs.python.org (Narendra) Date: Tue, 07 Nov 2017 13:21:42 +0000 Subject: [issue31969] re.groups() is not checking the arguments In-Reply-To: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> Message-ID: <1510060902.01.0.213398074469.issue31969@psf.upfronthosting.co.za> Narendra added the comment: Please look in to the following example: >>> m.groups() ('narendra', 'happiestmidns', 'com') >>> m.groups(1) ('narendra', 'happiestmidns', 'com') >>> m.groups(34) ('narendra', 'happiestmidns', 'com') >>> m.groups(10000000000000000000000000000000000000000000000000000000) ('narendra', 'happiestmidns', 'com') >>> ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:21:46 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 13:21:46 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510060906.7.0.213398074469.issue31970@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +4273 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:23:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 13:23:25 +0000 Subject: [issue31969] re.groups() is not checking the arguments In-Reply-To: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> Message-ID: <1510061005.57.0.213398074469.issue31969@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is nothing wrong with this output if you use the first example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:24:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 13:24:28 +0000 Subject: [issue31969] re.groups() is not checking the arguments In-Reply-To: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> Message-ID: <1510061068.49.0.213398074469.issue31969@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:29:07 2017 From: report at bugs.python.org (Eryk Sun) Date: Tue, 07 Nov 2017 13:29:07 +0000 Subject: [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u In-Reply-To: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> Message-ID: <1510061347.87.0.213398074469.issue31966@psf.upfronthosting.co.za> Eryk Sun added the comment: The error is in _io__WindowsConsoleIO_write_impl. If it's passed a length 0 buffer, it still tries to decode it via MultiByteToWideChar, which fails as documented. As Serhiy says, it can simply return Python int(0) in the zero-length case. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:29:53 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 13:29:53 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510061393.84.0.213398074469.issue31970@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:30:00 2017 From: report at bugs.python.org (Ilya Polyakovskiy) Date: Tue, 07 Nov 2017 13:30:00 +0000 Subject: [issue31968] exec(): method's default arguments from dict-inherited globals In-Reply-To: <1510058956.93.0.213398074469.issue31968@psf.upfronthosting.co.za> Message-ID: <1510061400.71.0.213398074469.issue31968@psf.upfronthosting.co.za> Change by Ilya Polyakovskiy : ---------- pull_requests: +4274 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:32:01 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 13:32:01 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510061521.74.0.213398074469.issue31970@psf.upfronthosting.co.za> Antoine Pitrou added the comment: If this is accepted on the principle, it would be great to also patch 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:33:12 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 13:33:12 +0000 Subject: [issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces In-Reply-To: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> Message-ID: <1510061592.3.0.213398074469.issue31955@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4275 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:42:39 2017 From: report at bugs.python.org (=?utf-8?b?0J3QuNC60L7Qu9Cw0Lkg0KHQv9Cw0YXQuNC10LI=?=) Date: Tue, 07 Nov 2017 13:42:39 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509985326.17.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: ??????? ??????? added the comment: I plan to work on a patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 09:00:22 2017 From: report at bugs.python.org (Dee Mee) Date: Tue, 07 Nov 2017 14:00:22 +0000 Subject: [issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces In-Reply-To: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> Message-ID: <1510063222.14.0.213398074469.issue31955@psf.upfronthosting.co.za> Dee Mee added the comment: I agree, that this fix is necessary only for Python 2. Submitted new PR 4316 ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 09:31:53 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 07 Nov 2017 14:31:53 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510065113.45.0.213398074469.issue31960@psf.upfronthosting.co.za> Yury Selivanov added the comment: > On the other hand, the Future implementation is entirely not thread-safe (btw, the constructor optimistically claims the done callbacks are scheduled using call_soon_threadsafe(), but the implementation actually calls call_soon()). This is weird. PEP 3156 specifies that Future uses call_soon. The implementation uses call_soon. And it actually makes sense to use call_soon for Futures. Situations when Future.cancel() or Future.set_result() is called from a different thread are extremely rare, so we want to avoid the overhead of using call_soon_threadsafe(). Moreover, I bet there are many other cases where Future implementation is not threadsafe. If one absolutely needs to call Future.set_result() from a different thread, they can always do `loop.call_soon_threadsafe(fut.set_result, ...)`. My opinion on this: update documentation for all Python versions to reflect that Future uses call_soon. > Do you think it would be fine for Future._schedule_callbacks() to check the event loop is the current one, or do you think it would impact performance too much (or perhaps it is simply not desirable)? I think we should update `Future._schedule_callbacks` to check if the loop is in debug mode. If it is call `loop._check_thread()`, which will raise a RuntimeError if the current thread is different from the one that the loop belongs to. This will have no detectable overhead, but will ease debugging of edge cases like writing multithreaded asyncio applications. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 09:43:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 14:43:02 +0000 Subject: [issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u In-Reply-To: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> Message-ID: <1510065782.62.0.213398074469.issue31966@psf.upfronthosting.co.za> STINNER Victor added the comment: The _io__WindowsConsoleIO_write_impl() function should be fixed to not call MultiByteToWideChar() but use 0 if the input string is zero. Ok, it makes sense. In that case, I agree to call it a simple issue ;-) ---------- title: print('hello\n', end='', flush=True) raises OSError when ran with py -u -> [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:23:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 15:23:17 +0000 Subject: [issue31971] idle_test: failures on x86 Windows7 3.x Message-ID: <1510068197.3.0.213398074469.issue31971@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/58/builds/122 ====================================================================== ERROR: tearDownClass (idlelib.idle_test.test_configdialog.KeysPageTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\idlelib\idle_test\test_configdialog.py", line 701, in tearDownClass del page.set_keys_type, page.load_keys_list AttributeError: set_keys_type ====================================================================== FAIL: test_set_keys_type (idlelib.idle_test.test_configdialog.KeysPageTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\idlelib\idle_test\test_configdialog.py", line 859, in test_set_keys_type eq(d.custom_keyset_on.state(), ('selected',)) AssertionError: Tuples differ: ('selected', 'hover') != ('selected',) First tuple contains 1 additional elements. First extra element 1: 'hover' - ('selected', 'hover') ? -------- + ('selected',) ---------- components: Tests messages: 305763 nosy: haypo, terry.reedy priority: normal severity: normal status: open title: idle_test: failures on x86 Windows7 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:31:15 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 15:31:15 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510068675.83.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > My opinion on this: update documentation for all Python versions to reflect that Future uses call_soon. Agreed. > I think we should update `Future._schedule_callbacks` to check if the loop is in debug mode. Unfortunately this is not sufficient for the snippet I posted. The loop's thread_id is only set when the loop runs, but the main loop in that example never runs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:31:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 15:31:50 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510068710.2.0.213398074469.issue31960@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: -haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:33:46 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 15:33:46 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510068826.49.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: My underlying question is why the Future has to set its loop in its constructor, instead of simply using get_event_loop() inside _schedule_callbacks(). This would always work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:41:46 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 15:41:46 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510069306.59.0.213398074469.issue31960@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +4277 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:42:09 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 07 Nov 2017 15:42:09 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510069329.21.0.213398074469.issue31960@psf.upfronthosting.co.za> Yury Selivanov added the comment: >> I think we should update `Future._schedule_callbacks` to check if the loop is in debug mode. > Unfortunately this is not sufficient for the snippet I posted. The loop's thread_id is only set when the loop runs, but the main loop in that example never runs. If the loop isn't running, call_soon works just fine from any thread. call_soon_threadsafe is different from call_soon when the loop *is* running. When it's running and blocked on IO, call_soon_threadsafe will make sure that the loop will be woken up. Currently, _schedule_callbacks() calls loop.call_soon(), which already calls loop._check_thread(). So it looks like we don't need to change anything after all, right? ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:46:17 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 15:46:17 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510069577.83.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: The call_soon / call_soon_threadsafe distinction is not relevant to the problem I posted. The problem is that the Future is registered with the event loop for the thread it was created in, even though it is only ever used in another thread (with another event loop). Just try the snippet :-) If you want to see it finish in a finite time, move the future instantiation inside the coroutine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:48:05 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 07 Nov 2017 15:48:05 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510069685.33.0.213398074469.issue31960@psf.upfronthosting.co.za> Yury Selivanov added the comment: > My underlying question is why the Future has to set its loop in its constructor, instead of simply using get_event_loop() inside _schedule_callbacks(). This would always work. So imagine a Future `fut` is completed. And we call `fut.add_done_callback()` in different contexts with different active event loops. With your suggestion we'll schedule our callbacks in different loops. Ideally you should use `loop.create_future()` when you can (and in libraries you usually can do that) to always make it explicit which loop your Future is attached to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:52:07 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 15:52:07 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510069927.78.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > So imagine a Future `fut` is completed. And we call `fut.add_done_callback()` in different contexts with different active event loops. With your suggestion we'll schedule our callbacks in different loops. I'm wondering: does this situation occur in practice? Since Future isn't threadsafe, is there really a point in using it from several loops at once? > Ideally you should use `loop.create_future()` when you can (and in libraries you usually can do that) to always make it explicit which loop your Future is attached to. Unfortunately that's not possible in our case. Short version: we are using Tornado which creates a asyncio Future eagerly, see https://github.com/tornadoweb/tornado/blob/master/tornado/locks.py#L199 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:57:35 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 07 Nov 2017 15:57:35 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510070255.89.0.213398074469.issue31960@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Just try the snippet :-) If you want to see it finish in a finite time, move the future instantiation inside the coroutine. Yeah, I see the problem. OTOH your proposed change to lazily attach a loop to the future isn't fully backwards compatible. It would be a nightmare to find a bug in a large codebase caused by this change in Future behaviour. So I'm -1 on this idea, that ship has sailed. > Unfortunately that's not possible in our case. Short version: we are using Tornado which creates a asyncio Future eagerly, see https://github.com/tornadoweb/tornado/blob/master/tornado/locks.py#L199 Maybe the solution is to fix Tornado? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:03:32 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:03:32 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510070612.63.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 22b1128559bdeb96907da5840960691bb050d11a by Antoine Pitrou in branch 'master': bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#4319) https://github.com/python/cpython/commit/22b1128559bdeb96907da5840960691bb050d11a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:04:38 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 16:04:38 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510070678.48.0.213398074469.issue31960@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4278 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:09:50 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:09:50 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510070990.91.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Maybe the solution is to fix Tornado? That's a possibility. I have to convince Ben Darnell that it deserves fixing :-) Another possibility is to use the asyncio concurrency primitives on Python 3, though that slightly complicates things, especially as the various coroutines there don't take a timeout parameter. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:13:09 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:13:09 +0000 Subject: [issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener} In-Reply-To: <1510038044.25.0.213398074469.issue31965@psf.upfronthosting.co.za> Message-ID: <1510071189.26.0.213398074469.issue31965@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 1e5d54cfa031f1de9ee2d2e968e0551b6e2397b7 by Antoine Pitrou (Jelle Zijlstra) in branch 'master': bpo-31965: fix doc for multiprocessing.connection.Client and Listener (#4304) https://github.com/python/cpython/commit/1e5d54cfa031f1de9ee2d2e968e0551b6e2397b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:14:28 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 16:14:28 +0000 Subject: [issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener} In-Reply-To: <1510038044.25.0.213398074469.issue31965@psf.upfronthosting.co.za> Message-ID: <1510071268.8.0.213398074469.issue31965@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4279 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:20:26 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:20:26 +0000 Subject: [issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener} In-Reply-To: <1510038044.25.0.213398074469.issue31965@psf.upfronthosting.co.za> Message-ID: <1510071626.9.0.213398074469.issue31965@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset d9c61c2a2662761dc89e0be14ceb7ea57531c836 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6': bpo-31965: fix doc for multiprocessing.connection.Client and Listener (GH-4304) (#4321) https://github.com/python/cpython/commit/d9c61c2a2662761dc89e0be14ceb7ea57531c836 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:20:44 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:20:44 +0000 Subject: [issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener} In-Reply-To: <1510038044.25.0.213398074469.issue31965@psf.upfronthosting.co.za> Message-ID: <1510071644.83.0.213398074469.issue31965@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:22:21 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:22:21 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510071741.23.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 518c6b97868d9c665475a40567b0aa417afad607 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6': bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (GH-4319) (#4320) https://github.com/python/cpython/commit/518c6b97868d9c665475a40567b0aa417afad607 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:23:11 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:23:11 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510071791.16.0.213398074469.issue31960@psf.upfronthosting.co.za> Antoine Pitrou added the comment: The documentation has been fixed. Should we close this now? Ideally I'd rather have asyncio warn me in such situations, but I feel this won't be doable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:23:33 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:23:33 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510071813.66.0.213398074469.issue31970@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 921e9432a1461bbf312c9c6dcc2b916be6c05fa0 by Antoine Pitrou in branch 'master': bpo-31970: Reduce performance overhead of asyncio debug mode. (#4314) https://github.com/python/cpython/commit/921e9432a1461bbf312c9c6dcc2b916be6c05fa0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:27:21 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:27:21 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510072041.08.0.213398074469.issue31970@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +4280 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:27:45 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 07 Nov 2017 16:27:45 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510072065.04.0.213398074469.issue31960@psf.upfronthosting.co.za> Yury Selivanov added the comment: I guess you can set Resolution to "postponed", Stage to "Resolved". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:30:30 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:30:30 +0000 Subject: [issue31960] Protection against using a Future with another loop only works with await In-Reply-To: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> Message-ID: <1510072230.86.0.213398074469.issue31960@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> postponed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:46:55 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 07 Nov 2017 16:46:55 +0000 Subject: [issue31793] Allow to specialize smart quotes in documentation translations In-Reply-To: <1508060988.99.0.213398074469.issue31793@psf.upfronthosting.co.za> Message-ID: <1510073215.89.0.213398074469.issue31793@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 5a66c8a64d180b5f3c80307924adaec53cc8faa3 by INADA Naoki (Julien Palard) in branch 'master': bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006) https://github.com/python/cpython/commit/5a66c8a64d180b5f3c80307924adaec53cc8faa3 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:48:14 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 16:48:14 +0000 Subject: [issue31793] Allow to specialize smart quotes in documentation translations In-Reply-To: <1508060988.99.0.213398074469.issue31793@psf.upfronthosting.co.za> Message-ID: <1510073294.97.0.213398074469.issue31793@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4281 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:49:13 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 16:49:13 +0000 Subject: [issue31793] Allow to specialize smart quotes in documentation translations In-Reply-To: <1508060988.99.0.213398074469.issue31793@psf.upfronthosting.co.za> Message-ID: <1510073353.9.0.213398074469.issue31793@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4282 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:50:52 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:50:52 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510073452.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset d8d218ffda6b7569625ff9edadbbc9a2b1055e32 by Antoine Pitrou in branch '3.6': [3.6] bpo-31970: Reduce performance overhead of asyncio debug mode. (GH-4314) (#4322) https://github.com/python/cpython/commit/d8d218ffda6b7569625ff9edadbbc9a2b1055e32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:51:22 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 16:51:22 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510073482.53.0.213398074469.issue31970@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thank you for the quick reviews! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:53:26 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 07 Nov 2017 16:53:26 +0000 Subject: [issue31793] Allow to specialize smart quotes in documentation translations In-Reply-To: <1508060988.99.0.213398074469.issue31793@psf.upfronthosting.co.za> Message-ID: <1510073606.22.0.213398074469.issue31793@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 47eaaa55247b6ad8ae507c0048509c2e3db79bf0 by INADA Naoki (Miss Islington (bot)) in branch '2.7': bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006) https://github.com/python/cpython/commit/47eaaa55247b6ad8ae507c0048509c2e3db79bf0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:55:11 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 07 Nov 2017 16:55:11 +0000 Subject: [issue31793] Allow to specialize smart quotes in documentation translations In-Reply-To: <1508060988.99.0.213398074469.issue31793@psf.upfronthosting.co.za> Message-ID: <1510073711.49.0.213398074469.issue31793@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 64f10492dcda4117ac06399ae46ab645cb09b19e by INADA Naoki (Miss Islington (bot)) in branch '3.6': bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006) https://github.com/python/cpython/commit/64f10492dcda4117ac06399ae46ab645cb09b19e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:55:33 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 07 Nov 2017 16:55:33 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510073733.63.0.213398074469.issue31970@psf.upfronthosting.co.za> Yury Selivanov added the comment: Thank you for helping with asyncio! I'll try to get to that transport performance issues you found sometime this week. I've a few ideas how to add 0-copy support to protocols. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 11:59:15 2017 From: report at bugs.python.org (INADA Naoki) Date: Tue, 07 Nov 2017 16:59:15 +0000 Subject: [issue31793] Allow to specialize smart quotes in documentation translations In-Reply-To: <1508060988.99.0.213398074469.issue31793@psf.upfronthosting.co.za> Message-ID: <1510073955.31.0.213398074469.issue31793@psf.upfronthosting.co.za> INADA Naoki added the comment: Thanks, Julien. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 12:28:52 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 07 Nov 2017 17:28:52 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1510075732.97.0.213398074469.issue31937@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Thanks Raymond. +1 for adding the above list. I don't think FAQ is the right place either, I prefer we don't have to add the entries in the form of questions & answers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 12:35:25 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 07 Nov 2017 17:35:25 +0000 Subject: [issue31620] asyncio.Queue leaks memory if the queue is empty and consumers poll it frequently In-Reply-To: <1506619669.24.0.466225441844.issue31620@psf.upfronthosting.co.za> Message-ID: <1510076125.16.0.213398074469.issue31620@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset c62f0cb3b1f6f9ca4ce463b1c99b0543bdfa38d6 by Andrew Svetlov (Suren Nihalani) in branch 'master': bpo-31620: have asyncio/queues not leak memory when you've exceptions during waiting (#3813) https://github.com/python/cpython/commit/c62f0cb3b1f6f9ca4ce463b1c99b0543bdfa38d6 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 12:36:31 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 07 Nov 2017 17:36:31 +0000 Subject: [issue31620] asyncio.Queue leaks memory if the queue is empty and consumers poll it frequently In-Reply-To: <1506619669.24.0.466225441844.issue31620@psf.upfronthosting.co.za> Message-ID: <1510076191.87.0.213398074469.issue31620@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4283 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 13:49:59 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 07 Nov 2017 18:49:59 +0000 Subject: [issue31425] Expose AF_QIPCRTR in socket module In-Reply-To: <1505168549.75.0.537554946733.issue31425@psf.upfronthosting.co.za> Message-ID: <1510080599.7.0.213398074469.issue31425@psf.upfronthosting.co.za> Change by Christian Heimes : ---------- assignee: -> christian.heimes nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 14:05:43 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 07 Nov 2017 19:05:43 +0000 Subject: [issue31972] Inherited docstrings for pathlib classes are confusing Message-ID: <1510081543.19.0.213398074469.issue31972@psf.upfronthosting.co.za> New submission from ?ric Araujo : pydoc pathlib.Path shows the docstring of PurePath: | PurePath represents a filesystem path and offers operations which | don't imply any actual filesystem I/O. But immediately after we see methods like chmod, exists and co which obviously aren?t pure. Looking at the reST docs or the source code, the reader can deduce that this is the docstring of PurePath inherited by Path, but I find it confusing. Solution: adding docstrings to all pathlib classes. PurePath and Path can have all the info, Posix/Windows* subclasses only one line with a reference. ---------- components: Library (Lib) keywords: easy messages: 305788 nosy: eric.araujo priority: normal severity: normal stage: needs patch status: open title: Inherited docstrings for pathlib classes are confusing type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 14:08:17 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 07 Nov 2017 19:08:17 +0000 Subject: [issue31620] asyncio.Queue leaks memory if the queue is empty and consumers poll it frequently In-Reply-To: <1506619669.24.0.466225441844.issue31620@psf.upfronthosting.co.za> Message-ID: <1510081697.61.0.213398074469.issue31620@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset ac4f6d4448fb6f9affb817bafb8357450fe43349 by Andrew Svetlov (Miss Islington (bot)) in branch '3.6': bpo-31620: have asyncio/queues not leak memory when you've exceptions during waiting (GH-3813) (#4326) https://github.com/python/cpython/commit/ac4f6d4448fb6f9affb817bafb8357450fe43349 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 15:17:14 2017 From: report at bugs.python.org (joe m) Date: Tue, 07 Nov 2017 20:17:14 +0000 Subject: [issue31951] import curses is broken on windows In-Reply-To: <1509922553.69.0.213398074469.issue31951@psf.upfronthosting.co.za> Message-ID: <1510085834.32.0.213398074469.issue31951@psf.upfronthosting.co.za> joe m added the comment: I would much prefer the curses module to be supported in newer versions since I believe that curses is installed as a built in module (not sure about that). Anyhow, thank you for your help but I have found a replacement module called "asciimatics" which for fills all the functions that I really need. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 15:18:31 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 20:18:31 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1510085911.95.0.213398074469.issue31937@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Agreed with Raymond that Python folk terminology should not go into the glossary. I don't think I ever say "dunder" myself. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 15:56:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 20:56:52 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1510088212.88.0.213398074469.issue31937@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I never seen terms like "stir" or "inker", but the term "dunder" is used pretty widely. The glossary already contains abbreviations and Python folk terminology like EAFP and BDFL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 16:43:14 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 07 Nov 2017 21:43:14 +0000 Subject: [issue31824] Missing default argument detail in documentation of StreamReaderWriter In-Reply-To: <1508455062.42.0.213398074469.issue31824@psf.upfronthosting.co.za> Message-ID: <1510090994.88.0.213398074469.issue31824@psf.upfronthosting.co.za> Berker Peksag added the comment: For those who want to work on this issue: codecs.StreamReaderWriter documentation is located at Doc/library/codecs.rst. ---------- keywords: +easy nosy: +berker.peksag stage: -> needs patch versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 16:57:13 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 07 Nov 2017 21:57:13 +0000 Subject: [issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple In-Reply-To: <1505496099.07.0.410774221671.issue31486@psf.upfronthosting.co.za> Message-ID: <1510091833.71.0.213398074469.issue31486@psf.upfronthosting.co.za> Berker Peksag added the comment: PR 3840 has been merged and it looks like Oren was correct. I'm getting the following output with current master: >>> encoder(obj=BadDict({'spam': 42}), _current_indent_level=4) ['{}'] ---------- nosy: +berker.peksag resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 17:23:15 2017 From: report at bugs.python.org (Zachary Ware) Date: Tue, 07 Nov 2017 22:23:15 +0000 Subject: [issue28791] update sqlite to latest version before beta 1 In-Reply-To: <1480017928.89.0.263397799958.issue28791@psf.upfronthosting.co.za> Message-ID: <1510093395.05.0.213398074469.issue28791@psf.upfronthosting.co.za> Zachary Ware added the comment: I'd say that's up to Ned and Benjamin. It's a very simple backport at this point. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 17:35:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 07 Nov 2017 22:35:54 +0000 Subject: [issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple In-Reply-To: <1505496099.07.0.410774221671.issue31486@psf.upfronthosting.co.za> Message-ID: <1510094154.46.0.213398074469.issue31486@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: bpo-28280 fixed this issue only in the master branch. I had left this issue open for fixing 3.6. ---------- resolution: out of date -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 17:44:49 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 07 Nov 2017 22:44:49 +0000 Subject: [issue31824] Missing default argument detail in documentation of StreamReaderWriter In-Reply-To: <1508455062.42.0.213398074469.issue31824@psf.upfronthosting.co.za> Message-ID: <1510094689.61.0.213398074469.issue31824@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +4284 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 17:55:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 22:55:44 +0000 Subject: [issue31957] [Windows] PCbuild error: A numeric comparison was attempted In-Reply-To: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> Message-ID: <1510095344.57.0.213398074469.issue31957@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you Steve for the quick fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 18:02:08 2017 From: report at bugs.python.org (=?utf-8?q?Mihai_Capot=C4=83?=) Date: Tue, 07 Nov 2017 23:02:08 +0000 Subject: [issue26692] cgroups support in multiprocessing In-Reply-To: <1459817171.82.0.158211239936.issue26692@psf.upfronthosting.co.za> Message-ID: <1510095728.85.0.213398074469.issue26692@psf.upfronthosting.co.za> Change by Mihai Capot? : ---------- nosy: +mihaic _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 18:15:49 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 07 Nov 2017 23:15:49 +0000 Subject: [issue31973] Incomplete DeprecationWarning for async/await keywords Message-ID: <1510096549.91.0.213398074469.issue31973@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : Issue bpo-26182 added DeprecationWarnings for "import async" and "import await" since both of those pseudo-keywords were to become actual reserved keywords in Python 3.7. This latter has now happened, but the fix in bpo-26182 is incomplete. It does not trigger warnings on "from .async import foo". base/ __init__.py async.py good.py -----async.py x = 1 -----good.py from .async import x $ python3.6 -W error::DeprecationWarning -c "import base.good" $ python3.7 -c "import base.good" Traceback (most recent call last): File "", line 1, in File "/private/tmp/x1/base/good.py", line 1 from .async import x ^ SyntaxError: invalid syntax $ cd base $ python3.6 -W error::DeprecationWarning -c "import async" DeprecationWarning: 'async' and 'await' will become reserved keywords in Python 3.7 ---------- messages: 305798 nosy: barry priority: normal severity: normal status: open title: Incomplete DeprecationWarning for async/await keywords versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 18:28:38 2017 From: report at bugs.python.org (Jakub Wilk) Date: Tue, 07 Nov 2017 23:28:38 +0000 Subject: [issue31973] Incomplete DeprecationWarning for async/await keywords In-Reply-To: <1510096549.91.0.213398074469.issue31973@psf.upfronthosting.co.za> Message-ID: <1510097318.19.0.213398074469.issue31973@psf.upfronthosting.co.za> Change by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 18:42:06 2017 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 07 Nov 2017 23:42:06 +0000 Subject: [issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR In-Reply-To: <1450143790.74.0.198268951027.issue25862@psf.upfronthosting.co.za> Message-ID: <1510098126.38.0.213398074469.issue25862@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- nosy: +ZackerySpytz versions: +Python 3.6, Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 20:01:39 2017 From: report at bugs.python.org (Stephen M. Gava) Date: Wed, 08 Nov 2017 01:01:39 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1510102899.0.0.213398074469.issue24132@psf.upfronthosting.co.za> Stephen M. Gava added the comment: Using a set of paths with special properties and formats in a project, thought "the cleanest oop way to do this is try out python's oop paths in pathlib". Subclassed Path to implement my extra (non platfor specific) properties and fell at the first hurdle because of this issue... for me pathlib does not provide oop paths if i can't subclass Path, for whatever reason. reverted to treating paths as strings and writing functions to handle my special path properties and formats. i was also surprised when i found another bug report on this issue that said it was closed for 3.7, great i thought this has been solved, but no, the other report was closed because it was about the same issue as this ancient report. ---------- nosy: +elguavas _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 20:56:55 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 08 Nov 2017 01:56:55 +0000 Subject: [issue31974] Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra Message-ID: <1510106215.52.0.213398074469.issue31974@psf.upfronthosting.co.za> New submission from Terry J. Reedy : MacOS Sierra 10.12.6, Python 3.6.1, tk 8.5.15 or .18. Consider this code with arbitrary compound statements and therefore indented lines. for i in range(10): if i%2: print(f(i)) Irv Kalb on idle-dev thread 'Bug in cursor placement in IDLE editor' windows reports the following obnoxious behavior: click just to left or on left side of 'p' and cursor appears on left margin. Keep clicking and cursor moves right one space at a time until arriving next to 'p', where it should immediately go, and does on Windows, and, I presume, elsewhere. (When the cursor first arrives at 'p', there is also the double-click selection highlight.) At my suggestion, he also tested with code inserted directly in a tk Test window with this: import tkinter as tk root = tk.Tk() text = tk.Text(root) sample = ''' ''' text.insert('1.0', sample) text.pack() root.mainloop() and encountered the same bug. (Hence, this is not an IDLE issue.)The only difference is that clicking beside keyword 'if' does not show bug in IDLE but does in Text. He also uploaded an unlisted video to YouTube. https://www.youtube.com/watch?v=Us8px0BY5rg Irv's current workaround is to click a letter or two to the right and use <-- key. I realize that this is likely not a tkinter issue either, but I wanted to record it and get you two's thoughts. Is this more likely to be a problem with a particular installation, or with at least one macOS release and even 8.5.18. If the latter, can Irv install Python compiled elsewhere to work with 8.6? Ned, do you have a recommendation? Kevin Walzer reported that he does not see the issue with Python built to run with 8.6 and using 8.6.7. He noted that 8.5.18 does not get bug fixes. I presume that this applies to 8.5 in general. Will 3.7.0 be compiled for 8.6? ---------- messages: 305800 nosy: IrvKalb, ned.deily, serhiy.storchaka, terry.reedy priority: normal severity: normal status: open title: Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 21:55:09 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 08 Nov 2017 02:55:09 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ Message-ID: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> New submission from Nick Coghlan : As per the post at https://mail.python.org/pipermail/python-dev/2017-November/150366.html, this is an RFE to cover adding a new warning filter to the default set: once::DeprecationWarning:__main__ This means that all deprecation warnings triggered directly by code in __main__ will start being reported again, while deprecation warnings triggered by imported modules will continue to be ignored by default. Thus the following will start emitting DeprecationWarning by default again (as they did in 2.6 and earlier): - experiments at the REPL - directly executed scripts - modules executed with the -m switch - pkg.__main__ submodules executed with the -m switch - __main__.py files in executed directories and zip archives However, any code *imported* from these will not trigger warnings. This means that the following still won't trigger any warnings by default: - modules imported & functions called from entry point wrapper scripts - modules imported & functions called from pkg.__main__ submodules - modules imported & functions called from __main__.py files The intent behind the change is that it should be much harder for developers and educators to miss seeing a deprecation warning at least once for a deprecated API, while still silencing deprecation warnings by default for deployed Python applications. ---------- messages: 305801 nosy: alex, gvanrossum, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add a default filter for DeprecationWarning in __main__ type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 22:04:22 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 08 Nov 2017 03:04:22 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510110262.47.0.213398074469.issue31975@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 22:45:59 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 08 Nov 2017 03:45:59 +0000 Subject: [issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args In-Reply-To: <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> Message-ID: <1510112759.37.0.213398074469.issue31961@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4285 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 22:49:14 2017 From: report at bugs.python.org (Anders Lorentsen) Date: Wed, 08 Nov 2017 03:49:14 +0000 Subject: [issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args In-Reply-To: <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> Message-ID: <1510112954.49.0.213398074469.issue31961@psf.upfronthosting.co.za> Anders Lorentsen added the comment: While researching this, I discovered that on MS Windows >>> subprocess.run([pathlike_object, additional_arguments]) did not run like it did on Posix. My PR includes this problem and it's fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 23:27:27 2017 From: report at bugs.python.org (Benjamin Fogle) Date: Wed, 08 Nov 2017 04:27:27 +0000 Subject: [issue31976] Segfault when closing BufferedWriter from a different thread Message-ID: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> New submission from Benjamin Fogle : To reproduce: ``` import threading import io import time import _pyio class MyFileIO(io.FileIO): def flush(self): # Simulate a slow flush. Slow disk, etc. time.sleep(0.25) super().flush() raw = MyFileIO('test.dat', 'wb') #fp = _pyio.BufferedWriter(raw) fp = io.BufferedWriter(raw) t1 = threading.Thread(target=fp.close) t1.start() time.sleep(0.1) # Ensure t1 is sleeping in fp.close()/raw.flush() fp.write(b'test') t1.join() ``` _pyio.BufferedWriter ignores the error completely rather than throwing a ValueError("write to closed file"). ---------- components: Interpreter Core messages: 305803 nosy: benfogle priority: normal severity: normal status: open title: Segfault when closing BufferedWriter from a different thread versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 23:27:34 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 08 Nov 2017 04:27:34 +0000 Subject: [issue31971] idle_test: failures on x86 Windows7 3.x In-Reply-To: <1510068197.3.0.213398074469.issue31971@psf.upfronthosting.co.za> Message-ID: <1510115254.87.0.213398074469.issue31971@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +4286 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 23:33:08 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 08 Nov 2017 04:33:08 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510115588.1.0.213398074469.issue31975@psf.upfronthosting.co.za> ?ric Araujo added the comment: This can?t be backported, but could the docs of 2.7 and stable 3.x version gain an example of equivalent PYTHONWARNINGS envvar? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 23:35:45 2017 From: report at bugs.python.org (Benjamin Fogle) Date: Wed, 08 Nov 2017 04:35:45 +0000 Subject: [issue31976] Segfault when closing BufferedWriter from a different thread In-Reply-To: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> Message-ID: <1510115745.63.0.213398074469.issue31976@psf.upfronthosting.co.za> Change by Benjamin Fogle : ---------- keywords: +patch pull_requests: +4287 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 23:39:26 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 08 Nov 2017 04:39:26 +0000 Subject: [issue31971] idle_test: failures on x86 Windows7 3.x In-Reply-To: <1510068197.3.0.213398074469.issue31971@psf.upfronthosting.co.za> Message-ID: <1510115966.71.0.213398074469.issue31971@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The failure in tearDownClass is a side-effect of the failure in test_set_keys causing 'p.set_keys_type = Func' being skipped. That could be prevented with 'try:finally: p.set_keys_type = Func'. I am completely puzzled at the sudden failure on one machine. configdialog and test_configdialog were lasted changed 11 days ago (10/27) by Serhey's patch to make font samples editable. test_idle passed consistently everywhere, including that machine, until build 121, 16 hours ago, and then suddenly started failing, consistently, on that one machine (as far as I know). It continues to pass on my Win 10 machine, freshly updated with Python rebuilt. I also checked the git log for tkinter.__init__ and tkinter.ttk and they have not been changed either. The failure message is also a surprise. 'custom_keyset_on' is a ttk Radiobutton. https://docs.python.org/3/library/tkinter.ttk.html#widget-states does not list 'hover' as a state. However https://www.tcl.tk/man/tcl8.6/TkCmd/ttk_widget.htm#M-state does (so the doc needs fixing): "The mouse cursor is within the widget." Perhaps 'hover' is a result of previous mouse cursor positioning from event_generates in the font tab test. (Why the sudden change on one system would still be a puzzle.) If this is the reason, then I only need to worry about this one state test. Otherwise, I would have to think about either parking the cursor where it cannot interfere, or about minimizing the dialog when it does not need to be de-iconified for event_generate to work. Serhiy, any thoughts on this? ---------- assignee: -> terry.reedy components: +IDLE nosy: +serhiy.storchaka type: -> behavior versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 23:53:08 2017 From: report at bugs.python.org (Benjamin Fogle) Date: Wed, 08 Nov 2017 04:53:08 +0000 Subject: [issue31976] Segfault when closing BufferedWriter from a different thread In-Reply-To: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> Message-ID: <1510116788.54.0.213398074469.issue31976@psf.upfronthosting.co.za> Change by Benjamin Fogle : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 23:53:49 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 08 Nov 2017 04:53:49 +0000 Subject: [issue31971] idle_test: failures on x86 Windows7 3.x In-Reply-To: <1510068197.3.0.213398074469.issue31971@psf.upfronthosting.co.za> Message-ID: <1510116829.17.0.213398074469.issue31971@psf.upfronthosting.co.za> Terry J. Reedy added the comment: In build 129, which finished perhaps 3 hours ago, test_idle passed again. I think we should merge the fix anyway in case 'hover' appears again on some machine. A similar try:except is needed elsewhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 00:12:05 2017 From: report at bugs.python.org (=?utf-8?b?5byg5pmT5p6X?=) Date: Wed, 08 Nov 2017 05:12:05 +0000 Subject: [issue31977] threading.Condition can not work with threading.Semaphore Message-ID: <1510117925.72.0.213398074469.issue31977@psf.upfronthosting.co.za> New submission from ??? : the python document say Condition work will Locks, like RLock... but i find it not work with Semaphore, because Condition._is_owned is like this def _is_owned(self): # Return True if lock is owned by current_thread. # This method is called only if _lock doesn't have _is_owned(). if self._lock.acquire(0): self._lock.release() return False else: return True this work for RLock, but not work for Semaphore, and Semaphore do not have it's own _is_owned implement. i spend a lot of time on this issue. maybe fix it, or document it out? ---------- messages: 305807 nosy: ??? priority: normal severity: normal status: open title: threading.Condition can not work with threading.Semaphore type: resource usage versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 00:51:49 2017 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 08 Nov 2017 05:51:49 +0000 Subject: [issue31834] BLAKE2: the (pure) SSE2 impl forced on x86_64 is slower than reference In-Reply-To: <1508572631.92.0.213398074469.issue31834@psf.upfronthosting.co.za> Message-ID: <1510120309.08.0.213398074469.issue31834@psf.upfronthosting.co.za> Benjamin Peterson added the comment: @tiran, can we close this again? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 01:25:11 2017 From: report at bugs.python.org (=?utf-8?b?5byg5pmT5p6X?=) Date: Wed, 08 Nov 2017 06:25:11 +0000 Subject: [issue31977] threading.Condition can not work with threading.Semaphore In-Reply-To: <1510117925.72.0.213398074469.issue31977@psf.upfronthosting.co.za> Message-ID: <1510122311.21.0.213398074469.issue31977@psf.upfronthosting.co.za> Change by ??? : ---------- type: resource usage -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 01:32:41 2017 From: report at bugs.python.org (Narendra) Date: Wed, 08 Nov 2017 06:32:41 +0000 Subject: [issue31969] re.groups() is not checking the arguments In-Reply-To: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> Message-ID: <1510122761.59.0.213398074469.issue31969@psf.upfronthosting.co.za> Narendra added the comment: Hi Storchaka, As per re.groups(), its should work as below: groups([default]) Return a tuple containing all the subgroups of the match, from 1 up to however many groups are in the pattern. The default argument is used for groups that did not participate in the match; it defaults to None. (Incompatibility note: in the original Python 1.5 release, if the tuple was one element long, a string would be returned instead. In later versions (from 1.5.1 on), a singleton tuple is returned in such cases.) For example: >>> m = re.match(r"(\d+)\.(\d+)", "24.1632") >>> m.groups() ('24', '1632') If we make the decimal place and everything after it optional, not all groups might participate in the match. These groups will default to None unless the default argument is given: >>> m = re.match(r"(\d+)\.?(\d+)?", "24") >>> m.groups() # Second group defaults to None. ('24', None) >>> m.groups('0') # Now, the second group defaults to '0'. ('24', '0') I tested some scenario as below: Scenario: Suppose i have a match like m = re.match(r"(\d+)\.(\d+)", "24.1632") Here if i pass m.groups(10000), then it should check if there is optional match (optional match, pattern which is specified using ?), it should print 10000 in that match and if not, it should throw error that there is no any optional match (didn't have any pattern with ?). Expected Output: >>> m.groups(10000) There is no any optional argument to use 10000 Received Output: >>> m.groups(10000) '24', '1632') Please review the above and provide your comments? ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 03:46:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 08:46:10 +0000 Subject: [issue31969] re.groups() is not checking the arguments In-Reply-To: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> Message-ID: <1510130770.87.0.213398074469.issue31969@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: No, it should not throw error that there is no any optional match. It is not easy to check if there is optional match. For example, the pattern '(a)|(b)' contains optional matches, while the group in the pattern '()?' always matches. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 03:54:42 2017 From: report at bugs.python.org (Tom Floyer) Date: Wed, 08 Nov 2017 08:54:42 +0000 Subject: [issue31811] async and await missing from keyword list in lexical analysis doc In-Reply-To: <1508340723.02.0.213398074469.issue31811@psf.upfronthosting.co.za> Message-ID: <1510131282.14.0.213398074469.issue31811@psf.upfronthosting.co.za> Change by Tom Floyer : ---------- pull_requests: -4095 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 03:55:20 2017 From: report at bugs.python.org (Paul Moore) Date: Wed, 08 Nov 2017 08:55:20 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1510131320.97.0.213398074469.issue24132@psf.upfronthosting.co.za> Paul Moore added the comment: @elguavas the problem is, no-one has proposed a patch. There's not likely to be much movement on this until someone provides one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 04:29:23 2017 From: report at bugs.python.org (Oren Milman) Date: Wed, 08 Nov 2017 09:29:23 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510133363.66.0.213398074469.issue31764@psf.upfronthosting.co.za> Change by Oren Milman : ---------- pull_requests: +4288 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 04:32:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 09:32:03 +0000 Subject: [issue31972] Inherited docstrings for pathlib classes are confusing In-Reply-To: <1510081543.19.0.213398074469.issue31972@psf.upfronthosting.co.za> Message-ID: <1510133523.27.0.213398074469.issue31972@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 04:38:43 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 09:38:43 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510133923.7.0.213398074469.issue31975@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Thus the following will start emitting DeprecationWarning by default again (as they did in 2.6 and earlier): > - experiments at the REPL This is backwards. If there's one place where you *don't* want stderr polluted with warnings (or any kind of logging), it's an interactive prompt. More generally, I think this entire proposal is unsound, and needs a PEP written to make its case clearly. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 04:50:20 2017 From: report at bugs.python.org (Oren Milman) Date: Wed, 08 Nov 2017 09:50:20 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510134620.83.0.213398074469.issue31764@psf.upfronthosting.co.za> Oren Milman added the comment: I opened #4333 for 2.7, but it is quite straightforward.. Am i missing something? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 04:53:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 09:53:42 +0000 Subject: [issue31971] idle_test: failures on x86 Windows7 3.x In-Reply-To: <1510068197.3.0.213398074469.issue31971@psf.upfronthosting.co.za> Message-ID: <1510134822.73.0.213398074469.issue31971@psf.upfronthosting.co.za> STINNER Victor added the comment: > I am completely puzzled at the sudden failure on one machine. The "x86 Windows7 3.x" buildbot worker is very slow. So this bug is probably a race condition which is hard to trigger on a fast machine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 04:57:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 09:57:07 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510135027.73.0.213398074469.issue31764@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset cd66d6d632b4a8190e97f265ee163f11b5ae38e6 by Victor Stinner (Oren Milman) in branch '2.7': bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (GH-4333) https://github.com/python/cpython/commit/cd66d6d632b4a8190e97f265ee163f11b5ae38e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 04:59:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 09:59:12 +0000 Subject: [issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized In-Reply-To: <1507748958.42.0.213398074469.issue31764@psf.upfronthosting.co.za> Message-ID: <1510135152.41.0.213398074469.issue31764@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you for the backport Oren, I already merged it into Python 2.7. Thanks Oren Milman for your bug report *and* for your bug fix! > I opened #4333 for 2.7, but it is quite straightforward.. Am i missing something? Sorry, I had to say that "git cherry-pick" failed on 2.7. I didn't check why ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 05:03:39 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 10:03:39 +0000 Subject: [issue31853] Use super().method instead of socket.method in SSLSocket In-Reply-To: <1508790377.43.0.213398074469.issue31853@psf.upfronthosting.co.za> Message-ID: <1510135419.59.0.213398074469.issue31853@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +earonesty _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 05:13:02 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Wed, 08 Nov 2017 10:13:02 +0000 Subject: [issue31978] make it simpler to round fractions Message-ID: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> New submission from Wolfgang Maier : Hi, because of floating point inaccuracies it is suboptimal to use round(int1/int2) for rounding of a fraction. fractions.Fraction, OTOH, offers exact rounding through its implementation of __round__, but using it requires users to create a fractions.Fraction instance from two ints first. The algorithm used by Fraction.__round__ is, essentially, the same as the one used in the pure-Python version of the datetime._divide_and_round module (which, in turn, is taken from a comment by Mark Dickinson in Objects/longobject.c). My suggestion is to promote this algorithm to an exposed function in the fractions module (actually, it may make sense to have it in the math module instead - compare the case of the gcd function, which started out in fractions, but is now in transition to math) so that it can be used by Fraction.__round__, but also any other code. Attached is a patch demonstrating the idea. In addition, to the above benefit, it turns out to actually speed up Fraction.__round__ substantially, when ndigits is not None because it then avoids the generation of temporary Fraction instances, and, in my hands at least, it even makes the general (ndigits=None) case slightly faster (apparently the copied datetime._divide_and_round code is more efficient than the original in Fraction.__round__). There is one slight additional tweak in the patch: in the case of ndigits < 0, it returns an int, not a Fraction (see test_fractions modification to make it pass). I think this is actually a mistake in the current Fraction.__round__, which already promotes the result to int in the general case. This change speeds up round to the next ndigits power of ten by ~ a factor of 5 in my hands because no new Fraction needs to be instantiated anymore. A full PR could include having pure-Python datetime import the function from fractions instead of rolling its own, but I'd first like to hear whether you think this should go into math instead. ---------- components: Library (Lib) files: fractions_divround.patch keywords: patch messages: 305817 nosy: mark.dickinson, wolma priority: normal severity: normal status: open title: make it simpler to round fractions type: enhancement versions: Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47254/fractions_divround.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 05:37:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 10:37:50 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510137470.08.0.213398074469.issue31978@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See also _divide_and_round() in Lib/datetime.py, _div_nearest() in Lib/_pydecimal.py and _PyLong_DivmodNear() in Objects/longobject.c. ---------- nosy: +belopolsky, facundobatista, rhettinger, serhiy.storchaka, skrah, stutzbach versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 05:51:03 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 10:51:03 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1510138262.99.0.213398074469.issue21862@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 7973e279a21999f134aff92dd6d344ec4591fae9 by Antoine Pitrou (Sanyam Khurana) in branch 'master': bpo-21862: Add -m option to cProfile for profiling modules (#4297) https://github.com/python/cpython/commit/7973e279a21999f134aff92dd6d344ec4591fae9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 05:51:30 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 10:51:30 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1510138290.25.0.213398074469.issue21862@psf.upfronthosting.co.za> Antoine Pitrou added the comment: This is done. Thank you Sanyam! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 06:09:55 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 11:09:55 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1510139395.66.0.213398074469.issue28180@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4289 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 06:11:31 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 11:11:31 +0000 Subject: [issue31910] test_socket.test_create_connection() failed with EADDRNOTAVAIL (err 99) In-Reply-To: <1509469522.6.0.213398074469.issue31910@psf.upfronthosting.co.za> Message-ID: <1510139491.92.0.213398074469.issue31910@psf.upfronthosting.co.za> Berker Peksag added the comment: I don't see this failure on Travis for a while now. Can this issue be closed? ---------- nosy: +berker.peksag type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 06:21:16 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Wed, 08 Nov 2017 11:21:16 +0000 Subject: [issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path In-Reply-To: <1403640414.18.0.449527177368.issue21862@psf.upfronthosting.co.za> Message-ID: <1510140076.59.0.213398074469.issue21862@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Thanks a lot Antoine and Nick :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 06:52:19 2017 From: report at bugs.python.org (Germano) Date: Wed, 08 Nov 2017 11:52:19 +0000 Subject: [issue23078] unittest.mock patch autospec doesn't work on staticmethods In-Reply-To: <1418892323.1.0.910322233262.issue23078@psf.upfronthosting.co.za> Message-ID: <1510141938.99.0.213398074469.issue23078@psf.upfronthosting.co.za> Germano added the comment: Hi, I hit this problem wile mocking one static method and found this fix. Tested it and works for me. However, I did not find it pushed anywhere: no Python 3.x and no mock for 2.7. Is there any reason why it is not pushed anywhere, yet? ---------- nosy: +germanop _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:21:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 12:21:21 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex Message-ID: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : This issue is inspired by the tweet https://twitter.com/dabeaz/status/925787482515533830 >>> a = 'n' >>> b = '?' >>> sys.getsizeof(a) 50 >>> sys.getsizeof(b) 74 >>> float(b) Traceback (most recent call last): File "", line 1, in ValueError: could not convert string to float: '?' >>> sys.getsizeof(b) 77 See also a discussion on Python-list (https://mail.python.org/pipermail/python-list/2017-November/728149.html) and Stack Overflow (https://stackoverflow.com/questions/47062184/why-does-the-size-of-this-python-string-change-on-a-failed-int-conversion). When convert a non-ASCII string which don't contain non-ASCII decimal digits and spaces, this will fail, but will change the size of the input string due to creating an internal UTF-8 representation. This can look surprising for beginners, but there is nothing wrong here. There are many cases in which an internal UTF-8 representation is created implicitly. But looking on the code I have found that it is too complicated. Parsers to int, float and complex call _PyUnicode_TransformDecimalAndSpaceToASCII() which transforms non-ASCII decimal digits and spaces to ASCII. This functions uses the general function fixup() which takes a transformation function, creates a new string object, apply the transformation. It checks if the transformation produces a string with larger maximal character code than the original string and creates a new string object and repeat the transformation in that case. Finally, if the resulting string is equal to the original string, destroy the resulting string and returns the original string. In the past fixup() was used for implementing methods like upper(). But now _PyUnicode_TransformDecimalAndSpaceToASCII() is only the user of fixup(), and it doesn't need all complicated logic of fixup(). For example, this transformation never produces wider strings. The proposed PR simplifies the code by getting rid of fixup() and fix_decimal_and_space_to_ascii(). The semantic of _PyUnicode_TransformDecimalAndSpaceToASCII() has been changed. It now always produces ASCII string (this also simplifies caller places). If non-ASCII characters which is not a decimal digit and is not a space is encountered, the rest of the string is replaced with '?' which will cause an error in parsers. The only visible behavior change (except not changing the size of the original string) is changing the exception raised by float() and complex() when the string contains lone surrogates from UnicodeEncodeError to ValueError (the same as for other malformed strings). int() already contained a special case for this and raised a ValueError. Unpatched: >>> int('\ud800') Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '\ud800' >>> float('\ud800') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 0: surrogates not allowed >>> complex('\ud800') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 0: surrogates not allowed Patched: >>> int('\ud800') Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '\ud800' >>> float('\ud800') Traceback (most recent call last): File "", line 1, in ValueError: could not convert string to float: '\ud800' >>> complex('\ud800') Traceback (most recent call last): File "", line 1, in ValueError: complex() arg is a malformed string This PR saves around 80 lines of code. ---------- assignee: serhiy.storchaka components: Unicode messages: 305824 nosy: ezio.melotti, haypo, serhiy.storchaka priority: normal severity: normal status: open title: Simplify converting non-ASCII strings to int, float and complex type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:24:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 12:24:15 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex In-Reply-To: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> Message-ID: <1510143855.27.0.213398074469.issue31979@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4290 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:38:29 2017 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Nov 2017 12:38:29 +0000 Subject: [issue31338] Use abort() for code we never expect to hit In-Reply-To: <1504552694.13.0.420212301121.issue31338@psf.upfronthosting.co.za> Message-ID: <1510144709.91.0.213398074469.issue31338@psf.upfronthosting.co.za> Change by Petr Viktorin : ---------- pull_requests: +4291 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:59:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 12:59:05 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) Message-ID: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : C99 provides functions log2(), log10() and exp2(). Is it worth to special case math.log(), math.pow() and built-in pow() for using these functions? log2(x) can be more accurate than log(x)/log(2). There are math.log2() and math.log10(), but not math.exp2(). ---------- components: Extension Modules messages: 305825 nosy: mark.dickinson, rhettinger, serhiy.storchaka, stutzbach priority: normal severity: normal status: open title: Special case log(x, 2), log(x, 10) and pow(2, x) type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:59:23 2017 From: report at bugs.python.org (Mikey D) Date: Wed, 08 Nov 2017 12:59:23 +0000 Subject: [issue31981] os.mkdirs does not exist on 2.7.5+ Message-ID: <1510145963.34.0.213398074469.issue31981@psf.upfronthosting.co.za> New submission from Mikey D : https://docs.python.org/2/library/os.html os.mkdirs('/tmp/folder') AttributeError: 'module' object has no attribute 'mkdirs'' os.makedirs('/tmp/folder') os.path.isdir('/tmp/folder') True ---------- assignee: docs at python components: Documentation messages: 305826 nosy: Mikey D, docs at python priority: normal severity: normal status: open title: os.mkdirs does not exist on 2.7.5+ versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:59:46 2017 From: report at bugs.python.org (Christophe BAL) Date: Wed, 08 Nov 2017 12:59:46 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1510131320.97.0.213398074469.issue24132@psf.upfronthosting.co.za> Message-ID: <76f77557-9386-fde8-9bbe-c780fa2c7811@gmail.com> Christophe BAL added the comment: For the moment, you can take a look at this little script that acheives subclassing of Path : https://github.com/bc-python/mistool/blob/master/mistool/os_use.py (search for class Path). Le 08/11/2017 ? 09:55, Paul Moore a ?crit?: > Paul Moore added the comment: > > @elguavas the problem is, no-one has proposed a patch. There's not likely to be much movement on this until someone provides one. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:03:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 13:03:28 +0000 Subject: [issue31981] os.mkdirs does not exist on 2.7.5+ In-Reply-To: <1510145963.34.0.213398074469.issue31981@psf.upfronthosting.co.za> Message-ID: <1510146208.59.0.213398074469.issue31981@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, os.mkdirs does not exist. What is your issue Mikey? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:03:43 2017 From: report at bugs.python.org (Mikey D) Date: Wed, 08 Nov 2017 13:03:43 +0000 Subject: [issue31981] os.mkdirs does not exist on 2.7.5+ In-Reply-To: <1510145963.34.0.213398074469.issue31981@psf.upfronthosting.co.za> Message-ID: Mikey D added the comment: Forgot to add, python 2.7.5 python-2.7.5-48.el7.x86_64 (RHEL 7.3) On Wed, Nov 8, 2017 at 7:59 AM, Mikey D wrote: > > New submission from Mikey D : > > https://docs.python.org/2/library/os.html > > os.mkdirs('/tmp/folder') > AttributeError: 'module' object has no attribute 'mkdirs'' > > os.makedirs('/tmp/folder') > os.path.isdir('/tmp/folder') > True > > ---------- > assignee: docs at python > components: Documentation > messages: 305826 > nosy: Mikey D, docs at python > priority: normal > severity: normal > status: open > title: os.mkdirs does not exist on 2.7.5+ > versions: Python 2.7 > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:04:50 2017 From: report at bugs.python.org (Christophe BAL) Date: Wed, 08 Nov 2017 13:04:50 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <76f77557-9386-fde8-9bbe-c780fa2c7811@gmail.com> Message-ID: Christophe BAL added the comment: Mistyping : /search for class PPath/ with two P. Le 08/11/2017 ? 13:59, Christophe BAL a ?crit?: > Christophe BAL added the comment: > > For the moment, you can take a look at this little script that acheives > subclassing of Path : > https://github.com/bc-python/mistool/blob/master/mistool/os_use.py > (search for class Path). > > Le 08/11/2017 ? 09:55, Paul Moore a ?crit?: >> Paul Moore added the comment: >> >> @elguavas the problem is, no-one has proposed a patch. There's not likely to be much movement on this until someone provides one. >> >> ---------- >> >> _______________________________________ >> Python tracker >> >> _______________________________________ > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:05:35 2017 From: report at bugs.python.org (Mikey D) Date: Wed, 08 Nov 2017 13:05:35 +0000 Subject: [issue31981] os.mkdirs does not exist on 2.7.5+ In-Reply-To: <1510146208.59.0.213398074469.issue31981@psf.upfronthosting.co.za> Message-ID: Mikey D added the comment: Bah, I need more coffee... sorry! I though I saw "mkdirs" on that page. Please close. On Wed, Nov 8, 2017 at 8:03 AM, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Yes, os.mkdirs does not exist. What is your issue Mikey? > > ---------- > nosy: +serhiy.storchaka > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:06:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 13:06:59 +0000 Subject: [issue31981] os.mkdirs does not exist on 2.7.5+ In-Reply-To: <1510145963.34.0.213398074469.issue31981@psf.upfronthosting.co.za> Message-ID: <1510146419.93.0.213398074469.issue31981@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: No problem. ;) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:11:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 13:11:19 +0000 Subject: [issue31338] Use abort() for code we never expect to hit In-Reply-To: <1504552694.13.0.420212301121.issue31338@psf.upfronthosting.co.za> Message-ID: <1510146679.56.0.213398074469.issue31338@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8bf288e2c5330148e4bd07d9c2f1ccd05ced5a86 by Serhiy Storchaka (Petr Viktorin) in branch 'master': Docs: Mention that Py_UNREACHABLE was added in 3.7 (#4337) https://github.com/python/cpython/commit/8bf288e2c5330148e4bd07d9c2f1ccd05ced5a86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:12:29 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 13:12:29 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510146749.75.0.213398074469.issue31970@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > I've a few ideas how to add 0-copy support to protocols. I'd be interesting to hear about them. The main challenge IMHO is to find a way to allow a readinto()-like functionality. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:26:11 2017 From: report at bugs.python.org (Michael Evans) Date: Wed, 08 Nov 2017 13:26:11 +0000 Subject: [issue7938] makesetup interprets macros -DA=B as a Make variable definition In-Reply-To: <1266281072.48.0.268109023834.issue7938@psf.upfronthosting.co.za> Message-ID: <1510147571.97.0.213398074469.issue7938@psf.upfronthosting.co.za> Change by Michael Evans : ---------- pull_requests: +4292 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:26:44 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 08 Nov 2017 13:26:44 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510147604.53.0.213398074469.issue31975@psf.upfronthosting.co.za> R. David Murray added the comment: >From the linked email: > That way ad hoc scripts and the REPL will get warnings by default, > while zipapps and packages can avoid warnings by keeping their > __main__.py simple, and importing a CLI helper function from another > module. Entry point wrapper scripts will implicitly have the same > effect for installed packages. But a lot of non-ad-hoc scripts consist of a single __main__ module, and this will produce warnings in those. Weren't those kind of scripts one of the motivators for not enabling deprecation warnings by default? I seem to remember that's where they annoyed me most, but it has been a long time (thankfully). When we had warnings by default we got lots of complaints. Since we turned them off and turned them back on in unittest (and other test packages followed suit), we have not had complaints that I remember hearing before this thread, except about them not appearing at the REPL. Are there real-world (as opposed to theoretical) instances of the current policy causing real problems? ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:33:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 13:33:00 +0000 Subject: [issue31338] Use abort() for code we never expect to hit In-Reply-To: <1504552694.13.0.420212301121.issue31338@psf.upfronthosting.co.za> Message-ID: <1510147980.27.0.213398074469.issue31338@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4293 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:40:21 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 08 Nov 2017 13:40:21 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510148421.2.0.213398074469.issue31970@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: >> I've a few ideas how to add 0-copy support to protocols. > I'd be interesting to hear about them. The main challenge IMHO is to find a way to allow a readinto()-like functionality. Exposing sendfile() should be straightforward. I started implementing it years ago but I gave up pretty soon because asyncio had no solid test framework for testing an actual data transfer between two sockets and that basically represented a blocker. Basically back then all recv() / send() related tests were mocks. Not sure about the current situation but if that has changed I would be happy to contribute a PR (I was the one who contributed socket.sendfile()). As for a readinto()-like functionality: the only thing I'm aware of is splice() syscall but it's Linux only. It must be noted that also sendfile() is UNIX only. Windows achieve the same via TransmitFile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:42:29 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 13:42:29 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510148421.2.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <6d22f382-164f-4677-5bda-84e4fb2aa324@free.fr> Antoine Pitrou added the comment: Le 08/11/2017 ? 14:40, Giampaolo Rodola' a ?crit?: > Exposing sendfile() should be straightforward. sendfile() is not useful for data that's read from (or written to) memory. > As for a readinto()-like functionality: the only thing I'm aware of is splice() syscall but it's Linux only. This is not the abstraction level we are talking about. The problem is the Protocol API imposes copies by default (data_received() gives you an arbitrarily-sized bytes object that doesn't match how your protocol chunks data). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:44:04 2017 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 08 Nov 2017 13:44:04 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510148644.86.0.213398074469.issue31970@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: Sorry. It looks like I completely misunderstood. =) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:44:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 13:44:11 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510148651.63.0.213398074469.issue31970@psf.upfronthosting.co.za> STINNER Victor added the comment: > The problem is the Protocol API imposes copies by default (...) IMHO performance is a good motivation to enhance the asyncio API ;-) The tricky part is to keep the backward compatibility. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:44:56 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 08 Nov 2017 13:44:56 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510148696.5.0.213398074469.issue31970@psf.upfronthosting.co.za> Yury Selivanov added the comment: > IMHO performance is a good motivation to enhance the asyncio API ;-) The tricky part is to keep the backward compatibility. Let's stop the discussion in this ticket :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:45:41 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 13:45:41 +0000 Subject: [issue31970] asyncio debug mode is very slow In-Reply-To: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> Message-ID: <1510148741.43.0.213398074469.issue31970@psf.upfronthosting.co.za> Antoine Pitrou added the comment: In any case, I think this is better discussed on async-sig (where I already started a discussion thread some weeks ago -- see """APIs for high-bandwidth large I/O?"""). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:53:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 13:53:09 +0000 Subject: [issue31910] test_socket.test_create_connection() failed with EADDRNOTAVAIL (err 99) In-Reply-To: <1509469522.6.0.213398074469.issue31910@psf.upfronthosting.co.za> Message-ID: <1510149189.56.0.213398074469.issue31910@psf.upfronthosting.co.za> STINNER Victor added the comment: > I don't see this failure on Travis for a while now. Can this issue be closed? Since the failure occurred randomly, we cannot make sure that the bug is really fixed. Usually in this case, I close the issue, but reopen it if the bug comes back. So yes, I close the issue right now. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 08:56:47 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 08 Nov 2017 13:56:47 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510149407.79.0.213398074469.issue31978@psf.upfronthosting.co.za> Mark Dickinson added the comment: > There is one slight additional tweak in the patch: in the case of ndigits < 0, it returns an int, not a Fraction (see test_fractions modification to make it pass). This would be a backwards incompatible change, potentially breaking existing code, so we'd need to think carefully before making it. It's definitely not a "slight tweak" :-). I'd prefer that this change is not made at all: in general, it's not a great idea to have a return _type_ that changes depending on the _values_ of an argument (though as always, there are exceptions). The general rule is that two-argument `round` returns something of the same type as its first argument: I don't think there's a really compelling reason to change this for the Fraction type. So -1 on this change from me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:04:26 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 08 Nov 2017 14:04:26 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510149866.71.0.213398074469.issue31978@psf.upfronthosting.co.za> Mark Dickinson added the comment: On the main proposal: rounding an integer division to the nearest integer does seem to be a somewhat common need, and one that's not entirely trivial to code up and get right first time. (Unlike floor or ceiling of a quotient, which can be simply spelled as `n // d` or `-(-n // d)` respectively.) As Serhiy points out, it already turns up in multiple guises in the C source. The questions for me would be: 1. Is it actually a common enough need that we should add it? 2. If answer to (1) is yes, where should we add it? A method on the `int` type is one possible option, beyond the ones already mentioned. 3. There are actually three related operations here: (a) round a quotient to the nearest integer; (b) get the remainder of that rounding (the integer version of math.remainder), and (c) both (a) and (b) together. Which of those three should be implemented? (i.e., do we want the round-to-nearest analogs of div, mod, divmod, all three, or some nontrivial subset)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:06:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 14:06:26 +0000 Subject: [issue31338] Use abort() for code we never expect to hit In-Reply-To: <1504552694.13.0.420212301121.issue31338@psf.upfronthosting.co.za> Message-ID: <1510149986.22.0.213398074469.issue31338@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 54cc0c0789af8ff2396cb19095b7ab269f2bc06c by Victor Stinner in branch 'master': bpo-31338: C API intro: add missing versionadded (#4339) https://github.com/python/cpython/commit/54cc0c0789af8ff2396cb19095b7ab269f2bc06c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:08:12 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Wed, 08 Nov 2017 14:08:12 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510150092.26.0.213398074469.issue31978@psf.upfronthosting.co.za> Wolfgang Maier added the comment: ok, I agree with you that the returned type should not change with the value of an argument. I simply didn't think one vs two argument versions here, but in terms of three different code branches where one returns int already. Maybe 'slight' was the wrong wording - think of it as 'easy to revert' then :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:14:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 14:14:26 +0000 Subject: [issue27987] obmalloc's 8-byte alignment causes undefined behavior In-Reply-To: <1473207430.19.0.578630759123.issue27987@psf.upfronthosting.co.za> Message-ID: <1510150466.07.0.213398074469.issue27987@psf.upfronthosting.co.za> STINNER Victor added the comment: alignment.patch: + long double dummy; /* force worst-case alignment */ Would it be possible to use max_align_t mentioned by Stefan, at least when this type is available? What is the impact of the patch on objects size? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:16:57 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 14:16:57 +0000 Subject: [issue28997] test_readline.test_nonascii fails on Android In-Reply-To: <1481965369.72.0.409169776064.issue28997@psf.upfronthosting.co.za> Message-ID: <1510150617.81.0.213398074469.issue28997@psf.upfronthosting.co.za> Xavier de Gaye added the comment: PEP 538 is implemented now in the master branch. Closing this issue as out of date for the following reasons: a) PR 4334 adds locale coercion for Android to the implementation of PEP 538 (and test_nonascii succeeds with this PR). b) With the current implementation of PEP 538 and without PR 4334 (thus lacking locale coercion on Android), test_nonascii also does not fail on Android. Conclusion: Because of b) the reason that test_nonascii was failing is not a problem of environment variables since locale coercion is missing. The readline library does indeed look up the "LANG" and "LC_ALL" locale environment variables first and if one is set the library uses it to set LC_CTYPE [1]. But when none of these environment variables is found, then readline gets the locale by calling setlocale (LC_CTYPE, (char *)NULL). In the current implementation of PEP 538 test_nonascii succeeds now in b) because setlocale(LC_ALL, "C.UTF-8") is called now by Python upon starting up when __ANDROID__ is defined. [1] search for _rl_init_eightbit () and _rl_get_locale_var in git.savannah.gnu.org/cgit/readline.git/tree/nls.c ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:19:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 14:19:02 +0000 Subject: [issue31884] [Windows] subprocess set priority on windows In-Reply-To: <1510011900.11.0.213398074469.issue31884@psf.upfronthosting.co.za> Message-ID: <1510150742.8.0.213398074469.issue31884@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b5d9e0811463f3b28ba355a9e0bee7f1682854e3 by Victor Stinner (James) in branch 'master': bpo-31884 subprocess: add Windows constants for process priority (#4150) https://github.com/python/cpython/commit/b5d9e0811463f3b28ba355a9e0bee7f1682854e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:26:02 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 14:26:02 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1510151162.1.0.213398074469.issue28180@psf.upfronthosting.co.za> Xavier de Gaye added the comment: PR 4334 added: fix the implementation of PEP 538 on Android. The current implementation of PEP 538 fixes issue 28997 without the locale coercion for Android added by PR 4334, see msg305848. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:36:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 14:36:09 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510151769.78.0.213398074469.issue31978@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I thought about adding a public function in the math module when worked on one of that functions. But there are not many cases for it in the stdlib (datetime, fractions, decimal, and maybe it's all). I don't know whether there is a common enough need in third-party code. But there is a parallel with math.remainder(). If add this function, I would implement it in C and add in the math module. It already contains integer specific functions factorial() and gcd(). There was a proposition to add as_integer_ratio() (which will work with arbitrary rationals). All together they will create a small integer mathematics domain in the math module. Or can be extracted in a special module. Later it can be extended by adding functions for binomial coefficients and the number of permutations and generators of prime and Fibonacci numbers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 09:45:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 14:45:36 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510152336.23.0.213398074469.issue31980@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is also a GNU extension pow10(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:04:02 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 15:04:02 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510153442.93.0.213398074469.issue31934@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 0de92859caf25e65fc968d4bb68626e9ba21b851 by xdegaye in branch 'master': bpo-31934: Abort when building out of a not clean source tree (GH-4255) https://github.com/python/cpython/commit/0de92859caf25e65fc968d4bb68626e9ba21b851 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:08:59 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 15:08:59 +0000 Subject: [issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory In-Reply-To: <1509335619.79.0.213398074469.issue31896@psf.upfronthosting.co.za> Message-ID: <1510153739.65.0.213398074469.issue31896@psf.upfronthosting.co.za> Berker Peksag added the comment: I agree with Terry. Your code calls hi() in an infinite loop (why timespec is defined in hi()?), we don't know how clock_gettime(3) is implemented etc. (it should cleanup its own memory if it calls malloc()) etc. Please use python-list or StackOverflow for usage questions. ---------- nosy: +berker.peksag resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:15:20 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 15:15:20 +0000 Subject: [issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory In-Reply-To: <1509335619.79.0.213398074469.issue31896@psf.upfronthosting.co.za> Message-ID: <1510154120.55.0.213398074469.issue31896@psf.upfronthosting.co.za> Berker Peksag added the comment: See also issue 12998. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:17:58 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 15:17:58 +0000 Subject: [issue11253] Document ctypes.wintypes constants In-Reply-To: <1298182426.14.0.687578094658.issue11253@psf.upfronthosting.co.za> Message-ID: <1510154278.01.0.213398074469.issue11253@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- stage: -> needs patch title: autodocument first appearance of ctypes.wintypes constants -> Document ctypes.wintypes constants type: -> enhancement versions: +Python 3.6, Python 3.7 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:26:05 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 15:26:05 +0000 Subject: [issue31824] Missing default argument detail in documentation of StreamReaderWriter In-Reply-To: <1508455062.42.0.213398074469.issue31824@psf.upfronthosting.co.za> Message-ID: <1510154765.02.0.213398074469.issue31824@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the PR, Pablo. I think we can make the same change to StreamRecoder documentation too: https://docs.python.org/3/library/codecs.html#codecs.StreamRecoder ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:31:21 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 15:31:21 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510155081.53.0.213398074469.issue31934@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4294 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:39:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 15:39:17 +0000 Subject: [issue31884] [Windows] subprocess set priority on windows In-Reply-To: <1510011900.11.0.213398074469.issue31884@psf.upfronthosting.co.za> Message-ID: <1510155557.78.0.213398074469.issue31884@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:47:47 2017 From: report at bugs.python.org (Michael Hrivnak) Date: Wed, 08 Nov 2017 15:47:47 +0000 Subject: [issue14119] Ability to adjust queue size in Executors In-Reply-To: <1330129142.34.0.452763799677.issue14119@psf.upfronthosting.co.za> Message-ID: <1510156067.37.0.213398074469.issue14119@psf.upfronthosting.co.za> Michael Hrivnak added the comment: My project also has a use case for this, very similar to the others described. Here's what we want: with ThreadPoolExecutor(queue_size=500) as executor: for item in parse_a_long_list_of_work(somefile.xml): executor.submit(Job(item)) I do not want to parse the entire list of work items and load them into memory at once. It is preferable for the main thread running the above code to block on submit() when the queue size is above some threshold. It's a classic case of the producer and consumer operating at different speeds. In the past, a Queue object has been the way to connect such a producer and consumer. The various Executor classes do not provide an easy way to consume from a provided Queue object, so giving them that capability would be a reasonable alternative to having the submit() method block. ---------- nosy: +mhrivnak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:48:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 15:48:50 +0000 Subject: [issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces In-Reply-To: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> Message-ID: <1510156130.92.0.213398074469.issue31955@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 849482955f70eb1adc47a20dcbce3b4add47d864 by Victor Stinner (Mazay0) in branch '2.7': bpo-31955: Fix distutils CCompiler.set_executable() for Unicode (GH-4316) https://github.com/python/cpython/commit/849482955f70eb1adc47a20dcbce3b4add47d864 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:49:56 2017 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Nov 2017 15:49:56 +0000 Subject: [issue31901] atexit callbacks only called for current subinterpreter In-Reply-To: <1509378283.18.0.213398074469.issue31901@psf.upfronthosting.co.za> Message-ID: <1510156196.98.0.213398074469.issue31901@psf.upfronthosting.co.za> Petr Viktorin added the comment: When you destroy a subinterpreter before Py_Finalize is called, Python can't start calling its atexit callbacks ? they no longer have a subinterpreter to run in. Therefore I think callbacks for a particular subinterpreter should be called when (and only when) that subinterpreter is destroyed. Regardless of whether it's the main one or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:50:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 15:50:23 +0000 Subject: [issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces In-Reply-To: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> Message-ID: <1510156223.13.0.213398074469.issue31955@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you Dee Mee for your bug report and your bug fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:51:21 2017 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Nov 2017 15:51:21 +0000 Subject: [issue29179] Py_UNUSED is not documented In-Reply-To: <1483712936.43.0.521596791461.issue29179@psf.upfronthosting.co.za> Message-ID: <1510156281.04.0.213398074469.issue29179@psf.upfronthosting.co.za> Petr Viktorin added the comment: Since the macro has a public name and is used in the wild outside CPython, I'll go ahead and submit a pull request documenting it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:51:37 2017 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Nov 2017 15:51:37 +0000 Subject: [issue29179] Py_UNUSED is not documented In-Reply-To: <1483712936.43.0.521596791461.issue29179@psf.upfronthosting.co.za> Message-ID: <1510156297.09.0.213398074469.issue29179@psf.upfronthosting.co.za> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +4295 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:51:37 2017 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Nov 2017 15:51:37 +0000 Subject: [issue19976] Argument Clinic: generate second arg for METH_NOARGS In-Reply-To: <1386945786.12.0.418187279765.issue19976@psf.upfronthosting.co.za> Message-ID: <1510156297.19.0.00913614298617.issue19976@psf.upfronthosting.co.za> Change by Petr Viktorin : ---------- pull_requests: +4296 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:51:37 2017 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 08 Nov 2017 15:51:37 +0000 Subject: [issue26179] Python C-API "unused-parameter" warnings In-Reply-To: <1453471580.75.0.72814531944.issue26179@psf.upfronthosting.co.za> Message-ID: <1510156297.3.0.0136706687182.issue26179@psf.upfronthosting.co.za> Change by Petr Viktorin : ---------- pull_requests: +4297 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:52:14 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 15:52:14 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510156334.32.0.213398074469.issue31934@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4298 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:54:09 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 15:54:09 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510156449.63.0.213398074469.issue31934@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 0c4785bf39b4e86dea3a70b651e5d5db2f2cf017 by xdegaye in branch '3.6': [3.6] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (#4340) https://github.com/python/cpython/commit/0c4785bf39b4e86dea3a70b651e5d5db2f2cf017 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:56:19 2017 From: report at bugs.python.org (Robert) Date: Wed, 08 Nov 2017 15:56:19 +0000 Subject: [issue31879] Launcher fails on custom command starting with "python" In-Reply-To: <1509037268.43.0.213398074469.issue31879@psf.upfronthosting.co.za> Message-ID: <1510156579.53.0.213398074469.issue31879@psf.upfronthosting.co.za> Robert added the comment: I am still waiting for a OK (or denial) of my proposed Modification. I want to avoid that I start coding and when I am finished the PSF denies my PullRequest. Is anybody out there who can decide this or at least lead a discussion? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:57:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 15:57:35 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510156655.42.0.213398074469.issue31934@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested manually the commit 0c4785bf39b4e86dea3a70b651e5d5db2f2cf017 merged into Python 3.6: it works as expected ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:59:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 15:59:23 +0000 Subject: [issue26179] Python C-API "unused-parameter" warnings In-Reply-To: <1453471580.75.0.72814531944.issue26179@psf.upfronthosting.co.za> Message-ID: <1510156763.71.0.213398074469.issue26179@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2138163621196a186975796afb2b0a6aa335231d by Victor Stinner (Petr Viktorin) in branch 'master': bpo-29179: Document the Py_UNUSED macro (#4341) https://github.com/python/cpython/commit/2138163621196a186975796afb2b0a6aa335231d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:59:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 15:59:23 +0000 Subject: [issue29179] Py_UNUSED is not documented In-Reply-To: <1483712936.43.0.521596791461.issue29179@psf.upfronthosting.co.za> Message-ID: <1510156763.87.0.912454111764.issue29179@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2138163621196a186975796afb2b0a6aa335231d by Victor Stinner (Petr Viktorin) in branch 'master': bpo-29179: Document the Py_UNUSED macro (#4341) https://github.com/python/cpython/commit/2138163621196a186975796afb2b0a6aa335231d ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:59:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 15:59:24 +0000 Subject: [issue19976] Argument Clinic: generate second arg for METH_NOARGS In-Reply-To: <1386945786.12.0.418187279765.issue19976@psf.upfronthosting.co.za> Message-ID: <1510156764.0.0.00913614298617.issue19976@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 2138163621196a186975796afb2b0a6aa335231d by Victor Stinner (Petr Viktorin) in branch 'master': bpo-29179: Document the Py_UNUSED macro (#4341) https://github.com/python/cpython/commit/2138163621196a186975796afb2b0a6aa335231d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 10:59:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 15:59:50 +0000 Subject: [issue29179] Py_UNUSED is not documented In-Reply-To: <1483712936.43.0.521596791461.issue29179@psf.upfronthosting.co.za> Message-ID: <1510156790.61.0.213398074469.issue29179@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:00:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 16:00:04 +0000 Subject: [issue29179] Py_UNUSED is not documented In-Reply-To: <1483712936.43.0.521596791461.issue29179@psf.upfronthosting.co.za> Message-ID: <1510156804.15.0.213398074469.issue29179@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you Petr for your PR! I merged it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:00:46 2017 From: report at bugs.python.org (Brian Kuhl) Date: Wed, 08 Nov 2017 16:00:46 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1510156846.54.0.213398074469.issue31904@psf.upfronthosting.co.za> Brian Kuhl added the comment: I'm quite happy to take on maintainer role for Python on VxWorks, so I think we can get that one solved. Enabling a build bot for cross compile of propitiatory OS presents a number of legal licensing issues that outside my control. And I'll discuss it internally at Wind River. However I think it is in line with where our customers want us to go, so well worth pursuing. I'll keep this pull request active and up to date, till the broader issues you have raised can be resolved. I'll post a proposal on the mailing list after I consulted within Wind River. Many thanks for your interest and support. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:01:07 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 16:01:07 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510156867.6.0.213398074469.issue31934@psf.upfronthosting.co.za> Xavier de Gaye added the comment: I also tested the 2.7 and 3.6 PRs before submitting them. Thanks for testing and for your reviews Victor :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:02:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 16:02:27 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510156947.64.0.213398074469.issue31934@psf.upfronthosting.co.za> STINNER Victor added the comment: > I also tested the 2.7 and 3.6 PRs before submitting them. Oh, I don't trust anyone, including myself :-) Since there is no automated, I chose to ("double") test manually your PRs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:02:31 2017 From: report at bugs.python.org (Paul Moore) Date: Wed, 08 Nov 2017 16:02:31 +0000 Subject: [issue31879] Launcher fails on custom command starting with "python" In-Reply-To: <1509037268.43.0.213398074469.issue31879@psf.upfronthosting.co.za> Message-ID: <1510156951.95.0.213398074469.issue31879@psf.upfronthosting.co.za> Paul Moore added the comment: Personally I don't see the value (in general, I don't see much use for the whole custom command idea - making the launcher into a generalised shebang processor was never really a core feature). But I'm not going to say no if others find it useful. Call me -0 on the proposal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:03:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 16:03:33 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1510157013.67.0.213398074469.issue21423@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What is the best way to silence logging in subprocesses? ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:05:47 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 16:05:47 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510157147.27.0.213398074469.issue31934@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Oh I understand, there is no practical way to test that feature except manually. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:10:19 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 08 Nov 2017 16:10:19 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510157419.9.0.213398074469.issue31934@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1 by xdegaye in branch '2.7': [2.7] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (#4342) https://github.com/python/cpython/commit/fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:10:51 2017 From: report at bugs.python.org (Sasha Kacanski) Date: Wed, 08 Nov 2017 16:10:51 +0000 Subject: =?utf-8?q?=5Bissue31982=5D_8=2E3=2E_collections_=E2=80=94_Container_datat?= =?utf-8?q?ypes?= Message-ID: <1510157451.94.0.213398074469.issue31982@psf.upfronthosting.co.za> New submission from Sasha Kacanski : Hi, In ChainMap example c = ChainMap() # Create root context d = c.new_child() # Create nested child context e = c.new_child() # Child of c, independent from d e.maps[0] # Current context dictionary -- like Python's locals() e.maps[-1] # Root context -- like Python's globals() e.parents # Enclosing context chain -- like Python's nonlocals d['x'] # Get first key in the chain of contexts d['x'] = 1 # Set value in current context d['x'] - will raise key does not exist error so simple fix is to flip last two lines... I know, possibly anal but look love Python and would like to help new folks to not get confused if they play with example in cPython shell... --best ---------- assignee: docs at python components: Documentation messages: 305876 nosy: Sasha Kacanski, docs at python priority: normal severity: normal status: open title: 8.3. collections ? Container datatypes versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:17:02 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 16:17:02 +0000 Subject: [issue21790] Change blocksize in http.client to the value of resource.getpagesize In-Reply-To: <1403019624.98.0.809499942301.issue21790@psf.upfronthosting.co.za> Message-ID: <1510157822.1.0.213398074469.issue21790@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:23:25 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 08 Nov 2017 16:23:25 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1510158205.91.0.213398074469.issue31904@psf.upfronthosting.co.za> R. David Murray added the comment: I'm not sure what licensing issues you are talking about, but setting up a buildbot shouldn't normally run into any. As long as you have a license to the run the OS, the fact that you are using it to receive jobs from our build master and run them shouldn't be a problem. You can keep the whole thing behind a firewall in a DMZ: the slave makes outbound connections to pick up its jobs. On the other hand, the logistics of setting up a cross compile buildbot might be a bit complex, I've never done that. You might need specific support from our build master. In any case, the python-buldbots mailing list is the place to talk if you want to/can pursue this. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:24:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 16:24:41 +0000 Subject: [issue31983] Officially add Py_SETREF and Py_XSETREF Message-ID: <1510158281.4.0.213398074469.issue31983@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Private macros Py_SETREF and Py_XSETREF were introduced in 3.6 and backported to all maintained versions for fixing bugs (see issue20440 and issue26200). They are helpful and used not only for the primary purpose, but also for simplifying the code. Their names don't start from underscore because I planned to make them public and didn't want massive renaming and backporting conflicts. Now I think it is a time to add them officially to the stable C API. ---------- assignee: docs at python components: Documentation, Interpreter Core messages: 305878 nosy: docs at python, serhiy.storchaka priority: normal severity: normal status: open title: Officially add Py_SETREF and Py_XSETREF type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:25:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 16:25:17 +0000 Subject: [issue31983] Officially add Py_SETREF and Py_XSETREF In-Reply-To: <1510158281.4.0.213398074469.issue31983@psf.upfronthosting.co.za> Message-ID: <1510158317.53.0.213398074469.issue31983@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:25:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 16:25:49 +0000 Subject: [issue31934] Failure to build out of source from a not clean source In-Reply-To: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> Message-ID: <1510158349.02.0.213398074469.issue31934@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:37:53 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 08 Nov 2017 16:37:53 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510159073.54.0.213398074469.issue31978@psf.upfronthosting.co.za> Mark Dickinson added the comment: > I don't know whether there is a common enough need in third-party code. Me neither. But one thing to look for would be people doing `round(a / b)`, which is almost certainly giving the wrong result in corner cases. OTOH, even those uses may well be in code that doesn't actually care about getting the wrong result in those corner cases, or that doesn't exercise the corner cases. (E.g., if both `a` and `b` are not-too-large integers, `round(a / b)` is still "safe" in that it will give the same result as if a non-lossy integer division is used.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:55:53 2017 From: report at bugs.python.org (Robert) Date: Wed, 08 Nov 2017 16:55:53 +0000 Subject: [issue31879] Launcher fails on custom command starting with "python" In-Reply-To: <1509037268.43.0.213398074469.issue31879@psf.upfronthosting.co.za> Message-ID: <1510160153.48.0.213398074469.issue31879@psf.upfronthosting.co.za> Robert added the comment: Of course I do not know the initial ideas/philosophy of the launcher. But the current implementation supports these custom commands (for whatever reason). Thus I'd say they should work "properly". My view of "properly" is that the implementation matches the documentation which is currently definitely not the case. Of course one could add an extra passus to the docs like: "custom command names must not start with 'python'". But why include a special case (and make it less intuitive) without need? By the way: We have a use case for this custom commands and I could image others had, too. Or how came that they were included? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:59:43 2017 From: report at bugs.python.org (Ronan Lamy) Date: Wed, 08 Nov 2017 16:59:43 +0000 Subject: [issue31984] startswith and endswith leak implementation details Message-ID: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> New submission from Ronan Lamy : One would think that u.startswith(v, start, end) would be equivalent to u[start: end].startswith(v), but one would be wrong. And the same goes for endswith(). Here is the actual spec (for bytes, but str and bytearray are the same), in the form of passing pytest+hypothesis tests: from hypothesis import strategies as st, given def adjust_indices(u, start, end): if end < 0: end = max(end + len(u), 0) else: end = min(end, len(u)) if start < 0: start = max(start + len(u), 0) return start, end @given(st.binary(), st.binary(), st.integers(), st.integers()) def test_startswith_3(u, v, start, end): if v: expected = u[start:end].startswith(v) else: start0, end0 = adjust_indices(u, start, end) expected = start0 <= len(u) and start0 <= end0 assert u.startswith(v, start, end) is expected @given(st.binary(), st.binary(), st.integers(), st.integers()) def test_endswith_3(u, v, start, end): if v: expected = u[start:end].endswith(v) else: start0, end0 = adjust_indices(u, start, end) expected = start0 <= len(u) and start0 <= end0 assert u.endswith(v, start, end) is expected Fixing this behaviour to work in the "obvious" way would be simple: just add a check for len(v) == 0 and always return True in that case. ---------- messages: 305881 nosy: Ronan.Lamy priority: normal severity: normal status: open title: startswith and endswith leak implementation details type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:18:28 2017 From: report at bugs.python.org (Tom Floyer) Date: Wed, 08 Nov 2017 17:18:28 +0000 Subject: [issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols In-Reply-To: <1508340179.09.0.213398074469.issue31810@psf.upfronthosting.co.za> Message-ID: <1510161508.87.0.213398074469.issue31810@psf.upfronthosting.co.za> Change by Tom Floyer : ---------- pull_requests: +4299 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:20:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 17:20:36 +0000 Subject: [issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols In-Reply-To: <1508340179.09.0.213398074469.issue31810@psf.upfronthosting.co.za> Message-ID: <1510161636.05.0.213398074469.issue31810@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: -4299 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:28:14 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 08 Nov 2017 17:28:14 +0000 Subject: [issue31984] startswith and endswith leak implementation details In-Reply-To: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> Message-ID: <1510162094.14.0.213398074469.issue31984@psf.upfronthosting.co.za> R. David Murray added the comment: Can you please give examples of what you think the problem is? ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:31:28 2017 From: report at bugs.python.org (Tom Floyer) Date: Wed, 08 Nov 2017 17:31:28 +0000 Subject: [issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols In-Reply-To: <1508340179.09.0.213398074469.issue31810@psf.upfronthosting.co.za> Message-ID: <1510162288.55.0.213398074469.issue31810@psf.upfronthosting.co.za> Change by Tom Floyer : ---------- pull_requests: +4300 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:31:33 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 08 Nov 2017 17:31:33 +0000 Subject: [issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols In-Reply-To: <1508340179.09.0.213398074469.issue31810@psf.upfronthosting.co.za> Message-ID: <1510162293.76.0.213398074469.issue31810@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset bf9d317626eebcf79bd0756b4dd43df82d5cc186 by Yury Selivanov (Tom Floyer) in branch 'master': bpo-31810: added missing keywords to docs. (#4140) https://github.com/python/cpython/commit/bf9d317626eebcf79bd0756b4dd43df82d5cc186 ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:31:51 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 08 Nov 2017 17:31:51 +0000 Subject: [issue31811] async and await missing from keyword list in lexical analysis doc In-Reply-To: <1508340723.02.0.213398074469.issue31811@psf.upfronthosting.co.za> Message-ID: <1510162311.72.0.213398074469.issue31811@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:39:30 2017 From: report at bugs.python.org (Matthew Barnett) Date: Wed, 08 Nov 2017 17:39:30 +0000 Subject: [issue31969] re.groups() is not checking the arguments In-Reply-To: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> Message-ID: <1510162770.21.0.213398074469.issue31969@psf.upfronthosting.co.za> Matthew Barnett added the comment: @Narendra: The argument, if provided, is merely a default. Checking whether it _could_ be used would not be straightforward, and raising an exception if it would never be used would have little, if any, benefit. It's not a bug, and it's not worth changing. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:43:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 17:43:42 +0000 Subject: [issue31811] async and await missing from keyword list in lexical analysis doc In-Reply-To: <1508340723.02.0.213398074469.issue31811@psf.upfronthosting.co.za> Message-ID: <1510163022.65.0.213398074469.issue31811@psf.upfronthosting.co.za> STINNER Victor added the comment: The final commit uses the wrong bpo number: New changeset bf9d317626eebcf79bd0756b4dd43df82d5cc186 by Yury Selivanov (Tom Floyer) in branch 'master': bpo-31810: added missing keywords to docs. (#4140) https://github.com/python/cpython/commit/bf9d317626eebcf79bd0756b4dd43df82d5cc186 ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:54:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 17:54:02 +0000 Subject: [issue31969] re.groups() is not checking the arguments In-Reply-To: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> Message-ID: <1510163642.6.0.213398074469.issue31969@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 12:57:39 2017 From: report at bugs.python.org (Ronan Lamy) Date: Wed, 08 Nov 2017 17:57:39 +0000 Subject: [issue31984] startswith and endswith leak implementation details In-Reply-To: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> Message-ID: <1510163859.6.0.213398074469.issue31984@psf.upfronthosting.co.za> Ronan Lamy added the comment: The problem is the complexity of the actual behaviour of these methods. It is impossible to get it right without looking at the source (at least, it was for me), and I doubt any ordinary user can correctly make use of the v='' behaviour, or predict what the return value will be in all cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 13:05:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 18:05:54 +0000 Subject: [issue31984] startswith and endswith leak implementation details In-Reply-To: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> Message-ID: <1510164354.91.0.213398074469.issue31984@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See issue24284. `s1.startswith(s2, start, end)` for non-negative indices and non-tuple s2 is equivalent to expressions start + len(s2) <= end and s2[start: start + len(s2)] == s2 or s1.find(s2, start, end) == start ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 13:06:31 2017 From: report at bugs.python.org (Stefan Krah) Date: Wed, 08 Nov 2017 18:06:31 +0000 Subject: [issue31983] Officially add Py_SETREF and Py_XSETREF In-Reply-To: <1510158281.4.0.213398074469.issue31983@psf.upfronthosting.co.za> Message-ID: <1510164391.64.0.213398074469.issue31983@psf.upfronthosting.co.za> Stefan Krah added the comment: Just adding +1. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 13:45:36 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 08 Nov 2017 18:45:36 +0000 Subject: [issue31984] startswith and endswith leak implementation details In-Reply-To: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> Message-ID: <1510166736.38.0.213398074469.issue31984@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 13:48:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 18:48:02 +0000 Subject: [issue31983] Officially add Py_SETREF and Py_XSETREF In-Reply-To: <1510158281.4.0.213398074469.issue31983@psf.upfronthosting.co.za> Message-ID: <1510166882.48.0.213398074469.issue31983@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Does anyone want to propose a patch? This is mainly a documentation issue. Needed documenting Py_SETREF and Py_XSETREF in Doc/c-api/refcounting.rst, adding entries in Doc/whatsnew/3.7.rst, and "Misc/NEWS.d/next/C API/", and updating a guard in Include/object.h. ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 14:17:44 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 08 Nov 2017 19:17:44 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510168664.63.0.213398074469.issue31980@psf.upfronthosting.co.za> Mark Dickinson added the comment: I'd say not. If people want `log` base 2 or 10, they should use the appropriate functions. One potential numeric issue here is maintaining monotonicity. If we swap out libm `log` calls for `log2` calls for some inputs, we not only make the code more complicated, but also risk breaking monotonicity. So -1 from me on the special casing. I'd be very happy with exposing exp2 in the math library, but that's a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 14:17:49 2017 From: report at bugs.python.org (Ronan Lamy) Date: Wed, 08 Nov 2017 19:17:49 +0000 Subject: [issue31984] startswith and endswith leak implementation details In-Reply-To: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> Message-ID: <1510168669.24.0.213398074469.issue31984@psf.upfronthosting.co.za> Ronan Lamy added the comment: Ah, thanks, I noticed the discrepancy between unicode and str in 2.7, but wondered when it was fixed. I guess I'm arguing that it was resolved in the wrong direction, then. Now, your first expression is wrong, even after fixing the obvious typo. The correct version is: start + len(s2) <= min(len(s1), end) and s1[start: start + len(s2)] == s2 If the person who implemented the behaviour can get it right, who will? ;-) The second expression is correct, but I'll argue that it shows that find() also suffers from a discrepancy between its basic one-argument form and the extended ones. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 14:22:30 2017 From: report at bugs.python.org (Colin McCabe) Date: Wed, 08 Nov 2017 19:22:30 +0000 Subject: [issue15631] Python 3.3/3.4 installation issue on OpenSUSE lib/lib64 folders In-Reply-To: <1344794304.26.0.478120841355.issue15631@psf.upfronthosting.co.za> Message-ID: <1510168950.02.0.213398074469.issue15631@psf.upfronthosting.co.za> Colin McCabe added the comment: When installing Python 3.6.3 from source on openSUSE Leap 42.2, this bug still occurs. Python cannot find the readline module, until you symlink $prefix/lib/python3.6/lib-dynload to $prefix/lib64/python3.6/lib-dynload. ---------- nosy: +cmccabe versions: +Python 3.6 -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 14:33:50 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Wed, 08 Nov 2017 19:33:50 +0000 Subject: [issue10598] Add test for curses haskey replacement In-Reply-To: <1291234378.99.0.641306252968.issue10598@psf.upfronthosting.co.za> Message-ID: <1510169630.28.0.213398074469.issue10598@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Is this bug still valid or we can just close it? ---------- nosy: +CuriousLearner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 14:48:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 19:48:52 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510170532.78.0.213398074469.issue31980@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is no two-argument libm `log`. Two-argument log(x, base) is implemented as log(x) / log(base). log(base) adds an error. >>> import math >>> math.log(2**31, 2) 31.000000000000004 Since two-argument log() doesn't correspond a C function, I think we are free to use more precise implementation. We could correct also two-argument logarithms with other bases. For example: def prec_log(x, y): a = math.log(x, y) return a + math.log(x / math.pow(y, a), y) >>> math.log(3**20, 3) 19.999999999999996 >>> prec_log(3**20, 3) 20.0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 14:55:40 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 08 Nov 2017 19:55:40 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510170940.17.0.213398074469.issue31980@psf.upfronthosting.co.za> Mark Dickinson added the comment: > There is no two-argument libm `log`. Two-argument log(x, base) is implemented as log(x) / log(base). Yep. But log(x) / log(base) is monotonic in x for a fixed base, assuming that the libm log is. My objections still hold. :-) Please let's keep the math.log implementation simple (or at least, no more complicated than it already is). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 14:58:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 19:58:50 +0000 Subject: [issue26182] Deprecation warnings for the future async and await keywords in Python 3.6 In-Reply-To: <1453489566.62.0.462459552998.issue26182@psf.upfronthosting.co.za> Message-ID: <1510171130.52.0.213398074469.issue26182@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: -970 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:01:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 20:01:52 +0000 Subject: [issue31973] Incomplete DeprecationWarning for async/await keywords In-Reply-To: <1510096549.91.0.213398074469.issue31973@psf.upfronthosting.co.za> Message-ID: <1510171312.16.0.213398074469.issue31973@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:07:09 2017 From: report at bugs.python.org (Graham Dumpleton) Date: Wed, 08 Nov 2017 20:07:09 +0000 Subject: [issue31901] atexit callbacks only called for current subinterpreter In-Reply-To: <1509378283.18.0.213398074469.issue31901@psf.upfronthosting.co.za> Message-ID: <1510171629.82.0.213398074469.issue31901@psf.upfronthosting.co.za> Graham Dumpleton added the comment: FWIW, that atexit callbacks were not called for sub interpreters ever was a pain point for mod_wsgi. What mod_wsgi does is override the destruction sequence so that it will first go through each sub interpreter when and shutdown threading explicitly, then call atexit handlers. When that is done, only then will it destroy the sub interpreter and the main interpreter. I have noted this previously in discussion associated with: https://bugs.python.org/issue6531 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:08:20 2017 From: report at bugs.python.org (Serhiy Int) Date: Wed, 08 Nov 2017 20:08:20 +0000 Subject: [issue6412] Titlecase as defined in Unicode Case Mappings not followed In-Reply-To: <1246662889.32.0.498842923824.issue6412@psf.upfronthosting.co.za> Message-ID: <1510171700.12.0.213398074469.issue6412@psf.upfronthosting.co.za> Change by Serhiy Int : ---------- nosy: +Serhiy Int _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:09:22 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 20:09:22 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1510171762.69.0.213398074469.issue11063@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 9a10ff4deb2494e22bc0dbea3e3a6f9e8354d995 by Berker Peksag in branch 'master': bpo-11063: Add a configure check for uuid_generate_time_safe (GH-4287) https://github.com/python/cpython/commit/9a10ff4deb2494e22bc0dbea3e3a6f9e8354d995 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:10:08 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 20:10:08 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1510171808.18.0.213398074469.issue11063@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:12:18 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 08 Nov 2017 20:12:18 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510171938.35.0.213398074469.issue31980@psf.upfronthosting.co.za> Mark Dickinson added the comment: Also, prec_log would need significant work to make it handle all the corner cases sensibly. For example: Python 3.6.3 (default, Oct 5 2017, 23:34:28) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import math >>> def prec_log(x, y): ... a = math.log(x, y) ... return a + math.log(x / math.pow(y, a), y) ... >>> math.log(3**1000, 3) 999.9999999999999 >>> prec_log(3**1000, 3) Traceback (most recent call last): File "", line 1, in File "", line 3, in prec_log OverflowError: math range error ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:17:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 20:17:57 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510172277.19.0.213398074469.issue31980@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Okay. I think that log(x, base) still will be monotonic, because log(x, nextafter(2, +INF)) <= log2(x) <= log(x, nextafter(2, -INF)). I know about this limitation of prec_log(). It was just an example. Maybe Tim know more robust and efficient algorithms. Exposing exp2 in the math library would be less interesting, because we don't add errors in pow() and just call libm pow(). The latter can call exp2() internally if it provides more accuracy than exp(log(x)*y). ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:28:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 20:28:10 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1510172890.76.0.213398074469.issue11063@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Does this check work? I tried similar checks with other functions and they were falsely passed because calling an undeclared function is not an error in C. The reliable check of the existence of the uuid_generate_time_safe function is: void *x = uuid_generate_time_safe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:37:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 20:37:48 +0000 Subject: [issue31984] startswith and endswith leak implementation details In-Reply-To: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> Message-ID: <1510173468.85.0.213398074469.issue31984@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: For the justification of the find() behavior see msg243668. But the largest argument for this behavior is that find() have it for a long time. Changing it will break existing code that depends on it. This argument is weaker in the case of startwith() and endwith() because their behavior for bytes and Unicode was inconsistent. But the consistency with find() plays a role. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:38:27 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 08 Nov 2017 20:38:27 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510173507.21.0.213398074469.issue31980@psf.upfronthosting.co.za> Raymond Hettinger added the comment: -1 from me as well. Various root finding and minimization algorithms rely (perhaps) incorrect on the functions transitioning smoothly across the inputs. Inside the code for math.log10() and math.log2(), it would be reasonable to use the C99 functions rather than having us compute them indirectly. But the math.log(x, b) function should be left alone IMO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:41:45 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 08 Nov 2017 20:41:45 +0000 Subject: =?utf-8?q?=5Bissue31982=5D_8=2E3=2E_collections_=E2=80=94_Container_datat?= =?utf-8?q?ypes?= In-Reply-To: <1510157451.94.0.213398074469.issue31982@psf.upfronthosting.co.za> Message-ID: <1510173705.12.0.213398074469.issue31982@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I will flip the two because there is not downside. However, the table of wasn't intended to be a sequential example (that's why there is no data or display of result). Instead, it was just meant to be table of typing-this-does-that. ---------- assignee: docs at python -> rhettinger nosy: +rhettinger priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:48:16 2017 From: report at bugs.python.org (Stefan Krah) Date: Wed, 08 Nov 2017 20:48:16 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1510172890.76.0.213398074469.issue11063@psf.upfronthosting.co.za> Message-ID: <20171108204805.GA21987@bytereef.org> Stefan Krah added the comment: On Wed, Nov 08, 2017 at 08:28:10PM +0000, Serhiy Storchaka wrote: > Does this check work? I tried similar checks with other functions and they were falsely passed because calling an undeclared function is not an error in C. Not here. If I replace uuid_generate_time_safe with a non-existing function name, it is still found: checking for uuid_generate_time_unsafe... yes The originally suggested AC_CHECK_LIB macro however works here in both cases. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 15:50:58 2017 From: report at bugs.python.org (Sasha Kacanski) Date: Wed, 08 Nov 2017 20:50:58 +0000 Subject: =?utf-8?q?=5Bissue31982=5D_8=2E3=2E_collections_=E2=80=94_Container_datat?= =?utf-8?q?ypes?= In-Reply-To: <1510173705.12.0.213398074469.issue31982@psf.upfronthosting.co.za> Message-ID: Sasha Kacanski added the comment: Agree, and I know. On Nov 8, 2017 3:41 PM, "Raymond Hettinger" wrote: > > Raymond Hettinger added the comment: > > I will flip the two because there is not downside. However, the table of > wasn't intended to be a sequential example (that's why there is no data or > display of result). Instead, it was just meant to be table of > typing-this-does-that. > > ---------- > assignee: docs at python -> rhettinger > nosy: +rhettinger > priority: normal -> low > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:12:58 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Wed, 08 Nov 2017 21:12:58 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge In-Reply-To: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> Message-ID: <1510175578.42.0.213398074469.issue31963@psf.upfronthosting.co.za> Neil Schemenauer added the comment: The current "master" branch seems to be building successfully on "AMD64 Debian PGO 3.x". Can we close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:18:05 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 21:18:05 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1510175885.73.0.213398074469.issue11063@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +4301 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:20:49 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 08 Nov 2017 21:20:49 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510176049.09.0.213398074469.issue31980@psf.upfronthosting.co.za> Mark Dickinson added the comment: > Exposing exp2 in the math library would be less interesting I disagree: a libm exp2 is likely to be significantly accurate than pow(2.0, x). The latter is unlikely to be special-cased by the libm pow. > The latter can call exp2() internally if it provides more accuracy than exp(log(x)*y). It would be a very poor pow implementation that used exp(log(x)*y). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:21:26 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 08 Nov 2017 21:21:26 +0000 Subject: [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) In-Reply-To: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> Message-ID: <1510176086.62.0.213398074469.issue31980@psf.upfronthosting.co.za> Mark Dickinson added the comment: > significantly accurate significantly *more* accurate ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:22:51 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 21:22:51 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1510176171.39.0.213398074469.issue11063@psf.upfronthosting.co.za> Berker Peksag added the comment: It worked for me on OS X (returns no) and Linux (returns yes after I installed uuid-dev) but I didn't test it on both systems at the same. Travis CI also returned 'no': https://travis-ci.org/python/cpython/jobs/299285001 In any case, Serhiy's suggestion is better than mine so I've opened PR 4343. And yes, I'm beginning to regret my decision on not using AC_CHECK_LIB :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:27:39 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 08 Nov 2017 21:27:39 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge In-Reply-To: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> Message-ID: <1510176459.85.0.213398074469.issue31963@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- resolution: -> works for me stage: -> resolved status: open -> closed type: performance -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:29:49 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 21:29:49 +0000 Subject: [issue31977] threading.Condition can not work with threading.Semaphore In-Reply-To: <1510117925.72.0.213398074469.issue31977@psf.upfronthosting.co.za> Message-ID: <1510176589.06.0.213398074469.issue31977@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Why do you want Condition to work with a Semaphore? What would be achieved? A Semaphore is not a lock, it's an other kind of concurrency primitive. I don't think there's any point in detailing it any futrher. ---------- nosy: +pitrou, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:32:38 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 21:32:38 +0000 Subject: [issue31976] Segfault when closing BufferedWriter from a different thread In-Reply-To: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> Message-ID: <1510176758.91.0.213398074469.issue31976@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +benjamin.peterson, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:32:58 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 08 Nov 2017 21:32:58 +0000 Subject: [issue31976] Segfault when closing BufferedWriter from a different thread In-Reply-To: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> Message-ID: <1510176778.56.0.213398074469.issue31976@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:43:17 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 08 Nov 2017 21:43:17 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1510177397.01.0.213398074469.issue11063@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 0e163d2ced28ade8ff526e8c663faf03c2c0b168 by Berker Peksag in branch 'master': bpo-11063: Use more reliable way to check if uuid function exists (GH-4343) https://github.com/python/cpython/commit/0e163d2ced28ade8ff526e8c663faf03c2c0b168 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:56:36 2017 From: report at bugs.python.org (Brian Curtin) Date: Wed, 08 Nov 2017 21:56:36 +0000 Subject: [issue31985] Deprecate/remove aifc.openfp Message-ID: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> New submission from Brian Curtin : Since 1993, aifc.openfp has simply pointed to aifc.open as a matter of backwards compatibility. See https://github.com/python/cpython/commit/7bc817d5ba917528e8bd07ec461c635291e7b06a for the exact change. aifc.openfp is both undocumented and untested, and in looking at doc coverage I decided it's better to deprecate it since it's silently been there for 25 years. ---------- assignee: brian.curtin components: Library (Lib) messages: 305912 nosy: brian.curtin priority: normal severity: normal stage: needs patch status: open title: Deprecate/remove aifc.openfp type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:05:04 2017 From: report at bugs.python.org (Brian Curtin) Date: Wed, 08 Nov 2017 22:05:04 +0000 Subject: [issue31985] Deprecate/remove aifc.openfp In-Reply-To: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Message-ID: <1510178704.47.0.213398074469.issue31985@psf.upfronthosting.co.za> Change by Brian Curtin : ---------- keywords: +patch pull_requests: +4302 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:20:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 22:20:43 +0000 Subject: [issue31986] [2.7] test_urllib2net.test_sites_no_connection_close() randomly fails on Python 2.7 Message-ID: <1510179643.18.0.213398074469.issue31986@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/78/builds/20 ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/test/test_urllib2net.py", line 193, in test_sites_no_connection_close req = urllib2.urlopen(URL) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 435, in open response = meth(req, response) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 473, in error return self._call_chain(*args) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 407, in _call_chain result = func(*args) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 503: Service Unavailable ---------- components: Tests messages: 305913 nosy: haypo priority: normal severity: normal status: open title: [2.7] test_urllib2net.test_sites_no_connection_close() randomly fails on Python 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:31:58 2017 From: report at bugs.python.org (Marc Le Roy) Date: Wed, 08 Nov 2017 22:31:58 +0000 Subject: [issue31987] Ctypes Packing Bitfields Incorrectly - GCC both Linux and Cygwin Message-ID: <1510180318.31.0.213398074469.issue31987@psf.upfronthosting.co.za> New submission from Marc Le Roy : The structure : typedef struct __attribute__ ((packed)) { unsigned int F0:24; unsigned int F3:24; unsigned int F6:24; unsigned int F9:24; } StructF_T; is mapped as expected by GCC under both Linux and Cygwin. As expected, the memory layout seen by the C program is : 0x111111222222333333444444 Using this definition : class StructF(ctypes.BigEndianStructure): _pack_ = 1 _fields_ = [ ('F0', ctypes.c_uint, 24), ('F3', ctypes.c_uint, 24), ('F6', ctypes.c_uint, 24), ('F9', ctypes.c_uint, 24), ] The memory layout seen from Python is not consistent : 0x11111100222222003333330044444400 It seems that the pack option is ignored by ctypes in such a case. I found the same problem using both ctypes.BigEndianStructure and ctypes.LittleEndianStructure ---------- components: ctypes messages: 305914 nosy: mleroy003 priority: normal severity: normal status: open title: Ctypes Packing Bitfields Incorrectly - GCC both Linux and Cygwin versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:32:41 2017 From: report at bugs.python.org (Jonas H.) Date: Wed, 08 Nov 2017 22:32:41 +0000 Subject: [issue31526] Allow setting timestamp in gzip-compressed tarfiles In-Reply-To: <1505884271.66.0.629388109764.issue31526@psf.upfronthosting.co.za> Message-ID: <1510180361.11.0.213398074469.issue31526@psf.upfronthosting.co.za> Jonas H. added the comment: This affects me too. ---------- nosy: +jonash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:40:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 22:40:29 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1510180829.73.0.213398074469.issue30855@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, test_use() still fails (commit fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1) on AMD64 Windows8.1 Refleaks 2.7. I reopen the issue. http://buildbot.python.org/all/#/builders/33/builds/21 ====================================================================== ERROR: test_use (test_tkinter.test_widgets.ToplevelTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_tkinter\test_widgets.py", line 93, in test_use widget2 = self.create(use=wid) File "D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_tkinter\test_widgets.py", line 67, in create return tkinter.Toplevel(self.root, **kwargs) File "D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\Tkinter.py", line 2138, in __init__ BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra) File "D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\Tkinter.py", line 2095, in __init__ (widgetName, self._w) + extra + self._options(cnf)) TclError: integer value too large to represent ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:41:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 22:41:24 +0000 Subject: [issue31985] Deprecate/remove aifc.openfp In-Reply-To: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Message-ID: <1510180884.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Don't forget about wave and sunau. You can use a common test for all three modules. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:49:07 2017 From: report at bugs.python.org (Stephen M. Gava) Date: Wed, 08 Nov 2017 22:49:07 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1510181347.9.0.213398074469.issue24132@psf.upfronthosting.co.za> Stephen M. Gava added the comment: @paul.moore is the original contributor mia? i seem to remember pathlib as once being marked 'provisional', i think it should have stayed that way until this problem was resolved. easy to say i know ;) when i don't have a patch. @projetmbc yes i found various work-arounds on the web and decided to not use any of them. really i feel this should be fixed as it's a jarring inconsistency with naturally expected behaviour for a class in python. so i added my report to this as a topic bump because i don't think this should be forgotten about and in case anyone might come up with an idea how to fix it. ---------- versions: +Python 3.6 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:54:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 22:54:44 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1510181684.9.0.213398074469.issue30855@psf.upfronthosting.co.za> STINNER Victor added the comment: > Hum, test_use() still fails (commit fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1) on AMD64 Windows8.1 Refleaks 2.7. I reopen the issue. I'm not 100% sure that this build really tested the commit fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1. We had an issue on the buildbot, the 2.7 builder was disabled. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 18:00:55 2017 From: report at bugs.python.org (Big Stone) Date: Wed, 08 Nov 2017 23:00:55 +0000 Subject: [issue30952] [Windows] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1510182055.34.0.213398074469.issue30952@psf.upfronthosting.co.za> Big Stone added the comment: I know you can do create_function(): https://raw.githubusercontent.com/stonebig/sqlite_bro/master/docs/sqlite_bro.GIF But the performance is crappy at best because of string conversion in the API. If you want SQlite because of its performance, recent version starts to do multi-threading, and/or fear to leave other langages a stupid sizeable performance advantage, then you may perhaps don't leave the situation as it is. Didn't Victor spoke about the need to 2X CPython performance recently, for it to stay in the game ? Look at latest Intel cpu shooting for quadcore, Iphone 8 being 6 cores, latest stable nodejs gaining a big speed bump, ... etc ... etc... and the need of efficiency to keep the planet cool enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 18:10:20 2017 From: report at bugs.python.org (Mark Lawrence) Date: Wed, 08 Nov 2017 23:10:20 +0000 Subject: [issue10598] Add test for curses haskey replacement In-Reply-To: <1291234378.99.0.641306252968.issue10598@psf.upfronthosting.co.za> Message-ID: <1510182620.18.0.213398074469.issue10598@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 18:20:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 23:20:21 +0000 Subject: [issue31988] Saving bytearray to binary plist file doesn't work Message-ID: <1510183221.28.0.213398074469.issue31988@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : >>> import plistlib >>> plistlib.dumps(bytearray(), fmt=plistlib.FMT_BINARY) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/plistlib.py", line 962, in dumps dump(value, fp, fmt=fmt, skipkeys=skipkeys, sort_keys=sort_keys) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 955, in dump writer.write(value) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 703, in write self._flatten(value) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 741, in _flatten if (type(value), value) in self._objtable: TypeError: unhashable type: 'bytearray' ---------- components: Library (Lib) messages: 305921 nosy: ronaldoussoren, serhiy.storchaka priority: normal severity: normal status: open title: Saving bytearray to binary plist file doesn't work type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 18:55:48 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 08 Nov 2017 23:55:48 +0000 Subject: [issue31984] startswith and endswith leak implementation details In-Reply-To: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> Message-ID: <1510185348.65.0.213398074469.issue31984@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Thank you for the bug report Ronan, but I'm afraid that I have no idea what you think the problematic behaviour is. I'm not going to spend the time installing the third-party hypothesis module, and learning how to use it, just to decipher your "actual spec". Where did this spec come from? The documentation is fairly sparse: https://docs.python.org/3/library/stdtypes.html#str.startswith so I'm not sure where your spec comes from. The title of this ticket is uninformative: what implementation details are being leaked? Saying "The problem is the complexity of the actual behaviour of these methods." explains nothing. Which actual behaviour? Please provide simple examples that contrast expected behaviour from actual behaviour, and justification for the expected behaviour. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 19:03:12 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 09 Nov 2017 00:03:12 +0000 Subject: [issue31984] startswith and endswith leak implementation details In-Reply-To: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> Message-ID: <1510185792.77.0.213398074469.issue31984@psf.upfronthosting.co.za> Steven D'Aprano added the comment: I don't have Python 3.7 available to me, but in 3.5 the behaviour of u.startswith(v) with an empty v seems consistent to me: py> "alpha".startswith("", 20, 30) True py> "alpha"[20:30].startswith("") True py> "".startswith("", 20, 30) True py> ""[20:30].startswith("") True So I can't see any inconsistency that might be fixed by always returning True in the case v="", as that appears to already be the case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 19:18:21 2017 From: report at bugs.python.org (Brian Curtin) Date: Thu, 09 Nov 2017 00:18:21 +0000 Subject: [issue31985] Deprecate aifc.openfp In-Reply-To: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Message-ID: <1510186701.55.0.213398074469.issue31985@psf.upfronthosting.co.za> Brian Curtin added the comment: i was going to do them as separate bugs and PRs per module, but if one is fine then i can do that. Updating the title as well since nothing is beings removed (was originally going to suggest skipping to removal but won?t do that). ---------- title: Deprecate/remove aifc.openfp -> Deprecate aifc.openfp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 19:28:50 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 09 Nov 2017 00:28:50 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510187330.06.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: Yes - stuff just flat out breaks when Linux distros upgrade Python. The response is "Yeah, python-dev decided years ago that they don't care about that". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 19:31:07 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 09 Nov 2017 00:31:07 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510187467.19.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: (And yes, I could push this as a downstream patch to Fedora's Python packages instead - if enough folks insist that springing breaking changes on people without warning them that those changes coming is fine, that's what I'll do) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 19:35:26 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 09 Nov 2017 00:35:26 +0000 Subject: [issue31901] atexit callbacks should be run at subinterpreter shutdown In-Reply-To: <1509378283.18.0.213398074469.issue31901@psf.upfronthosting.co.za> Message-ID: <1510187726.52.0.213398074469.issue31901@psf.upfronthosting.co.za> Nick Coghlan added the comment: Ah, I see - yeah, that makes a lot of sense. I've retitled the issue to make it clearer that the problem is where the responsibility for calling atexit functions lives - currently it's in Py_Finalize, but really it should be inside the interpreter object's own teardown code. ---------- components: +Interpreter Core -Extension Modules title: atexit callbacks only called for current subinterpreter -> atexit callbacks should be run at subinterpreter shutdown _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 19:36:45 2017 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 09 Nov 2017 00:36:45 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510187805.61.0.213398074469.issue31975@psf.upfronthosting.co.za> Guido van Rossum added the comment: > The response is "Yeah, python-dev decided years ago that they don't care about that". That's a little harsh don't you think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 20:08:43 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 09 Nov 2017 01:08:43 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510189723.14.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: Sure, it's harsh, but it's still what it looks like from the outside - there's no PEP explaining the reasoning for putting the interests of app developers that don't want to take responsibility for their user experience ahead of those of regular Python developers, and if you try to suggest that "Hey, maybe this was a mistake", you get a deluge of people yelling at you "No, we can't possibly revisit that decision". And this is with *me* suggesting it - let alone if someone that wasn't already an experienced core dev bringing it up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 21:19:21 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 09 Nov 2017 02:19:21 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510193961.75.0.213398074469.issue31975@psf.upfronthosting.co.za> R. David Murray added the comment: It was never about putting the interests of the app developers first, it was about putting the interests of the users first: not being pestered by seeing deprecation warnings they can't do anything about. So yeah, maybe a PEP explaining the logic would be helpful, since there seems to be disagreement about what the logic is. I'm not in a position to write it, though. Maybe it would indeed be worth it to push this change into Fedora/RedHat and see what the response is before doing it in core? Kind of the same principle as putting something on pypi before putting in the stdlib. Also note that *no matter what you do* adding keywords is painful. That's why we try really really hard not to do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 21:28:49 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Nov 2017 02:28:49 +0000 Subject: [issue28791] update sqlite to latest version before beta 1 In-Reply-To: <1480017928.89.0.263397799958.issue28791@psf.upfronthosting.co.za> Message-ID: <1510194529.86.0.213398074469.issue28791@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 for backporting. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 22:58:32 2017 From: report at bugs.python.org (Caleb Hattingh) Date: Thu, 09 Nov 2017 03:58:32 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1510199912.42.0.213398074469.issue30487@psf.upfronthosting.co.za> Caleb Hattingh added the comment: I messed up the PR through a failed rebase (trying to rebase my PR on top of upstream). I closed the PR as a result. I have now fixed up my feature branch, but I have not resubmitted the PR. Since the PR was left alone for many months, I'm ok with leaving things as is, and close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 23:11:26 2017 From: report at bugs.python.org (Mark Diekhans) Date: Thu, 09 Nov 2017 04:11:26 +0000 Subject: [issue31989] setattr on a property gives a very unhelpful exception Message-ID: <1510200686.12.0.213398074469.issue31989@psf.upfronthosting.co.za> New submission from Mark Diekhans : done a setattr on a property gives a very unhelpful error message AttributeError: can't set attribute it neither indicates the name of the attribute that failed or the cause. an error such as "can't set property attribute: the_attr_name" would be far more helpful. ---------- messages: 305933 nosy: diekhans priority: normal severity: normal status: open title: setattr on a property gives a very unhelpful exception type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 23:49:15 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Nov 2017 04:49:15 +0000 Subject: [issue31989] setattr on a property gives a very unhelpful exception In-Reply-To: <1510200686.12.0.213398074469.issue31989@psf.upfronthosting.co.za> Message-ID: <1510202955.22.0.213398074469.issue31989@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Usually, all the necessary information is present in the previous line of the traceback: >>> a.volume = 10 Traceback (most recent call last): File "", line 1, in a.volume = 10 AttributeError: can't set attribute I don't seem to recall anyone else having problems with this error message. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 23:56:24 2017 From: report at bugs.python.org (Mark Diekhans) Date: Thu, 09 Nov 2017 04:56:24 +0000 Subject: [issue31989] setattr on a property gives a very unhelpful exception In-Reply-To: <1510202955.22.0.213398074469.issue31989@psf.upfronthosting.co.za> Message-ID: <23043.57331.964256.94948@gargle.gargle.HOWL> Mark Diekhans added the comment: The trackback is not helpful if the attribute name is in a variable. It also doesn't explain why the error occurred. While I would not rate this as a high priority, I don't see an argument for having uninformative error messages. Raymond Hettinger writes: > > Raymond Hettinger added the comment: > > Usually, all the necessary information is present in the previous line of the traceback: > > >>> a.volume = 10 > Traceback (most recent call last): > File "", line 1, in > a.volume = 10 > AttributeError: can't set attribute > > I don't seem to recall anyone else having problems with this error message. > > ---------- > nosy: +rhettinger > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 00:04:05 2017 From: report at bugs.python.org (Zachary Ware) Date: Thu, 09 Nov 2017 05:04:05 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1510203845.23.0.213398074469.issue30487@psf.upfronthosting.co.za> Zachary Ware added the comment: You should be able to force-push your branch (`git push -f origin auto-venv-docbuilder`, or replace `origin` with the correct remote name) to fix the existing PR. Sorry I haven't gotten back to this previously; time to do a review and remembering that the PR exists have not coincided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 00:15:32 2017 From: report at bugs.python.org (Zachary Ware) Date: Thu, 09 Nov 2017 05:15:32 +0000 Subject: [issue30952] [Windows] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1510204532.04.0.213398074469.issue30952@psf.upfronthosting.co.za> Zachary Ware added the comment: I, for one, don't have the time to work on this, especially since I don't regularly use the sqlite3 module. If this is something you want, submit a PR. Lack of skill is not a legitimate reason not to do so; the devguide provides instructions on the mechanics of submitting a patch and any questions you have along the way can be asked here, on the core-mentorship mailing list, or on the #python-dev channel on freenode. It's much easier to justify 2 minutes to answer a question, even if that 2 minutes happens 10 times, than 2 hours to add a feature that I won't use and will be expected to maintain :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 01:12:00 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Nov 2017 06:12:00 +0000 Subject: [issue31977] threading.Condition can not work with threading.Semaphore In-Reply-To: <1510117925.72.0.213398074469.issue31977@psf.upfronthosting.co.za> Message-ID: <1510207920.0.0.213398074469.issue31977@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I concur with Antoine and don't think there is a real issue here to be solved. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 01:25:35 2017 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 09 Nov 2017 06:25:35 +0000 Subject: [issue27987] obmalloc's 8-byte alignment causes undefined behavior In-Reply-To: <1510150466.07.0.213398074469.issue27987@psf.upfronthosting.co.za> Message-ID: <1510208731.1358535.1166622400.70650663@webmail.messagingengine.com> Benjamin Peterson added the comment: On Wed, Nov 8, 2017, at 06:14, STINNER Victor wrote: > > STINNER Victor added the comment: > > alignment.patch: + long double dummy; /* force worst-case alignment > */ > > Would it be possible to use max_align_t mentioned by Stefan, at least > when this type is available? Yes, that would be the correct thing to do. I was looking for the quick hack. > > What is the impact of the patch on objects size? On 64-bit platforms, I believe it wastes a word for GC objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 02:04:06 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 09 Nov 2017 07:04:06 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510211046.25.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: I'm currently still too annoyed to write a PEP about this - it would probably come out in tone like the state of the unicode literals PEP before I edited it. I just don't understand how this logic is hard: *our* primary responsibility for deprecation warnings is to ensure that Python developers (including us) can alert other *Python developers* as to upcoming API breakages. Yet somehow this primary goal has been subordinated to "app developers are bad at managing whether or not deprecation warnings are shown to their users, so it's OK that we ended up breaking deprecation warnings in general for everyone that doesn't run a test suite, even though we didn't realise that's what we were doing at the time we made the decision". And I'll repeat: I'm entirely happy with the "revert the change for __main__ only" compromise, since it covers all the cases I care about. If folks are also running third party single file scripts, and those scripts are emitting warnings, and they really hate seeing those warnings, then they can put "PYTHONWARNINGS=ignore::DeprecationWarning" into their shell profile. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 03:21:08 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 09 Nov 2017 08:21:08 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510215668.8.0.213398074469.issue31978@psf.upfronthosting.co.za> Wolfgang Maier added the comment: > (E.g., if both `a` and `b` are not-too-large integers, `round(a / b)` is still "safe" in that it will give the same result as if a non-lossy integer division is used.) Well, it does not take particularly large a and b to break round's tie-breaking through rounding-to-even though: >>> for x in range(1,501): for y in range(1,501): if round(x/y, 1) != float(round(F(x,y), 1)): print(x,y) 1 20 2 40 3 20 3 60 4 80 5 100 6 40 6 120 7 20 7 140 8 160 9 20 9 60 9 180 10 200 11 220 12 80 12 240 13 20 13 260 14 40 14 280 15 100 15 300 16 320 17 340 18 40 18 120 18 360 19 20 19 380 20 400 21 20 21 60 21 140 21 420 22 440 23 20 23 460 24 160 24 480 25 500 ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 03:22:48 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 09 Nov 2017 08:22:48 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510215768.8.0.213398074469.issue31978@psf.upfronthosting.co.za> Wolfgang Maier added the comment: >>> for x in range(1,501): for y in range(1,501): if round(x/y, 1) != float(round(F(x,y), 1)): print(x,y) where F is fractions.Fraction Sorry! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 03:36:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 08:36:19 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510216579.84.0.213398074469.issue31978@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Mark said about round(x/y), not round(x/y, 1). Do you propose to add a three argument divide_and_round(x, y, ndigits)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 03:45:06 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 09 Nov 2017 08:45:06 +0000 Subject: [issue31978] make it simpler to round fractions In-Reply-To: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> Message-ID: <1510217106.33.0.213398074469.issue31978@psf.upfronthosting.co.za> Wolfgang Maier added the comment: That, of course, wasn't my original suggestion, but since Mark started discussing other possible forms this could take, like round-to-nearest analogs of mod and divmod, I thought maybe it's worth pointing out this aspect and, yes, maybe the three-argument form would be nice. Essentially, this would be fractions.Fraction.__round__ then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 03:58:20 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 08:58:20 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510217900.17.0.213398074469.issue31975@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > And I'll repeat: I'm entirely happy with the "revert the change for __main__ only" compromise, since it covers all the cases I care about. And that's what I'm unhappy with. We should either revert the change for all code, or not revert it at all. Such a middle ground is just a wishy-washy decision-by-committee compromise. It will satisfy almost nobody (neither the people who don't want to see deprecation warnings, nor the ones who don't to miss them), is more complicated to remember, and will most certainly have to be revisited in a couple of years. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 03:59:31 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Nov 2017 08:59:31 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1510217971.88.0.213398074469.issue31937@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: docs at python -> fdrake nosy: +fdrake _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 04:00:53 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 09 Nov 2017 09:00:53 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1510218053.69.0.213398074469.issue31937@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Recommend closing this and leaving it for StackOverflow. I really don't want to further garbage-up the glossary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 04:56:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 09:56:53 +0000 Subject: [issue30339] test_multiprocessing_main_handling: "RuntimeError: Timed out waiting for results" on x86 Windows7 3.x In-Reply-To: <1494463699.01.0.364437710045.issue30339@psf.upfronthosting.co.za> Message-ID: <1510221413.64.0.213398074469.issue30339@psf.upfronthosting.co.za> STINNER Victor added the comment: Yet another similar bug on "x86 Windows7 3.x": http://buildbot.python.org/all/#/builders/58/builds/134 ====================================================================== FAIL: test_ipython_workaround (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_multiprocessing_main_handling.py", line 179, in test_ipython_workaround self._check_script(script_name) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_multiprocessing_main_handling.py", line 156, in _check_script rc, out, err = assert_python_ok(*run_args, __isolated=False) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\script_helper.py", line 151, in assert_python_ok return _assert_python(True, *args, **env_vars) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\script_helper.py", line 137, in _assert_python res.fail(cmd_line) File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\script_helper.py", line 79, in fail err)) AssertionError: Process return code is 1 command line: ['D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\PCbuild\\win32\\python_d.exe', '-X', 'faulthandler', '-E', 'd:\\temp\\tmponku8v2m\\ipython.py', 'spawn'] stdout: --- --- stderr: --- Traceback (most recent call last): File "d:\temp\tmponku8v2m\ipython.py", line 23, in raise RuntimeError("Timed out waiting for results") RuntimeError: Timed out waiting for results --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 04:59:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 09:59:17 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510221557.29.0.213398074469.issue31893@psf.upfronthosting.co.za> STINNER Victor added the comment: Test fails on x86 Tiger 2.7: http://buildbot.python.org/all/#/builders/59/builds/17 ====================================================================== FAIL: test_create_event (test.test_kqueue.TestKQueue) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/db3l/buildarea/2.7.bolen-tiger/build/Lib/test/test_kqueue.py", line 39, in test_create_event self.assertRaises(TypeError, cmp, ev, None) AssertionError: TypeError not raised ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:02:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 10:02:20 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510221740.08.0.213398074469.issue31893@psf.upfronthosting.co.za> STINNER Victor added the comment: Same failure on x86-64 El Capitan 2.7/ http://buildbot.python.org/all/#builders/98/builds/17 ====================================================================== FAIL: test_create_event (test.test_kqueue.TestKQueue) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.7.billenstein-elcapitan/build/Lib/test/test_kqueue.py", line 39, in test_create_event self.assertRaises(TypeError, cmp, ev, None) AssertionError: TypeError not raised ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:03:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 10:03:27 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510221807.9.0.213398074469.issue31893@psf.upfronthosting.co.za> STINNER Victor added the comment: On also AMD64 FreeBSD 10.x Shared 2.7: http://buildbot.python.org/all/#/builders/97/builds/17 ====================================================================== FAIL: test_create_event (test.test_kqueue.TestKQueue) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/test/test_kqueue.py", line 39, in test_create_event self.assertRaises(TypeError, cmp, ev, None) AssertionError: TypeError not raised ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:04:29 2017 From: report at bugs.python.org (Albert Zeyer) Date: Thu, 09 Nov 2017 10:04:29 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack()) In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1510221869.07.0.213398074469.issue10049@psf.upfronthosting.co.za> Albert Zeyer added the comment: Note that this indeed seems confusing. I just found this thread by search for a null context manager. Because I found that in TensorFlow they introduced _NullContextmanager in their code and I wondered that this is not provided by the Python stdlib. ---------- nosy: +Albert.Zeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:13:48 2017 From: report at bugs.python.org (=?utf-8?b?SHJ2b2plIE5pa8WhacSH?=) Date: Thu, 09 Nov 2017 10:13:48 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack()) In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1510222428.03.0.213398074469.issue10049@psf.upfronthosting.co.za> Hrvoje Nik?i? added the comment: For what it's worth, we are still using our own null context manager function in critical code. We tend to avoid contextlib.ExitStack() for two reasons: 1) it is not immediately clear from looking at the code what ExitStack() means. (Unlike the "contextmanager" decorator, ExitStack is unfamiliar to most developers.) 2) ExitStack's __init__ and __exit__ incur a non-negligible overhead compared to a true do-nothing context manager. It doesn't surprise me that projects like Tensor Flow introduce their own versions of this decorator. Having said that, I can also understand why it wasn't added. It is certainly possible to live without it, and ExitStack() is a more than acceptable replacement for casual use. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:14:19 2017 From: report at bugs.python.org (Werner Smidt) Date: Thu, 09 Nov 2017 10:14:19 +0000 Subject: [issue31990] Pickling deadlocks in thread with python -m Message-ID: <1510222459.1.0.213398074469.issue31990@psf.upfronthosting.co.za> New submission from Werner Smidt : Hi there I recently stumbled on an interesting behaviour. I won't call it an error, because I think it's a mistake I made. BACKGROUND: I want to spawn threads that handle pickled data. This works really well. However, I would like to execute the python script in question as a module, i.e. python -m mymodule. This is merely for aesthetic purposes. The attached script has two functions: 1. Pickle/unpickle an instance of a `namedtuple` 2. Pickle/unpickle a string Each of these functions are run in the main thread and then in subsequent spawned threads. If I run the script attached with "python testqueuepickle.py", it works fine. I get the data pickled/unpickled in the respective functions and nothing deadlocks and everything is printed to screen. If, however, I run it with the "-m" option (python -m testqueuepickle.py) , the program deadlocks at the pickling of the "namedtuple" instance. The pickling/unpickling of the string appears to be unaffected. Programming practices aside, what do you think could be the cause of this? ---------- files: testqueuepickle.py messages: 305953 nosy: Werner Smidt priority: normal severity: normal status: open title: Pickling deadlocks in thread with python -m type: behavior versions: Python 2.7 Added file: https://bugs.python.org/file47255/testqueuepickle.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:25:13 2017 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 09 Nov 2017 10:25:13 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1510223113.74.0.213398074469.issue21423@psf.upfronthosting.co.za> Vinay Sajip added the comment: > What is the best way to silence logging in subprocesses? Are you referring to the output shown in msg305601? If it's caused by logging statements, the best way would be either to pipe stderr to /dev/null or to change the logging to use sys.stdout (sys.stderr is just the default) and then pipe stdout to /dev/null. I hope I haven't misunderstood your question, but I fear I may have. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:47:33 2017 From: report at bugs.python.org (Caleb Hattingh) Date: Thu, 09 Nov 2017 10:47:33 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1510224453.93.0.213398074469.issue30487@psf.upfronthosting.co.za> Change by Caleb Hattingh : ---------- keywords: +patch pull_requests: +4303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:50:19 2017 From: report at bugs.python.org (Caleb Hattingh) Date: Thu, 09 Nov 2017 10:50:19 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1510224619.59.0.213398074469.issue30487@psf.upfronthosting.co.za> Caleb Hattingh added the comment: No worries. I've made a new PR 4346. The old one was unsalvagable I'm afraid. Too many other people got added to the notifications list as a result of my incorrect rebase. The new one is fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:56:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 10:56:36 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1510224996.51.0.213398074469.issue21423@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm not well experienced with logging, but if we can change the logging in subprocesses, I think we could change it to not output messages at all. It would be better to save logging messages in subprocesses and check that expected logging messages are emitted in the main process. There is assertLogs(), but it works only with logging in the same process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 06:39:58 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 09 Nov 2017 11:39:58 +0000 Subject: [issue31987] Ctypes Packing Bitfields Incorrectly - GCC both Linux and Cygwin In-Reply-To: <1510180318.31.0.213398074469.issue31987@psf.upfronthosting.co.za> Message-ID: <1510227598.9.0.213398074469.issue31987@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for your report. I believe this is a duplicate of issue 29753. ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Ctypes Packing Bitfields Incorrectly - Linux type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 06:44:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 11:44:17 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510227857.45.0.213398074469.issue31893@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Oh, I didn't test on 2.7. The old code contradicted the common comparison behavior. It allowed comparing select.kevent with other objects only for equality as for identity. `kevent == other` always returned False even if `other == kevent` returned True. `kevent < other` raised a TypeError. The new code uses the default behavior. `kevent == other` returns the same as `other == kevent` (False by default if types are not comparable, but may return True if `other.__eq__(kevent)` returns True). `kevent < other` returns the same as `other > kevent`. E.g. raises a TypeError by default in Python 3. But in Python 2 all objects are comparable by default, and this breaks a test which expects that select.kevent is not comparable. There are two ways to fix this: 1. Make select.kevent non-comparable again. This contradicts the default behavior and I don't know reasons why it should be non-comparable, but this was an existing behavior. 2. Remove the tests or change them to test that comparing select.kevent with other object doesn't raise an error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 07:35:20 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 12:35:20 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1510230920.48.0.213398074469.issue21423@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +4304 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 07:35:46 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 12:35:46 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1510230946.93.0.213398074469.issue21423@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Serhiy, I think I have found a way to deal with the logging output: https://github.com/python/cpython/pull/4347 ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 07:38:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 12:38:25 +0000 Subject: [issue31265] Remove doubly-linked list from C OrderedDict In-Reply-To: <1503483859.09.0.0369181186057.issue31265@psf.upfronthosting.co.za> Message-ID: <1510231105.39.0.213398074469.issue31265@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 08:48:14 2017 From: report at bugs.python.org (Thomas Moreau) Date: Thu, 09 Nov 2017 13:48:14 +0000 Subject: [issue31991] Race condition in wait with timeout for multiprocessing.Event Message-ID: <1510235293.99.0.213398074469.issue31991@psf.upfronthosting.co.za> New submission from Thomas Moreau : If the methods `set` and `clear` of `multiprocessing.Event` are called one after another, while a `multiprocessing.Process` calls `wait`, the `Event` does not match the documented behavior (https://docs.python.org/3.7/library/threading.html#threading.Event.wait) and the call to wait can return `False` even though the call to wait did not timeout (This happens both with `timeout=30` or `timeout=None`). Attached is a script reproducing this issue. The documentation should either be changed or the behavior should be updated. ---------- components: Library (Lib) files: concurrent_event.py messages: 305960 nosy: tomMoral priority: normal severity: normal status: open title: Race condition in wait with timeout for multiprocessing.Event type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47256/concurrent_event.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 09:20:41 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 09 Nov 2017 14:20:41 +0000 Subject: [issue31989] setattr on a property gives a very unhelpful exception In-Reply-To: <1510200686.12.0.213398074469.issue31989@psf.upfronthosting.co.za> Message-ID: <1510237241.52.0.213398074469.issue31989@psf.upfronthosting.co.za> R. David Murray added the comment: This is a duplicate of #27794. ---------- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> setattr a read-only property; the AttributeError should show the attribute that failed versions: +Python 3.8 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 09:29:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 14:29:32 +0000 Subject: [issue27794] setattr a read-only property; the AttributeError should show the attribute that failed In-Reply-To: <1471528639.63.0.0729109170448.issue27794@psf.upfronthosting.co.za> Message-ID: <1510237772.04.0.213398074469.issue27794@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Interpreter Core nosy: +ncoghlan stage: -> needs patch versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 09:33:45 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 14:33:45 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1510238025.04.0.213398074469.issue21423@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 0a2ff23fe6efb1653d655ac19d0a4e1629fd8d95 by Antoine Pitrou in branch 'master': Silence error output in test_concurrent_futures (bpo-21423) (#4347) https://github.com/python/cpython/commit/0a2ff23fe6efb1653d655ac19d0a4e1629fd8d95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 09:36:46 2017 From: report at bugs.python.org (Erik Bray) Date: Thu, 09 Nov 2017 14:36:46 +0000 Subject: [issue28441] Change sys.executable to include executable suffix In-Reply-To: <1476452085.73.0.180033377767.issue28441@psf.upfronthosting.co.za> Message-ID: <1510238206.56.0.213398074469.issue28441@psf.upfronthosting.co.za> Change by Erik Bray : ---------- pull_requests: +4305 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 09:51:39 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 14:51:39 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1510239099.47.0.213398074469.issue21423@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 09:59:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 14:59:25 +0000 Subject: [issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument In-Reply-To: <1399160288.58.0.274862722075.issue21423@psf.upfronthosting.co.za> Message-ID: <1510239565.87.0.213398074469.issue21423@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Antoine! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 10:09:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 15:09:28 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510240168.34.0.213398074469.issue31893@psf.upfronthosting.co.za> STINNER Victor added the comment: kqueue_event_richcompare() returns NotImplemented if other is not an event: if (!kqueue_event_Check(o)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } So I don't understand why tests started to fail with the commit ce51890894be46f8f9d991a1d0ea1455fc41ccdc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 10:36:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 15:36:05 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510241765.52.0.213398074469.issue31893@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Because the default behavior is different in Python 2 and Python 3. In Python 3 this is a TypeError. In Python 2 all objects are comparable by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 10:39:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 15:39:04 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510241944.76.0.213398074469.issue31893@psf.upfronthosting.co.za> STINNER Victor added the comment: I suggest to fix the tests, the code looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 10:53:31 2017 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 09 Nov 2017 15:53:31 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510242811.97.0.213398074469.issue31975@psf.upfronthosting.co.za> Guido van Rossum added the comment: > Such a middle ground is just a wishy-washy decision-by-committee compromise. Fine, but since *I* won't tolerate these warnings on for everything, this is the best you can do. If you don't like it, the status quo wins. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 10:55:12 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 15:55:12 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510242912.77.0.213398074469.issue31975@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Then let the statu quo wins! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 10:55:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 15:55:54 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510242954.45.0.213398074469.issue31893@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4306 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 11:00:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 16:00:41 +0000 Subject: [issue31927] Fix compiling the socket module on NetBSD 8 and other issues In-Reply-To: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> Message-ID: <1510243241.35.0.213398074469.issue31927@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d3187158c09cf899e9849f335bdff10594209167 by Serhiy Storchaka in branch 'master': bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (#4235) https://github.com/python/cpython/commit/d3187158c09cf899e9849f335bdff10594209167 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 11:24:13 2017 From: report at bugs.python.org (Richard Neumann) Date: Thu, 09 Nov 2017 16:24:13 +0000 Subject: [issue31992] Make iteration over dict_items yield namedtuples Message-ID: <1510244653.28.0.213398074469.issue31992@psf.upfronthosting.co.za> New submission from Richard Neumann : Currently, iterating over dict_items will yield plain tuples, where the first item will be the key and the second item will be the respective value. This has some disadvantages when e.g. sorting dict items by value and key: def sort_by_value_len(dictionary): return sorted(dictionary.items(), key=lambda item: (len(item[1]), item[0])) I find this index accessing extremely unelegant and unnecessarily hard to read. If dict_items would instead yield namedtuples like DictItem = namedtuple('DictItem', ('key', 'value')) this would make constructs like def sort_by_value_len(dictionary): return sorted(dictionary.items(), key=lambda item: (len(item.value), item.key)) possible and increase code clarity a lot. Also, namedtuples mimic the behaviour of plain tuples regarding unpacking and index accessing, so that backward-compatipility should exist. ---------- components: Library (Lib) messages: 305970 nosy: Richard Neumann priority: normal severity: normal status: open title: Make iteration over dict_items yield namedtuples type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 11:42:29 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 16:42:29 +0000 Subject: [issue31977] threading.Condition can not work with threading.Semaphore In-Reply-To: <1510117925.72.0.213398074469.issue31977@psf.upfronthosting.co.za> Message-ID: <1510245749.94.0.213398074469.issue31977@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 11:46:58 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 09 Nov 2017 16:46:58 +0000 Subject: [issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android In-Reply-To: <1479715975.06.0.930254771903.issue28759@psf.upfronthosting.co.za> Message-ID: <1510246018.96.0.213398074469.issue28759@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4307 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:18:30 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:18:30 +0000 Subject: [issue31893] Issues with kqueue In-Reply-To: <1509277481.96.0.213398074469.issue31893@psf.upfronthosting.co.za> Message-ID: <1510247910.17.0.213398074469.issue31893@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Fixed by PR 4349 (changeset 15e14538f90cabc87473a489316fdb81af76cfb2). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:22:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:22:26 +0000 Subject: [issue31992] Make iteration over dict_items yield namedtuples In-Reply-To: <1510244653.28.0.213398074469.issue31992@psf.upfronthosting.co.za> Message-ID: <1510248146.62.0.213398074469.issue31992@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Oh, no! Tuples is one of the most charming features of Python. Use tuples, folk! ---------- nosy: +rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:23:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:23:51 +0000 Subject: [issue31927] Fix compiling the socket module on NetBSD 8 and other issues In-Reply-To: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> Message-ID: <1510248231.54.0.213398074469.issue31927@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4308 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:42:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:42:57 +0000 Subject: [issue31778] ast.literal_eval supports non-literals in Python 3 In-Reply-To: <1507847478.46.0.213398074469.issue31778@psf.upfronthosting.co.za> Message-ID: <1510249377.69.0.213398074469.issue31778@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ping. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:45:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 17:45:45 +0000 Subject: [issue30952] [Windows] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1510249545.76.0.213398074469.issue30952@psf.upfronthosting.co.za> STINNER Victor added the comment: "If you want SQlite because of its performance, recent version starts to do multi-threading, and/or fear to leave other langages a stupid sizeable performance advantage, then you may perhaps don't leave the situation as it is." I'm not sure of what you are asking here. Is it related to the math module? If not, you might open a different issue. "then you may perhaps don't leave the situation as it is" Reminder: Python is developed by volunteers working in their free time. It's not a product for which you pay a commercial support. "Look at latest Intel cpu shooting for quadcore, Iphone 8 being 6 cores, latest stable nodejs gaining a big speed bump, ... etc ... etc... and the need of efficiency to keep the planet cool enough." Ok, now you are really off-topic. *I* don't know anything about sqlite. That's why I asked how this feature is supposed to be implemented. If nobody proposes a pull request or explain how to implement it, this issue is not going to make progress ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:54:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:54:51 +0000 Subject: [issue30952] [Windows] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1510250091.91.0.213398074469.issue30952@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:57:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:57:10 +0000 Subject: [issue27142] Default int value with xmlrpclib / xmlrpc.client In-Reply-To: <1464387462.23.0.765030008479.issue27142@psf.upfronthosting.co.za> Message-ID: <1510250230.85.0.213398074469.issue27142@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:58:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:58:10 +0000 Subject: [issue25849] files, opened in unicode (text): write() returns symbols count, but seek() expect offset in bytes In-Reply-To: <1449951589.63.0.511826880998.issue25849@psf.upfronthosting.co.za> Message-ID: <1510250290.84.0.213398074469.issue25849@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:59:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:59:03 +0000 Subject: [issue14975] import unicodedata, DLL load failed on Python 2.7.3 In-Reply-To: <1338504145.87.0.920765614951.issue14975@psf.upfronthosting.co.za> Message-ID: <1510250343.68.0.213398074469.issue14975@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 12:59:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 17:59:39 +0000 Subject: [issue30035] [RFC] PyMemberDef.name should be const char * In-Reply-To: <1491885285.14.0.166738608305.issue30035@psf.upfronthosting.co.za> Message-ID: <1510250379.88.0.213398074469.issue30035@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:00:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 18:00:35 +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: <1510250435.26.0.213398074469.issue30213@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:02:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 18:02:17 +0000 Subject: [issue28827] f-strings: format spec should not accept unicode escapes In-Reply-To: <1480379497.98.0.444236262661.issue28827@psf.upfronthosting.co.za> Message-ID: <1510250537.7.0.213398074469.issue28827@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:03:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 18:03:53 +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: <1510250633.75.0.213398074469.issue29416@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: commit review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:11:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 18:11:28 +0000 Subject: [issue21322] Pathlib .owner() and .group() methods fail on broken links In-Reply-To: <1398098569.86.0.723629898468.issue21322@psf.upfronthosting.co.za> Message-ID: <1510251088.35.0.213398074469.issue21322@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:11:50 2017 From: report at bugs.python.org (Olivier Grisel) Date: Thu, 09 Nov 2017 18:11:50 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str Message-ID: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> New submission from Olivier Grisel : I noticed that both pickle.Pickler (C version) and pickle._Pickler (Python version) make unnecessary memory copies when dumping large str, bytes and bytearray objects. This is caused by unnecessary concatenation of the opcode and size header with the large bytes payload prior to calling self.write. For protocol 4, an additional copy is caused by the framing mechanism. I will submit a pull request to fix the issue for the Python version. I am not sure how to test this properly. The BigmemPickleTests seems to be skipped on my 16 GB laptop. ---------- components: Library (Lib) messages: 305975 nosy: Olivier.Grisel, pitrou priority: normal severity: normal status: open title: pickle.dump allocates unnecessary temporary bytes / str type: resource usage versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:12:32 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 18:12:32 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510251152.6.0.213398074469.issue31993@psf.upfronthosting.co.za> Antoine Pitrou added the comment: You don't need to add a test for a performance enhancement. ---------- stage: -> needs patch type: resource usage -> performance versions: -Python 3.4, Python 3.5, Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:13:32 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 18:13:32 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510251212.79.0.213398074469.issue31993@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Of course, +1 for fixing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:14:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 18:14:06 +0000 Subject: [issue19907] gettext - Non ascii chars in header In-Reply-To: <1386328833.52.0.797354581277.issue19907@psf.upfronthosting.co.za> Message-ID: <1510251246.3.0.213398074469.issue19907@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:14:39 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 09 Nov 2017 18:14:39 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510251279.91.0.213398074469.issue31993@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4309 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:15:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 18:15:51 +0000 Subject: [issue14124] _pickle.c comment/documentation improvement In-Reply-To: <1330203362.98.0.289163571674.issue14124@psf.upfronthosting.co.za> Message-ID: <1510251351.29.0.213398074469.issue14124@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:25:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 18:25:20 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510251920.12.0.213398074469.issue31993@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:29:54 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 18:29:54 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510252194.25.0.213398074469.issue31993@psf.upfronthosting.co.za> Antoine Pitrou added the comment: As for the C pickler, currently it dumps the whole pickle into an internal buffer before calling write() at the end. You may want to make writing more incremental. See Modules/_pickler.c (especially _Pickler_Write()). ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:30:10 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 18:30:10 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510252210.27.0.213398074469.issue31993@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:34:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 18:34:08 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510252448.63.0.213398074469.issue31993@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Would be nice to see benchmarks. And what about C version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 14:05:23 2017 From: report at bugs.python.org (Jason Hihn) Date: Thu, 09 Nov 2017 19:05:23 +0000 Subject: [issue31994] json encoder exception could be better Message-ID: <1510254323.87.0.213398074469.issue31994@psf.upfronthosting.co.za> New submission from Jason Hihn : Given this traceback: File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: 7.0374198 is not JSON serializable It would actually be better to have the error reported as type(o)+ " is not JSON serializable." because at first glance, 7.0374198 *is* serializable. In this specific case, the issue can be fixed by attempting to serialize float(o), because it is a ndarray. Maybe there's a better way to do numpy types or some kind of automatic conversion but for now, this is only a request to alter the message, I'd hope to something like: repr(o) + " of type " + type(o) + " is not JSON serializable" It's it's really more about the type rather than the value being serialized. ---------- components: Extension Modules messages: 305980 nosy: Jason Hihn priority: normal severity: normal status: open title: json encoder exception could be better type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 14:06:10 2017 From: report at bugs.python.org (Alexander Mentis) Date: Thu, 09 Nov 2017 19:06:10 +0000 Subject: [issue31995] Set operations documentation error Message-ID: <1510254370.03.0.213398074469.issue31995@psf.upfronthosting.co.za> New submission from Alexander Mentis : Documentation for set/frozenset says |=, &=, -=, ^= operators do not apply to immutable instances of frozenset. This is incorrect. These operators can be used on frozenset; however, they behave differently on frozenset than on set. When used with set, they modify the target set in place. When used with frozenset, they return a new frozenset that replaces the target frozenset. ---------- assignee: docs at python components: Documentation messages: 305981 nosy: Alexander Mentis, docs at python priority: normal severity: normal status: open title: Set operations documentation error versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 14:08:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 19:08:35 +0000 Subject: [issue31995] Set operations documentation error In-Reply-To: <1510254370.03.0.213398074469.issue31995@psf.upfronthosting.co.za> Message-ID: <1510254515.34.0.213398074469.issue31995@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +rhettinger, serhiy.storchaka versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 14:40:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 19:40:32 +0000 Subject: [issue31927] Fix compiling the socket module on NetBSD 8 and other issues In-Reply-To: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> Message-ID: <1510256432.32.0.213398074469.issue31927@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 596286f8f3c8e53ef010d6298464775dc900a515 by Serhiy Storchaka in branch '3.6': [3.6] bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (GH-4235) (#4352) https://github.com/python/cpython/commit/596286f8f3c8e53ef010d6298464775dc900a515 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 15:17:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 20:17:13 +0000 Subject: [issue31927] Fix compiling the socket module on NetBSD 8 and other issues In-Reply-To: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> Message-ID: <1510258633.98.0.213398074469.issue31927@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4310 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 16:06:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 21:06:01 +0000 Subject: [issue31927] Fix compiling the socket module on NetBSD 8 and other issues In-Reply-To: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> Message-ID: <1510261561.36.0.213398074469.issue31927@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 1bce4efdb4624561adce62e544dbe20ec2627ae2 by Serhiy Storchaka in branch '2.7': [2.7] bpo-31927: Fix reading arbitrary data when parse a AF_BLUETOOTH address (GH-4235) (GH-4352) (#4355) https://github.com/python/cpython/commit/1bce4efdb4624561adce62e544dbe20ec2627ae2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 16:26:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 21:26:48 +0000 Subject: [issue31927] Fix compiling the socket module on NetBSD 8 and other issues In-Reply-To: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> Message-ID: <1510262808.69.0.213398074469.issue31927@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 16:34:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 09 Nov 2017 21:34:35 +0000 Subject: [issue31222] datetime.py implementation of .replace inconsistent with C implementation In-Reply-To: <1502902905.88.0.809330827331.issue31222@psf.upfronthosting.co.za> Message-ID: <1510263275.79.0.213398074469.issue31222@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 191e993365ac3206f46132dcf46236471ec54bfa by Victor Stinner (Paul Ganssle) in branch 'master': bpo-31222: Make (datetime|date|time).replace return subclass type in Pure Python (#4176) https://github.com/python/cpython/commit/191e993365ac3206f46132dcf46236471ec54bfa ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 16:35:54 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 09 Nov 2017 21:35:54 +0000 Subject: [issue27987] obmalloc's 8-byte alignment causes undefined behavior In-Reply-To: <1473207430.19.0.578630759123.issue27987@psf.upfronthosting.co.za> Message-ID: <1510263354.6.0.213398074469.issue27987@psf.upfronthosting.co.za> Neil Schemenauer added the comment: FYI, this would seem to be an incentive to get my "bitmaps for small GC objects" idea implemented. I.e. https://mail.python.org/pipermail/python-dev/2017-September/149307.html If implemented, the extra size of the PyGC_Head would only apply to "large" objects. In my prototype, I'm thinking of using 512 bytes as the size limit for small GC objects. ---------- nosy: +nascheme _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 16:36:09 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 09 Nov 2017 21:36:09 +0000 Subject: [issue31222] datetime.py implementation of .replace inconsistent with C implementation In-Reply-To: <1502902905.88.0.809330827331.issue31222@psf.upfronthosting.co.za> Message-ID: <1510263368.99.0.213398074469.issue31222@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4312 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 16:36:34 2017 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 09 Nov 2017 21:36:34 +0000 Subject: [issue31992] Make iteration over dict_items yield namedtuples In-Reply-To: <1510244653.28.0.213398074469.issue31992@psf.upfronthosting.co.za> Message-ID: <1510263394.2.0.213398074469.issue31992@psf.upfronthosting.co.za> Eric V. Smith added the comment: I cannot imagine this ever happening, for performance reasons. You should write your own wrapper around items, if you want this behavior. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 16:45:10 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 09 Nov 2017 21:45:10 +0000 Subject: [issue31778] ast.literal_eval supports non-literals in Python 3 In-Reply-To: <1507847478.46.0.213398074469.issue31778@psf.upfronthosting.co.za> Message-ID: <1510263910.48.0.213398074469.issue31778@psf.upfronthosting.co.za> Neil Schemenauer added the comment: Just a comment on what I guess is the intended use of literal_eval(), i.e. taking a potentially untrusted string and turning it into a Python object. Exposing the whole of the Python parser to potential attackers would make me very worried. Parsing code for all of Python syntax is just going to be very complicated and there can easily be bugs there. Generating an AST and then walking over it to see if it is safe is also scary. The "attack surface" is too large. This is similar to the Shellshock bug. If you can trust the supplier of the string then okay but I would guess that literal_eval() is going to get used for untrusted inputs. It would be really nice to have something like ast.literal_eval() that could be used for untrusted strings. I would implement it by writing a retricted parser. Keep it extremely simple. Validate it by heavy code reviews and extensive testing (e.g. fuzzing). ---------- nosy: +nascheme _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 17:00:33 2017 From: report at bugs.python.org (Big Stone) Date: Thu, 09 Nov 2017 22:00:33 +0000 Subject: [issue30952] [Windows] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1510264833.52.0.213398074469.issue30952@psf.upfronthosting.co.za> Big Stone added the comment: Please apologize. I indeed went off-topic. I can understand few person find this request usefull, and over-react to defend it. Sorry again. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 17:01:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 22:01:13 +0000 Subject: [issue31985] Deprecate openfp() in aifc, sunau and wave In-Reply-To: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Message-ID: <1510264873.4.0.213398074469.issue31985@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- title: Deprecate aifc.openfp -> Deprecate openfp() in aifc, sunau and wave _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 17:04:05 2017 From: report at bugs.python.org (Brian Curtin) Date: Thu, 09 Nov 2017 22:04:05 +0000 Subject: [issue31985] Deprecate openfp() in aifc, sunau and wave In-Reply-To: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Message-ID: <1510265045.69.0.213398074469.issue31985@psf.upfronthosting.co.za> Brian Curtin added the comment: Serhiy, where should a common test that covers all three of these go? I'm not seeing an obvious place for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 17:15:49 2017 From: report at bugs.python.org (Olivier Grisel) Date: Thu, 09 Nov 2017 22:15:49 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510265749.39.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: I wrote a script to monitor the memory when dumping 2GB of data with python master (C pickler and Python pickler): ``` (py37) ogrisel at ici:~/code/cpython$ python ~/tmp/large_pickle_dump.py Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 5.141s => peak memory usage: 4.014 GB (py37) ogrisel at ici:~/code/cpython$ python ~/tmp/large_pickle_dump.py --use-pypickle Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 5.046s => peak memory usage: 5.955 GB ``` This is using protocol 4. Note that the C pickler is only making 1 useless memory copy instead of 2 for the Python pickler (one for the concatenation and the other because of the framing mechanism of protocol 4). Here the output with the Python pickler fixed in python/cpython#4353: ``` (py37) ogrisel at ici:~/code/cpython$ python ~/tmp/large_pickle_dump.py --use-pypickle Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 6.138s => peak memory usage: 2.014 GB ``` Basically the 2 spurious memory copies of the Python pickler with protocol 4 are gone. Here is the script: https://gist.github.com/ogrisel/0e7b3282c84ae4a581f3b9ec1d84b45a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 17:17:19 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 22:17:19 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510265839.95.0.213398074469.issue31993@psf.upfronthosting.co.za> Antoine Pitrou added the comment: But the total runtime is higher? (6 s. vs. 5 s.) Can you post the CPU time? (as measured by `time`, for example) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 17:17:41 2017 From: report at bugs.python.org (Olivier Grisel) Date: Thu, 09 Nov 2017 22:17:41 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510265861.18.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: Note that the time difference is not significant. I rerun the last command I got: ``` (py37) ogrisel at ici:~/code/cpython$ python ~/tmp/large_pickle_dump.py --use-pypickle Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 4.187s => peak memory usage: 2.014 GB ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 17:21:24 2017 From: report at bugs.python.org (Olivier Grisel) Date: Thu, 09 Nov 2017 22:21:24 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510266084.02.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: More benchmarks with the unix time command: ``` (py37) ogrisel at ici:~/code/cpython$ git checkout master Switched to branch 'master' Your branch is up-to-date with 'origin/master'. (py37) ogrisel at ici:~/code/cpython$ time python ~/tmp/large_pickle_dump.py --use-pypickle Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 10.677s => peak memory usage: 5.936 GB real 0m11.068s user 0m0.940s sys 0m5.204s (py37) ogrisel at ici:~/code/cpython$ time python ~/tmp/large_pickle_dump.py --use-pypickle Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 5.089s => peak memory usage: 5.978 GB real 0m5.367s user 0m0.840s sys 0m4.660s (py37) ogrisel at ici:~/code/cpython$ git checkout issue-31993-pypickle-dump-mem-optim Switched to branch 'issue-31993-pypickle-dump-mem-optim' (py37) ogrisel at ici:~/code/cpython$ time python ~/tmp/large_pickle_dump.py --use-pypickle Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 6.974s => peak memory usage: 2.014 GB real 0m7.300s user 0m0.368s sys 0m4.640s (py37) ogrisel at ici:~/code/cpython$ time python ~/tmp/large_pickle_dump.py --use-pypickle Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 10.873s => peak memory usage: 2.014 GB real 0m11.178s user 0m0.324s sys 0m5.100s (py37) ogrisel at ici:~/code/cpython$ time python ~/tmp/large_pickle_dump.py --use-pypickle Allocating source data... => peak memory usage: 2.014 GB Dumping to disk... done in 4.233s => peak memory usage: 2.014 GB real 0m4.574s user 0m0.396s sys 0m4.368s ``` User time is always better in the PR than on master but is also much slower than system time (disk access) in any case. System time is much less deterministic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 17:26:55 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 09 Nov 2017 22:26:55 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510266415.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Antoine Pitrou added the comment: So we're saving memory and CPU time. Cool! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 18:03:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 09 Nov 2017 23:03:32 +0000 Subject: [issue31985] Deprecate openfp() in aifc, sunau and wave In-Reply-To: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Message-ID: <1510268612.16.0.213398074469.issue31985@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: audiotests.py. Create class AudioMiscTests and inherit classes AifcMiscTest, SunauMiscTest, WaveMiscTest from it instead of AudioTests. There is more work because there was no base for misc tests, but this will make adding other common misc test easier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 18:07:56 2017 From: report at bugs.python.org (Dmitry Kazakov) Date: Thu, 09 Nov 2017 23:07:56 +0000 Subject: [issue31299] Add "ignore_modules" option to TracebackException.format() In-Reply-To: <1503992745.47.0.33675937395.issue31299@psf.upfronthosting.co.za> Message-ID: <1510268876.11.0.213398074469.issue31299@psf.upfronthosting.co.za> Dmitry Kazakov added the comment: I only recently realized that trace.Trace accepts two similar arguments, namely ignoremods and ignoredirs. Should we try to make the API and implementation of the functionality proposed here conform to that of trace.Trace's ignoremods? Would Python-Ideas be a more appropriate place to discuss this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 18:34:14 2017 From: report at bugs.python.org (Luther Thompson) Date: Thu, 09 Nov 2017 23:34:14 +0000 Subject: [issue31996] `setuptools.setup` parameter `py_modules` is undocumented Message-ID: <1510270454.88.0.213398074469.issue31996@psf.upfronthosting.co.za> New submission from Luther Thompson : I wrote my own distribution package with only one module, but the module file was not being installed along with the dist info file. I found by looking up the code for the `six` module that `setup` has a `py_modules` parameter which apparently must be used to make the installation work. This module is not mentioned anywhere in https://packaging.python.org/tutorials/distributing-packages/. ---------- assignee: docs at python components: Documentation messages: 305997 nosy: Luther Thompson, docs at python priority: normal severity: normal status: open title: `setuptools.setup` parameter `py_modules` is undocumented type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 18:37:48 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 09 Nov 2017 23:37:48 +0000 Subject: [issue31996] `setuptools.setup` parameter `py_modules` is undocumented In-Reply-To: <1510270454.88.0.213398074469.issue31996@psf.upfronthosting.co.za> Message-ID: <1510270668.6.0.213398074469.issue31996@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for your report, but the correct place to report issues with packaging.p.o is https://github.com/pypa/python-packaging-user-guide ---------- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 18:46:08 2017 From: report at bugs.python.org (Brian Curtin) Date: Thu, 09 Nov 2017 23:46:08 +0000 Subject: [issue31985] Deprecate openfp() in aifc, sunau and wave In-Reply-To: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Message-ID: <1510271168.16.0.213398074469.issue31985@psf.upfronthosting.co.za> Brian Curtin added the comment: I think https://github.com/python/cpython/pull/4344 covers what you're looking for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 19:52:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 10 Nov 2017 00:52:07 +0000 Subject: [issue31222] datetime.py implementation of .replace inconsistent with C implementation In-Reply-To: <1502902905.88.0.809330827331.issue31222@psf.upfronthosting.co.za> Message-ID: <1510275127.83.0.213398074469.issue31222@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b9a40aca2935d2569191844c88f8b61269e383cb by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-31222: Make (datetime|date|time).replace return subclass type in Pure Python (GH-4176) (#4356) https://github.com/python/cpython/commit/b9a40aca2935d2569191844c88f8b61269e383cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 20:35:42 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 10 Nov 2017 01:35:42 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1510277742.97.0.213398074469.issue10049@psf.upfronthosting.co.za> Nick Coghlan added the comment: Reopening this based on several years of additional experience with context managers since I wrote https://bugs.python.org/issue10049#msg119514 when originally closing it. The version I'm now interested in adding is the one from https://bugs.python.org/issue10049#msg281556 - rather than being completely without behaviour, the null context manager should accept the value to be returned from the call to __enter__ as an optional constructor parameter (defaulting to None). That allows even context managers that return a value from __enter__ to be made optional in a relatively obvious way that doesn't involve fundamentally rearranging the code. I think the overhead argument against the use of ExitStack() for this purpose also has merit (so I'd be curious to see relative performance numbers collected with perf), but it's not my main motive for changing my mind. ---------- resolution: rejected -> status: closed -> open title: Add a "no-op" (null) context manager to contextlib (Rejected: use contextlib.ExitStack()) -> Add a "no-op" (null) context manager to contextlib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 20:39:04 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 10 Nov 2017 01:39:04 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1510277944.71.0.213398074469.issue10049@psf.upfronthosting.co.za> Nick Coghlan added the comment: Reverting to "Needs patch", as the currently attached patch is for the "No behaviour" variant that always returns None from __enter__(). (hniksic, would you still be willing to sign the Python CLA? If so, then your patch could be used as the basis for an updated implementation. Otherwise I'd advise anyone working on this to start from scratch) ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 20:44:23 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 10 Nov 2017 01:44:23 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510278263.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: Antoine, it's not a wishy-washy compromise, it's a compromise based on the fact that code that has been factored out to a support module is far more likely to have a test suite than code that's directly in __main__. Thus the logic for the revised default filters is as follows: * code running in __main__ will see deprecation warnings when it runs * code running outside __main__ will see deprecation warnings when its test suite runs If someone is publishing code that's not in a main module, and they *don't* have a test suite for that code yet, then they have bigger problems to worry about than not seeing deprecation warnings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 20:54:14 2017 From: report at bugs.python.org (Sam Napolitano) Date: Fri, 10 Nov 2017 01:54:14 +0000 Subject: [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate Message-ID: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> New submission from Sam Napolitano : I recently came across an issue in the ssl library and have a simple fix to address it. When doing hostname verification against an X.509 certificate, a trailing dot (period) in the hostname is matched against the certificate. But the trailing dot should only be applied to the DNS lookup not the certificate match. Conversely, a certificate that has a trailing dot in its commonName (probably rare but allowed) should match a hostname without the trailing dot. As the ssl library is written now, both cases fail. The truth table below shows the current python ssl DNS matching behavior. +----------------------------------------+ | # hostname certificate MATCH | | +------------------------------------+ | | | dns dns. cname cname. | | | +------------------------------------+ | | 1 x x TRUE | | 2 x x FALSE | | 3 x x FALSE | | 4 x x TRUE | +----------------------------------------+ Case 1 and 4 currently match as both hostname and certificate strings match exactly when the trailing dot is either present or not. Case 2 is unlikely, as certificates are rarely signed with a trailing dot in the subject commonName and if they were, clients would ALWAYS have to enter the hostname with a trailing dot to get a match. Case 3 is more likely where the hostname has a trailing dot, but the certificate does not. For example, "www.example.com." is used for the DNS lookup, but then, "www.example.com." will not match the certificate due to the trailing dot missing from the certificate. I propose the truth table should be true in all cases and just ignore the trailing dot in both the hostname and certificate. As best I can tell, the RFCs [1] are silent on this issue. Although the hostname and commonName strings currently must match, there are a couple of precedents where ignoring the trailing dot is done in practice. Web browsers allow a trailing dot in the URI and will accept a certificate even when the certificate doesn't have a trailing dot. For example, visit Google with trailing dot (https://www.google.com./) from a browser of your choice and check certificate. It should check out as valid. [2] Also, at least two language SSL libraries, Ruby [3] and Go [4], match certificates when hostnames contain a trailing dot. Lastly cURL [5] ignores trailing dots in certs and hostnames. In summary, I don't feel the current python ssl library is wrong - it is following an interpretation of the RFC. But I think it can be more permissive, following the spirit of the RFC without sacrificing security. Patch attached with code change. If accepted, I can do a more formal PR, backport to 2.7 and add tests. Thoughts? -Sam Example of issue ================ Python 3.7.0a2+ (heads/master-dirty:cbe1756e3e, Nov 3 2017, 15:56:14) [Clang 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> cert = {'subject': ((('commonName', 'example.com'),),)} >>> ssl.match_hostname(cert, "example.com") ## Case 1 from truth table >>> ssl.match_hostname(cert, "example.com.") ## Case 3 from truth table Traceback (most recent call last): File "", line 1, in File ".../cpython/Lib/ssl.py", line 330, in match_hostname % (hostname, dnsnames[0])) ssl.CertificateError: hostname 'example.com.' doesn't match 'example.com' >>> cert = {'subject': ((('commonName', 'example.com.'),),)} >>> ssl.match_hostname(cert, "example.com.") ## Case 4 from truth table >>> ssl.match_hostname(cert, "example.com") ## Case 2 from truth table Traceback (most recent call last): File "", line 1, in File ".../cpython/Lib/ssl.py", line 330, in match_hostname % (hostname, dnsnames[0])) ssl.CertificateError: hostname 'example.com' doesn't match 'example.com.' References ========== [1] RFCs - there may be other RFCs addressing X.509 certificates https://tools.ietf.org/html/rfc6125 https://tools.ietf.org/html/rfc5280 https://tools.ietf.org/html/rfc3986 [2] Old Mozilla thread discussing the trailing dot: https://bugzilla.mozilla.org/show_bug.cgi?id=134402#c36 I quote: Yes, it's ok to match "www.example.com." (trailing) to the cert with "www.example.com" (no trailing) It's also OK to match "www.example.com" (no trailing) to the cert with "www.example.com." (trailing) [3] Ruby Ironically Ruby doesn't even take the trailing dot into consideration as it splits the strings using dot as the delimiter. irb> "www.example.com".split('.') == "www.example.com.".split('.') => true https://github.com/ruby/openssl/blob/master/lib/openssl/ssl.rb#L295 [4] Go The trailing dot is explicitly removed in Go TLS library. https://github.com/golang/go/blob/master/src/crypto/x509/verify.go#L913 [5] cURL cURL strips trailing dot following behavior in browsers. https://github.com/curl/curl/blob/master/lib/hostcheck.c#L51 The cURL author discusses the trailing dot in a couple threads. https://github.com/curl/curl/issues/716 https://lists.w3.org/Archives/Public/ietf-http-wg/2016JanMar/0430.html ---------- assignee: christian.heimes components: SSL files: ssl_trailing_dot.patch keywords: patch messages: 306004 nosy: christian.heimes, samiam priority: normal severity: normal status: open title: SSL lib does not handle trailing dot (period) in hostname or certificate type: behavior versions: Python 2.7, Python 3.8 Added file: https://bugs.python.org/file47257/ssl_trailing_dot.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 23:09:17 2017 From: report at bugs.python.org (Masayuki Yamamoto) Date: Fri, 10 Nov 2017 04:09:17 +0000 Subject: [issue28117] warning: dereferencing type-punned pointer will break strict-aliasing rules In-Reply-To: <1473750714.22.0.188258678348.issue28117@psf.upfronthosting.co.za> Message-ID: <1510286957.18.0.213398074469.issue28117@psf.upfronthosting.co.za> Masayuki Yamamoto added the comment: Serhiy, would you open a PR? Your patch looks good to me. I've been looking at the warning on my machine (ubuntu 16.04 x86), it's a bit annoying to me. ---------- nosy: +masamoto _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 01:20:37 2017 From: report at bugs.python.org (Matt Billenstein) Date: Fri, 10 Nov 2017 06:20:37 +0000 Subject: [issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS In-Reply-To: <1504778309.6.0.433500701634.issue31380@psf.upfronthosting.co.za> Message-ID: <1510294837.83.0.213398074469.issue31380@psf.upfronthosting.co.za> Matt Billenstein added the comment: Reflected on the High Sierra buildbot now: http://buildbot.python.org/all/#/builders/14/builds/162 ---------- nosy: +mattbillenstein _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 02:11:26 2017 From: report at bugs.python.org (Christian Heimes) Date: Fri, 10 Nov 2017 07:11:26 +0000 Subject: [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate In-Reply-To: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> Message-ID: <1510297886.11.0.213398074469.issue31997@psf.upfronthosting.co.za> Christian Heimes added the comment: In the future Python will no longer use its own hostname verification code. Instead we are going to rely on OpenSSL to verify the hostname for us. A trailing dot also affects SNI. How do OpenSSL's functions SSL_set_tlsext_host_name() and X509_VERIFY_PARAM_set1_host() deal with a trailing dot? How do TLS servers such as Apache mod_ssl, Apache mod_nss, nginx, Go's TLS server, ... deal with trailing dot in SNI? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 02:59:17 2017 From: report at bugs.python.org (Christian Heimes) Date: Fri, 10 Nov 2017 07:59:17 +0000 Subject: [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate In-Reply-To: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> Message-ID: <1510300757.24.0.213398074469.issue31997@psf.upfronthosting.co.za> Christian Heimes added the comment: Trailing dots in hostname seem to be protocol specific, e.g. SMTP does not allow them. Unless you find a RFC that mandates support for trailing dots in TLS, I'm against a change in Python's TLS stack. It's too risky to mess up SNI, too. I'd rather follow RFC 5890, make the caller deal with FQDN + trailing dot and require libraries to pass in a DNS Domain Names (a fully qualified domain name without a trailing dot) to server_hostname. https://tools.ietf.org/html/rfc6125#section-2.2 https://tools.ietf.org/html/rfc5890#section-2.2 (The complete name convention using a trailing dot described in RFC 1123 [RFC1123], which can be explicit as in "www.example.com." or implicit as in "www.example.com", is not considered in this specification.) ---------- nosy: +alex, dstufft, janssen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:25:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:25:53 +0000 Subject: [issue31998] test_zipapp failed when the zlib module is not available Message-ID: <1510305953.0.0.213398074469.issue31998@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : http://buildbot.python.org/all/#/builders/14/builds/160/steps/4/logs/stdio ====================================================================== ERROR: test_create_archive_with_compression (test.test_zipapp.ZipAppTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_zipapp.py", line 111, in test_create_archive_with_compression zipapp.create_archive(source, target, compressed=True) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/zipapp.py", line 138, in create_archive with zipfile.ZipFile(fd, 'w', compression=compression) as z: File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/zipfile.py", line 1061, in __init__ _check_compression(compression) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/zipfile.py", line 644, in _check_compression "Compression requires the (missing) zlib module") RuntimeError: Compression requires the (missing) zlib module ---------------------------------------------------------------------- ---------- assignee: serhiy.storchaka components: Tests messages: 306009 nosy: paul.moore, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: test_zipapp failed when the zlib module is not available type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:28:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:28:58 +0000 Subject: [issue31999] test_venv failed when the zlib module is not available Message-ID: <1510306138.21.0.213398074469.issue31999@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : http://buildbot.python.org/all/#/builders/14/builds/160/steps/4/logs/stdio ====================================================================== FAIL: test_with_pip (test.test_venv.EnsurePipTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_venv.py", line 363, in do_test_with_pip with_pip=True) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_venv.py", line 56, in run_with_capture func(*args, **kwargs) subprocess.CalledProcessError: Command '['/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmpljv28gk_/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_venv.py", line 421, in test_with_pip self.do_test_with_pip(False) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_venv.py", line 369, in do_test_with_pip self.fail(msg.format(exc, details)) AssertionError: Command '['/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmpljv28gk_/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. **Subprocess Output** Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/ensurepip/__main__.py", line 5, in sys.exit(ensurepip._main()) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 204, in _main default_pip=args.default_pip, File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 117, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip zipimport.ZipImportError: can't decompress data; zlib not available ---------------------------------------------------------------------- ---------- assignee: serhiy.storchaka components: Tests messages: 306010 nosy: serhiy.storchaka, vinay.sajip priority: normal severity: normal stage: needs patch status: open title: test_venv failed when the zlib module is not available type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:31:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:31:22 +0000 Subject: [issue31998] test_zipapp failed when the zlib module is not available In-Reply-To: <1510305953.0.0.213398074469.issue31998@psf.upfronthosting.co.za> Message-ID: <1510306282.5.0.213398074469.issue31998@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4313 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:36:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:36:02 +0000 Subject: [issue31999] test_venv failed when the zlib module is not available In-Reply-To: <1510306138.21.0.213398074469.issue31999@psf.upfronthosting.co.za> Message-ID: <1510306562.01.0.213398074469.issue31999@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4314 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:42:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:42:08 +0000 Subject: [issue32000] test_undecodable_filename in test_httpservers failed on Mac OS X Message-ID: <1510306928.27.0.213398074469.issue32000@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : http://buildbot.python.org/all/#/builders/14/builds/160/steps/4/logs/stdio ====================================================================== ERROR: test_undecodable_filename (test.test_httpservers.SimpleHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/support/__init__.py", line 598, in wrapper return func(*args, **kw) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_httpservers.py", line 395, in test_undecodable_filename with open(os.path.join(self.tempdir, filename), 'wb') as f: OSError: [Errno 92] Illegal byte sequence: '/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmp0hrc3ckd/@test_54539_tmp\udce7w\udcf0.txt' ---------------------------------------------------------------------- ---------- components: Tests, macOS messages: 306011 nosy: ned.deily, ronaldoussoren, serhiy.storchaka priority: normal severity: normal status: open title: test_undecodable_filename in test_httpservers failed on Mac OS X type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:45:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:45:27 +0000 Subject: [issue32000] test_undecodable_filename in test_httpservers failed on Mac OS X In-Reply-To: <1510306928.27.0.213398074469.issue32000@psf.upfronthosting.co.za> Message-ID: <1510307127.19.0.213398074469.issue32000@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Duplicate of issue31380. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:46:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:46:45 +0000 Subject: [issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS In-Reply-To: <1504778309.6.0.433500701634.issue31380@psf.upfronthosting.co.za> Message-ID: <1510307205.38.0.213398074469.issue31380@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Tests type: crash -> behavior versions: -Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:56:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:56:10 +0000 Subject: [issue31988] Saving bytearray to binary plist file doesn't work In-Reply-To: <1510183221.28.0.213398074469.issue31988@psf.upfronthosting.co.za> Message-ID: <1510307770.92.0.213398074469.issue31988@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:09:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 10:09:29 +0000 Subject: [issue31998] test_zipapp failed when the zlib module is not available In-Reply-To: <1510305953.0.0.213398074469.issue31998@psf.upfronthosting.co.za> Message-ID: <1510308569.06.0.213398074469.issue31998@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a1718bc7e0455ec5019e800d4172947bb4a07962 by Serhiy Storchaka in branch 'master': bpo-31998: Fix test_zipapp in case the zlib module is not available. (#4358) https://github.com/python/cpython/commit/a1718bc7e0455ec5019e800d4172947bb4a07962 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:09:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 10:09:41 +0000 Subject: [issue31999] test_venv failed when the zlib module is not available In-Reply-To: <1510306138.21.0.213398074469.issue31999@psf.upfronthosting.co.za> Message-ID: <1510308581.56.0.213398074469.issue31999@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 5e0df74b3bc6391e9a7eba0fd84531ed99a78ae9 by Serhiy Storchaka in branch 'master': bpo-31999: Fix test_venv in case the zlib module is not available. (#4359) https://github.com/python/cpython/commit/5e0df74b3bc6391e9a7eba0fd84531ed99a78ae9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:10:33 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 10 Nov 2017 10:10:33 +0000 Subject: [issue31999] test_venv failed when the zlib module is not available In-Reply-To: <1510306138.21.0.213398074469.issue31999@psf.upfronthosting.co.za> Message-ID: <1510308633.45.0.213398074469.issue31999@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4315 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:12:30 2017 From: report at bugs.python.org (Paul Moore) Date: Fri, 10 Nov 2017 10:12:30 +0000 Subject: [issue31998] test_zipapp failed when the zlib module is not available In-Reply-To: <1510305953.0.0.213398074469.issue31998@psf.upfronthosting.co.za> Message-ID: <1510308750.82.0.213398074469.issue31998@psf.upfronthosting.co.za> Paul Moore added the comment: Good catch, thanks Serhiy! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:18:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 10:18:29 +0000 Subject: [issue31998] test_zipapp failed when the zlib module is not available In-Reply-To: <1510305953.0.0.213398074469.issue31998@psf.upfronthosting.co.za> Message-ID: <1510309109.03.0.213398074469.issue31998@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:20:30 2017 From: report at bugs.python.org (Tom Hale) Date: Fri, 10 Nov 2017 10:20:30 +0000 Subject: [issue32001] @lru_cache needs to be called with () Message-ID: <1510309230.43.0.213398074469.issue32001@psf.upfronthosting.co.za> New submission from Tom Hale : This comes from a question I raised on StackOverflow: https://stackoverflow.com/q/47218313/5353461 I've copied the text below ===================================================================== ===================================================================== The [documentation for `lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache) gives the function definition: > @functools.lru_cache(maxsize=128, typed=False) This says to me that `maxsize` is optional. However, it doesn't like being called without an argument: Python 3.6.3 (default, Oct 24 2017, 14:48:20) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import functools >>> @functools.lru_cache ... def f(): ... ... Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/functools.py", line 477, in lru_cache raise TypeError('Expected maxsize to be an integer or None') TypeError: Expected maxsize to be an integer or None >>> Calling with an argument is fine: >>> @functools.lru_cache(8) ... def f(): ... ... >>> Am I misreading the documentation? ===================================================================== ===================================================================== The answer presented this solution: if callable(maxsize): def decorating_function(user_function): wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo) return update_wrapper(wrapper, user_function) return decorating_function(max_size) # yes, max_size is the function in this case O:) ===================================================================== ===================================================================== Would you accept a PR based on this solution? ---------- messages: 306016 nosy: ataraxy priority: normal severity: normal status: open title: @lru_cache needs to be called with () _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:21:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 10 Nov 2017 10:21:22 +0000 Subject: [issue31222] datetime.py implementation of .replace inconsistent with C implementation In-Reply-To: <1502902905.88.0.809330827331.issue31222@psf.upfronthosting.co.za> Message-ID: <1510309282.75.0.213398074469.issue31222@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Paul Ganssle for the bugfix! I merged your PR and backported it to Python 3.6. (Python 3.5 doesn't accept bugfixes anymore.) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:35:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 10:35:35 +0000 Subject: [issue32001] @lru_cache needs to be called with () In-Reply-To: <1510309230.43.0.213398074469.issue32001@psf.upfronthosting.co.za> Message-ID: <1510310135.52.0.213398074469.issue32001@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm -1. The beginner can make use lru_cache incorrectly the first time, but nobody will make this mistake twice. It is not worth to complicate the code (by the way, your code contains a bug) for saving from at most one mistake for all life. "Special cases aren't special enough to break the rules." ---------- nosy: +rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:47:52 2017 From: report at bugs.python.org (Erik Bray) Date: Fri, 10 Nov 2017 10:47:52 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" Message-ID: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> New submission from Erik Bray : Several of the tests in test_c_locale_coercion (particularly LocaleCoercionTests._check_c_locale_coercion) tend to assume that the system default locale used when setting setlocale(category, "") and when all the relevant environment variables are empty/blank will be the "C"/"POSIX" locale. While this is often true POSIX does not require this to be the case. For example on Cygwin it already defaults to "C.UTF-8", so these tests fail because they assume the legacy coercion will be used, when it isn't (e.g. the LC_CTYPE environment variable does not get forced to "C.UTF-8"). In principle this can affect any platform, however, that chooses a different default. ---------- components: Tests messages: 306019 nosy: erik.bray, ncoghlan priority: normal severity: normal status: open title: test_c_locale_coercion fails when the default LC_CTYPE != "C" type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:48:45 2017 From: report at bugs.python.org (Erik Bray) Date: Fri, 10 Nov 2017 10:48:45 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510310925.55.0.213398074469.issue32002@psf.upfronthosting.co.za> Change by Erik Bray : ---------- keywords: +patch pull_requests: +4316 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:57:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 10:57:03 +0000 Subject: [issue31999] test_venv failed when the zlib module is not available In-Reply-To: <1510306138.21.0.213398074469.issue31999@psf.upfronthosting.co.za> Message-ID: <1510311423.04.0.213398074469.issue31999@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7997fa2e2159cfce0cfbe985a953174ac86694a4 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-31999: Fix test_venv in case the zlib module is not available. (GH-4359) (#4360) https://github.com/python/cpython/commit/7997fa2e2159cfce0cfbe985a953174ac86694a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:58:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 10:58:58 +0000 Subject: [issue31530] Python 2.7 readahead feature of file objects is not thread safe In-Reply-To: <1505914032.54.0.91752475423.issue31530@psf.upfronthosting.co.za> Message-ID: <1510311538.06.0.213398074469.issue31530@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6401e5671781eb217ee1afb4603cc0d1b0367ae6 by Serhiy Storchaka in branch '2.7': [2.7] bpo-31530: Stop crashes when iterating over a file on multiple threads. (#3672) https://github.com/python/cpython/commit/6401e5671781eb217ee1afb4603cc0d1b0367ae6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:59:20 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 10 Nov 2017 10:59:20 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510311560.89.0.213398074469.issue32002@psf.upfronthosting.co.za> Nick Coghlan added the comment: Issue 30672 is potentially related here - some of the test cases are already disabled on Mac OS X and other *BSD systems since the tests assume that C & POSIX are aliases of each other. I've also added Xavier to the nosy list, since the current implementation and tests aren't quite right for Android either and it would be good to come up with a unified solution to more robust platform feature detection: https://bugs.python.org/issue28180#msg305850 ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:59:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 10:59:55 +0000 Subject: [issue31530] Python 2.7 readahead feature of file objects is not thread safe In-Reply-To: <1505914032.54.0.91752475423.issue31530@psf.upfronthosting.co.za> Message-ID: <1510311595.31.0.213398074469.issue31530@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 06:01:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 11:01:06 +0000 Subject: [issue31999] test_venv failed when the zlib module is not available In-Reply-To: <1510306138.21.0.213398074469.issue31999@psf.upfronthosting.co.za> Message-ID: <1510311666.93.0.213398074469.issue31999@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 06:16:39 2017 From: report at bugs.python.org (Erik Bray) Date: Fri, 10 Nov 2017 11:16:39 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510312599.4.0.213398074469.issue32002@psf.upfronthosting.co.za> Erik Bray added the comment: Yes, I looked at some of the other issues pertaining to this, but it wasn't immediately apparent how to kill multiple birds with one stone, so here I just focused on this one assumption. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 06:25:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 11:25:24 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510313124.0.0.213398074469.issue31993@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Actually the time varies too much between runs. 1.641s ... 8.475s ... 12.645s ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 07:00:18 2017 From: report at bugs.python.org (Olivier Grisel) Date: Fri, 10 Nov 2017 12:00:18 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510315218.51.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: In my last comment, I also reported the user times (not spend in OS level disk access stuff): the code of the PR is on the order of 300-400ms while master is around 800ms or more. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 07:15:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 12:15:12 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510316112.57.0.213398074469.issue31993@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'll try to write the C implementation. Maybe it will use other heuristic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 07:49:37 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 10 Nov 2017 12:49:37 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510318177.35.0.213398074469.issue32002@psf.upfronthosting.co.za> Nick Coghlan added the comment: OK, I'd been meaning to get back to refactoring those tests anyway, so assigning this to myself. I'm thinking that the right way to go will be to give the test case a more explicit model of "expected platform behaviour" (initialised in setupModule), rather than having that be implicit in a bunch of conditionals scattered throughout the individual test cases. Then we'd have at least the following cases: - default is C, POSIX is an alias for C (most Linux distros) - default is C, POSIX is a separate locale (*BSD) - default is C.UTF-8 (Cygwin, potentially Android depending on exactly how we resolve that) ---------- assignee: -> ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 07:55:54 2017 From: report at bugs.python.org (Richard Neumann) Date: Fri, 10 Nov 2017 12:55:54 +0000 Subject: [issue31992] Make iteration over dict_items yield namedtuples In-Reply-To: <1510244653.28.0.213398074469.issue31992@psf.upfronthosting.co.za> Message-ID: <1510318554.79.0.213398074469.issue31992@psf.upfronthosting.co.za> Richard Neumann added the comment: Maybe there is no need to sacrifice performance, if a new, optional keyword argument would be introduced to dict.items(): def items(self, named=False): if named: else: Currently I need to define a namedtuple everywhere I do this and starmap the dicts' items. It'd be nice to have this option built-in or a new collections class like: from collections import namedtuple from itertools import starmap DictItem = namedtuple('DictItem', ('key', 'value')) class NamedDict(dict): """Dictionary that yields named tuples on item iterations.""" def items(self): """Yields DictItem named tuples.""" return starmap(DictItem, super().items()) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 08:13:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 13:13:27 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510319607.77.0.213398074469.issue31993@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This speeds up pickling large bytes objects. $ ./python -m timeit -s 'import pickle; a = [bytes([i%256])*1000000 for i in range(256)]' 'with open("/dev/null", "wb") as f: pickle._dump(a, f)' Unpatched: 10 loops, best of 5: 20.7 msec per loop Patched: 200 loops, best of 5: 1.12 msec per loop But slows down pickling short bytes objects longer than 256 bytes (up to 40%). $ ./python -m timeit -s 'import pickle; a = [bytes([i%256])*1000 for i in range(25600)]' 'with open("/dev/null", "wb") as f: pickle._dump(a, f)' Unpatched: 5 loops, best of 5: 77.8 msec per loop Patched: 2 loops, best of 5: 98.5 msec per loop $ ./python -m timeit -s 'import pickle; a = [bytes([i%256])*256 for i in range(100000)]' 'with open("/dev/null", "wb") as f: pickle._dump(a, f)' Unpatched: 1 loop, best of 5: 278 msec per loop Patched: 1 loop, best of 5: 382 msec per loop Compare with: $ ./python -m timeit -s 'import pickle; a = [bytes([i%256])*255 for i in range(100000)]' 'with open("/dev/null", "wb") as f: pickle._dump(a, f)' Unpatched: 1 loop, best of 5: 277 msec per loop Patched: 1 loop, best of 5: 273 msec per loop I think the code should be optimized for decreasing an overhead of _write_many(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 08:28:26 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 10 Nov 2017 13:28:26 +0000 Subject: [issue31992] Make iteration over dict_items yield namedtuples In-Reply-To: <1510244653.28.0.213398074469.issue31992@psf.upfronthosting.co.za> Message-ID: <1510320506.52.0.213398074469.issue31992@psf.upfronthosting.co.za> R. David Murray added the comment: This is not something it is worth complicating the dict API or collections for. If you want the feature in your code, implement your subclass in your own utility library. If you disagree with this decision, please bring it up on the python-ideas mailing list for further analysis, but I'm guessing you won't get much traction. ---------- nosy: +r.david.murray resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 09:38:40 2017 From: report at bugs.python.org (Olivier Grisel) Date: Fri, 10 Nov 2017 14:38:40 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510324720.24.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: I have pushed a new version of the code that now has a 10% overhead for small bytes (instead of 40% previously). It could be possible to optimize further but I think that would render the code much less readable so I would be tempted to keep it this way. Please let me know what you think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 09:42:16 2017 From: report at bugs.python.org (Olivier Grisel) Date: Fri, 10 Nov 2017 14:42:16 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510324936.63.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: Actually, I think this can still be improved while keeping it readable. Let me try again :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 09:57:13 2017 From: report at bugs.python.org (Olivier Grisel) Date: Fri, 10 Nov 2017 14:57:13 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510325833.77.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: Alright, the last version has now ~4% overhead for small bytes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 10:00:48 2017 From: report at bugs.python.org (Ned Deily) Date: Fri, 10 Nov 2017 15:00:48 +0000 Subject: [issue31974] Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra In-Reply-To: <1510106215.52.0.213398074469.issue31974@psf.upfronthosting.co.za> Message-ID: <1510326048.29.0.213398074469.issue31974@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the very helpful video, Irv. It is definitely not a Python issue as I am able to reproduce the positioning problem using the current ActiveState Community Edition 8.6.6 and 8.5.18 macOS Wish shell text widget demos (as long as I use spaces at the beginning of a line and not tabs). However, the current MacPorts Tk which has been updated to 8.6.7 does not seem to have this problem, so, if it was fixed in Tk, it was fixed fairly recently. The python.org 3.7 for macOS will use 8.6 by default prior to feature code off. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 10:09:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 15:09:43 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510326583.97.0.213398074469.issue31993@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Nice! I have got virtually the same code as your intermediate variant, but your final variant event better! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 10:24:25 2017 From: report at bugs.python.org (Erik Bray) Date: Fri, 10 Nov 2017 15:24:25 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510327465.24.0.213398074469.issue32002@psf.upfronthosting.co.za> Erik Bray added the comment: In my PR there's a behavior test for the default, so we don't have to hard-code that on a per-platform basis at least. The C != POSIX thing I'm not sure you can easily test for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 11:33:26 2017 From: report at bugs.python.org (Samuel Nwokenkwo) Date: Fri, 10 Nov 2017 16:33:26 +0000 Subject: [issue32003] multiprocessing.Array("b", 1), multiprocessing.Array("c", 1 ) wrong value returned Message-ID: <1510331606.87.0.213398074469.issue32003@psf.upfronthosting.co.za> New submission from Samuel Nwokenkwo : 1st sequence: arr = multiprocessing.Array("b", 1) # byte type arr[0] = 's'.encode() print(arr[:]) result is [115] ---- 2nd sequence: arr = multiprocessing.Array("c", 1) # character type arr[0] = 's'.encode() print(arr[:]) result is b's' ---------- Wrong values for given types. ---------- components: asyncio messages: 306037 nosy: snwokenk, yselivanov priority: normal severity: normal status: open title: multiprocessing.Array("b", 1), multiprocessing.Array("c",1 ) wrong value returned versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 11:38:28 2017 From: report at bugs.python.org (Brian Curtin) Date: Fri, 10 Nov 2017 16:38:28 +0000 Subject: [issue31985] Deprecate openfp() in aifc, sunau and wave In-Reply-To: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> Message-ID: <1510331908.61.0.213398074469.issue31985@psf.upfronthosting.co.za> Brian Curtin added the comment: New changeset 9f914a01affc55abe799afc521ce71612bb495a5 by Brian Curtin in branch 'master': bpo-31985: Deprecate openfp in aifc, sunau, and wave (#4344) https://github.com/python/cpython/commit/9f914a01affc55abe799afc521ce71612bb495a5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 12:19:46 2017 From: report at bugs.python.org (Kevin Shweh) Date: Fri, 10 Nov 2017 17:19:46 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510334386.09.0.213398074469.issue15606@psf.upfronthosting.co.za> Kevin Shweh added the comment: It looks to me like there are more situations than the patch lists where whitespace still separates tokens. For example, *? is a reluctant quantifier and * ? is a syntax error, even in verbose mode. ---------- nosy: +Kevin Shweh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 12:30:35 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 10 Nov 2017 17:30:35 +0000 Subject: [issue32001] @lru_cache needs to be called with () In-Reply-To: <1510309230.43.0.213398074469.issue32001@psf.upfronthosting.co.za> Message-ID: <1510335035.83.0.213398074469.issue32001@psf.upfronthosting.co.za> ?ric Araujo added the comment: I remember seeing code needed to make a decorator that works with and without parens and finding it quite obscure and confusing for a long time. When you understand the distinction between, things become clear and simple again. I like that the stdlib keeps that distinction. We could change the doc to include an example without parameters. We may also make sure to call lru_cache a decorator factory, with a glossary link or link to decorator reference doc. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 13:14:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 18:14:05 +0000 Subject: [issue32001] @lru_cache needs to be called with () In-Reply-To: <1510309230.43.0.213398074469.issue32001@psf.upfronthosting.co.za> Message-ID: <1510337645.27.0.213398074469.issue32001@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: One such decorator was added in 3.7: xmlrpc.server.register_function (see issue7769). I don't think lru_cache should follow this example. There are few cases in which such obscure decorators are more or less appropriate: 1. The function initially was not a decorator, and now it can be used as a decorator, but we need to pass additional optional arguments. 2. The decorator initially didn't take arguments, but we need to pass optional arguments now. 3. The majority of usages of the decorator don't take arguments. Maybe needed to satisfy more than one of the above conditions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 13:32:15 2017 From: report at bugs.python.org (Olivier Grisel) Date: Fri, 10 Nov 2017 18:32:15 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510338735.52.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: BTW, I am looking at the C implementation at the moment. I think I can do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 14:28:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 19:28:24 +0000 Subject: [issue31994] json encoder exception could be better In-Reply-To: <1510254323.87.0.213398074469.issue31994@psf.upfronthosting.co.za> Message-ID: <1510342104.17.0.213398074469.issue31994@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a duplicate of issue24641. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Log type of unserializable value when raising JSON TypeError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 14:33:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 19:33:35 +0000 Subject: [issue31994] json encoder exception could be better In-Reply-To: <1510254323.87.0.213398074469.issue31994@psf.upfronthosting.co.za> Message-ID: <1510342415.92.0.213398074469.issue31994@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Actually it was fixed in issue26623. ---------- superseder: Log type of unserializable value when raising JSON TypeError -> JSON encode: more informative error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 14:41:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 19:41:51 +0000 Subject: [issue24641] Log type of unserializable value when raising JSON TypeError In-Reply-To: <1436993372.93.0.482029912936.issue24641@psf.upfronthosting.co.za> Message-ID: <1510342911.8.0.213398074469.issue24641@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This issue was partially fixed in issue26623. The error message for unsupported types now is `"Object of type '%s' is not JSON serializable" % o.__class__.__name__`. But this change is not complete. The error message for non-string keys still contains the repr of a key. And the example for default() in the module docstring contains the repr of an object. ---------- assignee: -> serhiy.storchaka stage: test needed -> versions: +Python 3.7 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 15:09:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 20:09:39 +0000 Subject: [issue24641] Log type of unserializable value when raising JSON TypeError In-Reply-To: <1436993372.93.0.482029912936.issue24641@psf.upfronthosting.co.za> Message-ID: <1510344579.08.0.213398074469.issue24641@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4317 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 15:32:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 20:32:08 +0000 Subject: [issue24641] Log type of unserializable value when raising JSON TypeError In-Reply-To: <1436993372.93.0.482029912936.issue24641@psf.upfronthosting.co.za> Message-ID: <1510345928.43.0.213398074469.issue24641@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The idea about including a path to non-serializable object looks interesting (and it would be even more useful for pickling), but harder to implement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:01:11 2017 From: report at bugs.python.org (Irv Kalb) Date: Fri, 10 Nov 2017 21:01:11 +0000 Subject: [issue31974] Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra In-Reply-To: <1510326048.29.0.213398074469.issue31974@psf.upfronthosting.co.za> Message-ID: Irv Kalb added the comment: Hi Ned, Thanks for your message. But I want to make sure I understand what you are saying here. I am using absolutely vanilla Python 3.6 from python.org , but have upgraded to version 8.5.18 if ActiveState tk. I was told that this version of Python would not work correctly with the current (8.6) version of tk. So, I have not installed that. Am I correct in understanding that this but is not fixable when using Python 3.6? (That's OK, I just want to make sure.) It sounds like when Python 3.7 comes out, if I still see the bug, I could upgrade to ActiveState 8.6.7, and that combination should fix the problem. Is that correct? Thanks again, Irv > On Nov 10, 2017, at 7:00 AM, Ned Deily wrote: > > > Ned Deily added the comment: > > Thanks for the very helpful video, Irv. It is definitely not a Python issue as I am able to reproduce the positioning problem using the current ActiveState Community Edition 8.6.6 and 8.5.18 macOS Wish shell text widget demos (as long as I use spaces at the beginning of a line and not tabs). However, the current MacPorts Tk which has been updated to 8.6.7 does not seem to have this problem, so, if it was fixed in Tk, it was fixed fairly recently. The python.org 3.7 for macOS will use 8.6 by default prior to feature code off. > > ---------- > resolution: -> third party > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:03:43 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 10 Nov 2017 21:03:43 +0000 Subject: [issue31976] Segfault when closing BufferedWriter from a different thread In-Reply-To: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> Message-ID: <1510347823.96.0.213398074469.issue31976@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 9703f092abc0259926d88c7855afeae4a78afc7d by Antoine Pitrou (benfogle) in branch 'master': bpo-31976: Fix race condition when flushing a file is slow. (#4331) https://github.com/python/cpython/commit/9703f092abc0259926d88c7855afeae4a78afc7d ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:04:47 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 10 Nov 2017 21:04:47 +0000 Subject: [issue31976] Segfault when closing BufferedWriter from a different thread In-Reply-To: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> Message-ID: <1510347887.61.0.213398074469.issue31976@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thank you for posting this Benjamin. As I said on the PR, I don't think I want to backport this to 3.6, as it is always delicate to reason about subclassing and threads. ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:05:15 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 10 Nov 2017 21:05:15 +0000 Subject: [issue31976] Segfault when closing BufferedWriter from a different thread In-Reply-To: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> Message-ID: <1510347915.3.0.213398074469.issue31976@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:28:25 2017 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 10 Nov 2017 21:28:25 +0000 Subject: [issue28369] Raise RuntimeError when transport's FD is used with add_reader etc In-Reply-To: <1475704054.39.0.284138754743.issue28369@psf.upfronthosting.co.za> Message-ID: <1510349305.66.0.213398074469.issue28369@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:29:01 2017 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 10 Nov 2017 21:29:01 +0000 Subject: [issue28369] Raise RuntimeError when transport's FD is used with add_reader etc In-Reply-To: <1475704054.39.0.284138754743.issue28369@psf.upfronthosting.co.za> Message-ID: <1510349341.66.0.213398074469.issue28369@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- keywords: +patch pull_requests: +4318 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:30:11 2017 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 10 Nov 2017 21:30:11 +0000 Subject: [issue28369] Raise RuntimeError when transport's FD is used with add_reader etc In-Reply-To: <1475704054.39.0.284138754743.issue28369@psf.upfronthosting.co.za> Message-ID: <1510349411.43.0.213398074469.issue28369@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:53:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 21:53:19 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510350799.79.0.213398074469.issue15606@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4319 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 16:57:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 21:57:34 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510351054.18.0.213398074469.issue15606@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Steven's patch is outdated since 71a0b43854164b6ada0026d90f241c987b54d019. But that commit missed that spaces are not ignored within tokens. PR 4366 fixes this by using the wording from Ezio's comments. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 17:14:45 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 10 Nov 2017 22:14:45 +0000 Subject: [issue31824] Missing default argument detail in documentation of StreamReaderWriter In-Reply-To: <1508455062.42.0.213398074469.issue31824@psf.upfronthosting.co.za> Message-ID: <1510352085.9.0.213398074469.issue31824@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I have updated the PR with the requested changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 17:19:57 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 10 Nov 2017 22:19:57 +0000 Subject: [issue31974] Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra In-Reply-To: <1510106215.52.0.213398074469.issue31974@psf.upfronthosting.co.za> Message-ID: <1510352397.74.0.213398074469.issue31974@psf.upfronthosting.co.za> Terry J. Reedy added the comment: 3.7.0a2 is out now. There will be an .0a3, .0a4, then .0b1 in January. Ned is saying that at least the last of these will be compiled to work with 8.6. Once that occurs, I would switch as most of the remaining changes before the .0 release will be fixes to new features, which you can not use. With respect to existing features, 3.7 should be as good as 3.6 as 3.7 has all of the bugfixes in 3.6 plus some that will only appear in the future 3.6.4 release. Irv, when you reply by email, please delete the quoted previous message (except perhaps for a phrase being specifically addressed). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 17:30:43 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 10 Nov 2017 22:30:43 +0000 Subject: [issue31356] Add context manager to temporarily disable GC In-Reply-To: <1504655244.01.0.877867263237.issue31356@psf.upfronthosting.co.za> Message-ID: <1510353043.23.0.213398074469.issue31356@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I just realize that the link I provided is incorrect. This is the correct one (also is the one that appears in this issue anyway): https://github.com/python/cpython/pull/4224 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 17:46:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 22:46:16 +0000 Subject: [issue31356] Add context manager to temporarily disable GC In-Reply-To: <1504655244.01.0.877867263237.issue31356@psf.upfronthosting.co.za> Message-ID: <1510353976.71.0.213398074469.issue31356@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What is the name of the context manager? gc_disabled, disabled, or Disabled? I see different names in the PR and this confuses me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:05:18 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 10 Nov 2017 23:05:18 +0000 Subject: [issue31824] Missing default argument detail in documentation of StreamReaderWriter In-Reply-To: <1508455062.42.0.213398074469.issue31824@psf.upfronthosting.co.za> Message-ID: <1510355118.83.0.213398074469.issue31824@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset e184cfd7bf8bcfd160e3b611d4351ca3ce52d9e2 by Berker Peksag (Pablo Galindo) in branch 'master': bpo-31824: Document default value of 'errors' parameters (GH-4328) https://github.com/python/cpython/commit/e184cfd7bf8bcfd160e3b611d4351ca3ce52d9e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:06:22 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 10 Nov 2017 23:06:22 +0000 Subject: [issue31824] Missing default argument detail in documentation of StreamReaderWriter In-Reply-To: <1508455062.42.0.213398074469.issue31824@psf.upfronthosting.co.za> Message-ID: <1510355182.25.0.213398074469.issue31824@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4320 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:10:08 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 10 Nov 2017 23:10:08 +0000 Subject: [issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown In-Reply-To: <1396556457.93.0.286132850658.issue21149@psf.upfronthosting.co.za> Message-ID: <1510355408.19.0.213398074469.issue21149@psf.upfronthosting.co.za> Gregory P. Smith added the comment: We're still seeing this (in 2.7.12, but the code at 2.7 head hasn't changed). In this case the RLock being used within _acquireLock() still exists but is an incomplete object by the time we use it. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:14:02 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 10 Nov 2017 23:14:02 +0000 Subject: [issue31824] Missing default argument detail in documentation of StreamReaderWriter In-Reply-To: <1508455062.42.0.213398074469.issue31824@psf.upfronthosting.co.za> Message-ID: <1510355642.06.0.213398074469.issue31824@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 7abbddd88d4debe75b201145b6212afb7d93c457 by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-31824: Document default value of 'errors' parameters (GH-4328) https://github.com/python/cpython/commit/7abbddd88d4debe75b201145b6212afb7d93c457 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:14:37 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 10 Nov 2017 23:14:37 +0000 Subject: [issue31824] Missing default argument detail in documentation of StreamReaderWriter In-Reply-To: <1508455062.42.0.213398074469.issue31824@psf.upfronthosting.co.za> Message-ID: <1510355677.44.0.213398074469.issue31824@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you, Peter and Pablo. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:18:08 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 10 Nov 2017 23:18:08 +0000 Subject: [issue28369] Raise RuntimeError when transport's FD is used with add_reader etc In-Reply-To: <1475704054.39.0.284138754743.issue28369@psf.upfronthosting.co.za> Message-ID: <1510355888.06.0.213398074469.issue28369@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: -1054 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:19:43 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Nov 2017 23:19:43 +0000 Subject: [issue32001] @lru_cache needs to be called with () In-Reply-To: <1510309230.43.0.213398074469.issue32001@psf.upfronthosting.co.za> Message-ID: <1510355983.21.0.213398074469.issue32001@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Marking this as rejected. We specifically added a test and error message for this particular misuse of lru_cache. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:31:04 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 10 Nov 2017 23:31:04 +0000 Subject: [issue31995] Set operations documentation error In-Reply-To: <1510254370.03.0.213398074469.issue31995@psf.upfronthosting.co.za> Message-ID: <1510356664.41.0.213398074469.issue31995@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This is an artifact of how in-place operators work (which is a topic covered in the Library Reference). It doesn't really have anything to do with frozensets specifically. For example, you see the same effect with tuples which like frozensets are immutable and do not implement any of the in-place dunder methods: >>> s = ('a', 'b', 'c') >>> s += ('d', 'e') >>> s ('a', 'b', 'c', 'd', 'e') IIRC, this is the first time this has come-up in the 15 year history of sets, so I don't think there is a real problem to be solved. At best, this should be a FAQ entry or relegated to StackOverflow. I would prefer not to alter the set documentation because doing so would likely create confusion rather than solve it. ---------- assignee: docs at python -> rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:33:54 2017 From: report at bugs.python.org (Eryk Sun) Date: Fri, 10 Nov 2017 23:33:54 +0000 Subject: [issue32003] multiprocessing.Array("b", 1), multiprocessing.Array("c", 1 ) wrong value returned In-Reply-To: <1510331606.87.0.213398074469.issue32003@psf.upfronthosting.co.za> Message-ID: <1510356834.51.0.213398074469.issue32003@psf.upfronthosting.co.za> Eryk Sun added the comment: The values are correct for the given type codes, which should be the same as the corresponding type codes for the array and struct modules. Except the array module doesn't support the "c" type. However, assigning b's' to an index of a "b" type array should fail with a TypeError, so I don't think you're showing actual code. A "b" array value is a signed integer in the range [-128, 127]. Larger magnitude integers can be assigned, but they alias (wrap around) back to this range. ---------- components: +Library (Lib) -asyncio nosy: +eryksun type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:37:38 2017 From: report at bugs.python.org (Olivier Grisel) Date: Fri, 10 Nov 2017 23:37:38 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510357058.96.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: I have tried to implement the direct write bypass for the C version of the pickler but I get a segfault in a Py_INCREF on obj during the call to memo_put(self, obj) after the call to _Pickler_write_large_bytes. Here is the diff of my current version of the patch: https://github.com/ogrisel/cpython/commit/4e093ad6993616a9f16e863b72bf2d2e37bc27b4 I am new to the Python C-API so I would appreciate some help on this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:40:07 2017 From: report at bugs.python.org (MosesofEgypt) Date: Fri, 10 Nov 2017 23:40:07 +0000 Subject: [issue32004] Allow specifying code packing order in audioop adpcm functions Message-ID: <1510357207.47.0.213398074469.issue32004@psf.upfronthosting.co.za> New submission from MosesofEgypt : --- Issue --- audioop.adpcm2lin and audioop.lin2adpcm currently treat the high 4 bits of each byte as the first code and the low 4 as the second code. In practice this is often the opposite. http://www.drdobbs.com/database/algorithm-alley/184410326 https://wiki.multimedia.cx/index.php/Microsoft_IMA_ADPCM --- Steps to reproduce --- Run the attached script to decompress the attached wav to two different 16bit signed pcm wav files. The "GOOD" one had the nibbles of each code swapped before being decoded, while the "BAD" one didnt. --- Suggested fix --- I propose an additional optional boolean parameter to these functions to specify which nibble is the first code and which is the second. NOTE: I haven't compiled my changes to test as I do not know how to set up a cpython build environment. This commit is more intended to show how to implement the fix. https://github.com/MosesofEgypt/cpython/commit/4a5ca65833ec79857f065546ae0d90661ce26f5f ---------- files: adpcm_test.zip messages: 306063 nosy: MosesofEgypt priority: normal severity: normal status: open title: Allow specifying code packing order in audioop adpcm functions type: enhancement versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47258/adpcm_test.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:43:54 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 10 Nov 2017 23:43:54 +0000 Subject: [issue32003] multiprocessing.Array("b", 1), multiprocessing.Array("c", 1 ) wrong value returned In-Reply-To: <1510331606.87.0.213398074469.issue32003@psf.upfronthosting.co.za> Message-ID: <1510357434.79.0.213398074469.issue32003@psf.upfronthosting.co.za> Steven D'Aprano added the comment: I don't understand why you think they are the wrong values. What values were you expecting? You have a byte array, you set the value to the byte b's', which is 115, and you get 115. You have a (byte) character array, you set the value to the byte b's', and you get b's'. What were you expecting? ---------- components: +asyncio -Library (Lib) nosy: +steven.daprano -eryksun type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:46:22 2017 From: report at bugs.python.org (Martin Panter) Date: Fri, 10 Nov 2017 23:46:22 +0000 Subject: [issue31526] Allow setting timestamp in gzip-compressed tarfiles In-Reply-To: <1505884271.66.0.629388109764.issue31526@psf.upfronthosting.co.za> Message-ID: <1510357582.05.0.213398074469.issue31526@psf.upfronthosting.co.za> Martin Panter added the comment: Perhaps you can compress the tar file using the ?gzip.GzipFile? class. It accepts a custom ?mtime? parameter (see Issue 4272, added in 2.7 and 3.1+): >>> gztar = BytesIO() >>> tar = GzipFile(fileobj=gztar, mode="w", mtime=0) >>> tarfile.open(fileobj=tar, mode="w|").close() >>> tar.close() >>> gztar.getvalue().hex() '1f8b08000000000002ffedc1010d000000c2a0f74f6d0e37a00000000000000000008037039ade1d2700280000' However, ?tarfile.open? accepts a ?compresslevel? argument for two of the compressors, so you could argue it is okay to add another argument to pass to the gzip compressor. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:53:08 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 10 Nov 2017 23:53:08 +0000 Subject: [issue32005] mutliprocessing.Array misleading error message in slice assignment Message-ID: <1510357988.91.0.213398074469.issue32005@psf.upfronthosting.co.za> New submission from Steven D'Aprano : multiprocessing.Array slice assignment claims to require a single character even if it requires more than one: py> arr = multiprocessing.Array('c', 3) py> arr[:] = b'xyz' # works py> arr[:] = 'xyz' Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.5/multiprocessing/sharedctypes.py", line 226, in __setitem__ self._obj[i] = value TypeError: one character bytes, bytearray or integer expected ---------- components: Library (Lib) messages: 306066 nosy: steven.daprano priority: normal severity: normal status: open title: mutliprocessing.Array misleading error message in slice assignment type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:56:52 2017 From: report at bugs.python.org (Alexander Mentis) Date: Fri, 10 Nov 2017 23:56:52 +0000 Subject: [issue31995] Set operations documentation error In-Reply-To: <1510254370.03.0.213398074469.issue31995@psf.upfronthosting.co.za> Message-ID: <1510358212.09.0.213398074469.issue31995@psf.upfronthosting.co.za> Alexander Mentis added the comment: I don't think you understood my bug. That the augmented assignment operators work differently for set and frozenset is not the issue. The issue is that the documentation says that the |=, &=, -=, ^= operators do not apply to immutable instances of frozenset. This is incorrect. ---------- resolution: rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:04:22 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 11 Nov 2017 00:04:22 +0000 Subject: [issue32005] multiprocessing.Array misleading error message in slice assignment In-Reply-To: <1510357988.91.0.213398074469.issue32005@psf.upfronthosting.co.za> Message-ID: <1510358662.03.0.213398074469.issue32005@psf.upfronthosting.co.za> Change by Steven D'Aprano : ---------- title: mutliprocessing.Array misleading error message in slice assignment -> multiprocessing.Array misleading error message in slice assignment _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:06:00 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 11 Nov 2017 00:06:00 +0000 Subject: [issue31995] Set operations documentation error In-Reply-To: <1510254370.03.0.213398074469.issue31995@psf.upfronthosting.co.za> Message-ID: <1510358760.84.0.213398074469.issue31995@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I did understand your report. IMO your "declaration of incorrectness" is due to an overly strict misreading of what the docs are trying to say and it does not reflect an understanding of what the in-place operators do in-general. We could write an extra paragraph in the set documentation on this topic; however, I believe it would create confusion where none currently exists (i.e. no reported issues for 15+ years). Also the discussion is somewhat generic to any type that doesn't specifically implement in-place operators. In other words, I prefer to leave the doc as-is. ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:06:21 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 11 Nov 2017 00:06:21 +0000 Subject: [issue31995] Set operations documentation error In-Reply-To: <1510254370.03.0.213398074469.issue31995@psf.upfronthosting.co.za> Message-ID: <1510358781.05.0.213398074469.issue31995@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: -> rhettinger priority: normal -> low resolution: -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:06:48 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 11 Nov 2017 00:06:48 +0000 Subject: [issue31995] Set operations documentation error In-Reply-To: <1510254370.03.0.213398074469.issue31995@psf.upfronthosting.co.za> Message-ID: <1510358808.43.0.213398074469.issue31995@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:10:10 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 11 Nov 2017 00:10:10 +0000 Subject: [issue32006] multiprocessing.Array 'c' code is not documented Message-ID: <1510359010.74.0.213398074469.issue32006@psf.upfronthosting.co.za> New submission from Steven D'Aprano : multiprocessing.Array is documented as taking the same character codes as array.array, but it also takes 'c' which is not documented. https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Array https://docs.python.org/3/library/array.html#module-array ---------- assignee: docs at python components: Documentation messages: 306069 nosy: docs at python, steven.daprano priority: normal severity: normal status: open title: multiprocessing.Array 'c' code is not documented type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:17:25 2017 From: report at bugs.python.org (Yilei Yang) Date: Sat, 11 Nov 2017 00:17:25 +0000 Subject: [issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown In-Reply-To: <1396556457.93.0.286132850658.issue21149@psf.upfronthosting.co.za> Message-ID: <1510359445.45.0.213398074469.issue21149@psf.upfronthosting.co.za> Yilei Yang added the comment: Here is a minimal example: main.py: from pkg_a import lib_a pkg_a/__init__.py pkg_a/lib_a.py import logging import sys import pkg_a # This is important handler = logging.StreamHandler(sys.stderr) It does not happen in Python 3 though (3.5.3 at least). ---------- nosy: +yileiyang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:18:45 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 11 Nov 2017 00:18:45 +0000 Subject: [issue31356] Add context manager to temporarily disable GC In-Reply-To: <1504655244.01.0.877867263237.issue31356@psf.upfronthosting.co.za> Message-ID: <1510359525.04.0.213398074469.issue31356@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Sorry about that. The context manager is "gc.Disabled()", which I admit is probably a bad name. The documentation is an example of the "equivalent" Python code as stated by Raymond in the first comment but I see now that this will raise confusion. Please, can you indicate what will be a correct name for the context manager so I can update the PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:21:58 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 11 Nov 2017 00:21:58 +0000 Subject: [issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown In-Reply-To: <1396556457.93.0.286132850658.issue21149@psf.upfronthosting.co.za> Message-ID: <1510359718.12.0.213398074469.issue21149@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:22:21 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 11 Nov 2017 00:22:21 +0000 Subject: [issue31356] Add context manager to temporarily disable GC In-Reply-To: <1504655244.01.0.877867263237.issue31356@psf.upfronthosting.co.za> Message-ID: <1510359741.97.0.213398074469.issue31356@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Just to clarify the current situation: At this point, the contextmanager is referred as "disabled" in the C code but is exported as "Disabled" to the garbage collection module. The "gc_disabled" is the Python "equivalent" given by Raymond that is included in the documentation ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 20:04:55 2017 From: report at bugs.python.org (Eryk Sun) Date: Sat, 11 Nov 2017 01:04:55 +0000 Subject: [issue32003] multiprocessing.Array("b", 1), multiprocessing.Array("c", 1 ) wrong value returned In-Reply-To: <1510331606.87.0.213398074469.issue32003@psf.upfronthosting.co.za> Message-ID: <1510362295.41.0.213398074469.issue32003@psf.upfronthosting.co.za> Change by Eryk Sun : ---------- components: +Library (Lib) -asyncio type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 20:06:00 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 11 Nov 2017 01:06:00 +0000 Subject: [issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown In-Reply-To: <1396556457.93.0.286132850658.issue21149@psf.upfronthosting.co.za> Message-ID: <1510362360.71.0.213398074469.issue21149@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +4321 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 22:02:34 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 11 Nov 2017 03:02:34 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510369354.46.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: OK, I've had a couple of days to become not-annoyed about this, and given the discovery that pytest doesn't currently enable DeprecationWarning by default (even though the default DeprecationWarning behaviour changed more than 7 years ago), I'm now prepared to write a short PEP explicitly defining our updated expectations around how deprecation warnings will be handled: * Change the default warning filters so that DeprecationWarning is once again visible by default for code in __main__ * Clearly document the assumption that anything factored out into a support library will have a test suite. If developers choose not to do that, then they're on their own when it comes to deprecation warnings for the APIs they use, just as they're on their own in relation to maintaining the compatibility of their own APIs. * Clearly document the assumption that test runners will override the interpreter's suitable-for-end-user-application defaults with defaults that are more appropriate for testing use cases * Recommend that test runners also set this in the environment (so it's inherited by subprocesses), not just in the current process * Clearly document "-We", "-Wi", "-Wd" as shorthands to override the default warnings filters with universal "error", "ignore" and "default" settings (right now you have to reverse engineer this from the warnings docs) * Clearly document "PYTHONWARNINGS=error", "PYTHONWARNINGS=ignore", and "PYTHONWARNINGS=default" as the environmental equivalents (right now you have to reverse engineer this from the warnings docs) * Explicitly recommend FutureWarning as the "always visible by default" alternative to DeprecationWarning * Explicitly recommend PendingDeprecationWarning as the "never visible by default" alternative to DeprecationWarning I suspect if we'd been clearer about our assumptions back when the change was made and advertised in the Python 2.7 What's New, we'd have had fewer problems in the time since (e.g. third party test runner developers would have been more likely to realise that we meant for them to make the same change that we made to unittest's defaults - re-reading https://docs.python.org/3/whatsnew/2.7.html#changes-to-the-handling-of-deprecation-warnings now, I'm no longer surprised they didn't catch that implication) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 00:16:04 2017 From: report at bugs.python.org (Samuel Nwokenkwo) Date: Sat, 11 Nov 2017 05:16:04 +0000 Subject: [issue32003] multiprocessing.Array("b", 1), multiprocessing.Array("c", 1 ) wrong value returned In-Reply-To: <1510331606.87.0.213398074469.issue32003@psf.upfronthosting.co.za> Message-ID: <1510377364.49.0.213398074469.issue32003@psf.upfronthosting.co.za> Samuel Nwokenkwo added the comment: I completely wrote the wrong code: So I'll copy and paste: -------------------- Scenario 1 import multiprocessing br = multiprocessing.Array('c', 1) br[0] = 's' print(br[:]) Scenario 1 result = "TypeError: one character bytes, bytearray or integer expected" ------------------------- Scenario 2 import multiprocessing br = multiprocessing.Array('b', 1) br[0] = 's'.encode() print(br[:]) Scenario 2 results = "TypeError: an integer is required (got type bytes)" ----------------------------------- I believe my confusion is that I am thinking more of the python data type byte, which takes b'', than C language data type byte (which takes numbers from -127 to 128. This confusion is compounded when I do something like scenario 3: ------------------------------- import multiprocessing br = multiprocessing.Array('c', 1) br[0] = 's'.encode() print(br[:]) scenario 3 results: b's' ------------------ In the first scenario passing 's' i get an error, even though by definition 's' is a c char data type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 00:26:20 2017 From: report at bugs.python.org (Samuel Nwokenkwo) Date: Sat, 11 Nov 2017 05:26:20 +0000 Subject: [issue32003] multiprocessing.Array("b", 1), multiprocessing.Array("c", 1 ) wrong value returned In-Reply-To: <1510331606.87.0.213398074469.issue32003@psf.upfronthosting.co.za> Message-ID: <1510377980.33.0.213398074469.issue32003@psf.upfronthosting.co.za> Samuel Nwokenkwo added the comment: To clarify my expectation was something like this: arr = multiprocessing.Array('c', 3) # type char arr = "Fun" which is similar to c implementation: char arr[3] = "Fun" AND arr = multiprocessing.Array('b', 3) # type byte arr = b'fun' Also this website list 'c' as a data type supported: https://svn.python.org/projects/python/trunk/Lib/multiprocessing/sharedctypes.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 01:04:55 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 11 Nov 2017 06:04:55 +0000 Subject: [issue31356] Add context manager to temporarily disable GC In-Reply-To: <1504655244.01.0.877867263237.issue31356@psf.upfronthosting.co.za> Message-ID: <1510380295.13.0.213398074469.issue31356@psf.upfronthosting.co.za> Nick Coghlan added the comment: Given the existing "gc.enable", "gc.disable" and "gc.isenabled" APIs, I'd suggest calling this one "gc.ensure_disabled": it ensures the GC is disabled in the with statement body, but only turns it back on at the end if it was previously enabled. That same name would then be used all the way through the code and documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 01:25:32 2017 From: report at bugs.python.org (Luther Thompson) Date: Sat, 11 Nov 2017 06:25:32 +0000 Subject: [issue31996] `setuptools.setup` parameter `py_modules` is undocumented In-Reply-To: <1510270454.88.0.213398074469.issue31996@psf.upfronthosting.co.za> Message-ID: <1510381532.53.0.213398074469.issue31996@psf.upfronthosting.co.za> Luther Thompson added the comment: Thanks, done: https://github.com/pypa/python-packaging-user-guide/issues/397 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 01:35:40 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 11 Nov 2017 06:35:40 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510382140.33.0.213398074469.issue32002@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- pull_requests: +4322 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 01:41:20 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 11 Nov 2017 06:41:20 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510382480.41.0.213398074469.issue32002@psf.upfronthosting.co.za> Nick Coghlan added the comment: The essential problem in both this issue and issue 30672 is that the tests are currently incorporating some Linux-specific assumptions about ways to request the "C" locale. In https://github.com/python/cpython/pull/4369, I've taken the approach of making the baseline tests only cover "C" and "invalid.ascii", and then explicitly *opt-in* to testing an empty locale and "POSIX" on Linux machines. If that's enough to get the test passing on Cygwin, I'm inclined to leave it at that. Dynamically calculated test expectations always make me nervous, since it's all too easy to end up with bugs that impact both the test case and the expectation calculator in the same way, and hence end up with the test passing when it should really fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 01:44:57 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 11 Nov 2017 06:44:57 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510382697.09.0.213398074469.issue32002@psf.upfronthosting.co.za> Nick Coghlan added the comment: Note: I'm not entirely sold on my own argument though, as I believe at least Alpine Linux already interprets the empty locale as C.UTF-8, so it may make more sense to use your dynamic check with both the empty string and "POSIX", and only testing those locales if they get reported back as effectively configuring the "C" locale. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 04:02:15 2017 From: report at bugs.python.org (Chris Jerdonek) Date: Sat, 11 Nov 2017 09:02:15 +0000 Subject: [issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad In-Reply-To: <1487329309.81.0.182915384821.issue29587@psf.upfronthosting.co.za> Message-ID: <1510390935.72.0.213398074469.issue29587@psf.upfronthosting.co.za> Change by Chris Jerdonek : ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 04:03:05 2017 From: report at bugs.python.org (Chris Jerdonek) Date: Sat, 11 Nov 2017 09:03:05 +0000 Subject: [issue18861] Problems with recursive automatic exception chaining In-Reply-To: <1377657727.9.0.627993776621.issue18861@psf.upfronthosting.co.za> Message-ID: <1510390985.47.0.213398074469.issue18861@psf.upfronthosting.co.za> Change by Chris Jerdonek : ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 04:54:31 2017 From: report at bugs.python.org (Hynek Schlawack) Date: Sat, 11 Nov 2017 09:54:31 +0000 Subject: [issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad In-Reply-To: <1487329309.81.0.182915384821.issue29587@psf.upfronthosting.co.za> Message-ID: <1510394071.78.0.213398074469.issue29587@psf.upfronthosting.co.za> Change by Hynek Schlawack : ---------- nosy: +hynek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 04:54:42 2017 From: report at bugs.python.org (Hynek Schlawack) Date: Sat, 11 Nov 2017 09:54:42 +0000 Subject: [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate In-Reply-To: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> Message-ID: <1510394082.47.0.213398074469.issue31997@psf.upfronthosting.co.za> Change by Hynek Schlawack : ---------- nosy: +hynek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 06:18:39 2017 From: report at bugs.python.org (Christian Heimes) Date: Sat, 11 Nov 2017 11:18:39 +0000 Subject: [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate In-Reply-To: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> Message-ID: <1510399119.71.0.213398074469.issue31997@psf.upfronthosting.co.za> Christian Heimes added the comment: After more investigation and discussion with Daniel Stenberg, I'm considering to close the issue as WONTFIX + documentation update. The issue cannot be addressed in the SSL/TLS layer. I'm waiting for a reply from Ryan Sleevi on CAB baseline requirements. BR 1.5.1 does not state if trailing dots are allowed. The trailing dot issue affects more than just hostname matching. For HTTPS, server name indication (SNI) and HTTP "Host" header play an important role, too. In general the SNI TLS header and HTTP Host header must match. In case the HTTP header is missing or deviates from the SNI header, web servers like Apache fail with Bad Request error. In general SNI must also match a SAN dNSName extension. Apache with mod_ssl strips off trailing dots internally. Daniel pointed out that other webservers (IIS) do not handle trailing dots correctly. Some protocols like SMTP do not allow trailing dot in FQDN. IMO the problem should be handled in high level libraries such as urllib. urllib should use the FQDN with trailing dot for DNS resolution, then strip off the trailing dot and use the FQDN for HTTP Host header and server_hostname. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 06:27:28 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 11 Nov 2017 11:27:28 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510369354.46.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <7855dfdf-b312-dbe3-e6b5-74a621151dfa@free.fr> Antoine Pitrou added the comment: > * Recommend that test runners also set this in the environment (so it's inherited by subprocesses), not just in the current process +1 > * Clearly document "-We", "-Wi", "-Wd" as shorthands to override the default warnings filters with universal "error", "ignore" and "default" settings (right now you have to reverse engineer this from the warnings docs) +1 > * Clearly document "PYTHONWARNINGS=error", "PYTHONWARNINGS=ignore", and "PYTHONWARNINGS=default" as the environmental equivalents (right now you have to reverse engineer this from the warnings docs) +1 > * Explicitly recommend FutureWarning as the "always visible by default" alternative to DeprecationWarning That's rather weird. It seems more and more library authors are discontent with DeprecationWarning's default behaviour. Why not change DeprecationWarning's behaviour to match expectations instead of starting recommending people switch to something less obvious? > I suspect if we'd been clearer about our assumptions back when the change was made and advertised in the Python 2.7 What's New, we'd have had fewer problems in the time since I think the main reason is that our assumptions weren't clear at all. The people who promoted this change didn't envision the issues that would come with it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 06:41:50 2017 From: report at bugs.python.org (Christian Heimes) Date: Sat, 11 Nov 2017 11:41:50 +0000 Subject: [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate In-Reply-To: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> Message-ID: <1510400510.15.0.213398074469.issue31997@psf.upfronthosting.co.za> Christian Heimes added the comment: Ryan said: Chrome will match both trailing dot and non-trailing dot in URL against non-trailing dot in cert. trailing dot in cert is 5280 violation by not being in preferred name syntax https://twitter.com/sleevi_/status/929305281405833216 ---------- versions: +Python 3.6, Python 3.7 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 07:57:26 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 11 Nov 2017 12:57:26 +0000 Subject: [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" In-Reply-To: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> Message-ID: <1510405046.7.0.213398074469.issue32002@psf.upfronthosting.co.za> Xavier de Gaye added the comment: > Several of the tests in test_c_locale_coercion (particularly LocaleCoercionTests._check_c_locale_coercion) tend to assume that the system default locale used when setting setlocale(category, "") and when all the relevant environment variables are empty/blank will be the "C"/"POSIX" locale. > > While this is often true POSIX does not require this to be the case. I think you are right. The section starting with "The values of locale categories shall be determined by a precedence order;" in [1] states: 4. If the LANG environment variable is not set or is set to the empty string, the implementation-defined default locale shall be used. In the current implementation of PR 4334 [2] only one change to test_c_locale_coercion is needed to fix the failures of some subtests of test_PYTHONCOERCECLOCALE_set_to_warn when all the locale envt variables are set to the empty string. All the other tests are unchanged and ok because the new _Py_SetLocaleFromEnv() function [3] causes Android to behave as a plain *nix platform except when the locale envt variables are unset or set to an empty string. [1] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html [2] PR 4334: Fix the implementation of PEP 538 on Android [3] And because after calling setlocale(category, "C"), setlocale(category) returns "C" on Android (this may not be the case on Cygwin). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 08:19:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Nov 2017 13:19:54 +0000 Subject: [issue31572] Avoid suppressing all exceptions in PyObject_HasAttr() In-Reply-To: <1506275205.91.0.662869765666.issue31572@psf.upfronthosting.co.za> Message-ID: <1510406394.68.0.213398074469.issue31572@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d4f8480dfe89447587550a85b61d4e9faf827e98 by Serhiy Storchaka in branch 'master': bpo-31572: Don't silence unexpected errors in the _warnings module. (#3731) https://github.com/python/cpython/commit/d4f8480dfe89447587550a85b61d4e9faf827e98 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 08:51:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Nov 2017 13:51:44 +0000 Subject: [issue31572] Avoid suppressing all exceptions in PyObject_HasAttr() In-Reply-To: <1506275205.91.0.662869765666.issue31572@psf.upfronthosting.co.za> Message-ID: <1510408304.82.0.213398074469.issue31572@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 1707e4020fa8dca8e6a3ac4f9da105b54d597b66 by Serhiy Storchaka in branch 'master': bpo-31572: Silence only AttributeError when get the __copy__ attribute in itertools.tee(). (#3724) https://github.com/python/cpython/commit/1707e4020fa8dca8e6a3ac4f9da105b54d597b66 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 09:20:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Nov 2017 14:20:01 +0000 Subject: [issue31572] Avoid suppressing all exceptions in PyObject_HasAttr() In-Reply-To: <1506275205.91.0.662869765666.issue31572@psf.upfronthosting.co.za> Message-ID: <1510410001.58.0.213398074469.issue31572@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 60c3d3551a96febac7b6016fb44605643842c686 by Serhiy Storchaka in branch 'master': bpo-31572: Get rid of _PyObject_HasAttrId() in dict and OrderedDict. (#3728) https://github.com/python/cpython/commit/60c3d3551a96febac7b6016fb44605643842c686 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 09:41:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Nov 2017 14:41:34 +0000 Subject: [issue31572] Avoid suppressing all exceptions in PyObject_HasAttr() In-Reply-To: <1506275205.91.0.662869765666.issue31572@psf.upfronthosting.co.za> Message-ID: <1510411294.71.0.213398074469.issue31572@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset bba2239c17a404fc99524bfbf8126c9b3b7fb343 by Serhiy Storchaka in branch 'master': bpo-31572: Get rid of _PyObject_HasAttrId() in the ASDL parser. (#3725) https://github.com/python/cpython/commit/bba2239c17a404fc99524bfbf8126c9b3b7fb343 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 10:39:07 2017 From: report at bugs.python.org (Olivier Grisel) Date: Sat, 11 Nov 2017 15:39:07 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510414747.69.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: Alright, I found the source of my refcounting bug. I updated the PR to include the C version of the dump for PyBytes. I ran Serhiy's microbenchmarks on the C version and I could not detect any overhead on small bytes objects while I get a ~20x speedup (and no-memory copy) on large bytes objects as expected. I would like to update the `write_utf8` function but I would need to find a way to wrap `const char* data` as a PyBytes instance without making a memory copy to be able to pass it to my `_Pickle_write_large_bytes`. I browsed the C-API documentation but I could not understand how to do that. Also I would appreciate any feedback on the code style or things that could be improved in my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 10:49:36 2017 From: report at bugs.python.org (Pierre Quentel) Date: Sat, 11 Nov 2017 15:49:36 +0000 Subject: [issue30576] http.server should support HTTP compression (gzip) In-Reply-To: <1496691724.59.0.955308322691.issue30576@psf.upfronthosting.co.za> Message-ID: <1510415376.6.0.213398074469.issue30576@psf.upfronthosting.co.za> Pierre Quentel added the comment: I think I have made all the changes requested in the code review (many thanks to the reviewer !). I see that the Pull Request has been flagged "awaiting core review". With the deadline for Python 3.7 coming soon (11 weeks), is there a chance that the feature will be added on time ? Is there something I should do or someone I should contact for that ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 12:06:23 2017 From: report at bugs.python.org (Mike Gilbert) Date: Sat, 11 Nov 2017 17:06:23 +0000 Subject: [issue32007] nis module fails to build against glibc-2.26 Message-ID: <1510419983.02.0.213398074469.issue32007@psf.upfronthosting.co.za> New submission from Mike Gilbert : The nis extension module fails to build against glibc-2.26 with the "obsolete-rpc" option disabled. Downstream bug report: https://bugs.gentoo.org/631488 glibc-2.26 release notes: https://sourceware.org/ml/libc-alpha/2017-08/msg00010.html The nis module is normally skipped since rpcsvc/yp_prot.h will not exist. However, if the external "libnsl" package is installed, compilation is attempted and fails as given below. building 'nis' extension x86_64-pc-linux-gnu-gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -march=native -O2 -pipe -g -fwrapv -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I./Include -I. -I/var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3/Include -I/var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3 -c /var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3/Modules/nismodule.c -o build/temp.linux-x86_64-3.6/var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3/Modules/nismodule.o /var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3/Modules/nismodule.c:17:21: fatal error: rpc/rpc.h: No such file or directory #include ^ compilation terminated. To summarize: glibc no longer provides rpc/rpc.h or rpcsvc/yp_prot.h. One must install a couple of external libraries to provide the same functionality. The missing rpcsvc/yp_prot.h file can be resolved by installing the "libnsl" package, which installs the header where setup.py expects to find it. The missing rpc/rpc.h file may be provided by the "libtirpc" package, but this installs the file under /usr/include/tirpc, which must be added to the include path (-I/usr/include/tirpc). Ideally, pkg-config would be used to find both libnsl and libtirpc. ---------- components: Build messages: 306090 nosy: floppymaster priority: normal severity: normal status: open title: nis module fails to build against glibc-2.26 type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 13:28:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 11 Nov 2017 18:28:45 +0000 Subject: [issue31829] Portability issues with pickle In-Reply-To: <1508521289.37.0.213398074469.issue31829@psf.upfronthosting.co.za> Message-ID: <1510424925.52.0.213398074469.issue31829@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It is possible to resolve issue with Unicode strings ending with \r. We can add a special mark in the stream (a combination of opcodes which is no-op) before writing the first Unicode strings ending with \r. If this mark is encountered in an input stream, therefore it was saved with new Python version, and ending \r can be removed from loaded Unicode strings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 13:32:13 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 11 Nov 2017 18:32:13 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510425133.15.0.213398074469.issue31993@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > I would like to update the `write_utf8` function but I would need to find a way to wrap `const char* data` as a PyBytes instance without making a memory copy to be able to pass it to my `_Pickle_write_large_bytes`. You should pass it as a memoryview instead: https://docs.python.org/3/c-api/memoryview.html#c.PyMemoryView_FromMemory ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 13:43:17 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 11 Nov 2017 18:43:17 +0000 Subject: [issue29180] skip tests that raise PermissionError in test_os (non-root user on Android) In-Reply-To: <1483715692.75.0.979129057464.issue29180@psf.upfronthosting.co.za> Message-ID: <1510425797.75.0.213398074469.issue29180@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 13:43:45 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 11 Nov 2017 18:43:45 +0000 Subject: [issue29181] skip tests that raise PermissionError in test_tarfile (non-root user on Android) In-Reply-To: <1483720295.96.0.810571843517.issue29181@psf.upfronthosting.co.za> Message-ID: <1510425825.4.0.213398074469.issue29181@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 13:44:02 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 11 Nov 2017 18:44:02 +0000 Subject: [issue29184] skip tests of test_socketserver when bind() raises PermissionError (non-root user on Android) In-Reply-To: <1483732137.12.0.493215743488.issue29184@psf.upfronthosting.co.za> Message-ID: <1510425842.14.0.213398074469.issue29184@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 14:20:37 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 11 Nov 2017 19:20:37 +0000 Subject: [issue29180] skip tests that raise PermissionError in test_os (non-root user on Android) In-Reply-To: <1483715692.75.0.979129057464.issue29180@psf.upfronthosting.co.za> Message-ID: <1510428037.28.0.213398074469.issue29180@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4323 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 14:36:05 2017 From: report at bugs.python.org (Kurt Roeckx) Date: Sat, 11 Nov 2017 19:36:05 +0000 Subject: [issue32008] Example suggest to use a TLSv1 socket Message-ID: <1510428965.62.0.213398074469.issue32008@psf.upfronthosting.co.za> New submission from Kurt Roeckx : Here: https://docs.python.org/3/library/ssl.html#ssl.SSLContext.check_hostname And here: https://docs.python.org/2/library/ssl.html#ssl.SSLContext.check_hostname It uses ssl.PROTOCOL_TLSv1, which is a bad example. Please change it to PROTOCOL_SSLv23 or PROTOCOL_TLS. (Those were the first 2 examples I could find via google on how to create an ssl connection using python.) ---------- assignee: docs at python components: Documentation messages: 306093 nosy: docs at python, kroeckx priority: normal severity: normal status: open title: Example suggest to use a TLSv1 socket type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 14:36:32 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 11 Nov 2017 19:36:32 +0000 Subject: [issue29181] skip tests that raise PermissionError in test_tarfile (non-root user on Android) In-Reply-To: <1483720295.96.0.810571843517.issue29181@psf.upfronthosting.co.za> Message-ID: <1510428992.78.0.213398074469.issue29181@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4324 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 17:18:02 2017 From: report at bugs.python.org (Britton Kerin) Date: Sat, 11 Nov 2017 22:18:02 +0000 Subject: [issue32009] seg fault when using Cntrl-q keymap to exit app Message-ID: <1510438682.67.0.213398074469.issue32009@psf.upfronthosting.co.za> New submission from Britton Kerin : This probably applies to more recent version also. It may be a readline bug, but I haven't seen it except when using the python interface, despite using this same .inputrc file with many different command line programs. I've attached the ~/.inputrc which are required to trigger the problem. This simple script will allow the problem to be reproduced: #!/usr/bin/python3.4-dbg import readline input('the_prompt> ') After launching test.py with the given ~/.inputrc in place, simply type Cntrl-q to trigger the seg fault. Perhaps if this can be confirmed to be a readline issue someone can submit a bug report to that project. Britton ---------- components: Library (Lib) files: the.inputrc messages: 306094 nosy: Britton Kerin priority: normal severity: normal status: open title: seg fault when using Cntrl-q keymap to exit app type: crash versions: Python 3.4 Added file: https://bugs.python.org/file47259/the.inputrc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 17:48:53 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 11 Nov 2017 22:48:53 +0000 Subject: [issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown In-Reply-To: <1396556457.93.0.286132850658.issue21149@psf.upfronthosting.co.za> Message-ID: <1510440533.01.0.213398074469.issue21149@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset e84f6d3817ad3d18fdfbb5223b8078606166cea0 by Gregory P. Smith in branch '2.7': [2.7] bpo-21149: Workaround a GC finalization bug in logging. (#4368) https://github.com/python/cpython/commit/e84f6d3817ad3d18fdfbb5223b8078606166cea0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 17:50:48 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 11 Nov 2017 22:50:48 +0000 Subject: [issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown In-Reply-To: <1396556457.93.0.286132850658.issue21149@psf.upfronthosting.co.za> Message-ID: <1510440648.93.0.213398074469.issue21149@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 18:41:29 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 11 Nov 2017 23:41:29 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510443689.57.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: Regarding "Why not revert DeprecationWarning to behaving the same as FutureWarning?", the rationale is basically the one Brett gave on python-dev (which was a restatement of the one that led to the change in python-dev): it's genuinely annoying as a Python developer to get deprecation warnings in your terminal for things like mypy, pylint, flake8, pip, pipenv, etc. So we've tried "DeprecationWarning ~= FutureWarning" up until 2.6/3.1, and found it overly noisy, mixing up output from the tool itself with warnings about the state of the tool's code. Since then, we've tried "DeprecationWarning ~= PendingDeprecationWarning", and found that tilts too far in the other direction (especially with popular test runners being yet to follow unittest's lead and switch their default warning settings) The PEP will thus propose a middle-ground that leaves FutureWarning and PendingDeprecationWarning alone (so folks can still choose those semantics if they prefer them), but tweaks the semantics of DeprecationWarning such that common app distribution techniques (the console_scripts and gui_scripts entry_points, zipapp, executable packages) will still leave them off by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 18:57:36 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 11 Nov 2017 23:57:36 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510444656.84.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: As far as documentation goes, there are the amendments I'm considering: =================== exception DeprecationWarning Base class for warnings about deprecated features. Visible by default for APIs called from `__main__` modules and when using the unittest test runner. See :exc:`PendingDeprecationWarning` and :exc:`FutureWarning` to emit warnings for future backwards incompatible changes with different default visibility. exception PendingDeprecationWarning Base class for warnings about features which will be deprecated in the future. Hidden by default, even for APIs called from `__main__` modules and when using the unittest test runner. See :exc:`DeprecationWarning` and :exc:`FutureWarning` to emit warnings for future backwards incompatible changes with different default visibility. exception FutureWarning Base class for warnings about constructs that will change semantically or cease working in the future. Always visible by default, even for code in imported modules. See :exc:`PendingDeprecationWarning` and :exc:`DeprecationWarning` to emit warnings for future backwards incompatible changes with different default visibility. =================== (I'd also add notes on default visibility to the other warning categories - ImportWarning, BytesWarning, and ResourceWarning are the other "hidden by default" categories) DeprecationWarning gets the preferred name because it has the semantics we think we will like best for that use case (i.e. visible in __main__ and while running tests, hidden otherwise), while cross-referencing it with FutureWarning and PendingDeprecationWarning makes it clear Python developers are still free to opt-in to either the pre-2.7 behaviour or the pre-3.7 behaviour if that's what they prefer for the APIs they expose. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 18:57:43 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 11 Nov 2017 23:57:43 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510443689.57.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: Antoine Pitrou added the comment: Le 12/11/2017 ? 00:41, Nick Coghlan a ?crit?: > > Regarding "Why not revert DeprecationWarning to behaving the same as FutureWarning?", the rationale is basically the one Brett gave on python-dev (which was a restatement of the one that led to the change in python-dev): it's genuinely annoying as a Python developer to get deprecation warnings in your terminal for things like mypy, pylint, flake8, pip, pipenv, etc. Why would mypy, flake8 or pip emit DeprecationWarnings? The original problem was about end-user applications, not specialist developer tools such as pip or mypy. Specialist developer tools can enable whatever warnings filter suits them, and that's what we're promoting for test runners for instance. But the problem is that, by silencing warnings in end-user applications (where those warnings may indeed annoy users), in turn we defeat the whole point of warnings since the developers of those applications become ignorant of them. That's the recurring theme of the whole discussion thread, and your proposal ignores it. (and I don't think chastising those application developers because they don't have good enough test coverage will do much to alleviate the problem; that's how a lot of software still gets written) > The PEP will thus propose a middle-ground that leaves FutureWarning and PendingDeprecationWarning alone (so folks can still choose those semantics if they prefer them), but tweaks the semantics of DeprecationWarning such that common app distribution techniques (the console_scripts and gui_scripts entry_points, zipapp, executable packages) will still leave them off by default. Did someone like Nathaniel confirm that the change you're proposing would satisfy his use cases? If not, I don't think you're achieving anything useful here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 20:17:53 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 12 Nov 2017 01:17:53 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: Message-ID: Nick Coghlan added the comment: Antoine, I'm a user too, and this single small change will be enough to solve *my* problems, while still addressing Guido's developer tool usability concerns that prompted him to change the default in the first place (see the stdlib-sig thread for more info on that). If someone else wants a different change, they can write their own competing PEP that explains why they think mine would be worse than the status quo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 21:34:25 2017 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 12 Nov 2017 02:34:25 +0000 Subject: [issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad In-Reply-To: <1487329309.81.0.182915384821.issue29587@psf.upfronthosting.co.za> Message-ID: <1510454065.89.0.213398074469.issue29587@psf.upfronthosting.co.za> Guido van Rossum added the comment: Yury do you agree this is a bug? Do you have any ideas on how to fix it? ---------- nosy: +gvanrossum, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 23:19:56 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 12 Nov 2017 04:19:56 +0000 Subject: [issue32009] seg fault when using Cntrl-q keymap to exit app In-Reply-To: <1510438682.67.0.213398074469.issue32009@psf.upfronthosting.co.za> Message-ID: <1510460396.9.0.213398074469.issue32009@psf.upfronthosting.co.za> Martin Panter added the comment: This looks the same as Issue 25259. The trigger is that multiple lines are generated at the same time, but Python only expects the first line. ---------- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> readline macros can segfault Python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 23:34:21 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 12 Nov 2017 04:34:21 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510461261.9.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: The initial draft of the PEP is up: https://www.python.org/dev/peps/pep-0565/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 00:34:34 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 12 Nov 2017 05:34:34 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510464874.38.0.213398074469.issue31975@psf.upfronthosting.co.za> R. David Murray added the comment: > Why would mypy, flake8 or pip emit DeprecationWarnings? Because they use python features that get deprecated, and the python the user is using to run them gets upgraded. Now, those particular tools probably will get updated quickly, but other tools will not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 04:55:10 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Sun, 12 Nov 2017 09:55:10 +0000 Subject: [issue16055] incorrect error text for int(base=1000, x='1') In-Reply-To: <1348688461.13.0.427927679227.issue16055@psf.upfronthosting.co.za> Message-ID: <1510480510.04.0.213398074469.issue16055@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- pull_requests: +4325 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 05:05:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 10:05:48 +0000 Subject: [issue31829] Portability issues with pickle In-Reply-To: <1508521289.37.0.213398074469.issue31829@psf.upfronthosting.co.za> Message-ID: <1510481148.62.0.213398074469.issue31829@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Updated PR correctly loads Unicode strings saved in text mode. As a mark used some corrected opcodes followed by newline. If any of previous newlines is \r\n, thus the file was written in text mode and is read in binary mode. If no opcodes with newlines was saved before the UNICODE opcode, the special no-op sequence STRING + "''\n" + POP is saved. This minimize overhead in common case. I'm going to merge this PR and port some changes to Python 3. Could anybody please make a review of the documentation changes? ---------- assignee: -> serhiy.storchaka versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 06:03:03 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 12 Nov 2017 11:03:03 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: Message-ID: <27810df0-54f7-4bad-dc79-35d04f1b14a3@free.fr> Antoine Pitrou added the comment: Le 12/11/2017 ? 02:17, Nick Coghlan a ?crit?: > > If someone else wants a different change, they can write their own > competing PEP that explains why they think mine would be worse than the > status quo. Nobody needs a PEP to advocate for the status quo. The status quo wins by default and you know it. It's your responsibility, if you want to change the status quo, to convince people that the changes you are proposing are desirable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 06:21:46 2017 From: report at bugs.python.org (Nitish) Date: Sun, 12 Nov 2017 11:21:46 +0000 Subject: [issue28197] Add start and stop parameters to the range.index() ABC method In-Reply-To: <1474231832.91.0.157673750963.issue28197@psf.upfronthosting.co.za> Message-ID: <1510485706.15.0.213398074469.issue28197@psf.upfronthosting.co.za> Change by Nitish : ---------- keywords: +patch pull_requests: +4326 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 06:40:08 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 12 Nov 2017 11:40:08 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510486808.28.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: My impression is that you've been arguing that my changes don't go far enough (i.e. you'd prefer full reversion to the pre-2.7 behaviour), not that the status quo is superior. My PEP covers both why I think the status quo is problematic, and why I no longer think full reversion would be a good idea (even though that was my original suggestion on python-dev). It also presents a list of additional known problems with the status quo that this particular PEP doesn't even attempt to address (although it does note some related possibilities for follow-on work if anyone is so inclined). If you (or anyone else) would like to make the case for an alternative approach, then you either need to persuade Guido that the status quo is superior to my proposal to add a new default filter setting, *or* present a competing proposal that he prefers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 06:41:30 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 12 Nov 2017 11:41:30 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510486808.28.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <03bae0ec-4671-c3c1-85a1-2bed00411eb6@free.fr> Antoine Pitrou added the comment: Le 12/11/2017 ? 12:40, Nick Coghlan a ?crit?: > > My impression is that you've been arguing that my changes don't go far enough (i.e. you'd prefer full reversion to the pre-2.7 behaviour), not that the status quo is superior. Ideally yes. That said, I also thought that the special case you were proposing was pointless. Now I've changed my mind though. Your PEP makes a good convincing argument. Thanks for writing it! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 06:46:04 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 11:46:04 +0000 Subject: [issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8 In-Reply-To: <1474024622.65.0.838685461995.issue28180@psf.upfronthosting.co.za> Message-ID: <1510487164.35.0.213398074469.issue28180@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 1588be66d7b0eeebc4614309cd0fc837ff52776a by xdegaye in branch 'master': bpo-28180: Fix the implementation of PEP 538 on Android (GH-4334) https://github.com/python/cpython/commit/1588be66d7b0eeebc4614309cd0fc837ff52776a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 06:58:51 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 12 Nov 2017 11:58:51 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510487931.87.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: I relearned a fair bit myself in writing it - I'd completely forgotten the original rationale was about developer tools emitting unhelpful noise (rather than general Python applications), and that's far more persuasive than the rationale I'd misremembered (hence the change in my own position as the discussion went on). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 07:02:22 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 12 Nov 2017 12:02:22 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510488142.46.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: I also learned we need more concrete examples of useful PYTHONWARNINGS and -W settings in the docs - I believe PEP 565 currently contains more of those than all of our existing warnings related documentation put together :) I'll look into that "warnings cookbook" aspect as part of putting a reference patch together for the PEP. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 07:08:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 12:08:09 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510488489.64.0.213398074469.issue31993@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: While we are here, wouldn't be worth to flush the buffer in the C implementation to the disk always after committing a frame? This will save a memory when dump a lot of small objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 07:43:24 2017 From: report at bugs.python.org (Olivier Grisel) Date: Sun, 12 Nov 2017 12:43:24 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510490604.4.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: Thanks Antoine, I updated my code to what you suggested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 09:11:29 2017 From: report at bugs.python.org (Ivan Pozdeev) Date: Sun, 12 Nov 2017 14:11:29 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510495889.66.0.213398074469.issue31691@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: Indeed, other branches can use this info as well. ---------- versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47260/0001-Add-missing-but-required-build-steps-and-how-to-buil.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 09:11:39 2017 From: report at bugs.python.org (Ivan Pozdeev) Date: Sun, 12 Nov 2017 14:11:39 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510495899.25.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Ivan Pozdeev : Removed file: https://bugs.python.org/file47191/0001-Add-missing-build-steps-in-build-procedure.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 09:11:48 2017 From: report at bugs.python.org (Ivan Pozdeev) Date: Sun, 12 Nov 2017 14:11:48 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510495908.94.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Ivan Pozdeev : Removed file: https://bugs.python.org/file47192/0001-Add-missing-build-steps-in-build-procedure.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 09:49:15 2017 From: report at bugs.python.org (Mario Corchero) Date: Sun, 12 Nov 2017 14:49:15 +0000 Subject: [issue32010] Multiple get "itemgetter" Message-ID: <1510498155.0.0.213398074469.issue32010@psf.upfronthosting.co.za> New submission from Mario Corchero : At the moment we can get an operator that performs multiple "gets" in object attributes. Example: >>> getter = operator.attrgetter("child1.child2") >>> o = mock.Mock() >>> getter(o) On the other hand, itemgetter -which can be used for mappings- can only access single level. a = itemgetter("a")(d) The proposal is to add a way to perform multiple fetches the say way attrgetter is doing it. The main worry here for me would be that it might break some existing callers if someone had "a.b" as a key in a dict and were using itemgetter. An option might be a new argument separator to split those so it'd look like: d = dict(a=dict(b=1), b=dict(c=2)) ab = itemgetter("a.b", separator=".")(d) This is effectively sugar for: itemgetter("b")(itemgetter("a")(d)) This should be available in the *args version as well so the following is valid: d = dict(a=dict(b=1), b=dict(c=2)) ab, ac = itemgetter("a.b", "b.c", separator=".")(d) This is coming from python-dev mailing list thread: "[Python-Dev] Analog of PEP 448 for dicts (unpacking in assignment with dict rhs)" I have a sample implementation on the py side. If this is interesting I can send a PR with the full impl (I havent started yet with the C one) If anyone is interested in the ongoing implementation: https://github.com/mariocj89/cpython/tree/multiple_itemgetter ---------- components: Library (Lib) messages: 306114 nosy: mariocj89 priority: normal severity: normal status: open title: Multiple get "itemgetter" type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 10:32:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 15:32:06 +0000 Subject: [issue32010] Multiple get "itemgetter" In-Reply-To: <1510498155.0.0.213398074469.issue32010@psf.upfronthosting.co.za> Message-ID: <1510500726.22.0.213398074469.issue32010@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: As you have said, this will break existing code. And this is not applicable to non-string indices. I think that it would be easier to use a lambda or local function for this: `lambda x: x['a']['b']`. It is shorter and cleaner. I don't see how this is related to the Python-Dev thread. ---------- nosy: +serhiy.storchaka resolution: -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 10:48:14 2017 From: report at bugs.python.org (Olivier Grisel) Date: Sun, 12 Nov 2017 15:48:14 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510501694.98.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: > While we are here, wouldn't be worth to flush the buffer in the C implementation to the disk always after committing a frame? This will save a memory when dump a lot of small objects. I think it's a good idea. The C pickler would behave more like the Python pickler. I think framing was intended this way initially. Antoine what do you think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 10:50:45 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 12 Nov 2017 15:50:45 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510501845.87.0.213398074469.issue31993@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Framing was originally intended to improve unpickling (since you don't have to issue lots of tiny file reads anymore). No objection to also improve pickling, though :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 10:50:52 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 15:50:52 +0000 Subject: [issue30696] infinite loop in PyRun_InteractiveLoopFlags() In-Reply-To: <1497781984.85.0.996199395593.issue30696@psf.upfronthosting.co.za> Message-ID: <1510501852.36.0.213398074469.issue30696@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset e0582a37c8d1776a2fd4968e9216f3a05f780276 by xdegaye in branch 'master': bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160) https://github.com/python/cpython/commit/e0582a37c8d1776a2fd4968e9216f3a05f780276 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:08:25 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 16:08:25 +0000 Subject: [issue30696] infinite loop in PyRun_InteractiveLoopFlags() In-Reply-To: <1497781984.85.0.996199395593.issue30696@psf.upfronthosting.co.za> Message-ID: <1510502905.73.0.213398074469.issue30696@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4327 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:31:09 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 16:31:09 +0000 Subject: [issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android In-Reply-To: <1479715975.06.0.930254771903.issue28759@psf.upfronthosting.co.za> Message-ID: <1510504269.72.0.213398074469.issue28759@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb by xdegaye in branch 'master': bpo-28759: Skip some tests on PermissionError raised by Android (GH-4350) https://github.com/python/cpython/commit/92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:33:18 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 16:33:18 +0000 Subject: [issue30696] infinite loop in PyRun_InteractiveLoopFlags() In-Reply-To: <1497781984.85.0.996199395593.issue30696@psf.upfronthosting.co.za> Message-ID: <1510504398.16.0.213398074469.issue30696@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset ea5b545e38b3fec7ff29276b5cd59dec583ebf34 by xdegaye in branch '3.6': [3.6] bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160). (#4379) https://github.com/python/cpython/commit/ea5b545e38b3fec7ff29276b5cd59dec583ebf34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:33:59 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 16:33:59 +0000 Subject: [issue30696] infinite loop in PyRun_InteractiveLoopFlags() In-Reply-To: <1497781984.85.0.996199395593.issue30696@psf.upfronthosting.co.za> Message-ID: <1510504439.96.0.213398074469.issue30696@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:45:49 2017 From: report at bugs.python.org (Olivier Grisel) Date: Sun, 12 Nov 2017 16:45:49 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510505149.06.0.213398074469.issue31993@psf.upfronthosting.co.za> Olivier Grisel added the comment: Flushing the buffer at each frame commit will cause a medium-sized write every 64kB on average (instead of one big write at the end). So that might actually cause a performance regression for some users if the individual file-object writes induce significant overhead. In practice though, latency inducing file objects like filesystem-backed ones are likely to derive from the [BufferedWriter](https://docs.python.org/3/library/io.html#io.BufferedWriter) base class and the only latency we should really care about it the one induced by the write call overhead itself in which case the 64kB frame / buffer size should be enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:46:36 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 16:46:36 +0000 Subject: [issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android In-Reply-To: <1479715975.06.0.930254771903.issue28759@psf.upfronthosting.co.za> Message-ID: <1510505196.88.0.213398074469.issue28759@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4328 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:48:35 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 12 Nov 2017 16:48:35 +0000 Subject: [issue31993] pickle.dump allocates unnecessary temporary bytes / str In-Reply-To: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> Message-ID: <1510505315.37.0.213398074469.issue31993@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Agreed. We shouldn't issue very small writes, but 64 kB is generally considered a reasonable buffer size for many kinds of I/O. Besides, it wouldn't be difficult to make the target frame size configurable if a use case arose for it, but I don't think we've ever had such a request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:57:06 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 16:57:06 +0000 Subject: [issue29180] skip tests that raise PermissionError in test_os (non-root user on Android) In-Reply-To: <1483715692.75.0.979129057464.issue29180@psf.upfronthosting.co.za> Message-ID: <1510505826.26.0.213398074469.issue29180@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 6a55d09573e5c35c9e4a24a6f811120b41a2a994 by xdegaye in branch 'master': bpo-29180: Skip test_os tests on PermissionError raised by Android (GH-4374) https://github.com/python/cpython/commit/6a55d09573e5c35c9e4a24a6f811120b41a2a994 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 11:58:03 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 16:58:03 +0000 Subject: [issue29180] skip tests that raise PermissionError in test_os (non-root user on Android) In-Reply-To: <1483715692.75.0.979129057464.issue29180@psf.upfronthosting.co.za> Message-ID: <1510505883.01.0.213398074469.issue29180@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:02:08 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 17:02:08 +0000 Subject: [issue29181] skip tests that raise PermissionError in test_tarfile (non-root user on Android) In-Reply-To: <1483720295.96.0.810571843517.issue29181@psf.upfronthosting.co.za> Message-ID: <1510506128.94.0.213398074469.issue29181@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset d7d4fea4a39da4bfdea1de22fe040023eb4ddc17 by xdegaye in branch 'master': bpo-29181: Skip test_tarfile tests on PermissionError raised by Android (GH-4375) https://github.com/python/cpython/commit/d7d4fea4a39da4bfdea1de22fe040023eb4ddc17 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:03:40 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 17:03:40 +0000 Subject: [issue29181] skip tests that raise PermissionError in test_tarfile (non-root user on Android) In-Reply-To: <1483720295.96.0.810571843517.issue29181@psf.upfronthosting.co.za> Message-ID: <1510506220.05.0.213398074469.issue29181@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:08:34 2017 From: report at bugs.python.org (Stefan Krah) Date: Sun, 12 Nov 2017 17:08:34 +0000 Subject: [issue28789] valgrind shows "invalid file descriptor" when calling platform.system() on my machine. In-Reply-To: <1480005120.89.0.855588033442.issue28789@psf.upfronthosting.co.za> Message-ID: <1510506514.43.0.213398074469.issue28789@psf.upfronthosting.co.za> Change by Stefan Krah : ---------- nosy: +skrah stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:14:12 2017 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 12 Nov 2017 17:14:12 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510487931.87.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: > the original rationale was about developer tools emitting unhelpful noise (rather than general Python applications) I don't recall that, and I'm not sure I agree (either that this is a good reason or that that was the reason stated when we originally silenced these by default). Have you found a specific historic message where this is brought up as the deciding reason? Why would noise from developer tools be worse than noise from other applications. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:15:50 2017 From: report at bugs.python.org (Stefan Krah) Date: Sun, 12 Nov 2017 17:15:50 +0000 Subject: [issue28789] valgrind shows "invalid file descriptor" when calling platform.system() on my machine. In-Reply-To: <1480005120.89.0.855588033442.issue28789@psf.upfronthosting.co.za> Message-ID: <1510506950.49.0.213398074469.issue28789@psf.upfronthosting.co.za> Stefan Krah added the comment: More info: ==22845== Warning: invalid file descriptor 1024 in syscall close() ==22845== at 0x4E493F0: __close_nocancel (syscall-template.S:81) ==22845== by 0xF0BAA74: _close_open_fds_safe (_posixsubprocess.c:297) ==22845== by 0xF0BADF6: child_exec (_posixsubprocess.c:494) ==22845== by 0xF0BB8B9: subprocess_fork_exec (_posixsubprocess.c:691) ==22845== by 0x46D188: _PyMethodDef_RawFastCallKeywords (call.c:691) ==22845== by 0x46D2AC: _PyCFunction_FastCallKeywords (call.c:726) ==22845== by 0x5693CE: call_function (ceval.c:4663) ==22845== by 0x563DFA: _PyEval_EvalFrameDefault (ceval.c:3149) ==22845== by 0x5569EB: PyEval_EvalFrameEx (ceval.c:549) ==22845== by 0x56758D: _PyEval_EvalCodeWithName (ceval.c:4011) ==22845== by 0x46CA56: _PyFunction_FastCallKeywords (call.c:433) ==22845== by 0x56979A: call_function (ceval.c:4702) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:18:39 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 17:18:39 +0000 Subject: [issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android In-Reply-To: <1479715975.06.0.930254771903.issue28759@psf.upfronthosting.co.za> Message-ID: <1510507119.15.0.213398074469.issue28759@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset ad004f9b5a581f577374c56d8ab27e9ef2e73452 by xdegaye in branch '3.6': [3.6] bpo-28759: Skip some tests on PermissionError raised by Android (GH-4350) (#4380) https://github.com/python/cpython/commit/ad004f9b5a581f577374c56d8ab27e9ef2e73452 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:20:18 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 12 Nov 2017 17:20:18 +0000 Subject: [issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android In-Reply-To: <1479715975.06.0.930254771903.issue28759@psf.upfronthosting.co.za> Message-ID: <1510507218.39.0.213398074469.issue28759@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:50:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 17:50:16 +0000 Subject: [issue32011] Restore loading of TYPE_INT64 in marshal Message-ID: <1510509016.94.0.213398074469.issue32011@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : TYPE_INT64 is supported in the marshal module since Python 1.5. Since its use causes instability of marhalled files produced on different platforms, the marshal module in Python 3.3 no longer use it when write new files (see issue15466). And in Python 3.4 it stopped reading files containing the TYPE_INT64 code (see issue15480). This is backward incompatible change. Python 2.7 still produce files containing the TYPE_INT64 code (though this code is rare, because integers in ranges -9223372036854775808..-2147483649 and 2147483648..9223372036854775807 are rare), and there may be marshal files produced by older versions of Python 3, Python 2 and Python 1. Formally Python 3 supports marshal formats produced by all previous versions, except the code objects and the TYPE_INT64 code. Supporting loading the TYPE_INT64 code don't create problems like using it for saving data. But it is needed for backward compatibility. I think that removing the TYPE_INT64 code was a mistake. ---------- assignee: serhiy.storchaka components: Extension Modules messages: 306128 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Restore loading of TYPE_INT64 in marshal type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 13:32:11 2017 From: report at bugs.python.org (Stefan Krah) Date: Sun, 12 Nov 2017 18:32:11 +0000 Subject: [issue28789] valgrind shows "invalid file descriptor" when calling platform.system() on my machine. In-Reply-To: <1480005120.89.0.855588033442.issue28789@psf.upfronthosting.co.za> Message-ID: <1510511531.83.0.213398074469.issue28789@psf.upfronthosting.co.za> Stefan Krah added the comment: Okay, it is probably this: https://bugs.kde.org/show_bug.cgi?id=331311 The question is whether we should add a suppression or a perhaps a comment in _posixsubprocess.c ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 13:50:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 18:50:38 +0000 Subject: [issue32011] Restore loading of TYPE_INT64 in marshal In-Reply-To: <1510509016.94.0.213398074469.issue32011@psf.upfronthosting.co.za> Message-ID: <1510512638.14.0.213398074469.issue32011@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4329 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 13:54:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 18:54:36 +0000 Subject: [issue32011] Restore loading of TYPE_INT64 in marshal In-Reply-To: <1510509016.94.0.213398074469.issue32011@psf.upfronthosting.co.za> Message-ID: <1510512876.05.0.213398074469.issue32011@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Example: $ python2 -c 'import sys, marshal; marshal.dump(1234567890, sys.stdout)' | python3 -c 'import sys, marshal; print(marshal.load(sys.stdin.buffer))' 1234567890 $ python2 -c 'import sys, marshal; marshal.dump(123456789012345, sys.stdout)' | python3 -c 'import sys, marshal; print(marshal.load(sys.stdin.buffer))' Traceback (most recent call last): File "", line 1, in ValueError: bad marshal data (unknown type code) python2 -c 'import sys, marshal; marshal.dump(12345678901234567890, sys.stdout)' | python3 -c 'import sys, marshal; print(marshal.load(sys.stdin.buffer))' 12345678901234567890 PR 4381 reverts this change and simplifies the restored code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 14:28:28 2017 From: report at bugs.python.org (R. David Murray) Date: Sun, 12 Nov 2017 19:28:28 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510514908.12.0.213398074469.issue31975@psf.upfronthosting.co.za> R. David Murray added the comment: My *personal* memory (as in, the reason I gave a sigh of relief when we made this change) was other tools, regardless of what core's rationale was :) (If I remember correctly it was some sysadmin-type tool I was using just about every day.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 17:29:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 22:29:05 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) Message-ID: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The syntax f(x for x in [1],) is ambiguous and reasons that allow it (omitting parenthesis in generator expression and using trailing comma in call expression) are not applicable in this case. Rationales see on Python-Dev: https://mail.python.org/pipermail/python-dev/2017-November/150481.html. ---------- components: Interpreter Core messages: 306132 nosy: benjamin.peterson, brett.cannon, ncoghlan, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Disallow ambiguous syntax f(x for x in [1],) type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 17:43:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 22:43:28 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510526608.45.0.213398074469.issue32012@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4330 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 18:05:19 2017 From: report at bugs.python.org (Anders Lorentsen) Date: Sun, 12 Nov 2017 23:05:19 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1510527919.28.0.213398074469.issue31956@psf.upfronthosting.co.za> Anders Lorentsen added the comment: I decided to work on this, and I would like some review, as this would be my second contribution to cpython. Also, a general question: As I defined the start and end arguments Py_ssize_t, bigger indexes (more negative or more positive) than what can fit in Py_ssize_t will trigger an overflow error. This should be OK, though, as other functions with index arguments has them as Py_ssize_t - and getarrayitem() itself accepts a Py_ssize_t. Or? ---------- nosy: +Phaqui Added file: https://bugs.python.org/file47261/WIP-issue-31956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 18:08:40 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 12 Nov 2017 23:08:40 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510528120.52.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: Reviewing the original thread yet again, you're right the original decision wasn't specifically about developer tools (and I guess at some level I knew that, or I wouldn't have been motivated to suggest the change to FutureWarning's documented purpose). That said, I consider noise from developer tools to be the most compelling example as: 1. Running them from the command line is their normal mode of use (unlike GUI apps which often have no visible console, implicitly silencing all warnings anyway) 2. It's routine for Python developers to run their developer tools on the latest version of Python, whereas regular applications are more likely to be pre-tested against a particular Python version these days 3. Mixing up warnings from a tool like pylint or mypy about the code it is analysing with deprecation warnings about pylint's own code is clearly going to be unhelpful and confusing, no matter how you feel about deprecation warnings in the general case All the points that are most debatable for regular apps ("Do they even have a console?", "Why are end users supplying their own Python version?", "Why can't they just ignore the error?") have clear answers in the developer tools case that favour leaving deprecation warnings off by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 18:57:29 2017 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 12 Nov 2017 23:57:29 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510528120.52.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: I simply don't think developer tools are the prime example of command line tools (it's just that because we are Python developers here, *everything* we use tends to be a developer tool). And "app" does not mean or imply "GUI app". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 19:49:33 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 13 Nov 2017 00:49:33 +0000 Subject: [issue31975] Add a default filter for DeprecationWarning in __main__ In-Reply-To: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> Message-ID: <1510534173.8.0.213398074469.issue31975@psf.upfronthosting.co.za> Nick Coghlan added the comment: The default command line UX of Python developer tools is also more unambiguously python-dev's responsibility, though. That's where my own initial line of argument for full reversion (i.e. that we should be letting app developers manage their own stderr UX, not trying to manage it for them) fell down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 22:46:18 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Mon, 13 Nov 2017 03:46:18 +0000 Subject: [issue24294] DeprecationWarnings should be visible by default in the interactive REPL In-Reply-To: <1432713990.67.0.935342603332.issue24294@psf.upfronthosting.co.za> Message-ID: <1510544778.5.0.213398074469.issue24294@psf.upfronthosting.co.za> Nathaniel Smith added the comment: See also PEP 565. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 00:06:34 2017 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 13 Nov 2017 05:06:34 +0000 Subject: [issue32007] nis module fails to build against glibc-2.26 In-Reply-To: <1510419983.02.0.213398074469.issue32007@psf.upfronthosting.co.za> Message-ID: <1510549594.88.0.213398074469.issue32007@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Rather than investing any effort in nis, we should probably just deprecate and eventually remove it. (If glibc is actually getting rid of something, you know must be very very deprecated.) ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 00:08:34 2017 From: report at bugs.python.org (Mathew M.) Date: Mon, 13 Nov 2017 05:08:34 +0000 Subject: [issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() Message-ID: <1510549714.44.0.213398074469.issue32013@psf.upfronthosting.co.za> New submission from Mathew M. : Hey there! I'm fairly new to the development process for Python, so I figured I'd start off with something tiny and then work on up from there. I'm not sure if this sort of minor fix warrants an issue being created, but I made this just to err on the safe side of things. So, as far as I understand (by all means correct me if I'm wrong), a 'Py_DECREF(key);' should be present before the return in the conditional within fast_save_enter() (https://github.com/python/cpython/blob/d7d4fea4a39da4bfdea1de22fe040023eb4ddc17/Modules/_pickle.c#L1792) ---------- components: Extension Modules messages: 306139 nosy: Mathew M. priority: normal severity: normal status: open title: _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 00:12:58 2017 From: report at bugs.python.org (Mathew M.) Date: Mon, 13 Nov 2017 05:12:58 +0000 Subject: [issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() In-Reply-To: <1510549714.44.0.213398074469.issue32013@psf.upfronthosting.co.za> Message-ID: <1510549978.1.0.213398074469.issue32013@psf.upfronthosting.co.za> Change by Mathew M. : ---------- keywords: +patch pull_requests: +4331 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 00:42:37 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 13 Nov 2017 05:42:37 +0000 Subject: [issue32010] Multiple get "itemgetter" In-Reply-To: <1510498155.0.0.213398074469.issue32010@psf.upfronthosting.co.za> Message-ID: <1510551757.19.0.213398074469.issue32010@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I also don't think this should be done to itemgetter() which should remain focused on its core task. Thank you for the suggestion, but am marking this as closed. Perhaps consider posting a recipe to the ASPN cookbook (I've posted a lot of ideas there) or publish something on PyPI to see if there is any uptake. ---------- nosy: +rhettinger stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 00:50:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 05:50:14 +0000 Subject: [issue1539925] warnings in interactive sessions Message-ID: <1510552214.46.0.213398074469.issue1539925@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Looks reasonable to me. Perhaps we should port the solution from IPython: https://github.com/ipython/ipython/issues/6611. ---------- versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 01:00:30 2017 From: report at bugs.python.org (stevezh) Date: Mon, 13 Nov 2017 06:00:30 +0000 Subject: [issue32014] multiprocessing Server's shutdown method useless send message to manager Message-ID: <1510552830.41.0.213398074469.issue32014@psf.upfronthosting.co.za> New submission from stevezh : When shutdown the manager, Server's handle_request will send back message to the manager, so is useless for the Server's shutdown method send back "None" to the manager? Source code from Lib/multiprocessing/managers.py: def shutdown(self, c): ''' Shutdown this process ''' try: util.debug('manager received shutdown message') # Is useless here? c.send(('#RETURN', None)) except: import traceback traceback.print_exc() finally: self.stop_event.set() Server's handle_request may throw and catch exception because the conn is closed in _finalize_manager() after Server's shutdown method returns. code from handle_request(): try: c.send(msg) except Exception as e: try: c.send(('#TRACEBACK', format_exc())) except Exception: pass code from _finalize_manager(): try: conn = _Client(address, authkey=authkey) try: dispatch(conn, None, 'shutdown') finally: conn.close() except Exception: pass Also the Server's shutdown method only used by manager class. ---------- components: Library (Lib) messages: 306142 nosy: davin, jnoller, pitrou, sbt, stevezh priority: normal severity: normal status: open title: multiprocessing Server's shutdown method useless send message to manager type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 01:57:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 06:57:36 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1510556256.97.0.213398074469.issue31956@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Just take list.index as an example. ---------- components: +Extension Modules -Library (Lib) nosy: +serhiy.storchaka type: -> enhancement versions: +Python 3.7 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 02:01:13 2017 From: report at bugs.python.org (Akash Jain) Date: Mon, 13 Nov 2017 07:01:13 +0000 Subject: [issue31948] [EASY] Broken MSDN links in msilib docs In-Reply-To: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> Message-ID: <1510556473.81.0.213398074469.issue31948@psf.upfronthosting.co.za> Akash Jain added the comment: Hi, I am new to contributing in Python, Can I work on this issue? ---------- nosy: +Akash Jain _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 02:35:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 07:35:39 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510558539.13.0.213398074469.issue32012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 4382 doesn't change the grammar, it changes only checks in the CST to AST transformer. Maybe it would be better to change the grammar. Currently it doesn't match the language specification and allows the following constructions: @deco(x for x in [1]) def f(): ... class C(x for x in [1]): ... And I think the part of issue27494 should be reverted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 02:39:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 07:39:22 +0000 Subject: [issue27494] 2to3 parser failure caused by a comma after a generator expression In-Reply-To: <1468319353.83.0.357995670089.issue27494@psf.upfronthosting.co.za> Message-ID: <1510558762.87.0.213398074469.issue27494@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Actually this syntax isn't allowed by the Python language specification. See issue32012 for fixing the Python parser. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 02:50:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 07:50:18 +0000 Subject: [issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() In-Reply-To: <1510549714.44.0.213398074469.issue32013@psf.upfronthosting.co.za> Message-ID: <1510559418.39.0.213398074469.issue32013@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset f76231f89a7231fd486b37f728fbb4aab389e4d7 by Serhiy Storchaka (Mat M) in branch 'master': bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() (#4384) https://github.com/python/cpython/commit/f76231f89a7231fd486b37f728fbb4aab389e4d7 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 02:50:31 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 13 Nov 2017 07:50:31 +0000 Subject: [issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() In-Reply-To: <1510549714.44.0.213398074469.issue32013@psf.upfronthosting.co.za> Message-ID: <1510559431.7.0.213398074469.issue32013@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4333 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 03:19:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 08:19:54 +0000 Subject: [issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() In-Reply-To: <1510549714.44.0.213398074469.issue32013@psf.upfronthosting.co.za> Message-ID: <1510561194.96.0.213398074469.issue32013@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6ed9d4ecde8c3f0eeadf188f15a5bbd32b9d1145 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() (GH-4384) (#4385) https://github.com/python/cpython/commit/6ed9d4ecde8c3f0eeadf188f15a5bbd32b9d1145 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 03:21:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 08:21:13 +0000 Subject: [issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() In-Reply-To: <1510549714.44.0.213398074469.issue32013@psf.upfronthosting.co.za> Message-ID: <1510561273.57.0.213398074469.issue32013@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> resource usage versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 03:24:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 08:24:12 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510561452.95.0.213398074469.issue32012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It is easy to forbid the above cases, but I don't know what error message is appropriate. General "invalid syntax"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 03:34:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Nov 2017 08:34:00 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1510562040.36.0.213398074469.issue31956@psf.upfronthosting.co.za> STINNER Victor added the comment: Anders Lorentsen: Py_ssize_t is the correct type for an index in the C language. It's not technically possible to create an array object larger than PY_SSIZE_T_MAX items :-) Serhiy> Just take list.index as an example. I concur with Serhiy :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 06:04:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Nov 2017 11:04:49 +0000 Subject: [issue30696] infinite loop in PyRun_InteractiveLoopFlags() In-Reply-To: <1497781984.85.0.996199395593.issue30696@psf.upfronthosting.co.za> Message-ID: <1510571089.67.0.213398074469.issue30696@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks for fixing this very old bug! What about Python 2.7? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 06:55:53 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 13 Nov 2017 11:55:53 +0000 Subject: [issue30696] infinite loop in PyRun_InteractiveLoopFlags() In-Reply-To: <1497781984.85.0.996199395593.issue30696@psf.upfronthosting.co.za> Message-ID: <1510574153.59.0.213398074469.issue30696@psf.upfronthosting.co.za> Xavier de Gaye added the comment: > What about Python 2.7? _testcapi.set_nomemory() does not exist on Pyhton 2.7 so the changes cannot be tested. Applying the changes to PyRun_InteractiveLoopFlags() in 2.7 looks rather straightforward but there are too many differences in PyRun_InteractiveOneFlags() between 2.7 and 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 06:59:21 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 13 Nov 2017 11:59:21 +0000 Subject: [issue30696] infinite loop in PyRun_InteractiveLoopFlags() In-Reply-To: <1497781984.85.0.996199395593.issue30696@psf.upfronthosting.co.za> Message-ID: <1510574361.04.0.213398074469.issue30696@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Also the existing test coverage of these functions in all the Python versions is very weak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 07:39:18 2017 From: report at bugs.python.org (Andrey) Date: Mon, 13 Nov 2017 12:39:18 +0000 Subject: [issue32015] Asyncio cycling during simultaneously socket read/write and reconnection Message-ID: <1510576758.61.0.213398074469.issue32015@psf.upfronthosting.co.za> New submission from Andrey : The bug is happened when the async reading/writing interrupted by other async method which reconnects the socket. The closed socket calls the appropriate handler in the loop due to cannot be removed due to wrong fileno of socket. ---------- components: asyncio files: raise.py messages: 306154 nosy: andr04, yselivanov priority: normal severity: normal status: open title: Asyncio cycling during simultaneously socket read/write and reconnection type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47262/raise.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 07:40:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Nov 2017 12:40:12 +0000 Subject: [issue30696] infinite loop in PyRun_InteractiveLoopFlags() In-Reply-To: <1497781984.85.0.996199395593.issue30696@psf.upfronthosting.co.za> Message-ID: <1510576812.03.0.213398074469.issue30696@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, I understand, thanks for the explanation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 08:04:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Nov 2017 13:04:53 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1510578293.47.0.213398074469.issue30855@psf.upfronthosting.co.za> STINNER Victor added the comment: Same buildbot, same bug: AMD64 Windows8.1 Refleaks 2.7 http://buildbot.python.org/all/#/builders/33/builds/26 ====================================================================== ERROR: test_use (test_tkinter.test_widgets.ToplevelTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_tkinter\test_widgets.py", line 93, in test_use widget2 = self.create(use=wid) File "D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\test\test_tkinter\test_widgets.py", line 67, in create return tkinter.Toplevel(self.root, **kwargs) File "D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\Tkinter.py", line 2138, in __init__ BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra) File "D:\buildarea\2.7.ware-win81-release.refleak\build\lib\lib-tk\Tkinter.py", line 2095, in __init__ (widgetName, self._w) + extra + self._options(cnf)) TclError: integer value too large to represent ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 08:07:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Nov 2017 13:07:44 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge In-Reply-To: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> Message-ID: <1510578464.56.0.213398074469.issue31963@psf.upfronthosting.co.za> STINNER Victor added the comment: Same bug, again, AMD64 Debian PGO 3.x, so I reopen the issue: http://buildbot.python.org/all/#/builders/47/builds/159 Python/compile.c: In function ?compiler_sync_comprehension_generator?: Python/compile.c:5457:1: internal compiler error: in create_edge, at cgraph.c:850 } ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. ---------- resolution: works for me -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 08:12:25 2017 From: report at bugs.python.org (Andrey) Date: Mon, 13 Nov 2017 13:12:25 +0000 Subject: [issue32015] Asyncio cycling during simultaneously socket read/write and reconnection In-Reply-To: <1510576758.61.0.213398074469.issue32015@psf.upfronthosting.co.za> Message-ID: <1510578745.69.0.213398074469.issue32015@psf.upfronthosting.co.za> Change by Andrey : ---------- keywords: +patch pull_requests: +4334 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 08:14:46 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 13:14:46 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1510578886.98.0.213398074469.issue30855@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 09:38:30 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 13 Nov 2017 14:38:30 +0000 Subject: [issue29184] skip tests of test_socketserver when bind() raises PermissionError (non-root user on Android) In-Reply-To: <1483732137.12.0.493215743488.issue29184@psf.upfronthosting.co.za> Message-ID: <1510583910.81.0.213398074469.issue29184@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4335 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 09:53:27 2017 From: report at bugs.python.org (Andrey) Date: Mon, 13 Nov 2017 14:53:27 +0000 Subject: [issue32015] Asyncio looping during simultaneously socket read/write and reconnection In-Reply-To: <1510576758.61.0.213398074469.issue32015@psf.upfronthosting.co.za> Message-ID: <1510584807.37.0.213398074469.issue32015@psf.upfronthosting.co.za> Change by Andrey : ---------- title: Asyncio cycling during simultaneously socket read/write and reconnection -> Asyncio looping during simultaneously socket read/write and reconnection _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 10:00:45 2017 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 13 Nov 2017 15:00:45 +0000 Subject: [issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad In-Reply-To: <1487329309.81.0.182915384821.issue29587@psf.upfronthosting.co.za> Message-ID: <1510585245.65.0.213398074469.issue29587@psf.upfronthosting.co.za> Yury Selivanov added the comment: Guido, The second example ("No active exception to reraise") was an actual long open bug. It was recently fixed by Mark Shannon in [1]. I think we should be able to fix the first case (missing __context__) although it's not critical. I'll look into it after the context PEP and few other open asyncio issues. [1] https://github.com/python/cpython/pull/1773 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 10:16:44 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 13 Nov 2017 15:16:44 +0000 Subject: [issue29185] test_distutils fails on Android API level 24 In-Reply-To: <1483737507.74.0.0285105710282.issue29185@psf.upfronthosting.co.za> Message-ID: <1510586204.96.0.213398074469.issue29185@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 10:19:35 2017 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Mon, 13 Nov 2017 15:19:35 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510586375.65.0.213398074469.issue32012@psf.upfronthosting.co.za> Henk-Jaap Wagenaar added the comment: Currently, Class C(*some_classes): ... works 'as expected' and is within grammar and language specification whereas Class C(x for x in [object]): ... does not work but does not cause a syntax error. I can see a use case for both in dynamic class factories. I was going to do this, but was thwarted by another issue (__doc__ cannot be assigned after creation, nor can it be defined as anything but a pure string, any work around or reason that is the case? Not true for e.g. functions). I think having one of these within the language specification and not the other is odd. ---------- nosy: +Henk-Jaap Wagenaar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 10:19:50 2017 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Mon, 13 Nov 2017 15:19:50 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510586390.34.0.213398074469.issue32012@psf.upfronthosting.co.za> Henk-Jaap Wagenaar added the comment: [As a follow-on, should I open a new issue/discuss on python-dev? Willing to help out with a solution on way or another! I know https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence, "In my head" <> "Should be the case" etc. very much applies.] In my head @... def foo(): pass is equivalent to def _foo(): pass foo = ...() del _foo However the following shows this is not the case: @0 def foo(): pass throws a syntax error, whereas def _foo(): pass foo = 0(_foo) throws a type error. This might seem silly, but it is still unexpected. https://docs.python.org/3/reference/compound_stmts.html#grammar-token-decorator has decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE which in my head is decorator ::= "@" atom NEWLINE Similarly for classes: https://docs.python.org/3/reference/compound_stmts.html#class-definitions inheritance ::= "(" [argument_list] ")" which allows for keyword arguments (does that make any sense!?). In my head it is (compare with call: https://docs.python.org/3/reference/expressions.html#calls) inheritance ::= "(" [positional_arguments [","] | comprehension] ")" [Tangentially related, this is how I originally got onto the mailing lists, my unhappiness with the definition of the for statement (https://docs.python.org/3/reference/compound_stmts.html#the-for-statement): for_stmt ::= "for" target_list "in" expression_list ":" suite ["else" ":" suite] Which I would expect to be: for_stmt ::= comp_for ":" suite ["else" ":" suite] so you could e.g. have if statements. ] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 11:10:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 16:10:41 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510589441.35.0.213398074469.issue32012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think this issue is not the best way for answering your question, but I will make a try. The fact that "class C(x for x in [object]): ..." does not cause a syntax error is a bug. This issue fixes it. The fact that corrected "class C((x for x in [object])): ..." doesn't work is expected, because a generator instance is not a class. The equivalence between a decorator expression and explicit calling a decorator function is true only in one direction and only for valid Python syntax. Saying about equivalence of syntactically incorrect Python code doesn't make sense. Yes, an inheritance list can contain keyword arguments. They are passed to a metaclass constructor as well as positional arguments. The syntaxes of the for statement and comprehensions are different. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 11:42:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Nov 2017 16:42:10 +0000 Subject: [issue24294] DeprecationWarnings should be visible by default in the interactive REPL In-Reply-To: <1432713990.67.0.935342603332.issue24294@psf.upfronthosting.co.za> Message-ID: <1510591330.03.0.213398074469.issue24294@psf.upfronthosting.co.za> STINNER Victor added the comment: If you consider that the REPL is designed for developers, I would also suggest to show ResourceWarning by default. I'm not sure of that since I like to write crappy code of REPL (and I hope that nobody logs my keyboard)! Example: haypo at selma$ python3 Python 3.6.2 (default, Oct 2 2017, 16:51:32) >>> open("/etc/issue").read() '\\S\nKernel \\r on an \\m (\\l)\n\n' I may be annoyed by a ResourceWarning warning here, since it's a oneliner written to be only run once. I know that my code is crappy, but I also know that it works well and it's much shorter to write than "with open(..) as fp: fp.read()" :-) Yet another approach: I proposed to add a "developer mode", -X dev option: https://mail.python.org/pipermail/python-dev/2017-November/150514.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 12:09:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Nov 2017 17:09:42 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex In-Reply-To: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> Message-ID: <1510592982.81.0.213398074469.issue31979@psf.upfronthosting.co.za> STINNER Victor added the comment: I don't think that the weird behaviour justify to backport this non-trivial change. I propose to only apply the change in Python 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 13:38:29 2017 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 13 Nov 2017 18:38:29 +0000 Subject: [issue28369] Raise RuntimeError when transport's FD is used with add_reader etc In-Reply-To: <1475704054.39.0.284138754743.issue28369@psf.upfronthosting.co.za> Message-ID: <1510598309.47.0.213398074469.issue28369@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset ce12629c84400c52734859e43b2386deb2b6da12 by Yury Selivanov in branch 'master': bpo-28369: Enhance transport socket check in add_reader/writer (#4365) https://github.com/python/cpython/commit/ce12629c84400c52734859e43b2386deb2b6da12 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 13:38:45 2017 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 13 Nov 2017 18:38:45 +0000 Subject: [issue28369] Raise RuntimeError when transport's FD is used with add_reader etc In-Reply-To: <1475704054.39.0.284138754743.issue28369@psf.upfronthosting.co.za> Message-ID: <1510598325.61.0.213398074469.issue28369@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 14:18:46 2017 From: report at bugs.python.org (Larry Chen) Date: Mon, 13 Nov 2017 19:18:46 +0000 Subject: [issue32016] Python 3.6.3 venv FAILURE Message-ID: <1510600726.31.0.213398074469.issue32016@psf.upfronthosting.co.za> New submission from Larry Chen : Upgraded from 3.6.1 to 3.6.3; but got an error when trying to create my virtual environment. [larrchen at rslab239 Larry]$ /opt/python3.6.3/bin/python3.6 -m venv /u/larrchen/work2/SAN/Users/Larry/rslab239_myENV_363 Error: Command '['/u/larrchen/work2/SAN/Users/Larry/rslab239_myENV_363/bin/python3.6', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. I can create a virtual env for 3.6.1 and 3.6.2 but not for 3.6.3. This is a regression issue. Try this command. It fails every time. python3.6 -m venv myEnv Larry ---------- messages: 306165 nosy: nihon2000 priority: normal severity: normal status: open title: Python 3.6.3 venv FAILURE versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 14:22:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 19:22:00 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex In-Reply-To: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> Message-ID: <1510600920.81.0.213398074469.issue31979@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: As a side effect it slightly optimizes parsing non-ASCII numbers. $ ./python -m perf timeit --compare-to=./python0 'int("?????????")' --duplicate 100 python0: ..................... 277 ns +- 3 ns python: ..................... 225 ns +- 3 ns Mean +- std dev: [python0] 277 ns +- 3 ns -> [python] 225 ns +- 3 ns: 1.23x faster (-19%) $ ./python -m perf timeit --compare-to=./python0 'float("?????.????")' --duplicate 100 python0: ..................... 256 ns +- 1 ns python: ..................... 199 ns +- 2 ns Mean +- std dev: [python0] 256 ns +- 1 ns -> [python] 199 ns +- 2 ns: 1.29x faster (-22%) $ ./python -m perf timeit --compare-to=./python0 'complex("?????.????j")' --duplicate 100 python0: ..................... 298 ns +- 4 ns python: ..................... 235 ns +- 3 ns Mean +- std dev: [python0] 298 ns +- 4 ns -> [python] 235 ns +- 3 ns: 1.27x faster (-21%) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 14:23:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 19:23:52 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex In-Reply-To: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> Message-ID: <1510601032.3.0.213398074469.issue31979@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 9b6c60cbce4ac45e8ccd7934babff465e9769509 by Serhiy Storchaka in branch 'master': bpo-31979: Simplify transforming decimals to ASCII (#4336) https://github.com/python/cpython/commit/9b6c60cbce4ac45e8ccd7934babff465e9769509 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 14:25:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 19:25:21 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex In-Reply-To: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> Message-ID: <1510601121.27.0.213398074469.issue31979@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 14:26:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 13 Nov 2017 19:26:01 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex In-Reply-To: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> Message-ID: <1510601161.61.0.213398074469.issue31979@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your review Victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 16:17:19 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 13 Nov 2017 21:17:19 +0000 Subject: [issue32017] profile.Profile() has no method enable() Message-ID: <1510607839.08.0.213398074469.issue32017@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The section here is wrong as it claims that API is common to profile and cProfile. https://docs.python.org/3/library/profile.html#module-cProfile ---------- assignee: docs at python components: Documentation messages: 306169 nosy: docs at python, eric.araujo, ezio.melotti, pitrou, willingc priority: normal severity: normal status: open title: profile.Profile() has no method enable() type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 16:18:51 2017 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Mon, 13 Nov 2017 21:18:51 +0000 Subject: [issue31867] Duplicated keys in MIME type_map with different values In-Reply-To: <1508926440.94.0.213398074469.issue31867@psf.upfronthosting.co.za> Message-ID: <1510607931.77.0.213398074469.issue31867@psf.upfronthosting.co.za> Change by Henk-Jaap Wagenaar : ---------- keywords: +patch pull_requests: +4337 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 16:49:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 13 Nov 2017 21:49:33 +0000 Subject: [issue16055] incorrect error text for int(base=1000, x='1') In-Reply-To: <1348688461.13.0.427927679227.issue16055@psf.upfronthosting.co.za> Message-ID: <1510609773.08.0.213398074469.issue16055@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 28b624825eb92cb8c96fbf8da267d8d14a61a841 by Victor Stinner (Sanyam Khurana) in branch 'master': bpo-16055: Fixes incorrect error text for int('1', base=1000) (#4376) https://github.com/python/cpython/commit/28b624825eb92cb8c96fbf8da267d8d14a61a841 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 16:51:01 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 13 Nov 2017 21:51:01 +0000 Subject: [issue16055] incorrect error text for int(base=1000, x='1') In-Reply-To: <1348688461.13.0.427927679227.issue16055@psf.upfronthosting.co.za> Message-ID: <1510609861.04.0.213398074469.issue16055@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4338 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 17:06:50 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Mon, 13 Nov 2017 22:06:50 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 Message-ID: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> New submission from Ivan Levkivskyi : The string representation of a function signature with annotations is currently like this: >>> def __init__(self, x: int = 1, y: int = 2) -> None: pass ... >>> import inspect >>> str(inspect.signature(__init__)) '(self, x:str=1, y:int=2) -> None' At the same time PEP 8 says: When combining an argument annotation with a default value, use spaces around the = sign (but only for those arguments that have both an annotation and a default). Yes: def munge(sep: AnyStr = None): ... def munge(input: AnyStr, sep: AnyStr = None, limit=1000): ... No: def munge(input: AnyStr=None): ... def munge(input: AnyStr, limit = 1000): ... I think there should be spaces in the signature repr. ---------- messages: 306171 nosy: levkivskyi, yselivanov priority: normal severity: normal status: open title: inspect.signature does not respect PEP 8 type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 17:11:27 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 13 Nov 2017 22:11:27 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510611087.92.0.213398074469.issue32018@psf.upfronthosting.co.za> R. David Murray added the comment: FWIW, I find the version without the spaces to be more readable (but I don't find annotations to be readable in general, so my opinion may not be worth much :) ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 17:36:06 2017 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 13 Nov 2017 22:36:06 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510612566.02.0.213398074469.issue32018@psf.upfronthosting.co.za> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 17:41:21 2017 From: report at bugs.python.org (Michael Selik) Date: Mon, 13 Nov 2017 22:41:21 +0000 Subject: [issue31908] trace module cli does not write cover files In-Reply-To: <1509418506.94.0.213398074469.issue31908@psf.upfronthosting.co.za> Message-ID: <1510612881.82.0.213398074469.issue31908@psf.upfronthosting.co.za> Change by Michael Selik : ---------- nosy: +selik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 17:43:51 2017 From: report at bugs.python.org (Michael Selik) Date: Mon, 13 Nov 2017 22:43:51 +0000 Subject: [issue31908] trace module cli does not write cover files In-Reply-To: <1509418506.94.0.213398074469.issue31908@psf.upfronthosting.co.za> Message-ID: <1510613031.91.0.213398074469.issue31908@psf.upfronthosting.co.za> Michael Selik added the comment: You're referring to something like this: + def test_count_and_summary(self): + name = TESTFN + '.py' + with open(name, 'w') as fd: + self.addCleanup(unlink, name) + fd.write("""\ +x = 1 +y = 2 + +def f(): + return x + y + +for i in range(10): + f() + """) + status, stdout, stderr = assert_python_ok('-m', 'trace', '-cs', name) + self.assertEqual(status, 0) + self.assertIn(b'lines cov% module (path)', stdout) + self.assertIn(('6 100%% %s (%s)' % (TESTFN, name)).encode(), stdout) + ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 17:49:59 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 13 Nov 2017 22:49:59 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510613399.74.0.213398074469.issue32018@psf.upfronthosting.co.za> Guido van Rossum added the comment: Those people who read and write annotations regularly are all using the convention that was added to PEP 8, so let's make inspect follow that lead rather than argue about it here. :-) ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 17:53:52 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 13 Nov 2017 22:53:52 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510613632.14.0.213398074469.issue32018@psf.upfronthosting.co.za> R. David Murray added the comment: Agreed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 18:02:31 2017 From: report at bugs.python.org (Aaron Meurer) Date: Mon, 13 Nov 2017 23:02:31 +0000 Subject: [issue32019] Interactive shell doesn't work with readline bracketed paste Message-ID: <1510614151.97.0.213398074469.issue32019@psf.upfronthosting.co.za> New submission from Aaron Meurer : Here are the steps to reproduce this: - Compile and link Python against readline version 7.0 or higher. - Add set enable-bracketed-paste on to your ~/.inputrc - Start python and paste the following two lines. Make sure to use a terminal emulator that supports bracketed paste (most modern ones do). You'll need to type enter after pasting the lines. a = 1 a You get something like >>> a = 1 a File "", line 1 a ^ SyntaxError: multiple statements found while compiling a single statement It does work, however, if you paste something that has a newline but is a single statement, like (1, 2) Fixing this in the right way might not be so easy, due to the way that compile('single') is over-engineered. A simple fix would be to disable bracketed paste in the Python shell. I tested this with Python 3.6.3. I was not able to get the git master to compile, so I couldn't test it there. ---------- messages: 306176 nosy: Aaron.Meurer priority: normal severity: normal status: open title: Interactive shell doesn't work with readline bracketed paste _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 18:23:36 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 13 Nov 2017 23:23:36 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge In-Reply-To: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> Message-ID: <1510615416.77.0.213398074469.issue31963@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Given this is gcc exploding, I'm not sure there is anything we can do about it. I _believe_ we're doing everything right. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 19:00:39 2017 From: report at bugs.python.org (Anders Lorentsen) Date: Tue, 14 Nov 2017 00:00:39 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1510617639.78.0.213398074469.issue31956@psf.upfronthosting.co.za> Anders Lorentsen added the comment: Writing my tests, I originally looked at Lib/test/seq_tests.py. One test case uses indexes that are (+-)4*sys.maxsize. This does not fit in Py_ssize_t, and so these tests cause my array implementation to raise an overflow exception. A solution is of course to have the function take general objects instead, and then truncate them down to a number that can fit in Py_ssize_t if it's too negative or positive). But I concur. It seems more reasonable to stay consistent with the rest of the module, too. I'll look over the test code to make sure I test for every given scenario (or as many as I can think of), and prepare a PR for this, then :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 19:26:30 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 00:26:30 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510619190.09.0.213398074469.issue32012@psf.upfronthosting.co.za> Nick Coghlan added the comment: In a function call, `f(x for x in iterable)` is roughly equivalent to `f(iter(iterable))`, not `f(*iterable)` (the genexp based equivalent of the latter would be ``f(*(x for x in iterable))`). Thus the base class list is no different from any other argument list in this case - it's just that generator objects aren't valid base classes. Getting back on topic for this particular bug fix though: as noted in my last PR review, I think the latest version goes too far by disallowing `@deco(x for x in iterable)` and `class C(x for x in iterable):`. While semantically questionable, there's nothing *syntactically* invalid about those - they pass a single generator expression, and that generator expression is correctly surrounded by parentheses. There's no more reason to prohibit a genexp in either of those situations at compile time than there is to prohibit a list comprehension. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 20:01:29 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 01:01:29 +0000 Subject: [issue1539925] warnings in interactive sessions Message-ID: <1510621289.89.0.213398074469.issue1539925@psf.upfronthosting.co.za> Nick Coghlan added the comment: As a user, what would I actually gain from being warned more than once per session that a particular API I'm using is deprecated? If I want that behaviour, I can already opt in to it by doing "warnings.simplefilter('always')". As things stand, the perpetually reset line counter just means that the effective default at the REPL is "warnings.simplefilter('module:::__main__')" ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 20:04:02 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 01:04:02 +0000 Subject: [issue24294] DeprecationWarnings should be visible by default in the interactive REPL In-Reply-To: <1432713990.67.0.935342603332.issue24294@psf.upfronthosting.co.za> Message-ID: <1510621442.48.0.213398074469.issue24294@psf.upfronthosting.co.za> Nick Coghlan added the comment: I don't think anybody consistently does proper resource management in the REPL, so the trade-offs involved there are quite different from those for deprecation warnings. Assuming PEP 565 gets accepted, we'll end up with once-per-session warnings for use of deprecated APIs (due to the REPL's perpetually reset line counter, as per issue 1539925), and that seems like a good level of notification to me (not too noisy, not so unobtrusive as to never be seen at all) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 21:39:24 2017 From: report at bugs.python.org (Aaron Meurer) Date: Tue, 14 Nov 2017 02:39:24 +0000 Subject: [issue24294] DeprecationWarnings should be visible by default in the interactive REPL In-Reply-To: <1432713990.67.0.935342603332.issue24294@psf.upfronthosting.co.za> Message-ID: <1510627164.28.0.213398074469.issue24294@psf.upfronthosting.co.za> Aaron Meurer added the comment: If it's of any interest to this discussion, for SymPy (for some time) we have used a custom subclass of DeprecationWarning that we enable by default https://github.com/sympy/sympy/blob/master/sympy/utilities/exceptions.py. I don't know if there are major libraries that do something similar. Our reasoning is that we really do want everybody to see the warnings. Obviously direct users of SymPy (both interactive users and library developers) need to see them so they can fix their code. But also if library X uses a deprecated behavior and a user of library X sees a deprecation warning for SymPy inside of library X, that incentivises them to bug the library X developers to fix the behavior (or PR it). The whole point of warnings as we see it is to be as loud as possible while still keeping things working, to avoid the situation where things stop working (when the deprecated behavior is removed). And + to Nathaniel's point that DeprecationWarnings are about more than just the standard library. Tons of libraries use the built in warnings, and the default warnings behavior makes no distinction between warnings coming from the standard library and warnings coming from other places. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 23:46:30 2017 From: report at bugs.python.org (Mathew M.) Date: Tue, 14 Nov 2017 04:46:30 +0000 Subject: [issue32020] arraymodule: Missing Py_DECREF in failure case of make_array() Message-ID: <1510634790.37.0.213398074469.issue32020@psf.upfronthosting.co.za> New submission from Mathew M. : Similar to issue 32013, just in a different location. For reference: https://github.com/python/cpython/blob/28b624825eb92cb8c96fbf8da267d8d14a61a841/Modules/arraymodule.c#L1932 ---------- components: Extension Modules messages: 306183 nosy: Mathew M. priority: normal severity: normal status: open title: arraymodule: Missing Py_DECREF in failure case of make_array() type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 23:54:04 2017 From: report at bugs.python.org (Mathew M.) Date: Tue, 14 Nov 2017 04:54:04 +0000 Subject: [issue32020] arraymodule: Missing Py_DECREF in failure case of make_array() In-Reply-To: <1510634790.37.0.213398074469.issue32020@psf.upfronthosting.co.za> Message-ID: <1510635244.69.0.213398074469.issue32020@psf.upfronthosting.co.za> Change by Mathew M. : ---------- keywords: +patch pull_requests: +4339 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 01:01:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 06:01:01 +0000 Subject: [issue32020] arraymodule: Missing Py_DECREF in failure case of make_array() In-Reply-To: <1510634790.37.0.213398074469.issue32020@psf.upfronthosting.co.za> Message-ID: <1510639261.32.0.213398074469.issue32020@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 56935a53b11b9a70f3e13e460777ec81a5b9195e by Serhiy Storchaka (Mat M) in branch 'master': bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() (#4391) https://github.com/python/cpython/commit/56935a53b11b9a70f3e13e460777ec81a5b9195e ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 01:01:11 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 14 Nov 2017 06:01:11 +0000 Subject: [issue32020] arraymodule: Missing Py_DECREF in failure case of make_array() In-Reply-To: <1510634790.37.0.213398074469.issue32020@psf.upfronthosting.co.za> Message-ID: <1510639271.57.0.213398074469.issue32020@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4340 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 01:07:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 06:07:43 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510639663.84.0.213398074469.issue32012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The problem with these constructions is that they are not allowed by the Python language specification. It should be explicitly changed for allowing them. And this change should be accepted by Guido. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 02:01:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 07:01:32 +0000 Subject: [issue32020] arraymodule: Missing Py_DECREF in failure case of make_array() In-Reply-To: <1510634790.37.0.213398074469.issue32020@psf.upfronthosting.co.za> Message-ID: <1510642892.32.0.213398074469.issue32020@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 18056fb11e6fe6e5247cd03073bd74df8ac0acc7 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() (GH-4391) (#4392) https://github.com/python/cpython/commit/18056fb11e6fe6e5247cd03073bd74df8ac0acc7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 02:02:31 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 07:02:31 +0000 Subject: [issue32020] arraymodule: Missing Py_DECREF in failure case of make_array() In-Reply-To: <1510634790.37.0.213398074469.issue32020@psf.upfronthosting.co.za> Message-ID: <1510642951.75.0.213398074469.issue32020@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 02:03:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 07:03:09 +0000 Subject: [issue32020] arraymodule: Missing Py_DECREF in failure case of make_array() In-Reply-To: <1510634790.37.0.213398074469.issue32020@psf.upfronthosting.co.za> Message-ID: <1510642989.53.0.213398074469.issue32020@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your contribution Mathew! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 02:43:50 2017 From: report at bugs.python.org (Andrey Klinger) Date: Tue, 14 Nov 2017 07:43:50 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes Message-ID: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> New submission from Andrey Klinger : Brotli (.br) encoding is not recognized by mimetypes module. mimetypes doesn't have API for adding encodings. The encoding is supported by most browsers: https://caniuse.com/#feat=brotli ---------- components: Library (Lib) messages: 306188 nosy: Andrey Klinger priority: normal severity: normal status: open title: Brotli encoding is not recognized by mimetypes type: enhancement versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 03:43:21 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 14 Nov 2017 08:43:21 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510649001.53.0.213398074469.issue32021@psf.upfronthosting.co.za> Christian Heimes added the comment: You can just add the encoding to mimetypes.encodings_map: mimetypes.encodings_map['.br'] = 'brotli' ---------- nosy: +christian.heimes versions: -Python 3.4, Python 3.5, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:02:41 2017 From: report at bugs.python.org (Shimon Malachi Cohen) Date: Tue, 14 Nov 2017 09:02:41 +0000 Subject: [issue32022] Python problem - == RESTART: Shell ===== Message-ID: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> New submission from Shimon Malachi Cohen : Dear Friends, It seems that I manage to find a problem with Python ... version 3.6.3 Attached is a PY file designed to solve a puzzle: see function makeGame1 To find a solution run: doFind() >>> doFind() ----> counter: 11735841 rec depth: 2367 86792-719 72581-938 916-398-- --9378-97 3985-4859 27-2879-- --819-698 937-69782 812-78561 ----> counter: 29203691 >>> It takes a few seconds to come up with a solution (deep recursive exhaustive search) if you switch between lines 109 <==> 110 then it restart Python !?!?!?!?! (see below) >>> doFind() =============================== RESTART: Shell =============================== >>> Dr. Shimon Cohen shamon51 at gmail.com ---------- components: Interpreter Core files: KAKURU.py messages: 306190 nosy: shamon51 priority: normal severity: normal status: open title: Python problem - == RESTART: Shell ===== type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47263/KAKURU.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:04:59 2017 From: report at bugs.python.org (Shimon Malachi Cohen) Date: Tue, 14 Nov 2017 09:04:59 +0000 Subject: [issue32022] Python problem - == RESTART: Shell ===== In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1510650299.71.0.213398074469.issue32022@psf.upfronthosting.co.za> Shimon Malachi Cohen added the comment: lines 209 <==> 210 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:19:06 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 14 Nov 2017 09:19:06 +0000 Subject: [issue32015] Asyncio looping during simultaneously socket read/write and reconnection In-Reply-To: <1510576758.61.0.213398074469.issue32015@psf.upfronthosting.co.za> Message-ID: <1510651146.75.0.213398074469.issue32015@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset e1d62e0b7cc842d6b75b4d480391f4a94e503255 by Andrew Svetlov (Andrey Egorov) in branch 'master': bpo-32015: Asyncio looping during simultaneously socket read/write an? (#4386) https://github.com/python/cpython/commit/e1d62e0b7cc842d6b75b4d480391f4a94e503255 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:19:51 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 14 Nov 2017 09:19:51 +0000 Subject: [issue32015] Asyncio looping during simultaneously socket read/write and reconnection In-Reply-To: <1510576758.61.0.213398074469.issue32015@psf.upfronthosting.co.za> Message-ID: <1510651191.76.0.213398074469.issue32015@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:35:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Nov 2017 09:35:19 +0000 Subject: [issue16055] incorrect error text for int(base=1000, x='1') In-Reply-To: <1348688461.13.0.427927679227.issue16055@psf.upfronthosting.co.za> Message-ID: <1510652119.92.0.213398074469.issue16055@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 58cbae22930486814cc01cf9f981d9fe5e0c68f9 by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-16055: Fixes incorrect error text for int('1', base=1000) (GH-4376) (#4389) https://github.com/python/cpython/commit/58cbae22930486814cc01cf9f981d9fe5e0c68f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:36:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 14 Nov 2017 09:36:41 +0000 Subject: [issue16055] incorrect error text for int(base=1000, x='1') In-Reply-To: <1348688461.13.0.427927679227.issue16055@psf.upfronthosting.co.za> Message-ID: <1510652201.63.0.213398074469.issue16055@psf.upfronthosting.co.za> STINNER Victor added the comment: Thank you Sanyam Khurana, I merged your PR and backported the fix automaticalled to Python 3.6. Can you please try to backport the fix to Python 2.7 and create a new PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:49:30 2017 From: report at bugs.python.org (Andrey) Date: Tue, 14 Nov 2017 09:49:30 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510652970.05.0.213398074469.issue32021@psf.upfronthosting.co.za> Andrey added the comment: Yes, however would it make sense to add it, so mimetypes recognizes it by default? I will make a PR if it makes sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:49:56 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 14 Nov 2017 09:49:56 +0000 Subject: [issue32015] Asyncio looping during simultaneously socket read/write and reconnection In-Reply-To: <1510576758.61.0.213398074469.issue32015@psf.upfronthosting.co.za> Message-ID: <1510652996.83.0.213398074469.issue32015@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- pull_requests: +4341 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 05:14:58 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 14 Nov 2017 10:14:58 +0000 Subject: [issue32015] Asyncio looping during simultaneously socket read/write and reconnection In-Reply-To: <1510576758.61.0.213398074469.issue32015@psf.upfronthosting.co.za> Message-ID: <1510654498.16.0.213398074469.issue32015@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset cc0961c517c31578f6a40a4dc7ea177d62c256b7 by Andrew Svetlov in branch '3.6': [3.6] bpo-32015: Asyncio looping during simultaneously socket read/write an? (GH-4386) (#4393) https://github.com/python/cpython/commit/cc0961c517c31578f6a40a4dc7ea177d62c256b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 05:25:04 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 10:25:04 +0000 Subject: [issue32023] Always require parentheses for genexps in base class lists Message-ID: <1510655104.02.0.213398074469.issue32023@psf.upfronthosting.co.za> New submission from Nick Coghlan : The compiler currently allows parentheses to be omitted if a generator expression is the sole entry in a base class list: >>> class C(x for x in []): pass ... Traceback (most recent call last): File "", line 1, in TypeError: cannot create 'generator' instances The language reference states that the parentheses around a generator expression are only optional for "calls with only one argument": https://docs.python.org/3/reference/expressions.html#generator-expressions A base class list is not a call, so this should be treated as a syntax error, rather than being handled as equivalent to `class C((x for x in [])): pass` ---------- components: Interpreter Core messages: 306197 nosy: ncoghlan, serhiy.storchaka priority: low severity: normal status: open title: Always require parentheses for genexps in base class lists type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 05:28:28 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 10:28:28 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510655308.25.0.213398074469.issue32012@psf.upfronthosting.co.za> Nick Coghlan added the comment: I created https://bugs.python.org/issue32023 to explicitly cover the base class list case, and after checking the language spec, I agree that case should be a syntax error. However, `@deco(x for x in [])` should *not* be a syntax error, as: * it's a call with one argument, so the genexp parentheses can be omitted as described in https://docs.python.org/3/reference/expressions.html#generator-expressions * it matches the "@dotted_name(arg_list)" pattern permitted by https://docs.python.org/3/reference/compound_stmts.html#function-definitions ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 05:43:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 10:43:13 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510656193.36.0.213398074469.issue32012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: No, it doesn't match the "@dotted_name(arg_list)" pattern. decorator: "@" `dotted_name` ["(" [`argument_list` [","]] ")"] NEWLINE call: `primary` "(" [`argument_list` [","] | `comprehension`] ")" argument_list: `positional_arguments` ["," `starred_and_keywords`] : ["," `keywords_arguments`] : | `starred_and_keywords` ["," `keywords_arguments`] : | `keywords_arguments` The call syntax contains a special case for generator expression. The decorator expression syntax dosn't contain it. You should change the grammar rule to decorator: "@" `dotted_name` ["(" [`argument_list` [","] | `comprehension`] ")"] NEWLINE for supporting this syntax. Please open a separate topic on Python-Dev for discussing this language change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 06:40:15 2017 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Tue, 14 Nov 2017 11:40:15 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510659615.92.0.213398074469.issue32012@psf.upfronthosting.co.za> Henk-Jaap Wagenaar added the comment: I think this showcases how difficult it is to get this right, requires carefully reading the EBNF language spec, not just the text, and the behaviour is unexpected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 07:38:37 2017 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 14 Nov 2017 12:38:37 +0000 Subject: [issue32022] Python problem - == RESTART: Shell ===== In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1510663117.46.0.213398074469.issue32022@psf.upfronthosting.co.za> Eric V. Smith added the comment: Can you reproduce this with a much smaller example? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 07:48:45 2017 From: report at bugs.python.org (Shimon Malachi Cohen) Date: Tue, 14 Nov 2017 12:48:45 +0000 Subject: [issue32022] Python problem - == RESTART: Shell ===== In-Reply-To: <1510663117.46.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: Shimon Malachi Cohen added the comment: Not really... Did you see the "restart" ? On Nov 14, 2017 2:38 PM, "Eric V. Smith" wrote: > > Eric V. Smith added the comment: > > Can you reproduce this with a much smaller example? > > ---------- > nosy: +eric.smith > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 07:59:05 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 14 Nov 2017 12:59:05 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510664345.43.0.213398074469.issue32021@psf.upfronthosting.co.za> R. David Murray added the comment: It looks like Brotli is a de-facto standard (RFC 7932 is an informational RFC), and it says the IANA registry has been updated. However, this appears to be http-only, with no corresponding program used for compression of files, and thus no "file extension" to be registered, or program name to put in the encodings_map table. We don't have most of the types listed in the http content encodings registry in mimetypes, so I don't at this time see any reason to add br. mimetypes is aimed at files, not http. In what context do you want to use mimetimes to look up br? ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:03:05 2017 From: report at bugs.python.org (Stefan Krah) Date: Tue, 14 Nov 2017 13:03:05 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510664585.08.0.213398074469.issue32012@psf.upfronthosting.co.za> Stefan Krah added the comment: I think "ambiguous" is not the right word. If a single argument can be a non-parenthesized generator and all arguments can be followed by a trailing comma, it's clear. The language spec is often behind in my experience. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:09:52 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 13:09:52 +0000 Subject: [issue32024] Nominal decorator function call syntax is inconsistent with regular function calls Message-ID: <1510664992.07.0.213398074469.issue32024@psf.upfronthosting.co.za> New submission from Nick Coghlan : Function calls in decorators are implemented as regular function calls, and hence permit the use of generator expressions as their sole argument without a second pair of parentheses. However, https://docs.python.org/3/reference/compound_stmts.html#function-definitions defines the permitted arguments differently from the way https://docs.python.org/3/reference/expressions.html#calls defines them, and thus technically considers a "function call as a decorator" to be a different construct from "a function call". The actual implementation treats these as the same thing, so clarification is needed as to whether it is the implementation or the language specification that should be updated to resolve the inconsistency. ---------- assignee: docs at python components: Documentation messages: 306205 nosy: docs at python, gvanrossum, ncoghlan, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Nominal decorator function call syntax is inconsistent with regular function calls type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:12:52 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 13:12:52 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510665172.13.0.213398074469.issue32012@psf.upfronthosting.co.za> Nick Coghlan added the comment: OK, I've filed https://bugs.python.org/issue32024 to cover the decorator syntax discrepancy. So I'd still prefer to restrict the patch for *this* issue to just the genuinely ambiguous case, and leave the unambiguous-but-inconsistent-with-the-language-spec cases to their respective issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:17:58 2017 From: report at bugs.python.org (Stefan Krah) Date: Tue, 14 Nov 2017 13:17:58 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510665172.13.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <20171114131747.GA14079@bytereef.org> Stefan Krah added the comment: I would prefer to do nothing about the subject of this issue. I still don't see any ambiguity, except in a very broad colloquial sense. Why introduce another special case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:31:52 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 13:31:52 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510666312.8.0.213398074469.issue32012@psf.upfronthosting.co.za> Nick Coghlan added the comment: If limited to the original scope, this isn't a new special case, it's fixing a bug in the implementation of the existing special case (where it's ignoring the trailing comma when it shouldn't be). If it hadn't been for the scope creep to include a couple of other cases where the implementation is arguably more permissive than the language spec says it should, it would have already been merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:43:30 2017 From: report at bugs.python.org (Stefan Krah) Date: Tue, 14 Nov 2017 13:43:30 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510666312.8.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <20171114134320.GA14749@bytereef.org> Stefan Krah added the comment: On Tue, Nov 14, 2017 at 01:31:52PM +0000, Nick Coghlan wrote: > If limited to the original scope, this isn't a new special case, it's fixing a bug in the implementation of the existing special case (where it's ignoring the trailing comma when it shouldn't be). This ignores the trailing comma: f([1,2,3],) And this: f(x for x in [1,2,3],) Seems logical to me. Do you want to allow the 1,2 to be read as a tuple? f(x for x in 1,2) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:50:20 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 14 Nov 2017 13:50:20 +0000 Subject: [issue32025] Add time.thread_time() Message-ID: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Currently, the time module has time.process_time(), a cross-platform function for getting per-process elapsed CPU time. Similarly, we could expose time.thread_time(), to get per-thread elapsed CPU time. On a modern POSIX platform, it can use clock_gettime(CLOCK_THREAD_CPUTIME_ID). On Windows, it can use GetThreadTimes(): https://msdn.microsoft.com/en-us/library/ms683237%28VS.85%29.aspx On other platforms, it can simply raise NotImplementedError. Currently, you would need ctypes hacks to call GetThreadTimes(), which is not very nice. ---------- components: Library (Lib) messages: 306210 nosy: belopolsky, haypo, pitrou priority: normal severity: normal status: open title: Add time.thread_time() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:55:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 13:55:40 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510667740.32.0.213398074469.issue32012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I would prefer to fix all related cases in one issue, for having all examples in one place and having only one reference. All this cases are caused by the limitation of the parser used in CPython, and using different grammar rules. This If you want to change the language specification for decorator expression and class definition, it should be discussed before merging PR 4382, and I would make corresponding changes in it. In any case it is harder to fix issue32023 without fixing the original issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:57:40 2017 From: report at bugs.python.org (Stefan Krah) Date: Tue, 14 Nov 2017 13:57:40 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510667860.9.0.213398074469.issue32012@psf.upfronthosting.co.za> Change by Stefan Krah : ---------- nosy: -skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:59:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 13:59:52 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510667992.64.0.213398074469.issue32012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Stefan, `[1,2,3]` is an expression, but `x for x in [1,2,3]` is not. If you want to change the Python language specification, please open a topic on Python-Dev and provide the rationale. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 09:02:28 2017 From: report at bugs.python.org (Stefan Krah) Date: Tue, 14 Nov 2017 14:02:28 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510668148.74.0.213398074469.issue32012@psf.upfronthosting.co.za> Stefan Krah added the comment: Yes Sir! ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 09:02:43 2017 From: report at bugs.python.org (Stefan Krah) Date: Tue, 14 Nov 2017 14:02:43 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510668163.73.0.213398074469.issue32012@psf.upfronthosting.co.za> Change by Stefan Krah : ---------- nosy: -skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 09:03:11 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 14 Nov 2017 14:03:11 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510668191.98.0.213398074469.issue32012@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- nosy: -yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 09:31:53 2017 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 14 Nov 2017 14:31:53 +0000 Subject: [issue32022] Python problem - == RESTART: Shell ===== In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1510669913.16.0.213398074469.issue32022@psf.upfronthosting.co.za> Eric V. Smith added the comment: That's too much code for me to run without analyzing it first. If I have time, I'll look at it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 09:34:03 2017 From: report at bugs.python.org (Andrey) Date: Tue, 14 Nov 2017 14:34:03 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510670043.98.0.213398074469.issue32021@psf.upfronthosting.co.za> Andrey added the comment: When "type, encoding = mimetypes.guess_type('file.js.br')" is used not only the "encoding" is not set to "brotli", but the type is also not recognized. Such code is used in aiohttp for example. My proposal is to add 'br' to mimetypes.encodings_map, not to mimetypes.types_map ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 10:21:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 15:21:28 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510672888.85.0.213398074469.issue15606@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b0b44b4b3337297007f5ef87220a75df204399f8 by Serhiy Storchaka in branch 'master': bpo-15606: Improve the re.VERBOSE documentation. (#4366) https://github.com/python/cpython/commit/b0b44b4b3337297007f5ef87220a75df204399f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 10:22:43 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 14 Nov 2017 15:22:43 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510672963.96.0.213398074469.issue15606@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4342 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 10:23:36 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 14 Nov 2017 15:23:36 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510673016.91.0.213398074469.issue15606@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4343 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 10:38:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 15:38:52 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510673932.56.0.213398074469.issue15606@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 14c1fe682f0086ec28f24fee9bf1c85d80507ee5 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-15606: Improve the re.VERBOSE documentation. (GH-4366) (#4394) https://github.com/python/cpython/commit/14c1fe682f0086ec28f24fee9bf1c85d80507ee5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 10:39:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 15:39:06 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510673946.24.0.213398074469.issue15606@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a2f1be0b5ba2bed49b7f94c026b541ff07e52518 by Serhiy Storchaka (Miss Islington (bot)) in branch '2.7': bpo-15606: Improve the re.VERBOSE documentation. (GH-4366) (#4395) https://github.com/python/cpython/commit/a2f1be0b5ba2bed49b7f94c026b541ff07e52518 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 10:39:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 15:39:50 +0000 Subject: [issue15606] re.VERBOSE whitespace behavior not completely documented In-Reply-To: <1344534617.67.0.49137100671.issue15606@psf.upfronthosting.co.za> Message-ID: <1510673990.52.0.213398074469.issue15606@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 10:40:09 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 14 Nov 2017 15:40:09 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1510674009.42.0.213398074469.issue31415@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I think there is nothing left to do for this issue, so I'm closing it. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 11:12:03 2017 From: report at bugs.python.org (Shimon Malachi Cohen) Date: Tue, 14 Nov 2017 16:12:03 +0000 Subject: [issue32022] Python problem - == RESTART: Shell ===== In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1510675923.59.0.213398074469.issue32022@psf.upfronthosting.co.za> Shimon Malachi Cohen added the comment: Here is another simple example - Simple? the game board ==> is small see attached PY file run ==> doFind() ---------- Added file: https://bugs.python.org/file47264/KAKURU.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 11:29:26 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 14 Nov 2017 16:29:26 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510676966.97.0.213398074469.issue32021@psf.upfronthosting.co.za> R. David Murray added the comment: OK, so there are "real" filenames that have .br on the end? That wasn't clear from the RFC and discussions I found. Based on the documentation, br is for use in the Content-Encoding header. What does aiohttp do when it gets a brotli encoded file? What does it do with the other types in the http content-encoding table? (https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding) Where is the standard that talks about the '.br' file extension? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 11:31:15 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 14 Nov 2017 16:31:15 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510677075.98.0.213398074469.issue32021@psf.upfronthosting.co.za> R. David Murray added the comment: Note, I'm not saying we shouldn't do this, I'd just like to get good documentation of why linked to this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 11:37:08 2017 From: report at bugs.python.org (PJ Naughter) Date: Tue, 14 Nov 2017 16:37:08 +0000 Subject: [issue32026] Memory leaks in Python on Windows Message-ID: <1510677428.51.0.213398074469.issue32026@psf.upfronthosting.co.za> New submission from PJ Naughter : I would like to report memory leaks in Python 3.6.3 when embedded in a C++ Windows app. I have download the Python 3.6.3 code and compiled a debug version of Python with my copy of Visual Studio 2017 Professional (have also confirmed the problem in Visual Studio 2015 Professional) and built the debug version of the Python DLL. With the following sample app I get memory leaks when compiled in debug mode: //Pull in the Windows header and the MSVC Debug C Runtime #include #define _CRTDBG_MAP_ALLOC #include #include //Pull in Python #include int __stdcall WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, _In_ LPTSTR /*lpCmdLine*/, int /*nCmdShow*/) { //Track memory leaks using the MSVC Debug CRT _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); //_CrtSetBreakAlloc(81); //Initialize Python Py_Initialize(); PyEval_InitThreads(); //Pretend this app does something! Sleep(2000); //Shutdown Python Py_FinalizeEx(); } Taking out the calls to Py_Initialize, PyEval_InitThreads & Py_FinalizeEx results in no memory leaks being reported. The actual reported memory leaks are reported to the output window in Visual Studio as follows: Detected memory leaks! Dumping objects -> {700} normal block at 0x014E0078, 2604 bytes long. Data: < r o > 00 00 0A 1C 72 FB FB FB 00 00 0A 0C 6F FB FB FB { 698 } normal block at 0x01502148, 2604 bytes long. Data : < r o > 00 00 0A 1C 72 FB FB FB 00 00 0A 0C 6F FB FB FB { 697 } normal block at 0x014DA350, 52 bytes long. Data : < $r > 00 00 00 24 72 FB FB FB FF FF FF FF FF FF FF FF { 458 } normal block at 0x01511A88, 81968 bytes long. Data : < @ r @ o > 00 01 40 20 72 FB FB FB 00 01 40 10 6F FB FB FB { 389 } normal block at 0x014F1270, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 359 } normal block at 0x014FA730, 5168 bytes long. Data : < r o > 00 00 14 20 72 FB FB FB 00 00 14 10 6F FB FB FB { 319 } normal block at 0x014EE120, 2604 bytes long. Data : < r o > 00 00 0A 1C 72 FB FB FB 00 00 0A 0C 6F FB FB FB { 315 } normal block at 0x014EC478, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 307 } normal block at 0x01500B98, 529 bytes long. Data : < r o > 00 00 02 01 72 FB FB FB 00 00 01 F1 6F FB FB FB { 281 } normal block at 0x01500350, 709 bytes long. Data : < r o > 00 00 02 B5 72 FB FB FB 00 00 02 A5 6F FB FB FB { 264 } normal block at 0x014FDAF8, 10284 bytes long. Data : < (r(o > 00 00 28 1C 72 FB FB FB 00 00 28 0C 6F FB FB FB { 253 } normal block at 0x014F89F0, 539 bytes long. Data : < r o > 00 00 02 0B 72 FB FB FB 00 00 01 FB 6F FB FB FB { 248 } normal block at 0x014F5448, 847 bytes long. Data: < ? r / o > 00 00 03 3F 72 FB FB FB 00 00 03 2F 6F FB FB FB { 247 } normal block at 0x014F0A78, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 235 } normal block at 0x014F2A58, 1409 bytes long. Data : < qr ao > 00 00 05 71 72 FB FB FB 00 00 05 61 6F FB FB FB { 234 } normal block at 0x014F1FB8, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 233 } normal block at 0x014F1A68, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 232 } normal block at 0x014F1518, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 231 } normal block at 0x014E2BE0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 230 } normal block at 0x014EFFF8, 2604 bytes long. Data : < r o > 00 00 0A 1C 72 FB FB FB 00 00 0A 0C 6F FB FB FB { 229 } normal block at 0x014EFD60, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 228 } normal block at 0x014EF9E8, 843 bytes long. Data : <; r + o > 00 00 03 3B 72 FB FB FB 00 00 03 2B 6F FB FB FB { 227 } normal block at 0x014EF750, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 226 } normal block at 0x014E4410, 561 bytes long. Data : < !r o > 00 00 02 21 72 FB FB FB 00 00 02 11 6F FB FB FB { 225 } normal block at 0x014EF1D0, 1360 bytes long. Data : < @r 0o > 00 00 05 40 72 FB FB FB 00 00 05 30 6F FB FB FB { 224 } normal block at 0x014E49E0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 206 } normal block at 0x014E3C88, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 205 } normal block at 0x014E3978, 734 bytes long. Data : < r o > 00 00 02 CE 72 FB FB FB 00 00 02 BE 6F FB FB FB { 204 } normal block at 0x014E3358, 1521 bytes long. Data : < r o > 00 00 05 E1 72 FB FB FB 00 00 05 D1 6F FB FB FB { 195 } normal block at 0x014E9890, 1553 bytes long. Data : < r o > 00 00 06 01 72 FB FB FB 00 00 05 F1 6F FB FB FB { 192 } normal block at 0x014E8648, 734 bytes long. Data : < r o > 00 00 02 CE 72 FB FB FB 00 00 02 BE 6F FB FB FB { 191 } normal block at 0x014E8508, 276 bytes long. Data : < r C : \ p > 00 00 01 04 72 FB FB FB 43 00 3A 00 5C 00 70 00 {118} normal block at 0x014E2948, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 117 } normal block at 0x014E26B0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 116 } normal block at 0x014E1F38, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 115 } normal block at 0x014E21D0, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 113 } normal block at 0x014E1CA0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 111 } normal block at 0x014E0DB0, 593 bytes long. Data : < Ar 1o > 00 00 02 41 72 FB FB FB 00 00 02 31 6F FB FB FB { 110 } normal block at 0x014E1528, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 108 } normal block at 0x014E1048, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 106 } normal block at 0x014E0B18, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 105 } normal block at 0x014DD3C0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 104 } normal block at 0x014DD128, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 103 } normal block at 0x014DCE90, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 102 } normal block at 0x014DCBF8, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 101 } normal block at 0x014DC9B8, 532 bytes long. Data : < r o > 00 00 02 04 72 FB FB FB 00 00 01 F4 6F FB FB FB { 99 } normal block at 0x014DEF40, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 98 } normal block at 0x014DF1D8, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 96 } normal block at 0x014DD658, 577 bytes long. Data : < 1r !o > 00 00 02 31 72 FB FB FB 00 00 02 21 6F FB FB FB { 95 } normal block at 0x014DEA60, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 93 } normal block at 0x014DE790, 670 bytes long. Data : < r ~o > 00 00 02 8E 72 FB FB FB 00 00 02 7E 6F FB FB FB { 92 } normal block at 0x014DE2B0, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 90 } normal block at 0x014DDDD0, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 88 } normal block at 0x014DD8F0, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 86 } normal block at 0x014DC720, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 85 } normal block at 0x014DC488, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 81 } normal block at 0x014DAC08, 464 bytes long. Data : < r : > > 00 00 01 C0 72 FB FB FB 00 00 3A 03 00 00 3E 03 Object dump complete. If you uncomment the call to _CrtSetBreakAlloc and set the parameter to this API to for example 81, the Visual Studio debugger will break where the memory allocation occurs. I have taken all the numbers and confirmed these are memory allocations which occur in the Python functions I am using. Most of these are due to memory allocations of static C variables in the Python source code. I would be most grateful if these issues can be fixed up in the Python codebase. I am available to answer any questions about the issue at any time if necessary. Regards, PJ Naughter ---------- components: Windows messages: 306223 nosy: paul.moore, pjna, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Memory leaks in Python on Windows type: resource usage versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:01:13 2017 From: report at bugs.python.org (Jeroen Demeyer) Date: Tue, 14 Nov 2017 17:01:13 +0000 Subject: [issue31388] Provide a way to defer SIGINT handling in the current thread In-Reply-To: <1504814605.12.0.216214618224.issue31388@psf.upfronthosting.co.za> Message-ID: <1510678873.49.0.213398074469.issue31388@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: It's not only about ensuring that cleanup code gets run, but also about ensuring that the interrupt is actually seen. Currently, if you press CTRL-C at the "wrong" moment (during __del__), it will just get ignored. ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:19:30 2017 From: report at bugs.python.org (Steve Dower) Date: Tue, 14 Nov 2017 17:19:30 +0000 Subject: [issue32026] Memory leaks in Python on Windows In-Reply-To: <1510677428.51.0.213398074469.issue32026@psf.upfronthosting.co.za> Message-ID: <1510679970.38.0.213398074469.issue32026@psf.upfronthosting.co.za> Steve Dower added the comment: Not sure how much we can do about this, but you may want to try with Python 3.7. Eric and Nick have been working on streamlining startup, which includes a lot of work (thanks Eric!) to remove static variables. Don't expect a fix in Python 3.6 for this, and don't be surprised if Eric/Nick closes this and references whichever bug they're using to track the other work, but it is something that we're aware of and are (slowly) working to address. ---------- nosy: +eric.snow, ncoghlan versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:20:39 2017 From: report at bugs.python.org (Andrey) Date: Tue, 14 Nov 2017 17:20:39 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510680039.41.0.213398074469.issue32021@psf.upfronthosting.co.za> Andrey added the comment: Currently aiohttp doesn't support Brotli. (I'm here because I would like to get that support) When it gets (as a server) a request for file.html it checks if file.html.gz exists (and accept-encoding contains 'gzip'). It then send file.html.gz to the client and sets Content-Encoding to gzip. It uses mimetypes.guess_type to set Content-Type and Content-Encoding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:24:15 2017 From: report at bugs.python.org (PJ Naughter) Date: Tue, 14 Nov 2017 17:24:15 +0000 Subject: [issue32026] Memory leaks in Python on Windows In-Reply-To: <1510677428.51.0.213398074469.issue32026@psf.upfronthosting.co.za> Message-ID: <1510680255.45.0.213398074469.issue32026@psf.upfronthosting.co.za> PJ Naughter added the comment: OK, Thanks for the quick reply. I have just migrated my application from Python 3.3 to Python 3.6.3 and would not expect you to backport changes from the 3.7 development stream to the released stream. What I will do when I get a chance is pull down the 3.7 sources and compare the demo app I have produced with 3.7 vs 3.6.3 to see if improvements have been done in this area. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:26:28 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 14 Nov 2017 17:26:28 +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: <1510680388.21.0.213398074469.issue29406@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I'm picking up the issue. Will provide an updated PR soon. ---------- assignee: yselivanov -> asvetlov nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:29:42 2017 From: report at bugs.python.org (=?utf-8?q?J=C3=B6rn_Hees?=) Date: Tue, 14 Nov 2017 17:29:42 +0000 Subject: [issue32027] argparse allow_abbrev option also controls short flag combinations Message-ID: <1510680582.36.0.213398074469.issue32027@psf.upfronthosting.co.za> New submission from J?rn Hees : The allow_abbrev option (default True) currently is documented like this (https://docs.python.org/3/library/argparse.html#allow-abbrev): > Normally, when you pass an argument list to the parse_args() method of an ArgumentParser, it recognizes abbreviations of long options. However, it also controls combinations of short options and especially the combination of flags (store_const) like `-a -b` as `-ab`. Example snippet for testing: import argparse import sys parser = argparse.ArgumentParser( allow_abbrev=False ) parser.add_argument('-a', action='store_true') parser.add_argument('-b', action='store_true') parser.add_argument('x', nargs='*') parser.parse_args('-a -b foo bar'.split()) parser.parse_args('-ab foo bar'.split()) As you can see the 2nd parse will fail if allow_abbrev=False. This issue is either a doc issue only or an unintended combination of long option shortening and (the way more common) flag combinations. When i deactivated this in my code, i wanted to disable the (nice to have) long option shortening, but i unintentionally also deactivated (MUST have) short flag combinations. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 306229 nosy: docs at python, joern priority: normal severity: normal status: open title: argparse allow_abbrev option also controls short flag combinations versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:31:09 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 14 Nov 2017 17:31:09 +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: <1510680669.86.0.213398074469.issue29406@psf.upfronthosting.co.za> Andrew Svetlov added the comment: I'm skeptical about `critical` priority. The bugfix could be backported to Python 3.6 but I very not sure about the need for 3.5. It is a desirable fix but not secure. Yury Selivanov please confirm. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:42:50 2017 From: report at bugs.python.org (Martin Drawitsch) Date: Tue, 14 Nov 2017 17:42:50 +0000 Subject: [issue32028] Syntactically wrong suggestions by the new custom print statement error message Message-ID: <1510681370.22.0.213398074469.issue32028@psf.upfronthosting.co.za> New submission from Martin Drawitsch : I think I found a bug in the new print syntax suggestion introduced by https://bugs.python.org/issue30597. When the following code is executed by Python 3.6.3 inside of a .py file: def f(): print '%d' % 2 , then Python gives the following error message: SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int '%d' % 2)? The "int" next to the left brace of the suggested print function is obviously wrong. The expected message would be: SyntaxError: Missing parentheses in call to 'print'. Did you mean print('%d' % 2)? Using other values or "%s" in the formatted string in a print statement produces the same wrong message. This bug only seems to happen when the print statement is inside of a function AND when it is is run inside of a .py file. At least I could not reproduce it in the python3 REPL or outside of a function. I am attaching the minimal example file in this bug report. Running it with "$ python3 print.py" should show the mentioned bug. ---------- components: Interpreter Core files: print.py messages: 306231 nosy: CuriousLearner, mdraw, ncoghlan priority: normal severity: normal status: open title: Syntactically wrong suggestions by the new custom print statement error message type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47265/print.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:44:27 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 14 Nov 2017 17:44:27 +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: <1510681467.31.0.213398074469.issue29406@psf.upfronthosting.co.za> Yury Selivanov added the comment: > The bugfix could be backported to Python 3.6 but I very not sure about the need for 3.5. > It is a desirable fix but not secure. The attached script looks very innocent, and it's worrisome that it's that easy to make an asyncio SSL server to leak sockets in some contexts. I think it's OK to fix 3.5, but let's make the final decision when we have an approved PR. I merged Nick's PR once, but then it introduced some problems on buildbots (https://bugs.python.org/msg295659), so I reverted the commit. I'd suggest to look at the attached script again (scratch_1.py) and try to understand what exactly causes the problem with that specific Apache server version. I'd also suggest to come up with a *functional* unittest that reproduces it (you can grab some testing utilities from the uvloop project). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 13:00:03 2017 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 14 Nov 2017 18:00:03 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510682403.95.0.213398074469.issue32012@psf.upfronthosting.co.za> Guido van Rossum added the comment: It's a (small) mistake that we didn't make the syntax for argument lists in decorators the same as argument lists everywhere else, and that should be fixed to allow exactly what's allowed in regular calls. (That syntax is weird because we don't want e.g. `@foo().bar` but we do want e.g. `@foo.bar()`.) I am honestly not sure that we should change anything here, since the meaning is not actually ambiguous: the syntax for generator expressions doesn't allow e.g. `x for x in 1, 2, 3` -- you have to write `x for x in (1, 2, 3)`. (A regular for-loop *does* allow this, but there the context makes it unambiguous -- that's why genexprs are different.) But I'm fine with changing it, as long as we do it consistently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 13:00:57 2017 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 14 Nov 2017 18:00:57 +0000 Subject: [issue32024] Nominal decorator function call syntax is inconsistent with regular function calls In-Reply-To: <1510664992.07.0.213398074469.issue32024@psf.upfronthosting.co.za> Message-ID: <1510682457.2.0.213398074469.issue32024@psf.upfronthosting.co.za> Guido van Rossum added the comment: The implementation is as intended and the language spec needs an update. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 13:04:46 2017 From: report at bugs.python.org (=?utf-8?q?J=C3=B6rn_Hees?=) Date: Tue, 14 Nov 2017 18:04:46 +0000 Subject: [issue32027] argparse allow_abbrev option also controls short flag combinations In-Reply-To: <1510680582.36.0.213398074469.issue32027@psf.upfronthosting.co.za> Message-ID: <1510682686.97.0.213398074469.issue32027@psf.upfronthosting.co.za> Change by J?rn Hees : ---------- keywords: +patch pull_requests: +4344 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 13:05:19 2017 From: report at bugs.python.org (Elias Zamaria) Date: Tue, 14 Nov 2017 18:05:19 +0000 Subject: [issue27923] PEP 467 -- Minor API improvements for binary sequences In-Reply-To: <1472691379.75.0.669592694643.issue27923@psf.upfronthosting.co.za> Message-ID: <1510682719.0.0.213398074469.issue27923@psf.upfronthosting.co.za> Elias Zamaria added the comment: Can someone here merge my pull request? If not, then what else needs to be done for my change to be included in 3.7? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 13:24:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 18:24:14 +0000 Subject: [issue27923] PEP 467 -- Minor API improvements for binary sequences In-Reply-To: <1472691379.75.0.669592694643.issue27923@psf.upfronthosting.co.za> Message-ID: <1510683854.51.0.213398074469.issue27923@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't think these changes should be merged. For bytes.zeros(N), you can use b'\0' * N. For iterbytes() methods, I think that the general function which works with any sequence that support slicing would be more useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 13:25:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 18:25:26 +0000 Subject: [issue32024] Nominal decorator function call syntax is inconsistent with regular function calls In-Reply-To: <1510664992.07.0.213398074469.issue32024@psf.upfronthosting.co.za> Message-ID: <1510683926.43.0.213398074469.issue32024@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- dependencies: +Disallow ambiguous syntax f(x for x in [1],) type: behavior -> enhancement versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 13:44:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 14 Nov 2017 18:44:28 +0000 Subject: [issue32023] Always require parentheses for genexps in base class lists In-Reply-To: <1510655104.02.0.213398074469.issue32023@psf.upfronthosting.co.za> Message-ID: <1510685068.93.0.213398074469.issue32023@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- dependencies: +Disallow ambiguous syntax f(x for x in [1],) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 14:56:04 2017 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 14 Nov 2017 19:56:04 +0000 Subject: [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge In-Reply-To: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> Message-ID: <1510689364.02.0.213398074469.issue31963@psf.upfronthosting.co.za> Neil Schemenauer added the comment: I'm willing to put some time into trying to fix this, in the case that it is caused by my Makefile changes. However, it would be very helpful if I could login to the build-bot and try running with the Makefile change backed out. Is that possible? Having to setup a VM to match the compiler of the build-bot would take quite a bit a of extra time. Looking at the "stdout" log file, I can't see that we are doing anything wrong. Specifically, the ".gc??" files are being removed and so I think that rules out the theory of stale profile information files messing up GCC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 14:57:02 2017 From: report at bugs.python.org (Sam Napolitano) Date: Tue, 14 Nov 2017 19:57:02 +0000 Subject: [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate In-Reply-To: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> Message-ID: <1510689422.98.0.213398074469.issue31997@psf.upfronthosting.co.za> Sam Napolitano added the comment: Sorry I wasn't able to get back to you sooner. If having a trailing dot in the cert is an RFC violation, then case 2 can be left alone. As for case 3, we can be more explicit: if hostname ends in a dot AND cert does not end in a dot, strip dot from hostname. This seems to be what Ryan was saying Chrome does. I did a test using s_client in openssl. Testing all 4 cases in the truth table returned 200s. $ openssl s_client -connect www.google.com.:443 ... # Enter next two lines and press return twice HEAD / HTTP/1.0 Host: www.google.com. # Returns 200 HTTP/1.0 200 OK Date: Sat, 11 Nov 2017 21:20:44 GMT Expires: -1 Cache-Control: private, max-age=0 Content-Type: text/html; charset=ISO-8859-1 ... So it would appear openssl against Google handles dots ok, but I could be wrong. I don't know what server software they are running. As for testing other server ssl implementations what are you looking for? I found a small C openssl client implementation. https://ubuntuforums.org/showthread.php?t=2217101&p=12989750#post12989750 Compiling that code with some minor tweaks against openssl and testing it with different hostnames and Host headers (dot and no dot), the ssl connection was established and data read. Invalid constructs led to errors. Yes, you could move the logic to urllib, but I'm not sure it's practical as many folks just expect the ssl lib to handle the nuances. If users have to handle it themselves or include urllib, it seems like an extra lift. I appreciate you taking the time to consider the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 16:58:00 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 14 Nov 2017 21:58:00 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510696680.52.0.213398074469.issue32021@psf.upfronthosting.co.za> R. David Murray added the comment: Hmm. OK, the docs do say that value should be usable as a content-encoding header. However, absent any sort of program that actually does brotli encoding/decoding to and from files, this would be essentially useless based on the aiohttp's algorithm (or any other use I can think of for the mimetimes module in this context). Does such a program exist? I didn't find one searching the web. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 17:13:32 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 14 Nov 2017 22:13:32 +0000 Subject: [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate In-Reply-To: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> Message-ID: <1510697612.05.0.213398074469.issue31997@psf.upfronthosting.co.za> Christian Heimes added the comment: As I explained before, the ssl module is the wrong place to address the issue. You *must* keep SNI TLS extension, HTTP Host header, and hostname for SAN matching in sync. Python uses the server_hostname argument for both SNI and hostname verification. The issue must be solved in HTTP layer because the HTTP layer is the only place that can affect the HTTP Host header and SNI. OpenSSL and NSS (Firefox's crypto and TLS lib) agree with me. Both don't like trailing dots in hostname either. BoringSSL's hostname verification code is based on OpenSSL's code. I'm pretty sure that Chrome handles trailing dot in a different layer, not in the actual TLS and X.509 handler. Ryan merely said that Chrome supports hostnames with trailing dot, not BoringSSL. $ /usr/lib64/nss/unsupported-tools/vfyserv www.python.org Connecting to host www.python.org (addr 151.101.112.223) on port 443 Handshake Complete: SERVER CONFIGURED CORRECTLY bulk cipher AES-128-GCM, 128 secret key bits, 128 key bits, status: 1 subject DN: CN=www.python.org,O=Python Software Foundation,L=Wolfeboro,ST=New Hampshire,C=US,postalCode=03894-4801,STREET=16 Allen Rd,serialNumber=3359300,incorporationState=Delaware,incorporationCountry=US,businessCategory=Private Organization issuer DN: CN=DigiCert SHA2 Extended Validation Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US 0 cache hits; 0 cache misses, 0 cache not reusable ***** Connection 1 read 518 bytes total. $ /usr/lib64/nss/unsupported-tools/vfyserv www.python.org. Connecting to host www.python.org. (addr 151.101.112.223) on port 443 Error in function PR_Write: -12276 - Unable to communicate securely with peer: requested domain name does not match the server's certificate. $ openssl s_client -servername www.python.org -verify_hostname www.python.org -connect www.python.org:443 ... SSL handshake has read 4204 bytes and written 403 bytes Verification: OK Verified peername: www.python.org ... $ openssl s_client -servername www.python.org. -verify_hostname www.python.org. -connect www.python.org.:443 ... SSL handshake has read 4204 bytes and written 404 bytes Verification error: Hostname mismatch ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 17:35:35 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 14 Nov 2017 22:35:35 +0000 Subject: [issue31948] [EASY] Broken MSDN links in msilib docs In-Reply-To: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> Message-ID: <1510698935.8.0.213398074469.issue31948@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4345 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 18:06:21 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 14 Nov 2017 23:06:21 +0000 Subject: [issue31948] [EASY] Broken MSDN links in msilib docs In-Reply-To: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> Message-ID: <1510700781.11.0.213398074469.issue31948@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 3bda02222aa3783bf85fc3ff8bc042aefd9c4fd3 by Mariatta (Jesse-Bakker) in branch 'master': bpo-31948: Fix broken links in msilib docs (GH-4397) https://github.com/python/cpython/commit/3bda02222aa3783bf85fc3ff8bc042aefd9c4fd3 ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 18:09:46 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Tue, 14 Nov 2017 23:09:46 +0000 Subject: [issue31948] [EASY] Broken MSDN links in msilib docs In-Reply-To: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> Message-ID: <1510700986.93.0.213398074469.issue31948@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: This couldn't be backported by miss-islington, so someone needs to do it manually. ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 18:30:01 2017 From: report at bugs.python.org (Jesse Bakker) Date: Tue, 14 Nov 2017 23:30:01 +0000 Subject: [issue31948] [EASY] Broken MSDN links in msilib docs In-Reply-To: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> Message-ID: <1510702201.54.0.213398074469.issue31948@psf.upfronthosting.co.za> Change by Jesse Bakker : ---------- pull_requests: +4346 stage: backport needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 19:23:41 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 15 Nov 2017 00:23:41 +0000 Subject: [issue31948] [EASY] Broken MSDN links in msilib docs In-Reply-To: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> Message-ID: <1510705421.12.0.213398074469.issue31948@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 42336def77f53861284336b3335098a1b9b8cab2 by Mariatta (Jesse-Bakker) in branch '3.6': bpo-31948: Fix broken links in msilib docs (GH-4397). (GH-4398) https://github.com/python/cpython/commit/42336def77f53861284336b3335098a1b9b8cab2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 19:27:17 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 15 Nov 2017 00:27:17 +0000 Subject: [issue31948] [EASY] Broken MSDN links in msilib docs In-Reply-To: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> Message-ID: <1510705637.65.0.213398074469.issue31948@psf.upfronthosting.co.za> Change by Mariatta Wijaya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 19:31:53 2017 From: report at bugs.python.org (Sebastian Rittau) Date: Wed, 15 Nov 2017 00:31:53 +0000 Subject: [issue32029] cgi: TypeError Message-ID: <1510705913.6.0.213398074469.issue32029@psf.upfronthosting.co.za> New submission from Sebastian Rittau : Consider the following code: import cgi from io import BytesIO cgi.FieldStorage(BytesIO(b"{}"), environ={ "REQUEST_METHOD": "POST", "CONTENT_TYPE": "application/json", "CONTENT_LENGTH": "14", }) This will throw the following exception: Traceback (most recent call last): File "foo.py", line 7, in "CONTENT_LENGTH": "14", File "/usr/lib/python3.6/cgi.py", line 561, in __init__ self.read_single() File "/usr/lib/python3.6/cgi.py", line 740, in read_single self.read_binary() File "/usr/lib/python3.6/cgi.py", line 762, in read_binary self.file.write(data) TypeError: write() argument must be str, not bytes Of course, the input does not contain any argument string to be parsed by FieldStorage. Nevertheless, a TypeError in a totally unrelated part of the code seems like a bug. In my opinion, FieldStorage should just remain empty in this case, or - at best - throw a ValueError with a sensible error message. ---------- messages: 306244 nosy: srittau priority: normal severity: normal status: open title: cgi: TypeError versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 19:33:30 2017 From: report at bugs.python.org (Sebastian Rittau) Date: Wed, 15 Nov 2017 00:33:30 +0000 Subject: [issue32029] cgi: TypeError when no argument string is found In-Reply-To: <1510705913.6.0.213398074469.issue32029@psf.upfronthosting.co.za> Message-ID: <1510706010.23.0.213398074469.issue32029@psf.upfronthosting.co.za> Change by Sebastian Rittau : ---------- components: +Library (Lib) title: cgi: TypeError -> cgi: TypeError when no argument string is found _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:30:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 01:30:24 +0000 Subject: [issue32030] Rewrite Py_Main() Message-ID: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> New submission from STINNER Victor : Python has a lot of code for its initialization. It's very hard to touch this code without risking to break something. It's hard to move code since many parts of the code are interdepent. The code rely on global "Py_xxx" configuration variables like Py_IsolateFlag (set by -I command line option). Moreover, currently Python uses the "Python runtime" early. For example, the code to parse the -W command line option uses PyUnicode_FromWideChar() and PyList_Append(). We need a stricter separation for the code before the "Python runtime" is initialized, at least partially initialized. Nick Coghlan and Eric Snow are already working on all these issues as part of the implementation of PEP 432. They redesigned Py_Initialize() and Py_Finalize(). I would like to finish the work on the step before: the Py_Main() function. Attached PR is a work-in-progress to rework deeply the Py_Main() function. I have different goals: * Enhance error handling: * Avoid whenever possible calls to Py_FatalError() -- currently, Py_FatalError() is still called, but at a single place * My patch adds missing checks on PyDict_SetItem() or PyList_Append() calls, catch errors when adding warnings options and XOptions * Reorder code to initialize: initialize Python in the "correct" order * Better "finalization": pymain_free() is now responsible to free memory of all data used by Py_Main(). The ownership of strings is now better defined. For example, Py_SetProgramName() memory was not released before. * pymain_init() is now the code which must not use the Python runtime * pymain_core() uses the Python runtime. Its code to initialize the Python runtime should be easier to follow Since pymain_free() now wants to release the memory, we need to force a memory allocator for PyMem_RawMalloc(), since pymain_core() changes the memory allocator. The main() already does something similar, but with simpler code since main() is a private function, whereas Py_Main() seems to be part of the public C API! ---------- messages: 306245 nosy: haypo priority: normal severity: normal status: open title: Rewrite Py_Main() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:31:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 01:31:01 +0000 Subject: [issue32030] Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510709461.1.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4347 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:36:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 01:36:05 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510709765.73.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Rewrite Py_Main() -> PEP 432: Rewrite Py_Main() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:37:05 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 15 Nov 2017 01:37:05 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510709825.16.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:41:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 01:41:33 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510710093.97.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: I rewrote Py_Main() to prepare the code to be able to implement my "-X dev" idea: https://mail.python.org/pipermail/python-dev//2017-November/150514.html The problem is that currently the code parsing command line options and the code setting the memory allocator (handle PYTHONMALLOC environment variable) are mixed, it's not possible to touch this code. I had similar technical issues when trying to implement properly my PEP 540 idea (Add a new UTF-8 mode): it's hard to change the Python filesystem encoding to UTF-8 after parsing command line arguments, since the current code to parse command line arguments already rely on the Python filesystem encoding and other parts of the Python runtime like the memory allocators. If I implemented my PR correctly, it should become much more simpler to control PYTHONMALLOC and the filesystem encoding from the command line: from an -X option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:41:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 01:41:45 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510710105.27.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +eric.snow, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:48:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 01:48:49 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: <1510710529.8.0.213398074469.issue32025@psf.upfronthosting.co.za> STINNER Victor added the comment: > On other platforms, it can simply raise NotImplementedError. Would it be possible to not provide the function if it's not supported by a platform? Do you know platforms which don't support time.thread_time()? Do you want to add time.thread_time_ns() with nanosecond resolution (PEP 564) ? I suggest to add it to be consistent with time.process_time(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:53:55 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 15 Nov 2017 01:53:55 +0000 Subject: [issue32029] cgi: TypeError when no argument string is found In-Reply-To: <1510705913.6.0.213398074469.issue32029@psf.upfronthosting.co.za> Message-ID: <1510710835.12.0.213398074469.issue32029@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for your report. This looks like a duplicate of issue 27777. You might workaround this by passing ``headers={"Content-Disposition": "inline"}`` to cgi.FieldStorage() (untested) ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:54:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 01:54:55 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: <1510710895.33.0.213398074469.issue32025@psf.upfronthosting.co.za> STINNER Victor added the comment: It seems like macOS doesn't implement CLOCK_THREAD_CPUTIME_ID but provides thread_info() which can be used by suming user and system times. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:55:21 2017 From: report at bugs.python.org (Sebastian Rittau) Date: Wed, 15 Nov 2017 01:55:21 +0000 Subject: [issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition In-Reply-To: <1471355745.98.0.805545529346.issue27777@psf.upfronthosting.co.za> Message-ID: <1510710921.65.0.213398074469.issue27777@psf.upfronthosting.co.za> Change by Sebastian Rittau : ---------- nosy: +srittau _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 21:18:56 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 15 Nov 2017 02:18:56 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510712336.68.0.213398074469.issue32030@psf.upfronthosting.co.za> Nick Coghlan added the comment: While it doesn't necessarily need to be in this patch, something else I recently realised (by breaking it *cough* [1]) is that the interaction between our command line options and our environment variables isn't really clearly defined anywhere. https://github.com/python/cpython/commit/d7ac06126db86f76ba92cbca4cb702852a321f78 restored the handling of simple on/off toggles as "toggle enabled = env var is set OR CLI flag is passed", but I noticed the other day that the interaction between PYTHONWARNINGS, the `-W` option, sys.warnoptions, and _warnings.filters is a bit confusing: ``` $ PYTHONWARNINGS=always,default python3 -Wignore -Wonce Python 3.6.2 (default, Oct 2 2017, 16:51:32) [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys, _warnings >>> sys.warnoptions ['always', 'default', 'ignore', 'once'] >>> [f[0] for f in _warnings.filters[:4]] ['once', 'ignore', 'default', 'always'] ``` The ordering makes *sense* (where sys.warnoptions just lists filter definitions in the order they're given, and later filters take priority over earlier ones, just as they do for any "warnings.filterwarnings" call), but it isn't immediately intuitive (since the outcome relies on filters being prepended by default). That said, I've checked and the current warnings configuration behaviour *is* explicitly covered by the test suite (in https://github.com/python/cpython/blob/master/Lib/test/test_warnings/__init__.py), so a passing test suite provides confidence we haven't broken anything on that front. [1] https://bugs.python.org/issue31845 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 00:42:46 2017 From: report at bugs.python.org (Andrey) Date: Wed, 15 Nov 2017 05:42:46 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510724566.04.0.213398074469.issue32021@psf.upfronthosting.co.za> Andrey added the comment: NodeJS: https://www.npmjs.com/package/brotli Python: https://pypi.python.org/pypi/brotlipy https://pypi.python.org/pypi/Brotli Ubuntu: https://launchpad.net/ubuntu/+source/brotli That said I don't expect an average user to compress their files as .br, but it is useful for site/webapp developers to have static resources as .br ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 01:27:56 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 15 Nov 2017 06:27:56 +0000 Subject: [issue32026] Memory leaks in Python on Windows In-Reply-To: <1510677428.51.0.213398074469.issue32026@psf.upfronthosting.co.za> Message-ID: <1510727276.56.0.213398074469.issue32026@psf.upfronthosting.co.za> Nick Coghlan added the comment: I think it's reasonable to keep this open if the problems can be reproduced with the current 3.7 dev branch - while we've refactored a lot of things, we haven't specifically gone memory leak hunting for the embedded case, and I'm pretty sure there are still some items where we delay cleaning them up until the next Py_Initialize call. The relevant embedding test case is the one at https://github.com/python/cpython/blob/master/Programs/_testembed.c#L41, but I'm not sure we regularly run that in a way that would reliably detect memory leaks (it runs in a subprocess, rather than the main process, so the refleak hunting runs may not be handling it properly). ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 01:35:19 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 15 Nov 2017 06:35:19 +0000 Subject: [issue32028] Syntactically wrong suggestions by the new custom print statement error message In-Reply-To: <1510681370.22.0.213398074469.issue32028@psf.upfronthosting.co.za> Message-ID: <1510727719.87.0.213398074469.issue32028@psf.upfronthosting.co.za> Nick Coghlan added the comment: Given the symptoms (stripping 4 spaces + "pr" from the start of the line, leaving "int " behind), it looks like we're not stripping the leading whitespace when determining the text to include in the suggested print() call. To reproduce this at the REPL, you can use an if statement (first example uses a 4 space indent, the second uses an 8 space indent): ``` >>> if 1: ... print 123 File "", line 2 print 123 ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int 123)? >>> if 1: ... print 123 File "", line 2 print 123 ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print 123)? ``` ---------- stage: -> test needed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 01:43:16 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Wed, 15 Nov 2017 06:43:16 +0000 Subject: [issue32028] Syntactically wrong suggestions by the new custom print statement error message In-Reply-To: <1510681370.22.0.213398074469.issue32028@psf.upfronthosting.co.za> Message-ID: <1510728196.13.0.213398074469.issue32028@psf.upfronthosting.co.za> Sanyam Khurana added the comment: Sure, let me have a look at it and work on fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 01:49:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 06:49:48 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510728588.25.0.213398074469.issue32012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 9165f77d5f93a2c12aa0e90853e3ae7212800d3c by Serhiy Storchaka in branch 'master': bpo-32012: Disallow trailing comma after genexpr without parenthesis. (#4382) https://github.com/python/cpython/commit/9165f77d5f93a2c12aa0e90853e3ae7212800d3c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 02:09:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 07:09:15 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510729755.75.0.213398074469.issue32012@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4348 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 03:16:40 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 15 Nov 2017 08:16:40 +0000 Subject: [issue32012] Disallow ambiguous syntax f(x for x in [1],) In-Reply-To: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> Message-ID: <1510733800.0.0.213398074469.issue32012@psf.upfronthosting.co.za> Nick Coghlan added the comment: With issue 32023 (base class lists) and 32034 (fixing the documentation for decorator factory function calls) covering the other refinements, this particular issue is done now. The most recent PR is the one for issue 32023. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 03:24:49 2017 From: report at bugs.python.org (Eric Wieser) Date: Wed, 15 Nov 2017 08:24:49 +0000 Subject: [issue31801] vars() manipulation encounters problems with Enum In-Reply-To: <1508199715.37.0.213398074469.issue31801@psf.upfronthosting.co.za> Message-ID: <1510734289.3.0.213398074469.issue31801@psf.upfronthosting.co.za> Eric Wieser added the comment: Not necessarily an argument against this feature, but two workarounds exist for this already: 1. Use `nonlocal` to prevent `value` going into the class namespace: value = None class BaudRate(enum.Enum): nonlocal value for value in rates: locals()['B%d' % value] = value @classmethod def valid_rate(cls, value): return (any(value == item.value for item in cls)) 2. Use `types.new_class`, which is more suited to dynamic class creation anyway: def make_cls(ns): for value in rates: ns['B%d' % value] = value @classmethod def valid_rate(cls, value): return (any(value == item.value for item in cls)) ns['valid_rate'] = valid_rate types.new_class('BaudRate', (enum.Enum,), exec_body=make_cls) ---------- nosy: +Eric.Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 03:53:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 08:53:41 +0000 Subject: [issue32023] Always require parentheses for genexps in base class lists In-Reply-To: <1510655104.02.0.213398074469.issue32023@psf.upfronthosting.co.za> Message-ID: <1510736021.43.0.213398074469.issue32023@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4349 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 03:57:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 08:57:43 +0000 Subject: [issue32024] Nominal decorator function call syntax is inconsistent with regular function calls In-Reply-To: <1510664992.07.0.213398074469.issue32024@psf.upfronthosting.co.za> Message-ID: <1510736263.05.0.213398074469.issue32024@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since this change is approved, this is a documentation issue, and I left it on to Nick. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 04:18:03 2017 From: report at bugs.python.org (Stefan Krah) Date: Wed, 15 Nov 2017 09:18:03 +0000 Subject: [issue31983] Officially add Py_SETREF and Py_XSETREF In-Reply-To: <1510158281.4.0.213398074469.issue31983@psf.upfronthosting.co.za> Message-ID: <1510737483.4.0.213398074469.issue31983@psf.upfronthosting.co.za> Change by Stefan Krah : ---------- nosy: -skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 04:37:41 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 15 Nov 2017 09:37:41 +0000 Subject: [issue32031] Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased Message-ID: <1510738661.72.0.213398074469.issue32031@psf.upfronthosting.co.za> New submission from Xavier de Gaye : test_mixed_case_module_names_are_lower_cased fails when there is a symlink in the directory path of the installed standard library. ---------- components: Tests messages: 306259 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 05:10:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 10:10:18 +0000 Subject: [issue32032] Module-level pickle tests test only default implementation Message-ID: <1510740618.54.0.213398074469.issue32032@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : In Python 2 tests for module-level API test both implementations, pickle and cPickle. In Python 3 they test only the default implementation. If _pickle is available, the Python implementation of module-level functions is not tested. ---------- assignee: serhiy.storchaka components: Tests messages: 306260 nosy: serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Module-level pickle tests test only default implementation type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 05:12:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 10:12:29 +0000 Subject: [issue32032] Module-level pickle tests test only default implementation In-Reply-To: <1510740618.54.0.213398074469.issue32032@psf.upfronthosting.co.za> Message-ID: <1510740749.23.0.213398074469.issue32032@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4350 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 05:29:56 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 15 Nov 2017 10:29:56 +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: <1510741796.89.0.213398074469.issue29406@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- pull_requests: +4351 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 05:34:19 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 15 Nov 2017 10:34:19 +0000 Subject: [issue32033] The pwd test test_values fails on Android Message-ID: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> New submission from Xavier de Gaye : On Android API 24: $ python -c "import pwd; print(pwd.getpwuid(0))" pwd.struct_passwd(pw_name='root', pw_passwd='', pw_uid=0, pw_gid=0, pw_gecos=None, pw_dir='/', pw_shell='/system/bin/sh') The pw_gecos member is None and the test_values test of pwd fails because it expects a string. The fix is either (1) to skip the pw_gecos check in test_values for Android or (2) to modify the sets() function in Modules/pwdmodule.c to set an empty string instead of None when the member of the passwd structure is a NULL pointer. POSIX [1] does not specify what are the possible values of the members of the struct passwd. GNU libc states that pw_dir and pw_shell may be NULL pointers so it seems that sets() is broken in these two cases. [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/getpwnam.html [2] https://www.gnu.org/software/libc/manual/html_node/User-Data-Structure.html#User-Data-Structure ---------- components: Extension Modules, Tests messages: 306261 nosy: haypo, serhiy.storchaka, xdegaye priority: normal severity: normal stage: needs patch status: open title: The pwd test test_values fails on Android type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 05:47:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 10:47:04 +0000 Subject: [issue32033] The pwd test test_values fails on Android In-Reply-To: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: <1510742824.13.0.213398074469.issue32033@psf.upfronthosting.co.za> STINNER Victor added the comment: > self.assertIsInstance(e.pw_gecos, str) This test is wrong: it's perfectly fine to get None here. Python must not test the OS itself, but only test our own code: make sure that Python converts properly C types to nice Python types, so a string or None. I propose to use something like: def check_type(field): self.assertTrue(field is None or isinstance(field, str), repr(field)) ... check_type(e.pw_gecos) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 05:49:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 10:49:52 +0000 Subject: [issue32033] The pwd test test_values fails on Android In-Reply-To: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: <1510742992.38.0.213398074469.issue32033@psf.upfronthosting.co.za> STINNER Victor added the comment: Hum, I changed my mind a little bit :-) > (2) to modify the sets() function in Modules/pwdmodule.c to set an empty string instead of None when the member of the passwd structure is a NULL pointer. I checked the doc: pwd doesn't mention None at all :-( https://docs.python.org/dev/library/pwd.html For practical reasons, maybe (2) is nicer option. It would avoid to have all existing code just for Android. I'm not sure that it's very useful to distinguish NULL and an empty char* string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 07:01:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 12:01:13 +0000 Subject: [issue32032] Module-level pickle tests test only default implementation In-Reply-To: <1510740618.54.0.213398074469.issue32032@psf.upfronthosting.co.za> Message-ID: <1510747273.02.0.213398074469.issue32032@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6545256df93ba54f811206107274cfa5a6d76b86 by Serhiy Storchaka in branch 'master': bpo-32032: Test both implementations of module-level pickle API. (#4401) https://github.com/python/cpython/commit/6545256df93ba54f811206107274cfa5a6d76b86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 07:01:22 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 15 Nov 2017 12:01:22 +0000 Subject: [issue32032] Module-level pickle tests test only default implementation In-Reply-To: <1510740618.54.0.213398074469.issue32032@psf.upfronthosting.co.za> Message-ID: <1510747282.38.0.213398074469.issue32032@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4352 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 07:13:43 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 15 Nov 2017 12:13:43 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510710529.8.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: Antoine Pitrou added the comment: Le 15/11/2017 ? 02:48, STINNER Victor a ?crit?: > > Would it be possible to not provide the function if it's not supported by a platform? Probably, yes. > Do you know platforms which don't support time.thread_time()? Any POSIX platform which doesn't have CLOCK_THREAD_CPUTIME_ID? It's an optional feature in the POSIX spec. > Do you want to add time.thread_time_ns() with nanosecond resolution (PEP 564) ? Yes, I think so. > It seems like macOS doesn't implement CLOCK_THREAD_CPUTIME_ID but provides thread_info() which can be used by suming user and system times. I don't have a macOS machine to test on, though :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 07:21:09 2017 From: report at bugs.python.org (=?utf-8?b?SHJ2b2plIE5pa8WhacSH?=) Date: Wed, 15 Nov 2017 12:21:09 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1510748469.74.0.213398074469.issue10049@psf.upfronthosting.co.za> Hrvoje Nik?i? added the comment: I am of course willing to sign the CLA (please send further instructions via email), although I don't know how useful my original patch is, given that it caches the null context manager. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 07:32:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 12:32:07 +0000 Subject: [issue32032] Module-level pickle tests test only default implementation In-Reply-To: <1510740618.54.0.213398074469.issue32032@psf.upfronthosting.co.za> Message-ID: <1510749127.57.0.213398074469.issue32032@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset eb38367f20b05f2ad04a4833bceb369b5e78b1a3 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32032: Test both implementations of module-level pickle API. (GH-4401) (#4403) https://github.com/python/cpython/commit/eb38367f20b05f2ad04a4833bceb369b5e78b1a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 07:53:23 2017 From: report at bugs.python.org (badouxn) Date: Wed, 15 Nov 2017 12:53:23 +0000 Subject: [issue32034] Impossible to unpickle IncompleteReadError Message-ID: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> New submission from badouxn : When using asyncio in combination with multiprocessing, a TypeError occur when readuntil() encounter an EOF instead of the delimiter. readuntil return a IncompleteReadError exception which is pickled by the multiprocessing package. The unpickling failed due to an argument being None. As noted in the following links, it fails: https://stackoverflow.com/questions/16244923/how-to-make-a-custom-exception-class-with-multiple-init-args-pickleable The error trace is: Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib64/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.6/multiprocessing/pool.py", line 463, in _handle_results task = get() File "/usr/lib64/python3.6/multiprocessing/connection.py", line 252, in recv return _ForkingPickler.loads(r) TypeError: __init__() missing 1 required positional argument: 'expected' Fix proposed: Make the "expected" parameter of the IncompleteReadError exception class optional. ---------- components: asyncio files: Impossible_to_unpickle_IncompleteReadError.py messages: 306268 nosy: badouxn, yselivanov priority: normal severity: normal status: open title: Impossible to unpickle IncompleteReadError Added file: https://bugs.python.org/file47266/Impossible_to_unpickle_IncompleteReadError.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 08:10:20 2017 From: report at bugs.python.org (badouxn) Date: Wed, 15 Nov 2017 13:10:20 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510751420.49.0.213398074469.issue32034@psf.upfronthosting.co.za> Change by badouxn : ---------- title: Impossible to unpickle IncompleteReadError -> Error when unpickling IncompleteReadError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 08:10:54 2017 From: report at bugs.python.org (badouxn) Date: Wed, 15 Nov 2017 13:10:54 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510751454.98.0.213398074469.issue32034@psf.upfronthosting.co.za> Change by badouxn : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 08:12:31 2017 From: report at bugs.python.org (badouxn) Date: Wed, 15 Nov 2017 13:12:31 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510751551.1.0.213398074469.issue32034@psf.upfronthosting.co.za> Change by badouxn : ---------- keywords: +patch pull_requests: +4353 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 09:08:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 14:08:34 +0000 Subject: [issue32032] Module-level pickle tests test only default implementation In-Reply-To: <1510740618.54.0.213398074469.issue32032@psf.upfronthosting.co.za> Message-ID: <1510754914.7.0.213398074469.issue32032@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 09:17:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 14:17:32 +0000 Subject: [issue27494] 2to3 parser failure caused by a comma after a generator expression In-Reply-To: <1468319353.83.0.357995670089.issue27494@psf.upfronthosting.co.za> Message-ID: <1510755452.89.0.213398074469.issue27494@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since this syntax never was valid according to the Python language specification, and it causes SyntaxError in 3.7 (see issue32012), I think that this change should be reverted. ---------- resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 09:45:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 14:45:45 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510757145.63.0.213398074469.issue32034@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This isn't so simple. >>> from asyncio.streams import IncompleteReadError >>> import pickle >>> e1 = IncompleteReadError(b'abc', 10) >>> e2 = pickle.loads(pickle.dumps(e1)) >>> print(e1) 3 bytes read on a total of 10 expected bytes >>> print(e2) 44 bytes read on a total of None expected bytes ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 09:54:20 2017 From: report at bugs.python.org (Daniel) Date: Wed, 15 Nov 2017 14:54:20 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes Message-ID: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> New submission from Daniel : The documentation for "ZipFile.writestr(zinfo_or_arcname, data[, compress_type])" says: "Write the string data to the archive; [...]" --> https://docs.python.org/3/library/zipfile.html I fails to mention that data could also be bytes. The source code does mention it however, that is how I found out: def writestr(self, zinfo_or_arcname, data, compress_type=None): """Write a file into the archive. The contents is 'data', which may be either a 'str' or a 'bytes' instance; if it is a 'str', it is encoded as UTF-8 first. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.""" I believe this should be added to the documentation as it's an important information to those who try to add non-UTF8 StringIO data to in-memory ZipFiles using BytesIO. ---------- assignee: docs at python components: Documentation messages: 306271 nosy: Daniel5148, docs at python priority: normal severity: normal status: open title: Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:05:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:05:45 +0000 Subject: [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes In-Reply-To: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> Message-ID: <1510758345.33.0.213398074469.issue32035@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +easy stage: -> needs patch type: -> enhancement versions: -Python 3.4, Python 3.5, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:22:36 2017 From: report at bugs.python.org (Josh Cullum) Date: Wed, 15 Nov 2017 15:22:36 +0000 Subject: [issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter In-Reply-To: <1508407674.96.0.213398074469.issue31817@psf.upfronthosting.co.za> Message-ID: <1510759356.2.0.213398074469.issue31817@psf.upfronthosting.co.za> Josh Cullum added the comment: Hi Ned, Tried that but unfortunately it didn't work. It still produces an error within the make install function which then re-removes the module - it does however create a folder called tkinter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:29:37 2017 From: report at bugs.python.org (Lukas Anzinger) Date: Wed, 15 Nov 2017 15:29:37 +0000 Subject: [issue31807] unitest.mock: Using autospec=True conflicts with 'wraps' In-Reply-To: <1508287695.22.0.213398074469.issue31807@psf.upfronthosting.co.za> Message-ID: <1510759777.14.0.213398074469.issue31807@psf.upfronthosting.co.za> Lukas Anzinger added the comment: I can reproduce the problem and have analyzed it a bit. My use case is a bit different, I want to use autospec=True and wraps= so that I can mock unbound methods but return the result from the original method (see also https://docs.python.org/3/library/unittest.mock-examples.html#mocking-unbound-methods). The problem in the mock code is that mock.return_value actually calls __get_return_value() which replaces the actual return value mock.DEFAULT (which is stored in self._mock_return_value) with a new child mock. When the mock is then called and _mock_call() is executed, the wrapped function is not executed because self._mock_return_value is not mock.DEFAULT anymore: if (self._mock_wraps is not None and self._mock_return_value is DEFAULT): return self._mock_wraps(*args, **kwargs) if ret_val is DEFAULT: ret_val = self.return_value return ret_val Since self._mock_return_value is not DEFAULT anymore it doesn't matter if the mock wraps something and it will instead just return a new mock. I think that the side effect of the assignment to self.return_value in _setup_func() is not intentional, i.e. the child mock should actually be created only if there is an outside access to return_value, but not when it is just wrapped in a function. The assignment can be made side effect free by assigning the internal attribute _mock_return_value (see attached patch). This solves the problem for me. I've attached a patch that fixes the problem and doesn't seem to introduce a regression (all unittest.mock tests pass). If somebody is interested in getting this merged, I'm happy to provide a regression test and everything else that is needed to get this merged. Cheers, Lukas ---------- keywords: +patch nosy: +Lukas Anzinger versions: +Python 3.7 Added file: https://bugs.python.org/file47267/0001-bpo-31807-unittest.mock-Fix-common-use-of-autospec-T.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:38:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:38:54 +0000 Subject: [issue31949] Bugs in PyTraceBack_Print() In-Reply-To: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> Message-ID: <1510760334.88.0.213398074469.issue31949@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset edad8eebeee3c99e324a7f1ac5073167c2b0b54d by Serhiy Storchaka in branch 'master': bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (#4289) https://github.com/python/cpython/commit/edad8eebeee3c99e324a7f1ac5073167c2b0b54d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:39:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:39:39 +0000 Subject: [issue32023] Always require parentheses for genexps in base class lists In-Reply-To: <1510655104.02.0.213398074469.issue32023@psf.upfronthosting.co.za> Message-ID: <1510760379.96.0.213398074469.issue32023@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset ddbce1378644f9d5ad0651e1c9035bd8c6502edc by Serhiy Storchaka in branch 'master': bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400) https://github.com/python/cpython/commit/ddbce1378644f9d5ad0651e1c9035bd8c6502edc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:41:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:41:07 +0000 Subject: [issue32011] Restore loading of TYPE_INT64 in marshal In-Reply-To: <1510509016.94.0.213398074469.issue32011@psf.upfronthosting.co.za> Message-ID: <1510760467.68.0.213398074469.issue32011@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 00987f6230fcdbecc8d9ab4b2b9fae8f99a1a4a9 by Serhiy Storchaka in branch 'master': bpo-32011: Revert "Issue #15480: Remove the deprecated and unused TYPE_INT64 code from marshal." (#4381) https://github.com/python/cpython/commit/00987f6230fcdbecc8d9ab4b2b9fae8f99a1a4a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:41:13 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 15 Nov 2017 15:41:13 +0000 Subject: [issue32011] Restore loading of TYPE_INT64 in marshal In-Reply-To: <1510509016.94.0.213398074469.issue32011@psf.upfronthosting.co.za> Message-ID: <1510760473.94.0.213398074469.issue32011@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4354 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:46:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:46:39 +0000 Subject: [issue31949] Bugs in PyTraceBack_Print() In-Reply-To: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> Message-ID: <1510760799.95.0.213398074469.issue31949@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4355 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:51:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:51:16 +0000 Subject: [issue30950] Convert round() to Arument Clinic In-Reply-To: <1500306445.79.0.000834391811439.issue30950@psf.upfronthosting.co.za> Message-ID: <1510761076.66.0.213398074469.issue30950@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset aca7f574b06c72c85a5e3e4b16a8a5e384a7c4a8 by Serhiy Storchaka in branch 'master': bpo-30950: Convert round() to Argument Clinic. (#2740) https://github.com/python/cpython/commit/aca7f574b06c72c85a5e3e4b16a8a5e384a7c4a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:51:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:51:50 +0000 Subject: [issue30950] Convert round() to Arument Clinic In-Reply-To: <1500306445.79.0.000834391811439.issue30950@psf.upfronthosting.co.za> Message-ID: <1510761110.26.0.213398074469.issue30950@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- dependencies: -Documentation for round() is incorrect. resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:53:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:53:32 +0000 Subject: [issue30399] Get rid of trailing comma in the repr() of BaseException In-Reply-To: <1495121537.81.0.536306192808.issue30399@psf.upfronthosting.co.za> Message-ID: <1510761212.32.0.213398074469.issue30399@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset f8a4c03ede6048022f60a58d5a21b278b78a8a16 by Serhiy Storchaka in branch 'master': bpo-30399: Get rid of trailing comma in the repr of BaseException. (#1650) https://github.com/python/cpython/commit/f8a4c03ede6048022f60a58d5a21b278b78a8a16 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:54:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:54:13 +0000 Subject: [issue30399] Get rid of trailing comma in the repr() of BaseException In-Reply-To: <1495121537.81.0.536306192808.issue30399@psf.upfronthosting.co.za> Message-ID: <1510761253.99.0.213398074469.issue30399@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 10:54:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 15:54:47 +0000 Subject: [issue32023] Always require parentheses for genexps in base class lists In-Reply-To: <1510655104.02.0.213398074469.issue32023@psf.upfronthosting.co.za> Message-ID: <1510761287.64.0.213398074469.issue32023@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:03:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 16:03:56 +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: <1510761836.62.0.213398074469.issue30143@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What are your thoughts about this Benjamin? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:04:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 16:04:48 +0000 Subject: [issue31949] Bugs in PyTraceBack_Print() In-Reply-To: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> Message-ID: <1510761888.74.0.213398074469.issue31949@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3864248866d6224336c7be49670447cb4d125cd6 by Serhiy Storchaka in branch '3.6': [3.6] bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (GH-4289) (#4406) https://github.com/python/cpython/commit/3864248866d6224336c7be49670447cb4d125cd6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:05:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 16:05:18 +0000 Subject: [issue31949] Bugs in PyTraceBack_Print() In-Reply-To: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> Message-ID: <1510761918.1.0.213398074469.issue31949@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:06:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 16:06:00 +0000 Subject: [issue32011] Restore loading of TYPE_INT64 in marshal In-Reply-To: <1510509016.94.0.213398074469.issue32011@psf.upfronthosting.co.za> Message-ID: <1510761960.66.0.213398074469.issue32011@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d15bb5fcad584e113836486d17c6abcbf2168a86 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32011: Revert "Issue GH-15480: Remove the deprecated and unused TYPE_INT64 code from marshal." (GH-4381) (#4405) https://github.com/python/cpython/commit/d15bb5fcad584e113836486d17c6abcbf2168a86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:06:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 16:06:19 +0000 Subject: [issue32011] Restore loading of TYPE_INT64 in marshal In-Reply-To: <1510509016.94.0.213398074469.issue32011@psf.upfronthosting.co.za> Message-ID: <1510761979.79.0.213398074469.issue32011@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:33:29 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 15 Nov 2017 16:33:29 +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: <1510763609.35.0.213398074469.issue30143@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 I think this change will be essential. IIRC, elsewhere Guido approved a 3.7 change so that the ABC will no longer be visible in collections. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:36:45 2017 From: report at bugs.python.org (Stefan Seefeld) Date: Wed, 15 Nov 2017 16:36:45 +0000 Subject: [issue32036] error mixing positional and non-positional arguments with `argparse` Message-ID: <1510763805.17.0.213398074469.issue32036@psf.upfronthosting.co.za> New submission from Stefan Seefeld : I'm trying to mix positional and non-positional arguments with a script using `argparse`, but I observe inconsistent behaviour. The attached test runs fine when invoked with test_argparse.py --info a a=b test_argparse.py a a=b --info but produces the error `error: unrecognized arguments: a=b` when invoked as test_argparse.py a --info a=b Is this intended behaviour ? If yes, is this documented ? If not, is there a way to make this work with existing `argparse` versions ? ---------- components: Library (Lib) files: test_argparse.py messages: 306283 nosy: stefan priority: normal severity: normal status: open title: error mixing positional and non-positional arguments with `argparse` type: behavior Added file: https://bugs.python.org/file47268/test_argparse.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:37:11 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 15 Nov 2017 16:37:11 +0000 Subject: [issue31983] Officially add Py_SETREF and Py_XSETREF In-Reply-To: <1510158281.4.0.213398074469.issue31983@psf.upfronthosting.co.za> Message-ID: <1510763831.57.0.213398074469.issue31983@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Adding my -1. My experience was that these macros impaired my ability to maintain the code and interfered with useful patterns like delaying all decrefs until an object was in a consistent state. While I know that name was bikeshedded quite a bit, the outcome is rather unintuitive: https://twitter.com/raymondh/status/930535938459025408 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:59:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 16:59:49 +0000 Subject: [issue32037] Pickle 32-bit integers with protocol 0 as INT instead of LONG Message-ID: <1510765189.73.0.213398074469.issue32037@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : In Python 3 different opcodes are used for pickling integers with protocol 1 and higher. But pickling with protocol 0 always uses the LONG opcode. In Python all such integers are unpickled to the long instances. Proposed PR makes integers that fit in a signed 32-bit integer be pickled with the INT opcode. This will decrease the size of a pickle (minus one byte 'L' per integer), speeds up pickling and unpickling, and makes these integers be unpickled to int instances in Python 2, that will save a memory. ---------- assignee: serhiy.storchaka components: Library (Lib) messages: 306285 nosy: alexandre.vassalotti, serhiy.storchaka priority: normal severity: normal status: open title: Pickle 32-bit integers with protocol 0 as INT instead of LONG type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:07:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 17:07:49 +0000 Subject: [issue32037] Pickle 32-bit integers with protocol 0 as INT instead of LONG In-Reply-To: <1510765189.73.0.213398074469.issue32037@psf.upfronthosting.co.za> Message-ID: <1510765669.5.0.213398074469.issue32037@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4356 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:08:30 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 15 Nov 2017 17:08:30 +0000 Subject: [issue32033] The pwd module implementation incorrectly sets some attributes to None In-Reply-To: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: <1510765710.65.0.213398074469.issue32033@psf.upfronthosting.co.za> Xavier de Gaye added the comment: > I'm not sure that it's very useful to distinguish NULL and an empty char* string. I agree. An attribute of a ('pwd' Python module) password database entry corresponds to the field of a line in a 'passwd' text file. So it makes sense that when the field is empty in the text file, the corresponding attribute be an empty string and never None if it is not an integer (FWIW Android does not have a 'passwd' file). Changing the title of the issue. ---------- components: -Tests title: The pwd test test_values fails on Android -> The pwd module implementation incorrectly sets some attributes to None versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:22:30 2017 From: report at bugs.python.org (Steve Dower) Date: Wed, 15 Nov 2017 17:22:30 +0000 Subject: [issue32026] Memory leaks in Python on Windows In-Reply-To: <1510677428.51.0.213398074469.issue32026@psf.upfronthosting.co.za> Message-ID: <1510766550.79.0.213398074469.issue32026@psf.upfronthosting.co.za> Steve Dower added the comment: I don't think the refleak handling would detect leaks across PyInitialize/PyFinalize calls anyway. Really, we probably just need to loop Initialize/Finalize a few hundred times and measure the memory usage of the process before/after. That will handle a range of leaks, though it doesn't necessarily help us track them down. ---------- stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:27:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 17:27:04 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510766824.54.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: I wrote a new "_PyInitError" type to report more information when something goes wrong: * indicate if it's an user error: don't abort() in that case * function name where the error was raised * error message Example: --- $ PYTHONHASHSEED=x ./python Fatal Python error: _Py_HashRandomization_Init: PYTHONHASHSEED must be "random" or an integer in range [0; 4294967295] --- => Python doesn't fail with abort() anymore => notice the new "_Py_HashRandomization_Init" function name which gives context to the error message Previously, Python called abort() and so might dump a core file: --- $ PYTHONHASHSEED=x python3 Fatal Python error: PYTHONHASHSEED must be "random" or an integer in range [0; 4294967295] Aborted (core dumped) --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:32:49 2017 From: report at bugs.python.org (badouxn) Date: Wed, 15 Nov 2017 17:32:49 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510767169.78.0.213398074469.issue32034@psf.upfronthosting.co.za> badouxn added the comment: My first fix was indeed wrong. Upon looking further into it, it seems to me that the problem come from the fact that the call to super is not done with the right argument. Upon unpickling, the argument that will be passed to the __init__ is the string representation built on line 33-34. That's why, when leaving expected as optional the number returned is 44, the length of the string. I went looking for similar Exception class in the code base and found the MaybeEncodingError in multiprocessing/pool.py By replacing the Error content with this one I don't have any error anymore. The message is kept identical. ''' def __init__(self, partial, expected): super().__init__(partial, expected) self.partial = partial self.expected = expected def __str__(self): return ("%d bytes read on a total of %r expected bytes" % (len(partial), expected)) ''' Does such a fix looks correct to you ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:36:41 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 15 Nov 2017 17:36:41 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510767401.84.0.213398074469.issue32018@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +4357 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:41:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 17:41:29 +0000 Subject: [issue32033] The pwd module implementation incorrectly sets some attributes to None In-Reply-To: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: <1510767689.91.0.213398074469.issue32033@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I disagree. This is an old API, a thin wrapper around standard POSIX API, and returning an empty string instead of None will make impossible to distinguish NULL from "". It is easy to convert None in an empty string in Python: `value or ''`. I would change the test to if field is not None: self.assertIsInstance(field, str) or self.assertIsInstance(field, (str, type(None))) (I prefer the former variant). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:46:28 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 15 Nov 2017 17:46:28 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510767988.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 12:54:17 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 15 Nov 2017 17:54:17 +0000 Subject: [issue32036] error mixing positional and non-positional arguments with `argparse` In-Reply-To: <1510763805.17.0.213398074469.issue32036@psf.upfronthosting.co.za> Message-ID: <1510768457.74.0.213398074469.issue32036@psf.upfronthosting.co.za> R. David Murray added the comment: Can you reproduce this without your PosArgsParser? ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 13:14:21 2017 From: report at bugs.python.org (badouxn) Date: Wed, 15 Nov 2017 18:14:21 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510769661.52.0.213398074469.issue32034@psf.upfronthosting.co.za> badouxn added the comment: Typo in the last comment. The code should be: ''' def __init__(self, partial, expected): super().__init__(partial, expected) self.partial = partial self.expected = expected def __str__(self): return ("%d bytes read on a total of %r expected bytes" % (len(self.partial), self.expected)) ''' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 13:19:31 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 15 Nov 2017 18:19:31 +0000 Subject: [issue32021] Brotli encoding is not recognized by mimetypes In-Reply-To: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> Message-ID: <1510769971.72.0.213398074469.issue32021@psf.upfronthosting.co.za> R. David Murray added the comment: OK, bouncing around from those URL I finally found this: https://github.com/google/ngx_brotli/issues/28 That indicates unambiguously that someone does expect files to be pre-compressed on the server and that the main brotli package provides a cli tool (I could not find any reference to that in the brotli docs themselves, such as they are). So, I think it is appropriate to add this, and one can hope that the program name is indeed 'brotli' so that it matches up with the existing mimetypes docs :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 13:20:18 2017 From: report at bugs.python.org (Stefan Seefeld) Date: Wed, 15 Nov 2017 18:20:18 +0000 Subject: [issue32036] error mixing positional and non-positional arguments with `argparse` In-Reply-To: <1510768457.74.0.213398074469.issue32036@psf.upfronthosting.co.za> Message-ID: <8e09624e-deae-b090-dbbf-84b139c83b2c@seefeld.name> Stefan Seefeld added the comment: On 15.11.2017 12:54, R. David Murray wrote: > Can you reproduce this without your PosArgsParser? I can indeed (by simply commenting out the `action` argument to the `add_argument()` calls). That obviously results in all positional arguments being accumulated in the `goal` member, as there is no logic to distinguish `a` from `a=b` semantically. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 13:25:51 2017 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 15 Nov 2017 18:25:51 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510770351.85.0.213398074469.issue32018@psf.upfronthosting.co.za> Dong-hee Na added the comment: I've submitted a patch. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 13:31:06 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 18:31:06 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510770666.64.0.213398074469.issue32018@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset 762b9571c9c8c6b036f1bf90140a1d030b3f9a01 by Yury Selivanov (Dong-hee Na) in branch 'master': bpo-32018: Fix inspect.signature repr to follow PEP 8 (#4408) https://github.com/python/cpython/commit/762b9571c9c8c6b036f1bf90140a1d030b3f9a01 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 13:31:22 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 18:31:22 +0000 Subject: [issue32018] inspect.signature does not respect PEP 8 In-Reply-To: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> Message-ID: <1510770682.41.0.213398074469.issue32018@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 13:46:04 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 18:46:04 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510771564.6.0.213398074469.issue32034@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- pull_requests: +4358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 13:48:02 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 18:48:02 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510771682.98.0.213398074469.issue32034@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Does such a fix looks correct to you ? No, this fix won't restore exception.args properly. I made a PR with a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:00:27 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 19:00:27 +0000 Subject: [issue32038] Add API to intercept socket.close() Message-ID: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> New submission from Yury Selivanov : asyncio has a few APIs that accept a Python socket object: loop.sock_recv(), loop.sock_accept() etc. asyncio (and event loops such as uvloop) expect that it controls the socket for the duration of the call. However, it cannot prevent the socket object from being closing *while* it is working with it: loop = asyncio.get_event_loop() sock = socket.socket() sock.connect(('google.com', 80)) sock.setblocking(0) f = loop.sock_recv(sock, 100) sock.close() await f The above snippet makes asyncio to forever try to read from 'sock' (resource leak). uvloop simply segfaults (at least on Linux) because libuv assumes that sockets can't be closed while it's working with them. Same problem exists when a user calls `loop.create_server(sock=sock)` and later manually calls `sock.close()`. My proposal is to add a new API: `socket.register_close(callback)`. `callback` will be called whenever a socket object is about to be closed. This will enable asyncio and uvloop to detect when sockets they are working with are about to be closed and to either raise an error, log a debug line, or/and to stop polling the socket. See also: https://github.com/MagicStack/uvloop/issues/100 ---------- components: IO, asyncio messages: 306298 nosy: asvetlov, gvanrossum, pitrou, yselivanov priority: normal severity: normal status: open title: Add API to intercept socket.close() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:01:35 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 15 Nov 2017 19:01:35 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510772495.11.0.213398074469.issue32038@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Why not instead add `loop.sock_close()`? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:02:02 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 15 Nov 2017 19:02:02 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: <1510772522.39.0.213398074469.issue32025@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +4359 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:04:38 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 19:04:38 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510772678.44.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Why not instead add `loop.sock_close()`? It wouldn't help if the program calls `socket.close()` somewhere. This can happen easily in big code bases. Ideally (at least I think so) we need to provide a guarantee that the socket object can't be closed at all (or be closed in a controlled manner) if it's being operated by asyncio/event-loop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:18:11 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 15 Nov 2017 19:18:11 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510773491.05.0.213398074469.issue32038@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, that sounds reasonable to me. Also cc'ing Ben Darnell (maintainer of Tornado) in case he wants to chime in. ---------- nosy: +Ben.Darnell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:24:56 2017 From: report at bugs.python.org (Stefan Seefeld) Date: Wed, 15 Nov 2017 19:24:56 +0000 Subject: [issue32036] error mixing positional and non-positional arguments with `argparse` In-Reply-To: <1510763805.17.0.213398074469.issue32036@psf.upfronthosting.co.za> Message-ID: <1510773896.75.0.213398074469.issue32036@psf.upfronthosting.co.za> Stefan Seefeld added the comment: It looks like https://bugs.python.org/issue14191 is a conversation about the same inconsistent behaviour. It is set to "fixed". Can you comment on this ? Should I follow the advice mentioned there about how to work around the issue ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:43:16 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 15 Nov 2017 19:43:16 +0000 Subject: [issue32039] timeit documentation should describe caveats Message-ID: <1510774996.46.0.213398074469.issue32039@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : timeit is cool, but it's not appropriate for all performance testing. For example, since it uses only a single Python process, anything that's cached is not a good candidate for timeit profiling. The classic example is timing imports. E.g. these are not the stats you're looking for: $ python3 -mtimeit "import my.slow.module" The timeit documentation should describe this caveat (are there others?) and possibly point to both cProfile and the 3rd party perf package as alternative ways to gather performance information. ---------- assignee: barry components: Documentation messages: 306303 nosy: barry priority: normal severity: normal status: open title: timeit documentation should describe caveats versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:48:55 2017 From: report at bugs.python.org (QbLearningPython) Date: Wed, 15 Nov 2017 19:48:55 +0000 Subject: [issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths Message-ID: <1510775335.55.0.213398074469.issue32040@psf.upfronthosting.co.za> New submission from QbLearningPython : While testing a module, I have found a weird behaviour of pathlib package. I have a list of pathlib.Paths and I sorted() it. I assumed that the order retrieved by sorting a list of Paths would be the same as the order retrieved by sorting the list of their corresponding (string) filenames. But it is not the case. I run the following example: ========================================================================== from pathlib import Path # order string filenames filenames_for_testing = ( '/spam/spams.txt', '/spam/spam.txt', '/spam/another.txt', '/spam/binary.bin', '/spam/spams/spam.ttt', '/spam/spams/spam01.txt', '/spam/spams/spam02.txt', '/spam/spams/spam03.ppp', '/spam/spams/spam04.doc', ) sorted_filenames = sorted(filenames_for_testing) # output ordered list of string filenames print() print("Ordered list of string filenames:") print() [print(f'\t{element}') for element in sorted_filenames] print() # order paths (build from same string filenames) paths_for_testing = [ Path(filename) for filename in filenames_for_testing ] sorted_paths = sorted(paths_for_testing) # outoput ordered list of pathlib.Paths print() print("Ordered list of pathlib.Paths:") print() [print(f'\t{element}') for element in sorted_paths] print() # compare print() if sorted_filenames == [str(path) for path in sorted_paths]: print('Ordered lists of string filenames and pathlib.Paths are EQUAL.') else: print('Ordered lists of string filenames and pathlib.Paths are DIFFERENT.') for element in range(0, len(sorted_filenames)): if sorted_filenames[element] != str(sorted_paths[element]): print() print('First different element:') print(f'\tElement #{element}') print(f'\t{sorted_filenames[element]} != {sorted_paths[element]}') break print() ========================================================================== The output of this script was: ========================================================================== Ordered list of string filenames: /spam/another.txt /spam/binary.bin /spam/spam.txt /spam/spams.txt /spam/spams/spam.ttt /spam/spams/spam01.txt /spam/spams/spam02.txt /spam/spams/spam03.ppp /spam/spams/spam04.doc Ordered list of pathlib.Paths: /spam/another.txt /spam/binary.bin /spam/spam.txt /spam/spams/spam.ttt /spam/spams/spam01.txt /spam/spams/spam02.txt /spam/spams/spam03.ppp /spam/spams/spam04.doc /spam/spams.txt Ordered lists of string filenames and pathlib.Paths are DIFFERENT. First different element: Element #3 /spam/spams.txt != /spam/spams/spam.ttt ========================================================================== As you can see, 'spam/spams.txt' goes in different places if you have sorted by pathlib.Paths than if you have sorted by string filenames. I think that it is weird that sorting pathlib.Paths yields a different result than sorting their string filenames. I think that pathlib.Paths should be ordered by alphabetical order of their corresponding filenames. Thank you. ---------- components: Extension Modules messages: 306304 nosy: QbLearningPython priority: normal severity: normal status: open title: Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:52:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 19:52:59 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510775579.43.0.213398074469.issue32034@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is the same issue with LimitOverrunError. I'm not sure that we should keep args the same. It affects __str__ and __repr__. badouxn overrides __str__. And the result of __repr__ currently looks like the exception constructor, but actually is not compatible with it. >>> IncompleteReadError(b'abc', 10) IncompleteReadError('3 bytes read on a total of 10 expected bytes',) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 15:09:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 20:09:37 +0000 Subject: [issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths In-Reply-To: <1510775335.55.0.213398074469.issue32040@psf.upfronthosting.co.za> Message-ID: <1510776577.29.0.213398074469.issue32040@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Paths are ordered by lexicographical order of their corresponding components. Paths are not strings, and this this order is more natural for them. The alphabetical order of Path strings: SPAMS.txt SPAM\file.txt spam\file.txt spams.txt spam-file.txt spam/file.txt spam_file.txt The lexicographical order of Path components: SPAM\file.txt SPAMS.txt spam\file.txt spams.txt spam/file.txt spam-file.txt spam_file.txt ---------- nosy: +serhiy.storchaka resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:01:06 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Wed, 15 Nov 2017 21:01:06 +0000 Subject: [issue32041] Cannot cast '\0' to c_void_p Message-ID: <1510779666.78.0.213398074469.issue32041@psf.upfronthosting.co.za> New submission from Ilya Kulakov : Happens on 3.6.3 only: >>> import ctypes >>> ctypes.cast('\0', ctypes.c_void_p) ctypes.ArgumentError: argument 1: : embedded null character ---------- components: ctypes messages: 306307 nosy: Ilya.Kulakov priority: normal severity: normal status: open title: Cannot cast '\0' to c_void_p type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:06:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 21:06:33 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: <1510779993.04.0.213398074469.issue32025@psf.upfronthosting.co.za> STINNER Victor added the comment: I can work on the macOS implementation, once your PR will be merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:09:32 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 15 Nov 2017 21:09:32 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510779993.04.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: <9091ae15-32a1-6fd5-8690-72c0dc95cb34@free.fr> Antoine Pitrou added the comment: Le 15/11/2017 ? 22:06, STINNER Victor a ?crit?: > > I can work on the macOS implementation, once your PR will be merged. Great! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:14:27 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 21:14:27 +0000 Subject: [issue26579] Support pickling slots in subclasses of common classes In-Reply-To: <1458204186.54.0.651323931278.issue26579@psf.upfronthosting.co.za> Message-ID: <1510780467.77.0.213398074469.issue26579@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- pull_requests: +4360 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:15:23 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 21:15:23 +0000 Subject: [issue26579] Support pickling slots in subclasses of common classes In-Reply-To: <1458204186.54.0.651323931278.issue26579@psf.upfronthosting.co.za> Message-ID: <1510780523.91.0.213398074469.issue26579@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: -4360 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:36:15 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 15 Nov 2017 21:36:15 +0000 Subject: [issue32039] timeit documentation should describe caveats In-Reply-To: <1510774996.46.0.213398074469.issue32039@psf.upfronthosting.co.za> Message-ID: <1510781775.25.0.213398074469.issue32039@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Other caveats: * The tight, repeated loops tend to have perfect branch prediction rates and 100% L1 cache hit rates that are rarely present in real code. There should be links to why this matters: - https://stackoverflow.com/questions/11227809 - https://www.extremetech.com/extreme/188776-how-l1-and-l2-cpu-caches-work-and-why-theyre-an-essential-part-of-modern-chips * Code timing list.append() or anything else that uses realloc() internally tends to be timing in clean environments where the realloc() extends in-place rather than recopying all the data. This is almost never true in real code. * Constant folding can produce misleading results. To time addition, use: python -m timeit -s "x=2" "x+3" rather than: python -m timeit "2+3" * Timings include global lookups, attribute lookups, and function call overhead in addition to the operation being timed. Use: python -m timeit -s "s=list(range(20))" -s "s_index=s.index" "s_index(5)" rather than: python -m timeit -s "s=list(range(20))" "s.index(5)" * Comparative timings should be repeated and interleaved to show whether the timings are noisy or have been affected the processor switching to a lower clock speed to avoid overheating: time a time b time a # expect this to be consistent with the first *a* timing time b # expect this to be consistent with the first *b* timing ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:39:32 2017 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBQZXTFmcOtxI1law==?=) Date: Wed, 15 Nov 2017 21:39:32 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest Message-ID: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> New submission from Tom?? Pet???ek : Would there be an interest and possibility to add an option to the doctest module to compare values instead of reprs? The idea is that the expected value would be eval'ed prior to comparison if this option was enabled. Motivation for this option is to enable comparison of values (states) as defined in the respective classes and not by a representation which might vary ({'a', 'b'} vs {'b', 'a'}, 'value' vs "value" etc.). ---------- components: Library (Lib), Tests messages: 306311 nosy: Tom?? Pet???ek priority: normal severity: normal status: open title: Option for comparing values instead of reprs in doctest type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:48:42 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Wed, 15 Nov 2017 21:48:42 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510782522.0.0.213398074469.issue31701@psf.upfronthosting.co.za> Ilya Kulakov added the comment: Victor, Does this change imply that no python-traceback-for-every-thread will be printed upon both handled and unhandled C++ exception? ---------- nosy: +Ilya.Kulakov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:52:25 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 15 Nov 2017 21:52:25 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: <1510782745.07.0.213398074469.issue32025@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 4bd41c9b52ea0c730e9e294caaf003e54c088c6e by Antoine Pitrou in branch 'master': bpo-32025: Add time.thread_time() (#4410) https://github.com/python/cpython/commit/4bd41c9b52ea0c730e9e294caaf003e54c088c6e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 17:00:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 22:00:16 +0000 Subject: [issue32039] timeit documentation should describe caveats In-Reply-To: <1510774996.46.0.213398074469.issue32039@psf.upfronthosting.co.za> Message-ID: <1510783216.04.0.213398074469.issue32039@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: +1 to all said by Raymond. But this is rather the matter of a special article or blog post than a note in the documentation. Other example of caching is regular expressions. Mistakes: python3 -m timeit -s "it = iter(range(1000000000))" "next(it)" python3 -m timeit -s "a = []" "a.append(1)" I remember one non-obvious trap in which I got caught. The performance of the iteration of a dict was influenced by the fact that in new dicts the order of iteration coincided with the order of creating keys, which were allocated sequentially in memory. Thus refcounts were touched in adjacent objects. This usually is not happen in real programs. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 17:03:23 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 15 Nov 2017 22:03:23 +0000 Subject: [issue32039] timeit documentation should describe caveats In-Reply-To: <1510783216.04.0.213398074469.issue32039@psf.upfronthosting.co.za> Message-ID: <5F5B577F-05E5-4C1D-B7AB-BB8D5FD7CB60@python.org> Barry A. Warsaw added the comment: On Nov 15, 2017, at 17:00, Serhiy Storchaka wrote: > > +1 to all said by Raymond. But this is rather the matter of a special article or blog post than a note in the documentation. Maybe a HOWTO on performance testing and analysis? We already have one on instrumenting with DTRACE/SystemTap, and we could point the timeit docs to this new HOWTO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 17:05:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 22:05:52 +0000 Subject: [issue32039] timeit documentation should describe caveats In-Reply-To: <1510774996.46.0.213398074469.issue32039@psf.upfronthosting.co.za> Message-ID: <1510783552.05.0.213398074469.issue32039@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 17:14:30 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 22:14:30 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510784070.75.0.213398074469.issue32034@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset 43605e6bfa8d49612df4a38460d063d6ba781906 by Yury Selivanov in branch 'master': bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable #4409 https://github.com/python/cpython/commit/43605e6bfa8d49612df4a38460d063d6ba781906 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 17:14:39 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 15 Nov 2017 22:14:39 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510784079.8.0.213398074469.issue32034@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4361 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 17:15:15 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 22:15:15 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510784115.17.0.213398074469.issue32034@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 18:07:01 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 15 Nov 2017 23:07:01 +0000 Subject: [issue32036] error mixing positional and non-positional arguments with `argparse` In-Reply-To: <1510763805.17.0.213398074469.issue32036@psf.upfronthosting.co.za> Message-ID: <1510787221.85.0.213398074469.issue32036@psf.upfronthosting.co.za> R. David Murray added the comment: Ah, yes, I'd managed to forget about that issue, even though I was the one that finally committed the fix. So, the alternate parser will be in 3.7. In the meantime you can grab the code from the commit and put it in a local file, I think. You'll doubtless have to tweak a few things to use it that way, but it should be fairly straightforward. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 18:18:42 2017 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBQZXTFmcOtxI1law==?=) Date: Wed, 15 Nov 2017 23:18:42 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1510787922.31.0.213398074469.issue32042@psf.upfronthosting.co.za> Tom?? Pet???ek added the comment: Related to https://bugs.python.org/issue3332 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 18:32:00 2017 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBQZXTFmcOtxI1law==?=) Date: Wed, 15 Nov 2017 23:32:00 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1510788720.0.0.213398074469.issue32042@psf.upfronthosting.co.za> Tom?? Pet???ek added the comment: This option can be seen as a more general case of the options already available which lift the requirement of exact representation match (True for 1, normalize whitespace etc.). It would enable easier testing of relevant behavior instead of repr's artifacts. An implementation draft is at https://github.com/tpet/cpython/commit/e59cc2d2c854f5995c36a60410eca0e893a7e269 As the expected value has to be reconstructed from the string representation anyway, it seems reasonable to do that for both values (expected and got). Only minor modifications seem to be required in that case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 18:34:31 2017 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBQZXTFmcOtxI1law==?=) Date: Wed, 15 Nov 2017 23:34:31 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1510788871.25.0.213398074469.issue32042@psf.upfronthosting.co.za> Tom?? Pet???ek added the comment: The following tests then succeed: def str_fun(): """ >>> str_fun() 'foo' >>> str_fun() "foo" >>> str_fun() '''foo''' """ return 'foo' def dict_fun(): """ >>> dict_fun() {'foo': 1, 'bar': 2} >>> dict_fun() {'bar': 2, 'foo': 1} >>> dict_fun() dict(foo=1, bar=2) """ return {'foo': 1, 'bar': 2} if __name__ == '__main__': import doctest doctest.testmod(verbose=True, optionflags=doctest.ACCEPT_EQUAL_VALUES) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 18:48:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 23:48:13 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510789693.95.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f7e5b56c37eb859e225e886c79c5d742c567ee95 by Victor Stinner in branch 'master': bpo-32030: Split Py_Main() into subfunctions (#4399) https://github.com/python/cpython/commit/f7e5b56c37eb859e225e886c79c5d742c567ee95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 19:13:27 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 16 Nov 2017 00:13:27 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1510791207.4.0.213398074469.issue32042@psf.upfronthosting.co.za> R. David Murray added the comment: I think it is an interesting idea. Let see what other people think. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 19:15:40 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Thu, 16 Nov 2017 00:15:40 +0000 Subject: [issue32041] Cannot cast '\0' to c_void_p In-Reply-To: <1510779666.78.0.213398074469.issue32041@psf.upfronthosting.co.za> Message-ID: <1510791340.81.0.213398074469.issue32041@psf.upfronthosting.co.za> Ilya Kulakov added the comment: That's the change that introduced the bug: https://github.com/python/cpython/pull/2285 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 19:28:28 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 00:28:28 +0000 Subject: [issue32034] Error when unpickling IncompleteReadError In-Reply-To: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> Message-ID: <1510792108.47.0.213398074469.issue32034@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset f35076a002b958f991d180d6f945344cc5ab3900 by Yury Selivanov (Miss Islington (bot)) in branch '3.6': bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable GH-4409 (#4411) https://github.com/python/cpython/commit/f35076a002b958f991d180d6f945344cc5ab3900 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 20:38:43 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Thu, 16 Nov 2017 01:38:43 +0000 Subject: [issue32041] Cannot cast '\0' to c_void_p In-Reply-To: <1510779666.78.0.213398074469.issue32041@psf.upfronthosting.co.za> Message-ID: <1510796323.67.0.213398074469.issue32041@psf.upfronthosting.co.za> Ilya Kulakov added the comment: I have fixed that problem by ensuring that ctypes-facing code passes bytes, not strings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 20:44:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 01:44:31 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510796671.01.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4362 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 20:49:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 01:49:04 +0000 Subject: [issue31415] Add -X option to show import time In-Reply-To: <1505107635.07.0.844960422859.issue31415@psf.upfronthosting.co.za> Message-ID: <1510796944.55.0.213398074469.issue31415@psf.upfronthosting.co.za> STINNER Victor added the comment: FYI I'm working on the Py_Main() function in bpo-32030. My latest PR (PR 4412) moves the code to parse -X importtime and PYTHONPROFILEIMPORTTIME into Py_Main(), to group all functions parsing the command line arguments and environment variables. With this change, the "importtime" option is now checked before the very first "Python" function call. The new code doesn't use the sys module anymore to parse -X options, and so break the dependency between "importtime", the import machinery and the sys module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 20:53:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 01:53:00 +0000 Subject: [issue32039] timeit documentation should describe caveats In-Reply-To: <1510774996.46.0.213398074469.issue32039@psf.upfronthosting.co.za> Message-ID: <1510797180.48.0.213398074469.issue32039@psf.upfronthosting.co.za> STINNER Victor added the comment: Barry: "... possibly point to both cProfile and the 3rd party perf package as alternative ways to gather performance information." FYI the timeit module of PyPy now emits a warning and points to the perf module: http://perf.readthedocs.io/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 21:04:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 02:04:32 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510797872.08.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: Nick: """ I noticed the other day that the interaction between PYTHONWARNINGS, the `-W` option, sys.warnoptions, and _warnings.filters is a bit confusing: $ PYTHONWARNINGS=always,default python3 -Wignore -Wonce (...) >>> sys.warnoptions ['always', 'default', 'ignore', 'once'] >>> [f[0] for f in _warnings.filters[:4]] ['once', 'ignore', 'default', 'always'] """ IMHO the command line must have the priority over environment variables, since environment variables are inherited, whereas the command line can be finely tuned *on purpose*. So it's correct, no? It's just that warnoptions gives options in the reverse order than the "expected" order, no? At least, with my commit, if you want to try to change the priority, you just have to exchange two lines in pymain_add_warnings_options() :-) if (pymain_add_warnings_optlist(&pymain->env_warning_options) < 0) ... if (pymain_add_warnings_optlist(&pymain->cmdline.warning_options) < 0) ... -- By the way, I'm not sure that it was a good idea to expose sys.warnoptions to users, but I don't think that we can remove it anymore :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 21:11:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 02:11:47 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510798307.38.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset a7368ac6360246b1ef7f8f152963c2362d272183 by Victor Stinner in branch 'master': bpo-32030: Enhance Py_Main() (#4412) https://github.com/python/cpython/commit/a7368ac6360246b1ef7f8f152963c2362d272183 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 21:43:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 02:43:27 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" Message-ID: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> New submission from STINNER Victor : I propose to add a new "developer mode": a new "-X dev" command line option. In short: python3 -X dev script.py behaves as: PYTHONMALLOC=debug python3 -W default -X faulthandler script.py For the rationale, please see: https://mail.python.org/pipermail/python-dev/2017-November/150514.html ---------- components: Interpreter Core messages: 306330 nosy: haypo priority: normal severity: normal status: open title: Add a new -X dev option: "developer mode" type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 21:47:55 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 16 Nov 2017 02:47:55 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1510800475.37.0.213398074469.issue32043@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 21:47:58 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 02:47:58 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1510800478.64.0.213398074469.issue32043@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4363 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 21:48:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 02:48:51 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1510800531.27.0.213398074469.issue32043@psf.upfronthosting.co.za> STINNER Victor added the comment: I rewrote Py_Main() in bpo-32030 to make it very easy to implement this new feature. I wrote PR 4413 to implement -X dev. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 21:52:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 02:52:42 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1510800762.7.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: I rewrote Py_Main() in two large commits. The code isn't perfect yet, for example, init_sys_streams() still reads the PYTHONIOENCODING environment variable. IMHO it should be read earlier. But as soon, my changes should allow to fix such issues much more easily. Since I was now able to implement my -X dev option in bpo-32043, I don't plan to push further changes in short term on Py_Main(). I keep this issue open a little bit to check if everything is fine on buildbots, and check if someone has complains :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 22:00:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 03:00:20 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510801220.97.0.213398074469.issue31701@psf.upfronthosting.co.za> STINNER Victor added the comment: > Does this change imply that no python-traceback-for-every-thread will be printed upon both handled and unhandled C++ exception? Right if I understood correctly. The best is to test yourself ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 22:35:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 03:35:35 +0000 Subject: [issue32026] Memory leaks in Python on Windows In-Reply-To: <1510677428.51.0.213398074469.issue32026@psf.upfronthosting.co.za> Message-ID: <1510803335.99.0.213398074469.issue32026@psf.upfronthosting.co.za> STINNER Victor added the comment: Python doesn't clean everything at exit: see bpo-29881. I just modified Py_Main() in bpo-32030 to clean a few more bytes (like program_name): see pymain_free() in Modules/main.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 23:14:47 2017 From: report at bugs.python.org (Ben Darnell) Date: Thu, 16 Nov 2017 04:14:47 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510805687.44.0.213398074469.issue32038@psf.upfronthosting.co.za> Ben Darnell added the comment: It's worse than a resource leak - the same file descriptor number could be reused for a different file/socket, and then depending on the selector in use, you could see the data from a completely different connection. I did see a bug like this years ago (in libcurl), although it's not a common problem. I'd use the proposed hook if it existed, but it seems like an intrusive solution to a rare issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 00:01:03 2017 From: report at bugs.python.org (Daniel E Platt) Date: Thu, 16 Nov 2017 05:01:03 +0000 Subject: [issue32044] pip3 install 3.6.3 crashes on startup; 3.5.4 works; on OS X 10.13.1 Message-ID: <1510808462.98.0.213398074469.issue32044@psf.upfronthosting.co.za> New submission from Daniel E Platt : pip3 installed with 3.6.3 crashes on startup. pip3 installed with 3.5.4 works. Appears on OS X 10.13.1 ---------- components: Installation messages: 306336 nosy: DanPlatt priority: normal severity: normal status: open title: pip3 install 3.6.3 crashes on startup; 3.5.4 works; on OS X 10.13.1 type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 00:08:41 2017 From: report at bugs.python.org (Daniel E Platt) Date: Thu, 16 Nov 2017 05:08:41 +0000 Subject: [issue32044] pip3 install 3.6.3 crashes on startup; 3.5.4 works; on OS X 10.13.1 In-Reply-To: <1510808462.98.0.213398074469.issue32044@psf.upfronthosting.co.za> Message-ID: <1510808921.94.0.213398074469.issue32044@psf.upfronthosting.co.za> Daniel E Platt added the comment: platt at MacBook-Pro.local:/Users/platt $ pip3 Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3", line 7, in from pip import main File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/__init__.py", line 26, in from pip.utils import get_installed_distributions, get_prog File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in from pip._vendor import pkg_resources File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in @_call_aside File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside f(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set dist.activate(replace=False) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate declare_namespace(pkg) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace _handle_ns(packageName, path_item) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns _rebuild_mod_path(path, packageName, module) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path orig_path.sort(key=position_in_sys_path) AttributeError: '_NamespacePath' object has no attribute 'sort' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 00:54:16 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Thu, 16 Nov 2017 05:54:16 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510811656.27.0.213398074469.issue31701@psf.upfronthosting.co.za> Ilya Kulakov added the comment: May I ask why AddVectoredExceptionHandler is used instead of SetUnhandledExceptionFilter? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 01:27:25 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 16 Nov 2017 06:27:25 +0000 Subject: [issue32044] pip3 install 3.6.3 crashes on startup; 3.5.4 works; on OS X 10.13.1 In-Reply-To: <1510808462.98.0.213398074469.issue32044@psf.upfronthosting.co.za> Message-ID: <1510813645.74.0.213398074469.issue32044@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for your report. This is a problem with setuptools: https://github.com/pypa/setuptools/issues/885 I suggest upgrading both setuptools and pip: $ pip install -U setuptools pip ---------- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 01:47:34 2017 From: report at bugs.python.org (Daniel E Platt) Date: Thu, 16 Nov 2017 06:47:34 +0000 Subject: [issue32044] pip3 install 3.6.3 crashes on startup; 3.5.4 works; on OS X 10.13.1 In-Reply-To: <1510808462.98.0.213398074469.issue32044@psf.upfronthosting.co.za> Message-ID: <1510814854.98.0.213398074469.issue32044@psf.upfronthosting.co.za> Daniel E Platt added the comment: platt at MacBook-Pro.local:/Users/platt $ pip install -U setuptools pip Collecting setuptools Downloading setuptools-36.7.2-py2.py3-none-any.whl (482kB) 100% |????????????????????????????????| 491kB 2.6MB/s Requirement already up-to-date: pip in ./Library/Python/2.7/lib/python/site-packages Installing collected packages: setuptools Found existing installation: setuptools 18.5 Uninstalling setuptools-18.5: Exception: Traceback (most recent call last): File "/Users/platt/Library/Python/2.7/lib/python/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Users/platt/Library/Python/2.7/lib/python/site-packages/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/Users/platt/Library/Python/2.7/lib/python/site-packages/pip/req/req_set.py", line 778, in install requirement.uninstall(auto_confirm=True) File "/Users/platt/Library/Python/2.7/lib/python/site-packages/pip/req/req_install.py", line 754, in uninstall paths_to_remove.remove(auto_confirm) File "/Users/platt/Library/Python/2.7/lib/python/site-packages/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/Users/platt/Library/Python/2.7/lib/python/site-packages/pip/utils/__init__.py", line 267, in renames shutil.move(old, new) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move copytree(src, real_dst, symlinks=True) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree raise Error, errors Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/var/folders/68/lk7bsfq51hq3406jk8v83z880000gn/T/pip-hvP8_p-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")] ---------- resolution: third party -> wont fix status: closed -> open type: behavior -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 02:16:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 07:16:27 +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: <1510816587.83.0.213398074469.issue30143@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 0a2abdfca2495291809855cf7dfc6721c9c962e3 by Serhiy Storchaka in branch 'master': bpo-30143: 2to3 now generates a code that uses abstract collection classes (#1262) https://github.com/python/cpython/commit/0a2abdfca2495291809855cf7dfc6721c9c962e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 02:19:42 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 07:19:42 +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: <1510816782.05.0.213398074469.issue30143@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 02:44:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 07:44:45 +0000 Subject: [issue32037] Pickle 32-bit integers with protocol 0 as INT instead of LONG In-Reply-To: <1510765189.73.0.213398074469.issue32037@psf.upfronthosting.co.za> Message-ID: <1510818285.65.0.213398074469.issue32037@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 3daaafb700df45716bb55f3a293f88773baf3463 by Serhiy Storchaka in branch 'master': bpo-32037: Use the INT opcode for 32-bit integers in protocol 0 pickles. (#4407) https://github.com/python/cpython/commit/3daaafb700df45716bb55f3a293f88773baf3463 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 02:45:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 07:45:07 +0000 Subject: [issue32037] Pickle 32-bit integers with protocol 0 as INT instead of LONG In-Reply-To: <1510765189.73.0.213398074469.issue32037@psf.upfronthosting.co.za> Message-ID: <1510818307.36.0.213398074469.issue32037@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 03:01:13 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 16 Nov 2017 08:01:13 +0000 Subject: [issue32027] argparse allow_abbrev option also controls short flag combinations In-Reply-To: <1510680582.36.0.213398074469.issue32027@psf.upfronthosting.co.za> Message-ID: <1510819273.97.0.213398074469.issue32027@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for the report and for the PR. I think this is a duplicate of issue 26967. > This issue is either a doc issue only or an unintended combination of > long option shortening and (the way more common) flag combinations. This is indeed a bug so it would be better to fix it. ---------- nosy: +berker.peksag resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> argparse: allow_abbrev=False stops -vv from working type: -> behavior versions: -Python 3.5, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 03:20:19 2017 From: report at bugs.python.org (Rohan D'Sa) Date: Thu, 16 Nov 2017 08:20:19 +0000 Subject: [issue32045] Does json.dumps have a memory leak? Message-ID: <1510820419.37.0.213398074469.issue32045@psf.upfronthosting.co.za> New submission from Rohan D'Sa : import gc, json class leak(object): def __init__(self): pass gc.set_debug(gc.DEBUG_LEAK) while True: leak_ = leak() json.dumps(leak_.__dict__, indent=True) gc.collect() print(f"garbage count: {len(gc.garbage)}") Using the following code under Python 3.6.3, the garbage count keeps increasing and windows task manager records steady memory increase. However without indent json.dumps(self.__dict__), no leak is observed. ---------- components: Library (Lib) messages: 306344 nosy: rohandsa priority: normal severity: normal status: open title: Does json.dumps have a memory leak? versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 03:27:07 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 16 Nov 2017 08:27:07 +0000 Subject: [issue31808] tarfile.extractall fails to overwrite symlinks In-Reply-To: <1508315375.63.0.213398074469.issue31808@psf.upfronthosting.co.za> Message-ID: <1510820827.74.0.213398074469.issue31808@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +4364 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 03:44:41 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 16 Nov 2017 08:44:41 +0000 Subject: [issue31808] tarfile.extractall fails to overwrite symlinks In-Reply-To: <1508315375.63.0.213398074469.issue31808@psf.upfronthosting.co.za> Message-ID: <1510821881.74.0.213398074469.issue31808@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 04:01:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 09:01:32 +0000 Subject: [issue32045] Does json.dumps have a memory leak? In-Reply-To: <1510820419.37.0.213398074469.issue32045@psf.upfronthosting.co.za> Message-ID: <1510822892.3.0.213398074469.issue32045@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: indent=True just makes json to use Python implementation instead of C implementation. Python implementation uses closures which reference one other. Simple example not involving json is: import gc def f(): def g(): return h def h(): return g return gc.set_debug(gc.DEBUG_LEAK) while True: f() gc.collect() print(f"garbage count: {len(gc.garbage)}") The "leak" is caused by using gc.set_debug(gc.DEBUG_LEAK). gc.DEBUG_LEAK includes gc.DEBUG_COLLECTABLE, gc.DEBUG_UNCOLLECTABLE and gc.DEBUG_SAVEALL. gc.DEBUG_SAVEALL causes garbage-collected objects to be saved in gc.garbage for inspection. In normal circumstances they are collected. ---------- nosy: +pitrou, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 04:09:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 09:09:32 +0000 Subject: [issue32046] 2to3 fix for operator.isCallable() Message-ID: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently 2to3 converts `operator.isCallable(obj)` to `hasattr(obj, '__call__')`. This looks cumbersome, and can be deceived by instance attribute __call__. The more correct way is to use `isinstance(obj, collections.abc.Callable)`. Starting from Python 3.2 it can use the callable() builtin. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 306346 nosy: benjamin.peterson, levkivskyi, serhiy.storchaka priority: normal severity: normal status: open title: 2to3 fix for operator.isCallable() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 04:19:20 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 16 Nov 2017 09:19:20 +0000 Subject: [issue32044] pip3 install 3.6.3 crashes on startup; 3.5.4 works; on OS X 10.13.1 In-Reply-To: <1510808462.98.0.213398074469.issue32044@psf.upfronthosting.co.za> Message-ID: <1510823960.85.0.213398074469.issue32044@psf.upfronthosting.co.za> Berker Peksag added the comment: 1) Don't reopen a closed issue. 2) Please use python-list or StackOverflow for usage questions. You need to replace 'pip' with 'pip3' in your case. If you get a similar error with 'pip3', try 'sudo pip3 install -U ...' or 'pip3 install --user -U ...'. ---------- resolution: wont fix -> third party status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 04:49:08 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 16 Nov 2017 09:49:08 +0000 Subject: [issue31808] tarfile.extractall fails to overwrite symlinks In-Reply-To: <1508315375.63.0.213398074469.issue31808@psf.upfronthosting.co.za> Message-ID: <1510825748.67.0.213398074469.issue31808@psf.upfronthosting.co.za> Dong-hee Na added the comment: I 've submitted the patch please take a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 05:38:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 10:38:34 +0000 Subject: [issue30349] Preparation for advanced set syntax in regular expressions In-Reply-To: <1494576853.44.0.660813121244.issue30349@psf.upfronthosting.co.za> Message-ID: <1510828714.0.0.213398074469.issue30349@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 05cb728d68a278d11466f9a6c8258d914135c96c by Serhiy Storchaka in branch 'master': bpo-30349: Raise FutureWarning for nested sets and set operations (#1553) https://github.com/python/cpython/commit/05cb728d68a278d11466f9a6c8258d914135c96c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 05:39:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 10:39:01 +0000 Subject: [issue30349] Preparation for advanced set syntax in regular expressions In-Reply-To: <1494576853.44.0.660813121244.issue30349@psf.upfronthosting.co.za> Message-ID: <1510828741.61.0.213398074469.issue30349@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 05:40:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 10:40:13 +0000 Subject: [issue31672] string.Template should use re.ASCII flag In-Reply-To: <1507029340.05.0.213398074469.issue31672@psf.upfronthosting.co.za> Message-ID: <1510828813.79.0.213398074469.issue31672@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is something left to do here? In 3.7 r'(?-i:[_a-zA-Z][_a-zA-Z0-9]*)' can be replaced with r'(?a:[_a-z][_a-z0-9]*)' if it will add clarity. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 05:41:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 10:41:48 +0000 Subject: [issue24896] It is undocumented that re.UNICODE and re.LOCALE affect re.IGNORECASE In-Reply-To: <1439987891.31.0.547960058443.issue24896@psf.upfronthosting.co.za> Message-ID: <1510828908.58.0.213398074469.issue24896@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:09:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 11:09:33 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510830573.66.0.213398074469.issue31701@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4365 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:14:20 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 16 Nov 2017 11:14:20 +0000 Subject: [issue32046] 2to3 fix for operator.isCallable() In-Reply-To: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> Message-ID: <1510830860.41.0.213398074469.issue32046@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +4366 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:20:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 11:20:33 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1510831233.05.0.213398074469.issue32043@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ccb0442a338066bf40fe417455e5a374e5238afb by Victor Stinner in branch 'master': bpo-32043: New "developer mode": "-X dev" option (#4413) https://github.com/python/cpython/commit/ccb0442a338066bf40fe417455e5a374e5238afb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:22:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 11:22:53 +0000 Subject: [issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt In-Reply-To: <1507206772.04.0.213398074469.issue31702@psf.upfronthosting.co.za> Message-ID: <1510831373.79.0.213398074469.issue31702@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset cede8c9edb408321b493d8d5e73be9e1018020e4 by Serhiy Storchaka in branch 'master': bpo-31702: Allow to specify rounds for SHA-2 hashing in crypt.mksalt(). (#4110) https://github.com/python/cpython/commit/cede8c9edb408321b493d8d5e73be9e1018020e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:23:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 11:23:51 +0000 Subject: [issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt In-Reply-To: <1507206772.04.0.213398074469.issue31702@psf.upfronthosting.co.za> Message-ID: <1510831431.86.0.213398074469.issue31702@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:50:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 11:50:52 +0000 Subject: [issue32047] asyncio: enable debug mode when -X dev is used Message-ID: <1510833052.89.0.213398074469.issue32047@psf.upfronthosting.co.za> New submission from STINNER Victor : The bpo-32043 added a new "developer mode" enabled with the new -X dev command line option. I propose to enable asyncio debug mode with the global Python "developer mode". If an asyncio application is correctly written, the single side effect of -X dev would be to log "Executing ... took ... seconds" if a handle took longer than 100 ms. Well, a handle should *not* take longer than 100 ms. So maybe it's ok to start logging such events in the "developer mode", no? Example with attached block_loop.py script which blocks the event loop. (1) This command doesn't display anything: haypo at selma$ ./python block_loop.py (2) In developer mode, the warning a emitted to warn the developer about the bug: $ ./python -X dev block_loop.py Executing result=None created at /home/haypo/prog/python/master/Lib/asyncio/base_events.py:444> took 1.002 seconds ---------- components: asyncio files: block_loop.py messages: 306353 nosy: haypo, yselivanov priority: normal severity: normal status: open title: asyncio: enable debug mode when -X dev is used versions: Python 3.7 Added file: https://bugs.python.org/file47269/block_loop.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:51:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 11:51:37 +0000 Subject: [issue32047] asyncio: enable debug mode when -X dev is used In-Reply-To: <1510833052.89.0.213398074469.issue32047@psf.upfronthosting.co.za> Message-ID: <1510833097.73.0.213398074469.issue32047@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4367 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:53:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 11:53:32 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510833212.06.0.213398074469.issue31701@psf.upfronthosting.co.za> STINNER Victor added the comment: > May I ask why AddVectoredExceptionHandler is used instead of SetUnhandledExceptionFilter? Honestly, I don't know well Windows API and so I'm not sure which one is the best. https://stackoverflow.com/questions/28629351/is-addvectoredexceptionhandler-a-replacement-for-setunhandledexceptionfilter ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:53:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 11:53:47 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510833227.93.0.213398074469.issue31701@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 33217d22131ab1ffaa09a6944bae704f722f25a9 by Victor Stinner in branch '3.6': bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929) (#4416) https://github.com/python/cpython/commit/33217d22131ab1ffaa09a6944bae704f722f25a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:54:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 11:54:18 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510833258.33.0.213398074469.issue31701@psf.upfronthosting.co.za> STINNER Victor added the comment: I backported the fix to Python 3.6. @Steve Dower: What do you think of using SetUnhandledExceptionFilter? ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 07:36:28 2017 From: report at bugs.python.org (=?utf-8?b?0JDRgNGC0LXQvNC40Lkg0KDQvtC00LjQvtC90L7Qsg==?=) Date: Thu, 16 Nov 2017 12:36:28 +0000 Subject: [issue32048] Misprint in the unittest.mock documentation. Message-ID: <1510835787.98.0.213398074469.issue32048@psf.upfronthosting.co.za> Change by ??????? ???????? : ---------- assignee: docs at python components: Documentation nosy: docs at python, ??????? ???????? priority: normal severity: normal status: open title: Misprint in the unittest.mock documentation. type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 07:43:08 2017 From: report at bugs.python.org (=?utf-8?b?0JDRgNGC0LXQvNC40Lkg0KDQvtC00LjQvtC90L7Qsg==?=) Date: Thu, 16 Nov 2017 12:43:08 +0000 Subject: [issue32048] Misprint in the unittest.mock documentation. Message-ID: <1510836188.29.0.213398074469.issue32048@psf.upfronthosting.co.za> Change by ??????? ???????? : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 08:04:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 13:04:17 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1510837457.58.0.213398074469.issue32043@psf.upfronthosting.co.za> STINNER Victor added the comment: Antoine Pitrou asked me to document the performance and memory overhead of -X dev: https://mail.python.org/pipermail/python-dev/2017-November/150578.html For example, I measured an increase of +50% on the peak memory usage (measured by tracemalloc) when running test_os. Antoine proposed: """Currently, developer mode adds negligible CPU time overhead, but can increase memory consumption significantly if many small objects are allocated. This is subject to change in the future.""" https://mail.python.org/pipermail/python-dev/2017-November/150579.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 08:25:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 13:25:52 +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: <1510838752.04.0.213398074469.issue30133@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The proper way of escaping the replacement string has been documented by issue31714. ---------- resolution: -> out of date stage: -> resolved status: open -> closed superseder: -> Improve re documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 08:26:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 13:26:58 +0000 Subject: [issue23689] Memory leak in Modules/sre_lib.h In-Reply-To: <1426611380.23.0.46113718722.issue23689@psf.upfronthosting.co.za> Message-ID: <1510838818.47.0.213398074469.issue23689@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 08:27:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 13:27:57 +0000 Subject: [issue23691] re.finditer iterator is not reentrant, but doesn't protect against nested calls to __next__ In-Reply-To: <1426612626.66.0.267835433945.issue23691@psf.upfronthosting.co.za> Message-ID: <1510838877.42.0.213398074469.issue23691@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 08:28:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 13:28:44 +0000 Subject: [issue9134] sre bug: lastmark_save/restore In-Reply-To: <1277932738.21.0.537266945796.issue9134@psf.upfronthosting.co.za> Message-ID: <1510838924.36.0.213398074469.issue9134@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 08:39:17 2017 From: report at bugs.python.org (Sven Pagel) Date: Thu, 16 Nov 2017 13:39:17 +0000 Subject: [issue32049] 2.7.14 does not uninstall cleanly if installation was run as SYSTEM account (SCCM) Message-ID: <1510839557.93.0.213398074469.issue32049@psf.upfronthosting.co.za> New submission from Sven Pagel : If I install Python 2.7.14 on Windows (using the MSI) using the SYSTEM account, as is done by SCCM, uninstalling fails to clean up the registry so Python is still showing up as installed in the control panel (and still detected by SCCM). SCCM runs the following command line to install Python: msiexec /i "python-2.7.14.amd64.msi" ADDLOCAL=ALL /qn For uninstallation I use the following command line: msiexec /x {0398A685-FD8D-46B3-9816-C47319B0CF5F} Both are run as the SYSTEM account. ---------- components: Installation, Windows messages: 306359 nosy: niemalsnever, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: 2.7.14 does not uninstall cleanly if installation was run as SYSTEM account (SCCM) type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 08:51:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 13:51:53 +0000 Subject: [issue24555] Python logic error when deal with re and muti-threading In-Reply-To: <1435904415.54.0.666966497229.issue24555@psf.upfronthosting.co.za> Message-ID: <1510840313.8.0.213398074469.issue24555@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> re functions never release GIL _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:01:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:01:20 +0000 Subject: [issue25054] Capturing start of line '^' In-Reply-To: <1441887596.73.0.766811958538.issue25054@psf.upfronthosting.co.za> Message-ID: <1510840880.7.0.213398074469.issue25054@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka versions: +Python 2.7, Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:01:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 14:01:28 +0000 Subject: [issue32047] asyncio: enable debug mode when -X dev is used In-Reply-To: <1510833052.89.0.213398074469.issue32047@psf.upfronthosting.co.za> Message-ID: <1510840888.89.0.213398074469.issue32047@psf.upfronthosting.co.za> STINNER Victor added the comment: I sent an email about this change to python-dev: https://mail.python.org/pipermail/python-dev/2017-November/150572.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:12:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:12:24 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1510841544.81.0.213398074469.issue30004@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Do you mind to create a pull request on GitHub Cristian? ---------- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett, serhiy.storchaka stage: -> needs patch versions: -Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:14:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:14:36 +0000 Subject: [issue28951] re.flags not documented in Module Contents as promised. In-Reply-To: <1481569048.46.0.00215126822864.issue28951@psf.upfronthosting.co.za> Message-ID: <1510841676.95.0.213398074469.issue28951@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett stage: -> needs patch versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:14:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:14:44 +0000 Subject: [issue28951] re.flags not documented in Module Contents as promised. In-Reply-To: <1481569048.46.0.00215126822864.issue28951@psf.upfronthosting.co.za> Message-ID: <1510841684.55.0.213398074469.issue28951@psf.upfronthosting.co.za> Change by Serhiy Storchaka : Removed file: https://bugs.python.org/file45941/unnamed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:14:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:14:49 +0000 Subject: [issue28951] re.flags not documented in Module Contents as promised. In-Reply-To: <1481569048.46.0.00215126822864.issue28951@psf.upfronthosting.co.za> Message-ID: <1510841689.6.0.213398074469.issue28951@psf.upfronthosting.co.za> Change by Serhiy Storchaka : Removed file: https://bugs.python.org/file45940/unnamed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:14:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:14:54 +0000 Subject: [issue28951] re.flags not documented in Module Contents as promised. In-Reply-To: <1481569048.46.0.00215126822864.issue28951@psf.upfronthosting.co.za> Message-ID: <1510841694.83.0.213398074469.issue28951@psf.upfronthosting.co.za> Change by Serhiy Storchaka : Removed file: https://bugs.python.org/file45934/unnamed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:35:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:35:25 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1510842925.24.0.213398074469.issue31324@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4368 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:38:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 14:38:56 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1510843136.31.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested manually Serhiy's PR 4420: it works as expected! haypo at selma$ ./python -m test test_os --list-cases -m test.test_os.FileTests.test_access test.test_os.FileTests.test_access haypo at selma$ ./python -m test test_os --list-cases -m test_access test.test_os.FileTests.test_access haypo at selma$ ./python -m test test_os --list-cases -m FileTests test.test_os.FileTests.test_access test.test_os.FileTests.test_closerange test.test_os.FileTests.test_fdopen test.test_os.FileTests.test_large_read test.test_os.FileTests.test_open_keywords test.test_os.FileTests.test_read test.test_os.FileTests.test_rename test.test_os.FileTests.test_replace test.test_os.FileTests.test_symlink_keywords test.test_os.FileTests.test_write test.test_os.FileTests.test_write_windows_console haypo at selma$ ./python -m test test_os --list-cases -m 'FileTest*' test.test_os.FileTests.test_access test.test_os.FileTests.test_closerange test.test_os.FileTests.test_fdopen test.test_os.FileTests.test_large_read test.test_os.FileTests.test_open_keywords test.test_os.FileTests.test_read test.test_os.FileTests.test_rename test.test_os.FileTests.test_replace test.test_os.FileTests.test_symlink_keywords test.test_os.FileTests.test_write test.test_os.FileTests.test_write_windows_console haypo at selma$ ./python -m test test_os --list-cases -m 'test_acc*' test.test_os.FileTests.test_access test.test_os.StatAttributeTests.test_access_denied haypo at selma$ ./python -m test test_os --list-cases -m '*FileTests.test_access' test.test_os.FileTests.test_access ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:51:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:51:12 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1510843872.1.0.213398074469.issue31324@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: $ time ./python -m test.bisect --fail-env-changed -o bisect test_asyncio -N1 ... Bisection failed after 2 iterations and 0:00:11 real 0m10,441s user 0m8,726s sys 0m0,292s There is good opportunity for optimizing the regular expression. All cases have the literal 'test.test_asyncio.' prefix, and even longer literal prefixes are common for tens cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:52:23 2017 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 16 Nov 2017 14:52:23 +0000 Subject: [issue32046] 2to3 fix for operator.isCallable() In-Reply-To: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> Message-ID: <1510843943.34.0.213398074469.issue32046@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 09:56:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 14:56:22 +0000 Subject: [issue30148] Pathological regex behaviour In-Reply-To: <1492975562.82.0.745519478527.issue30148@psf.upfronthosting.co.za> Message-ID: <1510844182.66.0.213398074469.issue30148@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 10:01:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 15:01:37 +0000 Subject: [issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions In-Reply-To: <1476529213.17.0.132534478532.issue28450@psf.upfronthosting.co.za> Message-ID: <1510844497.35.0.213398074469.issue28450@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Barry, could you please improve the documentation about unknown escape sequences in regular expressions? My skills is not enough for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 10:16:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 15:16:45 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1510845405.81.0.213398074469.issue31324@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4369 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 10:49:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 15:49:19 +0000 Subject: [issue32050] Deprecated python3 -x option Message-ID: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> New submission from STINNER Victor : Python has a -x option documented as a "DOS specific hack only": https://docs.python.org/dev/using/cmdline.html#cmdoption-x Python doesn't support MS-DOS since Python 2.1: https://www.python.org/dev/peps/pep-0011/#no-longer-supported-platforms I propose to deprecate the option in Python 3.7: using it emits a DeprecationWarning, option deprecated in the documentation; and remove the option in Python 3.8. ---------- components: Interpreter Core messages: 306365 nosy: haypo priority: normal severity: normal status: open title: Deprecated python3 -x option versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:02:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 16:02:14 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510848134.67.0.213398074469.issue32050@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4370 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:03:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 16:03:29 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510848209.84.0.213398074469.issue32050@psf.upfronthosting.co.za> STINNER Victor added the comment: The note in the documentation is wrong: the line number is correct when using the -x option, even if the first line is skipped. Example with Python 2.7: --- $ cat x.py print(1) print(2) x $ python2 x.py 1 2 Traceback (most recent call last): File "x.py", line 3, in x NameError: name 'x' is not defined $ python2 -x x.py 2 Traceback (most recent call last): File "x.py", line 3, in x NameError: name 'x' is not defined --- Attached PR 4423 fixes Python 2.7 documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:12:43 2017 From: report at bugs.python.org (QbLearningPython) Date: Thu, 16 Nov 2017 16:12:43 +0000 Subject: [issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths In-Reply-To: <1510775335.55.0.213398074469.issue32040@psf.upfronthosting.co.za> Message-ID: <1510848763.5.0.213398074469.issue32040@psf.upfronthosting.co.za> QbLearningPython added the comment: Thanks, serhiy.storchaka, for your answer. I am not fully convinced. You have described the current behaviour of the pathlib package. But let me ask: should be this the desired behaviour? Since string filenames and pathlib.Paths are different ways to refer to the same object (a path in a filesystem), should not be they behaved in the same way when sorting? You pointed out that the current behaviour is "more natural order" for pathlib.Paths. I am not truly sure about that. Can you please provide any citation or additional information about that? Thank you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:18:01 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 16:18:01 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510849081.34.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > It's worse than a resource leak - the same file descriptor number could be reused for a different file/socket, and then depending on the selector in use, you could see the data from a completely different connection. I actually debugged a bug like this in asyncio code once. Took me quite a bit of time to figure it out. > I did see a bug like this years ago (in libcurl), although it's not a common problem. I'd use the proposed hook if it existed, but it seems like an intrusive solution to a rare issue. I don't think the proposed solution is too intrusive. If we don't like the "set a callback to intercept all socket.close()" idea, we can change it to: "add socket.add_close_callback() method to the socket object." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:21:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 16:21:32 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510849292.43.0.213398074469.issue32050@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Python still supports Windows. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:24:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 16:24:40 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510849480.59.0.213398074469.issue32038@psf.upfronthosting.co.za> STINNER Victor added the comment: The socket.socket (Python type) has a private _io_refs counter. close() does nothing until _io_refs reachs zero. Maybe we can develop an API to temporary increase the _io_refs counter to prevent a real close? Pseudo-code: @contextlib.contextmanager def dont_close_socket(sock): assert not sock._closed sock._io_refs += 1 try: yield sock finally: sock._io_refs -= 1 It may be a context manager or a new object. It would probably be better to put in the socket.socke type, since it uses private attributes. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:26:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 16:26:53 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510849613.6.0.213398074469.issue32050@psf.upfronthosting.co.za> STINNER Victor added the comment: > Python still supports Windows. What is the use case for this option on Windows? On Unix, the first line is usually used for the shebang, a line like: #!/usr/bin/env python3 But this shebang is seen as a comment in Python and Python simply ignore the shebang, seen as a comment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:27:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 16:27:13 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510849633.49.0.213398074469.issue32050@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4371 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:34:58 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 16:34:58 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510850098.49.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > The socket.socket (Python type) has a private _io_refs counter. close() does nothing until _io_refs reachs zero. I didn't know about this. Looks like I can use '_io_refs' to fix some problems in uvloop, thanks Victor! The only problem with '_io_refs' and `dont_close_socket` approach is that the original intent to close the socket is "lost". Consider this example: fut = loop.sock_recv(sock) sock.close() await fut Ideally, I'd expect `sock` to be closed right after `await fut` is completed. One way to make that possible is to initialize socket object with 'self._io_refs = 1', not 0. Whenever it goes to 0, the socket gets closed. This is a slight change to the existing machinery, but it would make sock.close() more predictable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:38:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 16:38:50 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510850330.51.0.213398074469.issue32038@psf.upfronthosting.co.za> STINNER Victor added the comment: >From my example: "finally: sock._io_refs -= 1" Oh, sock._decref_socketios() must be uesd here to really close the socket if it was closed in the meanwhile: def _decref_socketios(self): if self._io_refs > 0: self._io_refs -= 1 if self._closed: self.close() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:40:25 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 16:40:25 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510850425.73.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Oh, sock._decref_socketios() must be uesd here to really close the socket if it was closed in the meanwhile: For it to work correctly, socket objects should be initialized with "self._io_refs = 1". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:41:12 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 16:41:12 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510850472.55.0.213398074469.issue32038@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- Removed message: https://bugs.python.org/msg306374 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:42:07 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 16:42:07 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510850527.67.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Oh, sock._decref_socketios() must be uesd here to really close the socket if it was closed in the meanwhile: There's also 'sock._closed' attribute that sock.close() and sock. _decref_socketios() interact with.. Alright, let me play with this in uvloop. So far it looks like we don't need any new APIs :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:42:46 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 16:42:46 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510850566.84.0.213398074469.issue32050@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The same as on DOS. Change the extension of the Python script from .py to .bat, and insert the following first line: @path\to\python -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 Now you can run it as a bat-file. The command in the first line will run Python, passing the name of this file and up to 9 arguments (you can make it passing more than 9 arguments, but I don't remember the syntax). "@" disables printing this command itself. The first line is not valid Python syntax, but due to the -x option it will be skipped. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:46:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 16:46:56 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510850816.04.0.213398074469.issue32050@psf.upfronthosting.co.za> STINNER Victor added the comment: > @path\to\python -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 Oh wow, I never saw that before. There is now a "py" launcher on Windows, do we still need such "hack"? ---------- components: +Windows -Interpreter Core nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:50:41 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 16 Nov 2017 16:50:41 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510851041.97.0.213398074469.issue32038@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Hmm... _decref_socketios() is not really a public API. I think it would be nice to have an official way to deal with this, and a socket close callback sounds reasonable to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:51:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 16:51:43 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510851103.82.0.213398074469.issue32038@psf.upfronthosting.co.za> STINNER Victor added the comment: > Hmm... _decref_socketios() is not really a public API. I think it would be nice to have an official way to deal with this, and a socket close callback sounds reasonable to me. I dislike the idea of an event when a socket is closed. It doesn't prevent a crash if you are using the socket with the GIL released. I prefer to "hold" the socket while using it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:52:53 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 16:52:53 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510851173.68.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Hmm... _decref_socketios() is not really a public API. I think it would be nice to have an official way to deal with this, and a socket close callback sounds reasonable to me. We can just make it public (after some renames) :) My first idea was to add a refcounting API to sockets, I just didn't know it's already there (I assumed that socketmodule.c implements the actual 'socket' object, and never even looked in socket.py module). I'll experiment with this stuff in asyncio/uvloop and report back to this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 11:55:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 16:55:09 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510851309.94.0.213398074469.issue32050@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, of course. The py launcher is not an alternative to this "hack". It just allows you to specify just "py" (with possible options -2, -3, -3.6) instead of hardcoding the full name to the Python binary or add the path to directory containing the Python binary to your PATH. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:04:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 17:04:10 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1510851850.55.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: > There is good opportunity for optimizing the regular expression. All cases have the literal 'test.test_asyncio.' prefix, and even longer literal prefixes are common for tens cases. I implemented such code long time ago :-) https://github.com/haypo/hachoir3/blob/master/hachoir/regex/regex.py I'm not sure that this code works on Python 3, it was written for Python 2 but not only ported to Python 3 partially. It only supports a subset of regular expressions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:04:15 2017 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 16 Nov 2017 17:04:15 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510851173.68.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Perhaps you can just dup() the socket? That's what the ref counter is for IIRC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:05:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 17:05:36 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510851936.61.0.213398074469.issue32038@psf.upfronthosting.co.za> STINNER Victor added the comment: > Perhaps you can just dup() the socket? That's what the ref counter is for IIRC. Sure. That's another option. But for asyncio with a lot of concurrent users, I'm not sure that it's ok to create a temporary file descriptor, since there is a risk of hitting the maximum number of open file descriptors :-( Depending on the platform and the event loop implementation, the limit may be low. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:09:27 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 17:09:27 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510852167.37.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Perhaps you can just dup() the socket? That's what the ref counter is for IIRC. I already dup them for loop.create_server(sock=sock) and loop.create_connection(sock=sock) cases. Duping for sock_recv & friends will add too much overhead (they are relatively short operations). Another argument against duping is that the number of open FDs is a limited OS resource. So far Victor's idea of using '_io_refs' sounds like a perfect fit for both asyncio and uvloop. After all, asyncio use case is very similar to `socket.makefile()` -- keep the socket object alive while another API relies on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:10:05 2017 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 16 Nov 2017 17:10:05 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510851936.61.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: OK, then maybe socket objects should get a dup() method that just increments the ref counter, and that would be the public API you're looking for? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:14:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 17:14:15 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1510852455.08.0.213398074469.issue31324@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I know :-) Unfortunately it is not obviously that these optimization actually optimize regular expressions. Due to the implementation particularities sometimes "unoptimized" code is faster than "optimized". I'm going to implement these optimizations in the re module, but it needs to be very careful, and may need changing the matching engine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:17:11 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 17:17:11 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510852631.36.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > OK, then maybe socket objects should get a dup() method that just increments the ref counter, and that would be the public API you're looking for? "dup()" returns a new socket object, but here we only want to protect the original one. Maybe just 'sock.inc_io_ref()' and 'sock.dec_io_ref()'? OTOH using the current private socket API in asyncio and uvloop doesn't really scare me as long as it works, so keeping the status quo is also OK. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:27:04 2017 From: report at bugs.python.org (jason) Date: Thu, 16 Nov 2017 17:27:04 +0000 Subject: [issue32051] Possible issue in multiprocessing doc Message-ID: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> New submission from jason : in multiprocessing doc https://docs.python.org/3.6/library/multiprocessing.html under 17.2.2.7.2. Using a remote manager, >>> from multiprocessing.managers import BaseManager >>> import queue >>> queue = queue.Queue() >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue', callable=lambda:queue) >>> m = QueueManager(address=('', 50000), authkey=b'abracadabra') >>> s = m.get_server() >>> s.serve_forever() queue is used as both module name and variable name, should this be avoided? ---------- assignee: docs at python components: Documentation messages: 306389 nosy: 1a1a11a, docs at python priority: normal severity: normal status: open title: Possible issue in multiprocessing doc type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:50:57 2017 From: report at bugs.python.org (Guillaume Boily) Date: Thu, 16 Nov 2017 17:50:57 +0000 Subject: [issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls In-Reply-To: <1460619804.34.0.222553592589.issue26752@psf.upfronthosting.co.za> Message-ID: <1510854657.26.0.213398074469.issue26752@psf.upfronthosting.co.za> Guillaume Boily added the comment: As pointed here: https://github.com/testing-cabal/mock/issues/353, this issue is related to the method assert_has_calls or probably any calls that use the method _call_matcher to match calls. Given that you mock a class and spec it, since we always bind to the _spec_signature (e.g. the constructor signature), when it is a method call then it bind() throws a TypeError looking like `missing a require argument`. A possible solution would be to include method signatures into the spec. ---------- components: +Tests nosy: +guboi72 versions: +Python 3.6 -Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:51:36 2017 From: report at bugs.python.org (Ben Darnell) Date: Thu, 16 Nov 2017 17:51:36 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510854696.54.0.213398074469.issue32038@psf.upfronthosting.co.za> Ben Darnell added the comment: Note that a guard on socket objects can only solve part of the problem: in the case where i've seen this bug, it was with raw file descriptors from libcurl, and there's nothing python can do about that because there are no (python) socket objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 13:02:25 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 16 Nov 2017 18:02:25 +0000 Subject: [issue32038] Add API to intercept socket.close() In-Reply-To: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> Message-ID: <1510855345.6.0.213398074469.issue32038@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Note that a guard on socket objects can only solve part of the problem: in the case where i've seen this bug, it was with raw file descriptors from libcurl, and there's nothing python can do about that because there are no (python) socket objects. Well, in this case 'dup' is the only option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 13:25:43 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 16 Nov 2017 18:25:43 +0000 Subject: [issue32046] 2to3 fix for operator.isCallable() In-Reply-To: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> Message-ID: <1510856743.01.0.213398074469.issue32046@psf.upfronthosting.co.za> ?ric Araujo added the comment: Why about just removing the check, now that callable has been back in 3.x for a few releases? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 13:26:02 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 16 Nov 2017 18:26:02 +0000 Subject: [issue32046] 2to3 fix for operator.isCallable() In-Reply-To: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> Message-ID: <1510856762.1.0.213398074469.issue32046@psf.upfronthosting.co.za> Change by ?ric Araujo : ---------- Removed message: https://bugs.python.org/msg306393 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 13:40:03 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 16 Nov 2017 18:40:03 +0000 Subject: [issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths In-Reply-To: <1510775335.55.0.213398074469.issue32040@psf.upfronthosting.co.za> Message-ID: <1510857603.06.0.213398074469.issue32040@psf.upfronthosting.co.za> R. David Murray added the comment: It is "obvious by inspection". Paths are paths instead of strings because they are formed out of discrete path components instead of strings. If you sorted each directory in the paths from the top down, and then sorted the subdirectories, and then sorted the filenames, you get that sorting by component. It's the same order you would get out of an ls -R. ---------- nosy: +r.david.murray stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 13:41:02 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 16 Nov 2017 18:41:02 +0000 Subject: [issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths In-Reply-To: <1510775335.55.0.213398074469.issue32040@psf.upfronthosting.co.za> Message-ID: <1510857662.19.0.213398074469.issue32040@psf.upfronthosting.co.za> R. David Murray added the comment: To put it another way, think about sorting a list of tuples. Same behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 13:53:49 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Thu, 16 Nov 2017 18:53:49 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510858429.24.0.213398074469.issue31701@psf.upfronthosting.co.za> Ilya Kulakov added the comment: I think faulthandler should use both. E.g. in [1] you can read about an exception that can be handled by AddVectoredExceptionHandler but not SetUnhandledExceptionFilter. Perhaps implementation should use SetUnhandledExceptionFilter for everything and AddVectoredExceptionHandler only for those exceptions that cannot be handled by the former, like c0000374. I couldn't find a list, so guess it will be an ongoing WIP. 1: https://stackoverflow.com/questions/19656946/why-setunhandledexceptionfilter-cannot-capture-some-exception-but-addvectoredexc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 14:09:48 2017 From: report at bugs.python.org (Bruce Merry) Date: Thu, 16 Nov 2017 19:09:48 +0000 Subject: [issue32052] Provide access to buffer of asyncio.StreamReader Message-ID: <1510859388.33.0.213398074469.issue32052@psf.upfronthosting.co.za> New submission from Bruce Merry : While asyncio.StreamReader.readuntil is an improvement on only having readline, it is still quite limited e.g. you cannot have multiple possible terminators. The real problem is that it's not possible to roll your own without accessing _underscore fields (other than by reading one byte at a time, which I'm guessing would be bad for performance). I'm not sure exactly what a public API to assist would look like, but I think the following would be a good start: 1. A get_buffer method, that returns (self._buffer, self._eof); the caller must treat the buffer as readonly. 2. A wait_for_data method to wait for the return value of get_buffer to change (basically like current _wait_for_data) 3. Access to the _limit attribute. With that available, I think readuntil or more complex variants of it could be implemented externally using only the public interface (consumption of data from the buffer would be via readexactly rather than by messing with the buffer array directly). ---------- components: asyncio messages: 306397 nosy: Bruce Merry, yselivanov priority: normal severity: normal status: open title: Provide access to buffer of asyncio.StreamReader type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 14:39:54 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 16 Nov 2017 19:39:54 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: <1510861194.3.0.213398074469.issue32025@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Should I leave this open for you to work on the macOS implementation, Victor? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 16:36:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 21:36:43 +0000 Subject: [issue32053] Inconsistent use of tabs and spaces in indentation not always detected Message-ID: <1510868203.24.0.213398074469.issue32053@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : >>> exec('''if 1: ... print(1) ... \tprint(2) ... ''') 1 2 The first indented line uses 8 spaces. The second indented line uses 7 spaces + tabulation. Indentations are different, but TabError is not raised. ---------- components: Interpreter Core messages: 306399 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: Inconsistent use of tabs and spaces in indentation not always detected type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 17:00:13 2017 From: report at bugs.python.org (Marc Le Roy) Date: Thu, 16 Nov 2017 22:00:13 +0000 Subject: [issue29753] Ctypes Packing Bitfields Incorrectly - Linux In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1510869613.87.0.213398074469.issue29753@psf.upfronthosting.co.za> Change by Marc Le Roy : ---------- nosy: +mleroy003 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 17:07:02 2017 From: report at bugs.python.org (Pedro) Date: Thu, 16 Nov 2017 22:07:02 +0000 Subject: [issue32054] Creating RPM on Python 2 works, but Python 3 fails because of sys.implementation.cache_tag Message-ID: <1510870022.27.0.213398074469.issue32054@psf.upfronthosting.co.za> New submission from Pedro : I am trying to create an RPM on SLES12 SP2. (I think that corresponds to OpenSUSE 42.2.) This is my setup.py file, nothing special: import setuptools setuptools.setup(name='MyApp', version='1.2.3', options={'bdist_rpm': {'post_install': 'post_install.sh', 'post_uninstall': 'post_uninstall.sh'}}) Running `python setup.py bdist_rpm` with Python 2 works. However, running `python3 setup.py bdist_rpm` outputs the following: running bdist_rpm running egg_info writing top-level names to MyApp.egg-info/top_level.txt ... byte-compiling /home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py to my_file.cpython-34.pyc ... Processing files: MyApp-1.2.3-1.noarch error: File not found: /home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py RPM build errors: File not found: /home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py error: command 'rpmbuild' failed with exit status 1 The problem appears to be that setuptools is generating a file that ends in `.cpython-34.pyc`, and later looks for a file without the `.cpython-34` but can't find it. The RPM generation process on Python 3 goes through `distutils.util.byte_compile()`, which in turn calls `importlib.util.cache_from_source(path)`, where `path` is the file to be byte-compiled. `cache_from_source()` injects the value of `sys.implementation.cache_tag` (which is equal to 'cpython-34' on SLES12 SP2) into the filename of the compiled file. This attribute of `sys` does not exist in Python 2. So it looks like `setuptools` alters the filename with that tag during byte compilation, but later forgets that it modified the filename and fails because it's looking for the original name. I ended up working around this by patching `distutils.file_util.write_file` to eliminate the .pyc entries from INSTALLED_FILES: orig_bytecode_var = os.environ.get('PYTHONDONTWRITEBYTECODE', '') os.environ['PYTHONDONTWRITEBYTECODE'] = '1' orig_write_file = distutils.file_util.write_file def my_patch(*args, **kwargs): new_args = list(args) if args[0] == 'INSTALLED_FILES': new_args[1] = [fname for fname in args[1] if fname[-4:] not in ('.pyc', '.pyo')] orig_write_file(*new_args, **kwargs) distutils.file_util.write_file = my_patch setuptools.setup(name='MyApp', version='1.2.3', options={'bdist_rpm': {'post_install': 'post_install.sh', 'post_uninstall': 'post_uninstall.sh'}}) os.environ['PYTHONDONTWRITEBYTECODE'] = orig_bytecode_var distutils.file_util.write_file = orig_write_file But I don't think I should have to do anything special to build an RPM on Python 3 vs. Python 2. Is this expected behavior? ---------- components: Distutils messages: 306400 nosy: dstufft, eric.araujo, pgacv2 priority: normal severity: normal status: open title: Creating RPM on Python 2 works, but Python 3 fails because of sys.implementation.cache_tag type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:05:25 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Thu, 16 Nov 2017 23:05:25 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510873525.36.0.213398074469.issue31701@psf.upfronthosting.co.za> Ilya Kulakov added the comment: Another option is to use AddVectoredContinueHandler [1]. It seems to be called if both VEH and SEH failed to handle the error. 1: https://msdn.microsoft.com/en-us/library/windows/desktop/ms679273(v=vs.85).aspx ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:11:46 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 16 Nov 2017 23:11:46 +0000 Subject: [issue31911] Use malloc_usable_size() in pymalloc for realloc In-Reply-To: <1509472664.46.0.213398074469.issue31911@psf.upfronthosting.co.za> Message-ID: <1510873906.57.0.213398074469.issue31911@psf.upfronthosting.co.za> Antoine Pitrou added the comment: What would be the point of this? This would complicate the code with platform-specific code and it's not obvious that it would change runtime performance in any significant way. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:41:28 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 16 Nov 2017 23:41:28 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510875688.02.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4372 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:43:52 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 16 Nov 2017 23:43:52 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510875832.21.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4373 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:47:11 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 16 Nov 2017 23:47:11 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510876031.92.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4374 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:55:08 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 16 Nov 2017 23:55:08 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510876508.5.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4375 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:56:09 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 16 Nov 2017 23:56:09 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510876569.34.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4376 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:56:30 2017 From: report at bugs.python.org (Steve Dower) Date: Thu, 16 Nov 2017 23:56:30 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510876590.54.0.213398074469.issue31691@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset fd0fa67464f75cebca67cd14d050476a0c73bd53 by Steve Dower (native-api) in branch 'master': bpo-31691: Specify where to find build instructions for the Windows installer (#4426) https://github.com/python/cpython/commit/fd0fa67464f75cebca67cd14d050476a0c73bd53 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 18:57:50 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 16 Nov 2017 23:57:50 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510876670.36.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4377 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 19:28:45 2017 From: report at bugs.python.org (Steve Dower) Date: Fri, 17 Nov 2017 00:28:45 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510878525.93.0.213398074469.issue31691@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset c02307e9634583d3f2660e46b5200bf0b282695a by Steve Dower (native-api) in branch '2.7': bpo-31691: Specify how to build installer in Windows (#4430) https://github.com/python/cpython/commit/c02307e9634583d3f2660e46b5200bf0b282695a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 19:49:38 2017 From: report at bugs.python.org (Steve Dower) Date: Fri, 17 Nov 2017 00:49:38 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510879778.17.0.213398074469.issue31691@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset 0a6158ca392adfdfbeb7eb43d8d8109c02b00d23 by Steve Dower (Miss Islington (bot)) in branch '3.6': bpo-31691: Specify where to find build instructions for the Windows installer (GH-4426) (#4431) https://github.com/python/cpython/commit/0a6158ca392adfdfbeb7eb43d8d8109c02b00d23 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 19:49:59 2017 From: report at bugs.python.org (Steve Dower) Date: Fri, 17 Nov 2017 00:49:59 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510879799.31.0.213398074469.issue31691@psf.upfronthosting.co.za> Steve Dower added the comment: Thanks for the PR! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 19:50:50 2017 From: report at bugs.python.org (Steve Dower) Date: Fri, 17 Nov 2017 00:50:50 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510879850.24.0.213398074469.issue31691@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset c69611990365ae2f2efffd191de0aba9ee98d95c by Steve Dower (native-api) in branch '3.6': bpo-31691: Specify where to find installer build instructions for Windows (#4427) https://github.com/python/cpython/commit/c69611990365ae2f2efffd191de0aba9ee98d95c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 23:39:55 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 17 Nov 2017 04:39:55 +0000 Subject: [issue32051] Possible issue in multiprocessing doc In-Reply-To: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> Message-ID: <1510893595.56.0.213398074469.issue32051@psf.upfronthosting.co.za> Berker Peksag added the comment: The example itself works fine, but I agree that it would be better to use a better name. We could replace ``('foo.bar.org', 50000)`` in the following examples with ``('', 50000)`` too. Would you like to send a PR? The documentation file is located at Doc/library/multiprocessing.rst. ---------- keywords: +easy nosy: +berker.peksag stage: -> needs patch type: enhancement -> behavior versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 23:43:14 2017 From: report at bugs.python.org (jason) Date: Fri, 17 Nov 2017 04:43:14 +0000 Subject: [issue32051] Possible issue in multiprocessing doc In-Reply-To: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> Message-ID: <1510893794.97.0.213398074469.issue32051@psf.upfronthosting.co.za> jason added the comment: Thank you for answering! Yes, I would be very happy to do that, this is going to be my first contribution! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 23:49:13 2017 From: report at bugs.python.org (Charles Machalow) Date: Fri, 17 Nov 2017 04:49:13 +0000 Subject: [issue29753] Ctypes Packing Bitfields Incorrectly - Linux In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1510894153.41.0.213398074469.issue29753@psf.upfronthosting.co.za> Charles Machalow added the comment: Antti, is there a place in the ctypes documentation that explicitly says ctypes is not meant to be used cross-platform? If not, shouldn't that be mentioned? I think ultimately ctypes should default to standard OS/compiler behavior, but should allow the flexibility for one to override for cross-platform interchangeability. In the C++ code here, the code is explicitly checking if Windows (or GCC) to choose behavior. In theory, that could be changed to allow runtime-choice for packing behavior. Of course, that is probably best for a feature issue. For this one, I'd just like to have the behavior on Linux match GCC, as that is the definitive bug here as our example has shown. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 01:06:11 2017 From: report at bugs.python.org (Lisa Roach) Date: Fri, 17 Nov 2017 06:06:11 +0000 Subject: [issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples In-Reply-To: <1508439273.05.0.213398074469.issue31822@psf.upfronthosting.co.za> Message-ID: <1510898771.57.0.213398074469.issue31822@psf.upfronthosting.co.za> Change by Lisa Roach : ---------- keywords: +patch pull_requests: +4378 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 02:27:58 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 17 Nov 2017 07:27:58 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1510903678.77.0.213398074469.issue31956@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4379 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 02:43:17 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 17 Nov 2017 07:43:17 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests Message-ID: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> New submission from Nick Coghlan : (I thought there was an open low priority issue for this, but I can't find it, so filing a new one) Currently, "in" and "not in" are classified as comparison operations in the language grammar, even though they're not actually documented as such (see https://bugs.python.org/issue28617 in relation to the latter point). Issue reports like https://bugs.python.org/issue30965, user questions like https://stackoverflow.com/questions/45180899/unexpected-result-from-in-operator-python/45180967, and behaviour puzzles like https://github.com/cosmologicon/pywat#operator-precedence suggest that the existing behaviour isn't particular intuitive to users. At the language design level (as far as I am aware), the benefit of treating "in" and "not in" as comparison operators is to ensure they share a precedence level with the other comparisons. While this is mostly a pretty harmless quirk, I think it's weird enough and useless enough for us to at least consider refining the Grammar such that "in" and "not in" live at the same level as other comparison operators, but *don't* participate in comparison chaining (i.e. "a == b in c" and "a in c == b" would both be syntax errors that required parentheses to disambiguate the desired associativity). ---------- messages: 306411 nosy: ncoghlan priority: low severity: normal status: open title: Reconsider comparison chaining for containment tests type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 02:45:07 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 17 Nov 2017 07:45:07 +0000 Subject: [issue28617] Why isn't "in" called a comparison operation? In-Reply-To: <1478291760.05.0.758080389861.issue28617@psf.upfronthosting.co.za> Message-ID: <1510904707.88.0.213398074469.issue28617@psf.upfronthosting.co.za> Nick Coghlan added the comment: Also see https://bugs.python.org/issue32055 regarding the prospect of bringing the implementation into line with the intuitive semantics, and preventing implicit comparison chaining for containment tests. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 02:47:57 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 17 Nov 2017 07:47:57 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests In-Reply-To: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> Message-ID: <1510904877.65.0.213398074469.issue32055@psf.upfronthosting.co.za> Nick Coghlan added the comment: https://bugs.python.org/issue14247 is another older issue related to this point (again related to a user finding the current behaviour genuinely unintuitive) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 02:51:08 2017 From: report at bugs.python.org (Rohan D'Sa) Date: Fri, 17 Nov 2017 07:51:08 +0000 Subject: [issue32045] Does json.dumps have a memory leak? In-Reply-To: <1510820419.37.0.213398074469.issue32045@psf.upfronthosting.co.za> Message-ID: <1510905068.22.0.213398074469.issue32045@psf.upfronthosting.co.za> Rohan D'Sa added the comment: you are right. i realized later i actually had a leak in a com instantiated object, assumed it was a leak in the python and tried to find it using the gc module. The gc documentation led me down the garden path. QUOTE gc.garbage A list of objects which the collector found to be unreachable but could not be freed (uncollectable objects). UNQUOTE i assumed: - cyclic references are unreachable but can be freed and hence collectable. - __del__ finalizer (with cyclic references?) objects are unreachable and cannot be freed and hence uncollectable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:12:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Nov 2017 09:12:20 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests In-Reply-To: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> Message-ID: <1510909940.0.0.213398074469.issue32055@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: `a in b < c` makes sense if b and c are sets. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:14:38 2017 From: report at bugs.python.org (Stefan Krah) Date: Fri, 17 Nov 2017 09:14:38 +0000 Subject: [issue32053] Inconsistent use of tabs and spaces in indentation not always detected In-Reply-To: <1510868203.24.0.213398074469.issue32053@psf.upfronthosting.co.za> Message-ID: <1510910078.99.0.213398074469.issue32053@psf.upfronthosting.co.za> Change by Stefan Krah : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> TabError behavior doesn't match documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:23:36 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Nov 2017 09:23:36 +0000 Subject: [issue24260] TabError behavior doesn't match documentation In-Reply-To: <1432244751.77.0.187754601995.issue24260@psf.upfronthosting.co.za> Message-ID: <1510910616.38.0.213398074469.issue24260@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: My model is the same as the Martin's one. I know how to implement this, but the code isn't simple. I'm going to do this after fixing other bugs in the tokenizer. ---------- nosy: +serhiy.storchaka priority: normal -> low versions: +Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:30:52 2017 From: report at bugs.python.org (Stefan Krah) Date: Fri, 17 Nov 2017 09:30:52 +0000 Subject: [issue24260] TabError behavior doesn't match documentation In-Reply-To: <1432244751.77.0.187754601995.issue24260@psf.upfronthosting.co.za> Message-ID: <1510911052.54.0.213398074469.issue24260@psf.upfronthosting.co.za> Stefan Krah added the comment: I'm now in the camp of forbidding tabs. When I wrote my own parser a couple of years ago, I tested it on a huge body of Python files that were present on my system. Tabs always looked accidental. Is there any *known* code base that deliberately uses tabs? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:30:58 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 17 Nov 2017 09:30:58 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests In-Reply-To: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> Message-ID: <1510911058.2.0.213398074469.issue32055@psf.upfronthosting.co.za> Nick Coghlan added the comment: Aye, there are definitely cases where the answer isn't nonsense. Even for sets though, "a in b < c" isn't an intuitive spelling of "a in b and b < c" the way that "a < b < c" is an intuitive spelling of an ordering relation. Hence filing this as a low priority issue - it's a weird quirk, and potentially worth changing to avoid a particular "Wat?" moment when folks first see it, but it isn't a bug magnet the way some other historical constructs have been. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:33:55 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 17 Nov 2017 09:33:55 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests In-Reply-To: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> Message-ID: <1510911235.15.0.213398074469.issue32055@psf.upfronthosting.co.za> Nick Coghlan added the comment: Just a note on why I find "a in b < c" unintuitive, even for sets: my brain initially wanted to read it as equivalent to "a in b & c". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:34:14 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 17 Nov 2017 09:34:14 +0000 Subject: [issue29185] test_distutils fails on Android API level 24 In-Reply-To: <1483737507.74.0.0285105710282.issue29185@psf.upfronthosting.co.za> Message-ID: <1510911254.81.0.213398074469.issue29185@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4380 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:42:26 2017 From: report at bugs.python.org (=?utf-8?b?5byg5b635bKz?=) Date: Fri, 17 Nov 2017 09:42:26 +0000 Subject: [issue32056] bug in Lib/wave.py Message-ID: <1510911746.81.0.213398074469.issue32056@psf.upfronthosting.co.za> New submission from ??? : I found a bug in wave.py because there is no check for self._channel in _read_fmt_chunk function. When I try to open a wav file which channel is zero, it will crash bacause of divided by zero in initfp function. ---------- components: Library (Lib) files: audio-testcase.wav messages: 306420 nosy: BT123 priority: normal pull_requests: 4381 severity: normal status: open title: bug in Lib/wave.py type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47270/audio-testcase.wav _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:42:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 17 Nov 2017 09:42:44 +0000 Subject: [issue24260] TabError behavior doesn't match documentation In-Reply-To: <1432244751.77.0.187754601995.issue24260@psf.upfronthosting.co.za> Message-ID: <1510911764.5.0.213398074469.issue24260@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Lets not continue a holy war here. I'm in the camp of tab-indenters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:51:20 2017 From: report at bugs.python.org (Stefan Krah) Date: Fri, 17 Nov 2017 09:51:20 +0000 Subject: [issue24260] TabError behavior doesn't match documentation In-Reply-To: <1432244751.77.0.187754601995.issue24260@psf.upfronthosting.co.za> Message-ID: <1510912280.56.0.213398074469.issue24260@psf.upfronthosting.co.za> Stefan Krah added the comment: python-dev is becoming insufferable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:51:52 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 17 Nov 2017 09:51:52 +0000 Subject: [issue32031] Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased In-Reply-To: <1510738661.72.0.213398074469.issue32031@psf.upfronthosting.co.za> Message-ID: <1510912312.69.0.213398074469.issue32031@psf.upfronthosting.co.za> Xavier de Gaye added the comment: The error: generic_x86_64:/data/local/tmp/python $ python -m test test_pydoc Run tests sequentially 0:00:00 [1/1] test_pydoc test test_pydoc failed -- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_pydoc.py", line 459, in test_mixed_case_module_names_are_lower_cased self.assertIn('xml.etree.elementtree', doc_link) File "/sdcard/org.python/lib/python3.7/unittest/case.py", line 1103, in assertIn if member not in container: TypeError: argument of type 'NoneType' is not iterable test_pydoc failed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:53:01 2017 From: report at bugs.python.org (Stefan Krah) Date: Fri, 17 Nov 2017 09:53:01 +0000 Subject: [issue24260] TabError behavior doesn't match documentation In-Reply-To: <1432244751.77.0.187754601995.issue24260@psf.upfronthosting.co.za> Message-ID: <1510912381.94.0.213398074469.issue24260@psf.upfronthosting.co.za> Change by Stefan Krah : ---------- nosy: -skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:59:41 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 17 Nov 2017 09:59:41 +0000 Subject: [issue32031] Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased In-Reply-To: <1510738661.72.0.213398074469.issue32031@psf.upfronthosting.co.za> Message-ID: <1510912781.73.0.213398074469.issue32031@psf.upfronthosting.co.za> Xavier de Gaye added the comment: The path returned by inspect.getabsfile(xml.etree.ElementTree) is not the canonical path, hence the test failure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:00:14 2017 From: report at bugs.python.org (zhangdeyue) Date: Fri, 17 Nov 2017 10:00:14 +0000 Subject: [issue32056] bug in Lib/wave.py In-Reply-To: <1510911746.81.0.213398074469.issue32056@psf.upfronthosting.co.za> Message-ID: <1510912814.69.0.213398074469.issue32056@psf.upfronthosting.co.za> Change by zhangdeyue : ---------- keywords: +patch pull_requests: +4382 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:10:22 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 17 Nov 2017 10:10:22 +0000 Subject: [issue31867] Duplicated keys in MIME type_map with different values In-Reply-To: <1508926440.94.0.213398074469.issue31867@psf.upfronthosting.co.za> Message-ID: <1510913422.54.0.213398074469.issue31867@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset f02f5e5c3eb815fff9578dc58de60374c6baaa3d by Andrew Svetlov (Henk-Jaap Wagenaar) in branch 'master': bpo-31867: Remove duplicates in default mimetypes. (#4388) https://github.com/python/cpython/commit/f02f5e5c3eb815fff9578dc58de60374c6baaa3d ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:11:03 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 17 Nov 2017 10:11:03 +0000 Subject: [issue31867] Duplicated keys in MIME type_map with different values In-Reply-To: <1508926440.94.0.213398074469.issue31867@psf.upfronthosting.co.za> Message-ID: <1510913463.58.0.213398074469.issue31867@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Henk-Jaap thanks for contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:17:40 2017 From: report at bugs.python.org (Bogdan Popa) Date: Fri, 17 Nov 2017 10:17:40 +0000 Subject: [issue32057] time.sleep(n) interrupted by signal Message-ID: <1510913860.03.0.213398074469.issue32057@psf.upfronthosting.co.za> New submission from Bogdan Popa : I ran into this while backporting some code from 3.6 to 3.5 and 3.4. The following piece of code prints one line every second, as expected, on 3.6 and 3.5, but it doesn't on 3.4. It looks like the signal is able to wake up the main thread from sleeping: ``` import time import signal def handle(signum, mask): print("received signal at", time.time()) signal.setitimer(signal.ITIMER_REAL, 1, 1) signal.signal(signal.SIGALRM, handle) for _ in range(2): now = time.time() delta = 1 - (time.time() - int(time.time())) time.sleep(delta) print(now, delta, time.time()) ``` If I remove the timer, then everything works as expected on 3.4. Here is some sample output from 3.6: ``` 1510913832.4726589 0.5273411273956299 1510913833.000339 received signal at 1510913833.477888 1510913833.000449 0.9995510578155518 1510913834.000187 ``` And some from 3.4: ``` 1510913813.525479 0.4745209217071533 1510913814.004106 received signal at 1510913814.529313 1510913814.004233 0.9957659244537354 1510913814.529413 ``` ---------- components: Interpreter Core messages: 306427 nosy: Bogdan Popa priority: normal severity: normal status: open title: time.sleep(n) interrupted by signal versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:22:44 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 17 Nov 2017 10:22:44 +0000 Subject: [issue32031] Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased In-Reply-To: <1510738661.72.0.213398074469.issue32031@psf.upfronthosting.co.za> Message-ID: <1510914164.71.0.213398074469.issue32031@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +4383 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:24:47 2017 From: report at bugs.python.org (Bogdan Popa) Date: Fri, 17 Nov 2017 10:24:47 +0000 Subject: [issue32057] time.sleep(n) interrupted by signal In-Reply-To: <1510913860.03.0.213398074469.issue32057@psf.upfronthosting.co.za> Message-ID: <1510914287.47.0.213398074469.issue32057@psf.upfronthosting.co.za> Bogdan Popa added the comment: I forgot to mention that I am on macOS Sierra (10.12.6) and I ran the code on Python 3.4.6, 3.5.3 and 3.6.3, respectively. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:31:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 10:31:13 +0000 Subject: [issue32057] time.sleep(n) interrupted by signal In-Reply-To: <1510913860.03.0.213398074469.issue32057@psf.upfronthosting.co.za> Message-ID: <1510914673.64.0.213398074469.issue32057@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm sorry but Python 3.4 doesn't accept bugfixes anymore. Same for Python 3.5. https://devguide.python.org/#status-of-python-branches > The following piece of code prints one line every second, as expected, on 3.6 and 3.5 Good, at least Python behaves as you want :-) Maybe it's an enhancement caused by the PEP 475. ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:56:37 2017 From: report at bugs.python.org (Bogdan Popa) Date: Fri, 17 Nov 2017 10:56:37 +0000 Subject: [issue32057] time.sleep(n) interrupted by signal In-Reply-To: <1510913860.03.0.213398074469.issue32057@psf.upfronthosting.co.za> Message-ID: <1510916197.72.0.213398074469.issue32057@psf.upfronthosting.co.za> Bogdan Popa added the comment: Fair enough. From reading PEP 475, it does look like that's what fixed it. Thanks Victor! ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 06:06:43 2017 From: report at bugs.python.org (tom de wulf) Date: Fri, 17 Nov 2017 11:06:43 +0000 Subject: [issue32058] Faulty behaviour in email.utils.parseaddr if square brackets in subject Message-ID: <1510916803.84.0.213398074469.issue32058@psf.upfronthosting.co.za> New submission from tom de wulf : Probably a parsing bug in email.utils.parseaddr. How to recreate: >>> import email.utils >>> test = 'Subject: I am a bug [Random]\r\nFrom: someone \r\n\r\n' >>> email.utils.parseaddr(test) ('', 'I') >>> email.utils.parseaddr(test.replace('[', '').replace(']','')) ('someone', 'some at email.address') Expected behaviour: no need to remove the []'s ---------- components: email messages: 306431 nosy: barry, r.david.murray, tom de wulf priority: normal severity: normal status: open title: Faulty behaviour in email.utils.parseaddr if square brackets in subject type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 06:19:21 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 17 Nov 2017 11:19:21 +0000 Subject: [issue32059] detect_modules() in setup.py must also search the sysroot paths Message-ID: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> New submission from Xavier de Gaye : When cross-compiling, the gcc and clang `--sysroot=` compiler option may be used to change the logical path of the system headers and libraries to a path located within the install path of the cross-compiler tool chain. Android is a special case: -------------------------- With Unified Headers [1], the most recent versions of the Android NDK add an additional constraint: the root paths of usr/include and usr/lib are distinct. For example when cross-compiling for API 24 and the x86_64 architecture the full paths are: * headers: ANDROID_NDK_ROOT/sysroot/usr/include * libraries: ANDROID_NDK_ROOT/platforms/android-24/arch-x86_64/usr/lib64 To use sysroot in this example one needs to set sysroot to ANDROID_NDK_ROOT/sysroot in CFLAGS or CPPFLAGS and to set sysroot to ANDROID_NDK_ROOT/platforms/android-24/arch-x86_64 in LDFLAGS, while on a standard platform where the root path of usr/include and usr/lib is common, one would only need to set sysroot to this root path in CFLAGS. [1] https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md ---------- components: Cross-Build messages: 306432 nosy: Alex.Willmer, xdegaye priority: normal severity: normal stage: needs patch status: open title: detect_modules() in setup.py must also search the sysroot paths type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 07:20:29 2017 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 17 Nov 2017 12:20:29 +0000 Subject: [issue24260] TabError behavior doesn't match documentation In-Reply-To: <1432244751.77.0.187754601995.issue24260@psf.upfronthosting.co.za> Message-ID: <1510921229.28.0.213398074469.issue24260@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 07:35:55 2017 From: report at bugs.python.org (Alex Corcoles) Date: Fri, 17 Nov 2017 12:35:55 +0000 Subject: [issue32060] Should an ABC fail if no abstract methods are defined? Message-ID: <1510922155.04.0.213398074469.issue32060@psf.upfronthosting.co.za> New submission from Alex Corcoles : Hi, $ python3 Python 3.5.3 (default, Jan 19 2017, 14:11:04) >>> import abc >>> class Foo(abc.ABC): ... pass ... >>> Foo() <__main__.Foo object at 0x7f253e6dcb38> I think declaring a class as ABC without declaring any abstract method is an error. I've tried searching if this was already discussed, but did not find it. Maybe it is related to https://bugs.python.org/issue9731 Cheers, ?lex ---------- messages: 306433 nosy: Alex Corcoles priority: normal severity: normal status: open title: Should an ABC fail if no abstract methods are defined? type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 07:50:18 2017 From: report at bugs.python.org (Antti Haapala) Date: Fri, 17 Nov 2017 12:50:18 +0000 Subject: [issue29753] Ctypes Packing Bitfields Incorrectly - Linux In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1510923018.88.0.213398074469.issue29753@psf.upfronthosting.co.za> Antti Haapala added the comment: "Antti, is there a place in the ctypes documentation that explicitly says ctypes is not meant to be used cross-platform? If not, shouldn't that be mentioned?" I don't know about that, but the thing is nowhere does it say that it is meant to be used cross-platform. It just says it allows defining C types. It is somewhat implied that C types are not cross-platform at binary level, at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:07:11 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 17 Nov 2017 14:07:11 +0000 Subject: [issue32058] Faulty behaviour in email.utils.parseaddr if square brackets in subject In-Reply-To: <1510916803.84.0.213398074469.issue32058@psf.upfronthosting.co.za> Message-ID: <1510927631.94.0.213398074469.issue32058@psf.upfronthosting.co.za> R. David Murray added the comment: parseaddr is for parsing the contents of an address header, not for parsing any additional text. So the correct way to call it is parseaddress('someone '). In any case, please look in to the new email policies, which provide a much more convenient API: >>> from email import message_from_bytes >>> from email.policy import default >>> m = message_from_bytes(b'Subject: I am a bug [Random]\r\nFrom: someone \r\n\r\n', policy=default) >>> m['from'] 'someone ' >>> m['from'].addresses (Address(display_name='someone', username='some', domain='email.address'),) >>> m['from'].addresses[0].display_name 'someone' >>> m['from'].addresses[0].username 'some' >>> m['from'].addresses[0].addr_spec 'some at email.address' ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:12:07 2017 From: report at bugs.python.org (tom de wulf) Date: Fri, 17 Nov 2017 14:12:07 +0000 Subject: [issue32058] Faulty behaviour in email.utils.parseaddr if square brackets in subject In-Reply-To: <1510916803.84.0.213398074469.issue32058@psf.upfronthosting.co.za> Message-ID: <1510927927.93.0.213398074469.issue32058@psf.upfronthosting.co.za> tom de wulf added the comment: I do get this data from an IMAP fetch statement, see my code below: rv, data = imap.fetch(num, "(BODY[HEADER.FIELDS (FROM SUBJECT)])") if rv != 'OK': logging.error("Error getting message sender and subject (" + num.decode("ascii") + ")") return logging.info("Got message " + num.decode("ascii")) sender_subject = data[0][1].decode("utf-8") sender = email.utils.parseaddr(sender_subject.replace('[', '').replace(']',''))[1].replace("\r\n", "") Thank you for providing this new API though, I will make sure to switch to that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:12:45 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 17 Nov 2017 14:12:45 +0000 Subject: [issue32060] Should an ABC fail if no abstract methods are defined? In-Reply-To: <1510922155.04.0.213398074469.issue32060@psf.upfronthosting.co.za> Message-ID: <1510927965.95.0.213398074469.issue32060@psf.upfronthosting.co.za> R. David Murray added the comment: No, you could create an ABC whose only purpose was to be a target of register calls. As with the issue you reference, this is something better implemented in a linter. I'll leave this open for at least one other dev to concur and close, though. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:15:34 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 17 Nov 2017 14:15:34 +0000 Subject: [issue32058] Faulty behaviour in email.utils.parseaddr if square brackets in subject In-Reply-To: <1510916803.84.0.213398074469.issue32058@psf.upfronthosting.co.za> Message-ID: <1510928134.91.0.213398074469.issue32058@psf.upfronthosting.co.za> R. David Murray added the comment: Unfortunately the imap module in the stdlib doesn't provide a whole lot in the way of tools for parsing the imap data, just for sending it back and forth to the server. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:25:10 2017 From: report at bugs.python.org (Cristian Barbarosie) Date: Fri, 17 Nov 2017 14:25:10 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1510928710.17.0.213398074469.issue30004@psf.upfronthosting.co.za> Cristian Barbarosie added the comment: I'm sorry, I have no experience at all with Git. Could you please do it for me ? The bug appears in two places, see my first two messages. Thank you ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:34:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:34:34 +0000 Subject: [issue24260] TabError behavior doesn't match documentation In-Reply-To: <1432244751.77.0.187754601995.issue24260@psf.upfronthosting.co.za> Message-ID: <1510929274.37.0.213398074469.issue24260@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:35:44 2017 From: report at bugs.python.org (Mandeep Bhutani) Date: Fri, 17 Nov 2017 14:35:44 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1510929344.55.0.213398074469.issue30004@psf.upfronthosting.co.za> Mandeep Bhutani added the comment: Serhiy, Christian: I'll submit a PR for this later today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:44:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:44:50 +0000 Subject: [issue32061] test_httpservers.test_undecodable_filename() fails with [Errno 92] Illegal byte sequence on macOS Sierra Message-ID: <1510929890.31.0.213398074469.issue32061@psf.upfronthosting.co.za> New submission from STINNER Victor : x86-64 Sierra 3.6 failure: http://buildbot.python.org/all/#/builders/20/builds/81 ====================================================================== ERROR: test_undecodable_filename (test.test_httpservers.SimpleHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/support/__init__.py", line 601, in wrapper return func(*args, **kw) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_httpservers.py", line 381, in test_undecodable_filename with open(os.path.join(self.tempdir, filename), 'wb') as f: OSError: [Errno 92] Illegal byte sequence: '/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmp19j_8j75/@test_98516_tmp\udce7w\udcf0.txt' ---------- components: Tests, macOS messages: 306441 nosy: haypo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: test_httpservers.test_undecodable_filename() fails with [Errno 92] Illegal byte sequence on macOS Sierra versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:46:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:46:32 +0000 Subject: [issue32062] test_venv fails if zlib is not available Message-ID: <1510929992.88.0.213398074469.issue32062@psf.upfronthosting.co.za> New submission from STINNER Victor : test_venv should skip test_with_pip() test when the zlib module is missing. x86-64 Sierra 3.6 failure: http://buildbot.python.org/all/#/builders/20/builds/62 test_with_pip (test.test_venv.EnsurePipTest) ... FAIL ====================================================================== FAIL: test_with_pip (test.test_venv.EnsurePipTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_venv.py", line 368, in do_test_with_pip with_pip=True) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_venv.py", line 61, in run_with_capture func(*args, **kwargs) subprocess.CalledProcessError: Command '['/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmpzg_lamk1/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_venv.py", line 428, in test_with_pip self.do_test_with_pip(False) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_venv.py", line 374, in do_test_with_pip self.fail(msg.format(exc, details)) AssertionError: Command '['/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmpzg_lamk1/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. **Subprocess Output** Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/ensurepip/__main__.py", line 5, in sys.exit(ensurepip._main()) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 204, in _main default_pip=args.default_pip, File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 117, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip zipimport.ZipImportError: can't decompress data; zlib not available ---------- components: Tests messages: 306442 nosy: haypo, vinay.sajip priority: normal severity: normal status: open title: test_venv fails if zlib is not available versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:48:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:48:44 +0000 Subject: [issue32063] test_multiprocessing_forkserver failed with OSError: [Errno 48] Address already in use Message-ID: <1510930124.82.0.213398074469.issue32063@psf.upfronthosting.co.za> New submission from STINNER Victor : x86-64 Sierra 3.6: http://buildbot.python.org/all/#/builders/20/builds/62 0:06:16 load avg: 3.45 [ 87/405/1] test_multiprocessing_forkserver failed -- running: test_tokenize (77 sec) Process QueueManager-260: Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/managers.py", line 539, in _run_server server = cls._Server(registry, address, authkey, serializer) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/managers.py", line 139, in __init__ self.listener = Listener(address=address, backlog=16) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 438, in __init__ self._listener = SocketListener(address, family, backlog) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 576, in __init__ self._socket.bind(address) OSError: [Errno 48] Address already in use (...) test_rlock (test.test_multiprocessing_forkserver.WithThreadsTestLock) ... ok test_rapid_restart (test.test_multiprocessing_forkserver.WithThreadsTestManagerRestart) ... ERROR Warning -- Dangling processes: {} test_boundaries (test.test_multiprocessing_forkserver.WithThreadsTestPoll) ... ok test_dont_merge (test.test_multiprocessing_forkserver.WithThreadsTestPoll) ... ok (...) test_timeout (test.test_multiprocessing_forkserver.WithThreadsTestSemaphore) ... skipped 'test not appropriate for threads' test_import (test.test_multiprocessing_forkserver._TestImportStar) ... ok Warning -- Dangling processes: {} ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing_forkserver.WithThreadsTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/_test_multiprocessing.py", line 2508, in test_rapid_restart manager.start() File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/managers.py", line 517, in start self._address = reader.recv() File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 250, in recv buf = self._recv_bytes() File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 407, in _recv_bytes buf = self._recv(4) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 383, in _recv raise EOFError EOFError ---------- components: Tests messages: 306443 nosy: haypo priority: normal severity: normal status: open title: test_multiprocessing_forkserver failed with OSError: [Errno 48] Address already in use versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:50:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:50:55 +0000 Subject: [issue32062] test_venv fails if zlib is not available In-Reply-To: <1510929992.88.0.213398074469.issue32062@psf.upfronthosting.co.za> Message-ID: <1510930255.79.0.213398074469.issue32062@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, Serhiy already fixed it: bpo-31999. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_venv failed when the zlib module is not available _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:51:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:51:44 +0000 Subject: [issue32061] test_httpservers.test_undecodable_filename() fails with [Errno 92] Illegal byte sequence on macOS Sierra In-Reply-To: <1510929890.31.0.213398074469.issue32061@psf.upfronthosting.co.za> Message-ID: <1510930304.21.0.213398074469.issue32061@psf.upfronthosting.co.za> STINNER Victor added the comment: Oh, it's a duplicate of bpo-31380. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:51:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:51:49 +0000 Subject: [issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS In-Reply-To: <1504778309.6.0.433500701634.issue31380@psf.upfronthosting.co.za> Message-ID: <1510930309.96.0.213398074469.issue31380@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +haypo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 10:48:59 2017 From: report at bugs.python.org (Mandeep Bhutani) Date: Fri, 17 Nov 2017 15:48:59 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1510933739.3.0.213398074469.issue30004@psf.upfronthosting.co.za> Change by Mandeep Bhutani : ---------- keywords: +patch pull_requests: +4384 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 10:53:21 2017 From: report at bugs.python.org (Mandeep Bhutani) Date: Fri, 17 Nov 2017 15:53:21 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1510934001.93.0.213398074469.issue30004@psf.upfronthosting.co.za> Mandeep Bhutani added the comment: Cristian, Serhiy: I've submitted a PR for this bug. Cristian: I apologize for misspelling your name in a prior post. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 11:07:33 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 17 Nov 2017 16:07:33 +0000 Subject: [issue32059] detect_modules() in setup.py must also search the sysroot paths In-Reply-To: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> Message-ID: <1510934853.48.0.213398074469.issue32059@psf.upfronthosting.co.za> Xavier de Gaye added the comment: > while on a standard platform where the root path of usr/include and usr/lib is common, one would only need to set sysroot to this root path in CFLAGS s/CFLAGS/CC/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 12:50:27 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 17 Nov 2017 17:50:27 +0000 Subject: [issue32060] Should an ABC fail if no abstract methods are defined? In-Reply-To: <1510922155.04.0.213398074469.issue32060@psf.upfronthosting.co.za> Message-ID: <1510941027.88.0.213398074469.issue32060@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I concur. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 12:57:27 2017 From: report at bugs.python.org (Nick Lamb) Date: Fri, 17 Nov 2017 17:57:27 +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: <1510941447.22.0.213398074469.issue28414@psf.upfronthosting.co.za> Nick Lamb added the comment: As much for myself when I next run into this on my checklist as for any other readers: Despite the appearance of nothing happening PR 3010 (linked) actually has a little bit of momentum and seems likely to eventually land in Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 13:04:03 2017 From: report at bugs.python.org (Alex Corcoles) Date: Fri, 17 Nov 2017 18:04:03 +0000 Subject: [issue32060] Should an ABC fail if no abstract methods are defined? In-Reply-To: <1510922155.04.0.213398074469.issue32060@psf.upfronthosting.co.za> Message-ID: <1510941843.12.0.213398074469.issue32060@psf.upfronthosting.co.za> Alex Corcoles added the comment: Are you referring to something akin to Java's marker interfaces? That is, a class with no methods which you inherit from just for semantic meaning (e.g. Java's serializable interface that you implement to indicate that the class is designed for pickling). In that case, I suppose the docs could mention this clearly so this is more "discoverable" to noobs like me and prevent further issues like this (I think mine wasn't an unreasonable expectation). In any case, it's a minor point and I don't feel I have enough authority to discuss this topic- it's fine to close this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 13:27:58 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 17 Nov 2017 18:27:58 +0000 Subject: [issue32016] Python 3.6.3 venv FAILURE In-Reply-To: <1510600726.31.0.213398074469.issue32016@psf.upfronthosting.co.za> Message-ID: <1510943278.12.0.213398074469.issue32016@psf.upfronthosting.co.za> ?ric Araujo added the comment: Can you find out the full error message from pip? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 13:39:18 2017 From: report at bugs.python.org (R. David Murray) Date: Fri, 17 Nov 2017 18:39:18 +0000 Subject: [issue32060] Should an ABC fail if no abstract methods are defined? In-Reply-To: <1510922155.04.0.213398074469.issue32060@psf.upfronthosting.co.za> Message-ID: <1510943958.81.0.213398074469.issue32060@psf.upfronthosting.co.za> R. David Murray added the comment: The docs start out with "as outlined in PEP 3119; see the PEP for why this was added to Python". I think it would be a good doc enhancement request to extract the motivation and other description out of that pep and put it in the main docs in a suitable form, and make sure this point is included. We used to just treat the peps as extensions of the documentation, but we've found over time that it is better to actually move the important parts of the text into the main docs, since the actual implementation and sometimes even how we talk about the feature tends to evolve away from the original PEP over time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 14:27:57 2017 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 17 Nov 2017 19:27:57 +0000 Subject: [issue32046] 2to3 fix for operator.isCallable() In-Reply-To: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> Message-ID: <1510946877.88.0.213398074469.issue32046@psf.upfronthosting.co.za> Guido van Rossum added the comment: I would convert this to `callable()` -- the conversion to collections.abc.Callable is more verbose and requires an extra import (that can be slow). ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 14:45:27 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 17 Nov 2017 19:45:27 +0000 Subject: [issue32060] Should an ABC fail if no abstract methods are defined? In-Reply-To: <1510922155.04.0.213398074469.issue32060@psf.upfronthosting.co.za> Message-ID: <1510947927.57.0.213398074469.issue32060@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, I should have add a bit more explanation. The logic for ABCs instantiation is roughly: if any(method.is_abstract() for method in dir(cls)): raise TypeError('I refuse to instantiate') inst = instantiate(cls) The edge case for any() is to default to False for an empty input sequence and this logic applies to ABCs as well. Alternatively, you can think of the it as using all() style logic, "instantiate this class only if all of the methods are non-abstract even if the class has no methods at all". The edge case for all() is that it returns True for an empty input. Another way of describing the logic is that the normal case for instantiating a class is to create an instance unless there is still work to be done (as evidenced by the presence of one or more abstract methods). The abstract methods are essentially a todo list for subclassers. If there are no open todos (even if there were never any todos), instantiation can go forward -- "You can't build that building until you have all the permits, but there are no permit requirements in this case, so go ahead with the construction." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 15:37:30 2017 From: report at bugs.python.org (uday kiran) Date: Fri, 17 Nov 2017 20:37:30 +0000 Subject: [issue32064] python msilib view.fetch is not returning none Message-ID: <1510951050.2.0.213398074469.issue32064@psf.upfronthosting.co.za> New submission from uday kiran : Please see my script attached. Once the records are completed, the View.Fetch() function should give a none value but intsead giving runtime error: _msi.MSIError: unknown error 103 It is already mentioned in the bugs. https://bugs.python.org/issue29364 https://bugs.python.org/issue1102 The comments mentioned as it will be fixed in the coming release. But it is a long back comment,but still not fixed. Any update on this? ---------- components: Windows files: MSIFileRead.py messages: 306456 nosy: paul.moore, steve.dower, tim.golden, uday kiran, zach.ware priority: normal severity: normal status: open title: python msilib view.fetch is not returning none type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47271/MSIFileRead.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 16:14:22 2017 From: report at bugs.python.org (uday kiran) Date: Fri, 17 Nov 2017 21:14:22 +0000 Subject: [issue32064] python msilib view.fetch is not returning none In-Reply-To: <1510951050.2.0.213398074469.issue32064@psf.upfronthosting.co.za> Message-ID: <1510953262.89.0.213398074469.issue32064@psf.upfronthosting.co.za> uday kiran added the comment: It seems you have added some patches as .c files, but how do we apply those on windows machines? No documentation related to it. https://bugs.python.org/file24795/_msi_fetch.patch.txt https://bugs.python.org/file11840/_msi.patch.txt Could you please help me how to apply these patches on windows environment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 17:10:20 2017 From: report at bugs.python.org (Ivan Pozdeev) Date: Fri, 17 Nov 2017 22:10:20 +0000 Subject: [issue31691] Include missing info on required build steps and how to build installer In-Reply-To: <1507129799.44.0.213398074469.issue31691@psf.upfronthosting.co.za> Message-ID: <1510956620.3.0.213398074469.issue31691@psf.upfronthosting.co.za> Change by Ivan Pozdeev : Removed file: https://bugs.python.org/file47260/0001-Add-missing-but-required-build-steps-and-how-to-buil.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 18:11:12 2017 From: report at bugs.python.org (yegle) Date: Fri, 17 Nov 2017 23:11:12 +0000 Subject: [issue32065] range_iterator doesn't have length, leads to surprised result Message-ID: <1510960272.2.0.213398074469.issue32065@psf.upfronthosting.co.za> New submission from yegle : This also affects xrange in Python2, so I chose the affected version as python27. range object (and xrange in Python2) has __len__(), but the range_iterator object created from __reversed__() doesn't have __len__. Python2: >>> x = xrange(10) >>> len(x) 10 >>> reversed(x) >>> y = reversed(x) >>> len(y) Traceback (most recent call last): File "", line 1, in TypeError: object of type 'rangeiterator' has no len() Python3.6 >>> x = range(10) >>> len(x) 10 >>> len(reversed(x)) Traceback (most recent call last): File "", line 1, in TypeError: object of type 'range_iterator' has no len() ---------- components: Interpreter Core messages: 306458 nosy: yegle priority: normal severity: normal status: open title: range_iterator doesn't have length, leads to surprised result versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 18:27:14 2017 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 17 Nov 2017 23:27:14 +0000 Subject: [issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional Message-ID: <1510961234.41.0.213398074469.issue32066@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- components: asyncio nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 18:30:49 2017 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 17 Nov 2017 23:30:49 +0000 Subject: [issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional Message-ID: <1510961449.69.0.213398074469.issue32066@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- keywords: +patch pull_requests: +4386 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 18:46:55 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 23:46:55 +0000 Subject: [issue32065] range_iterator doesn't have length, leads to surprised result In-Reply-To: <1510960272.2.0.213398074469.issue32065@psf.upfronthosting.co.za> Message-ID: <1510962415.47.0.213398074469.issue32065@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 18:53:12 2017 From: report at bugs.python.org (Steve Dower) Date: Fri, 17 Nov 2017 23:53:12 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510962792.8.0.213398074469.issue31701@psf.upfronthosting.co.za> Steve Dower added the comment: SetUnhandledExceptionFilter could be a good option. I suspect the difference between that and AddVectorContinueHandler are because of the weird prioritization of the two types of handler, and are probably not significant enough to worry about here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 19:02:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 18 Nov 2017 00:02:50 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510963370.37.0.213398074469.issue31701@psf.upfronthosting.co.za> STINNER Victor added the comment: > I suspect the difference between that and AddVectorContinueHandler are because of the weird prioritization of the two types of handler, and are probably not significant enough to worry about here. Ok, thanks. I close the issue since the initial bug has been fixed. Thank you Fynn Be for the bug report! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 19:03:13 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Sat, 18 Nov 2017 00:03:13 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510963393.08.0.213398074469.issue31701@psf.upfronthosting.co.za> Ilya Kulakov added the comment: Steve, the difficulty with SetUnhandledExceptionFilter is that it can replace filter installed by the user (e.g. one of loaded libraries). The information about AddVectoredContinueHandler is scarce, but according to what I found at [1]: If the exception is still not handled after all your frame based SEH handlers are called, vectored continue handler will be called. This gives you the last opportunity to handle the exception in a way you want. 1: https://blogs.msdn.microsoft.com/zhanli/2010/06/24/c-tips-addvectoredexceptionhandler-addvectoredcontinuehandler-and-setunhandledexceptionfilter/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 19:07:59 2017 From: report at bugs.python.org (yegle) Date: Sat, 18 Nov 2017 00:07:59 +0000 Subject: [issue32065] range_iterator doesn't have length, leads to surprised result In-Reply-To: <1510960272.2.0.213398074469.issue32065@psf.upfronthosting.co.za> Message-ID: <1510963679.47.0.213398074469.issue32065@psf.upfronthosting.co.za> yegle added the comment: Hmm I think this also applies to list_listiterator. In general I'd expect these to be true: l = [1,2,3] r = range(3) assert len(l) == len(reversed(l)) assert len(r) == len(reversed(r)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 19:37:54 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Sat, 18 Nov 2017 00:37:54 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510965474.31.0.213398074469.issue31701@psf.upfronthosting.co.za> Ilya Kulakov added the comment: Please ignore everything I said about AddVectoredContinueHandler. I finally got a chance to test the code on Windows and the way it's called is not suitable for faulthandler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 20:07:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 18 Nov 2017 01:07:14 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510967234.3.0.213398074469.issue31701@psf.upfronthosting.co.za> STINNER Victor added the comment: > Please ignore everything I said about AddVectoredContinueHandler. I finally got a chance to test the code on Windows and the way it's called is not suitable for faulthandler. Oh, good to know. Thank you for having tested that ;-) At least, it seems like my faulthandler is useful to a few people :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 20:20:38 2017 From: report at bugs.python.org (R. David Murray) Date: Sat, 18 Nov 2017 01:20:38 +0000 Subject: [issue32065] range_iterator doesn't have length, leads to surprised result In-Reply-To: <1510960272.2.0.213398074469.issue32065@psf.upfronthosting.co.za> Message-ID: <1510968038.63.0.213398074469.issue32065@psf.upfronthosting.co.za> R. David Murray added the comment: By design, iterators do not have a length (see msg248496). ---------- nosy: +r.david.murray resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 21:59:28 2017 From: report at bugs.python.org (Charles Machalow) Date: Sat, 18 Nov 2017 02:59:28 +0000 Subject: [issue29753] Ctypes Packing Bitfields Incorrectly - Linux In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1510973968.32.0.213398074469.issue29753@psf.upfronthosting.co.za> Charles Machalow added the comment: All of Python is implicitly cross platform. If something isn't actually cross platform, it should be mentioned explicitly in the documentation. For example see the mmap documentation, it explicitly say on Unix it does X, on Windows it does Y. We should be as explicit as possible for ctypes to say on Windows we expect packing like X (GCC) and on Linux we expect packing like Y (VC++). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 22:39:21 2017 From: report at bugs.python.org (Ivan Pozdeev) Date: Sat, 18 Nov 2017 03:39:21 +0000 Subject: [issue31643] test_uuid: test_getnode and test_windll_getnode fail if connected to the Internet via an Android phone In-Reply-To: <1506721038.97.0.213398074469.issue31643@psf.upfronthosting.co.za> Message-ID: <1510976361.59.0.213398074469.issue31643@psf.upfronthosting.co.za> Change by Ivan Pozdeev : ---------- pull_requests: +4387 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 23:01:39 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Sat, 18 Nov 2017 04:01:39 +0000 Subject: [issue31701] faulthandler dumps 'Windows fatal exception: code 0xe06d7363' In-Reply-To: <1507197551.3.0.213398074469.issue31701@psf.upfronthosting.co.za> Message-ID: <1510977699.15.0.213398074469.issue31701@psf.upfronthosting.co.za> Ilya Kulakov added the comment: Victor, it's very helpful to analyze which Python stack caused exceptions in native code on user's machines. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 23:24:55 2017 From: report at bugs.python.org (uday kiran) Date: Sat, 18 Nov 2017 04:24:55 +0000 Subject: [issue32064] python msilib view.fetch is not returning none In-Reply-To: <1510951050.2.0.213398074469.issue32064@psf.upfronthosting.co.za> Message-ID: <1510979095.21.0.213398074469.issue32064@psf.upfronthosting.co.za> uday kiran added the comment: I tried adding the bugs to the python source code and compile it by using the steps in https://docs.python.org/devguide/ and the fix in https://bugs.python.org/file24795/_msi_fetch.patch.txt, but ended up with many compilation errors ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 00:25:12 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 18 Nov 2017 05:25:12 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1510982712.94.0.213398074469.issue32022@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The RESTART line means that you ran this in IDLE and that your program crashed the separate (sub)process that was running your code. When IDLE notices this, it starts a new subprocess. To test whether this is an IDLE-only problem, I ran your code without IDLE. C:\Users\Terry>python -i -m tem >>> doFind() R 6 12 R 12 22 R 21 32 C 10 21 C 13 22 C 16 23 and quickly got the the Windows 'Program has stopped running' box, with no Python error message. Ditto when run on 3.7.0a2. Since this is not an IDLE issue, I revised the title. ---------- nosy: +terry.reedy stage: -> test needed title: Python problem - == RESTART: Shell ===== -> Python crashes with mutually recursive code versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 00:27:48 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 18 Nov 2017 05:27:48 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1510982868.18.0.213398074469.issue32022@psf.upfronthosting.co.za> Terry J. Reedy added the comment: It is possible that this is a duplicate of an existing crash report, but I am not familiar with such at all. With only the standard, non-specific error message, it is hard to search ;-). What OS are you using? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 00:29:09 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 18 Nov 2017 05:29:09 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1510982949.49.0.213398074469.issue32022@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I believe I used the 2nd version of kakuru.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 00:45:32 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 18 Nov 2017 05:45:32 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510983932.86.0.213398074469.issue32050@psf.upfronthosting.co.za> Terry J. Reedy added the comment: So the hack is not specific to DOS but is still needed for Windows .bat files. They run in Command Prompt, which was once called the DOS box. (I don't know if they work unaltered in PowerShell.) It seems that the doc should be updated. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 01:09:59 2017 From: report at bugs.python.org (Shimon Malachi Cohen) Date: Sat, 18 Nov 2017 06:09:59 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510982949.49.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: Shimon Malachi Cohen added the comment: Cool, thanks! On Nov 18, 2017 5:29 AM, "Terry J. Reedy" wrote: > > Terry J. Reedy added the comment: > > I believe I used the 2nd version of kakuru.py. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 02:09:42 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 18 Nov 2017 07:09:42 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1510988982.05.0.213398074469.issue32022@psf.upfronthosting.co.za> Terry J. Reedy added the comment: PS. When you respond by EMail, please delete the quoted message, as it is redundant, on the web page, with the original copy above. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 02:44:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 07:44:51 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510991091.53.0.213398074469.issue32050@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The current short line of the description was enough to me for understanding what is the purpose of this option and how it can be used (I didn't use Windows for more than 10 years). But I was surprised not founding more detailed information about this feature in the documentation. Definitely it should be better documented. Most of users will have no ideas about this feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 03:47:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 08:47:13 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1510994833.96.0.213398074469.issue32050@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It seems to me that the best way is to add the following line at the start of the script: @path\to\python -x %0 %* & exit /b Or @py -3 -x %0 %* & exit /b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 04:16:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 18 Nov 2017 09:16:56 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510994833.96.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Ok, I will update the doc instead of deprecating the option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 05:13:30 2017 From: report at bugs.python.org (Stefan Krah) Date: Sat, 18 Nov 2017 10:13:30 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1511000010.07.0.213398074469.issue31630@psf.upfronthosting.co.za> Stefan Krah added the comment: Tim has mentioned the high quality of fdlibm, and indeed I cannot reproduce the issue: wget -r http://www.netlib.org/fdlibm/ Then build libm with or without optimizations, with or without -m32, gcc or clang. Then compile a C program that calls tan(1.5707963267948961). This is a bit treacherous, because gcc apparently has a builtin tan(), so one needs to make sure that it actually uses fdlibm. gcc-4.7 -fno-builtin -O3 -m32 -Wall -W -o xxx xxx.c libm.a All is fine here (Ubuntu Linux). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 06:12:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 11:12:27 +0000 Subject: [issue32067] Deprecate accepting Message-ID: <1511003547.89.0.213398074469.issue32067@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently `{m}`, `{m,n}`, `{m,}` and `{,n}` where m and n are non-negative decimal numbers are accepted in regular expressions as quantifiers that mean repeating the previous RE from m (0 by default) to n (infinity by default) times. But if the opening brace '{'is not followed by one of the above patterns, it means just the literal '{'. >>> import re >>> re.search('(foobar){e}', 'xirefoabralfobarxie') >>> re.search('(foobar){e}', 'foobar{e}') This conflicts with the regex module which uses braces for defining the "fuzzy" matching. >>> import regex >>> regex.search('(foobar){e}', 'xirefoabralfobarxie') >>> regex.search('(foobar){e}', 'foobar{e}') I don't think it is worth to add support of fuzzy matching in the re module, but for compatibility it would be better to raise an error or a warning in case of '{' not following by the one of the recognized patterns. This could also help to catch typos and errors in regular expressions, i.e. in '-{1.2}' or '-{1, 2}' instead of '-{1,2}'. Possible variants: 1. Emit a DeprecationWarning in 3.7 (and 2.7.15 with the -3 option), raise a re.error in 3.8 or 3.9. 2. Emit a PendingDeprecationWarning in 3.7, a DeprecationWarning in 3.8, and raise a re.error in 3.9 or 3.10. 3. Emit a RuntimeWarning or SyntaxWarning in 3.7 and forever. 4. Emit a FutureWarning in 3.7, and implement the fuzzy matching or replace re with regex sometimes in future. Unlikely. ---------- assignee: serhiy.storchaka components: Library (Lib), Regular Expressions messages: 306479 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal status: open title: Deprecate accepting type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 06:46:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 11:46:05 +0000 Subject: [issue32067] Deprecate accepting unrecognized braces in regular expressions In-Reply-To: <1511003547.89.0.213398074469.issue32067@psf.upfronthosting.co.za> Message-ID: <1511005565.22.0.213398074469.issue32067@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- title: Deprecate accepting -> Deprecate accepting unrecognized braces in regular expressions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 08:36:32 2017 From: report at bugs.python.org (Stefan Krah) Date: Sat, 18 Nov 2017 13:36:32 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1511012192.56.0.213398074469.issue31630@psf.upfronthosting.co.za> Stefan Krah added the comment: I found an unused i386 box with OpenBSD and Linux (so no VM): A C program with tan(1.5707963267948961) is wrong on both systems. fdlibm (directly from netlib.org) is correct on both systems. Both OS versions are relatively old, so I cannot file an upstream issue. I was planning to dig through the fdlibm code if there was an issue, but it produces the correct results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 09:15:21 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 18 Nov 2017 14:15:21 +0000 Subject: [issue31943] Add asyncio.Handle.cancelled() method In-Reply-To: <1509812825.97.0.213398074469.issue31943@psf.upfronthosting.co.za> Message-ID: <1511014521.72.0.213398074469.issue31943@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 09:20:36 2017 From: report at bugs.python.org (Slava Bacherikov) Date: Sat, 18 Nov 2017 14:20:36 +0000 Subject: [issue32068] textpad from curses package isn't handling backspace key Message-ID: <1511014836.54.0.213398074469.issue32068@psf.upfronthosting.co.za> New submission from Slava Bacherikov : textpad isn't handling backspace key on my system and seems on others too. When I press backspace key, terminal sends `ascii.DEL` (127) and it isn't handled by textpad. I've attached patch that fixes this, should I also create PR for this or patch is enough ? ---------- components: Library (Lib) files: textpad.patch keywords: patch messages: 306481 nosy: bacher09 priority: normal severity: normal status: open title: textpad from curses package isn't handling backspace key type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file47272/textpad.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 09:20:51 2017 From: report at bugs.python.org (Marat Sharafutdinov) Date: Sat, 18 Nov 2017 14:20:51 +0000 Subject: [issue31943] Add asyncio.Handle.cancelled() method In-Reply-To: <1509812825.97.0.213398074469.issue31943@psf.upfronthosting.co.za> Message-ID: <1511014851.57.0.213398074469.issue31943@psf.upfronthosting.co.za> Change by Marat Sharafutdinov : ---------- versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 09:44:11 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 18 Nov 2017 14:44:11 +0000 Subject: [issue32069] Drop loop._make_legacy_ssl_transport Message-ID: <1511016251.23.0.213398074469.issue32069@psf.upfronthosting.co.za> New submission from Andrew Svetlov : It uses `wrap_socket` and exists only for backward compatibility with Python without ssl.MemoryBIO, which is Python 3.4 Let's cut it out from Python 3.7 and 3.6 -- it's safe, pretty sure. ---------- components: Library (Lib), asyncio messages: 306482 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Drop loop._make_legacy_ssl_transport versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 09:44:53 2017 From: report at bugs.python.org (Yury Selivanov) Date: Sat, 18 Nov 2017 14:44:53 +0000 Subject: [issue32069] Drop loop._make_legacy_ssl_transport In-Reply-To: <1511016251.23.0.213398074469.issue32069@psf.upfronthosting.co.za> Message-ID: <1511016293.06.0.213398074469.issue32069@psf.upfronthosting.co.za> Yury Selivanov added the comment: +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 10:11:51 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 18 Nov 2017 15:11:51 +0000 Subject: [issue32069] Drop loop._make_legacy_ssl_transport In-Reply-To: <1511016251.23.0.213398074469.issue32069@psf.upfronthosting.co.za> Message-ID: <1511017911.22.0.213398074469.issue32069@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +4388 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 10:55:00 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 15:55:00 +0000 Subject: [issue1647489] zero-length match confuses re.finditer() Message-ID: <1511020500.73.0.213398074469.issue1647489@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: niemeyer -> serhiy.storchaka nosy: +serhiy.storchaka versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 10:55:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 15:55:13 +0000 Subject: [issue1647489] zero-length match confuses re.finditer() Message-ID: <1511020513.7.0.213398074469.issue1647489@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Library (Lib) nosy: +ezio.melotti type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 11:39:53 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 18 Nov 2017 16:39:53 +0000 Subject: [issue32059] detect_modules() in setup.py must also search the sysroot paths In-Reply-To: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> Message-ID: <1511023193.82.0.213398074469.issue32059@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +4389 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 11:54:07 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 18 Nov 2017 16:54:07 +0000 Subject: [issue32069] Drop loop._make_legacy_ssl_transport In-Reply-To: <1511016251.23.0.213398074469.issue32069@psf.upfronthosting.co.za> Message-ID: <1511024047.88.0.213398074469.issue32069@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset 51d546ae4d563fde608e23c9c337fefd7e95c93f by Andrew Svetlov in branch 'master': bpo-32069: Drop legacy SSL transport (#4451) https://github.com/python/cpython/commit/51d546ae4d563fde608e23c9c337fefd7e95c93f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 11:54:18 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 18 Nov 2017 16:54:18 +0000 Subject: [issue32069] Drop loop._make_legacy_ssl_transport In-Reply-To: <1511016251.23.0.213398074469.issue32069@psf.upfronthosting.co.za> Message-ID: <1511024058.23.0.213398074469.issue32069@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4390 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 12:01:56 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 18 Nov 2017 17:01:56 +0000 Subject: [issue32059] detect_modules() in setup.py must also search the sysroot paths In-Reply-To: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> Message-ID: <1511024516.08.0.213398074469.issue32059@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- nosy: +brett.cannon, martin.panter, twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 12:10:55 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 18 Nov 2017 17:10:55 +0000 Subject: [issue29184] skip tests of test_socketserver when bind() raises PermissionError (non-root user on Android) In-Reply-To: <1483732137.12.0.493215743488.issue29184@psf.upfronthosting.co.za> Message-ID: <1511025055.83.0.213398074469.issue29184@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 9001d1f438e968f4d327313e0a95a49f22e724f4 by xdegaye in branch 'master': bpo-29184: Skip test_socketserver tests on PermissionError raised by Android (GH-4387) https://github.com/python/cpython/commit/9001d1f438e968f4d327313e0a95a49f22e724f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 12:13:50 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 18 Nov 2017 17:13:50 +0000 Subject: [issue29184] skip tests of test_socketserver when bind() raises PermissionError (non-root user on Android) In-Reply-To: <1483732137.12.0.493215743488.issue29184@psf.upfronthosting.co.za> Message-ID: <1511025230.8.0.213398074469.issue29184@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 12:17:18 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 18 Nov 2017 17:17:18 +0000 Subject: [issue29185] test_distutils fails on Android API level 24 In-Reply-To: <1483737507.74.0.0285105710282.issue29185@psf.upfronthosting.co.za> Message-ID: <1511025438.55.0.213398074469.issue29185@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset d34d8fc24f23ccff5de03c9277da5acbbdc30e90 by xdegaye in branch 'master': bpo-29185: Fix `test_distutils` failures on Android (GH-4438) https://github.com/python/cpython/commit/d34d8fc24f23ccff5de03c9277da5acbbdc30e90 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 12:18:36 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 18 Nov 2017 17:18:36 +0000 Subject: [issue32069] Drop loop._make_legacy_ssl_transport In-Reply-To: <1511016251.23.0.213398074469.issue32069@psf.upfronthosting.co.za> Message-ID: <1511025516.23.0.213398074469.issue32069@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 12:18:41 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 18 Nov 2017 17:18:41 +0000 Subject: [issue29185] test_distutils fails on Android API level 24 In-Reply-To: <1483737507.74.0.0285105710282.issue29185@psf.upfronthosting.co.za> Message-ID: <1511025521.61.0.213398074469.issue29185@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 12:20:23 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 18 Nov 2017 17:20:23 +0000 Subject: [issue32031] Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased In-Reply-To: <1510738661.72.0.213398074469.issue32031@psf.upfronthosting.co.za> Message-ID: <1511025623.02.0.213398074469.issue32031@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset ebfaa71c2e8c018f72c179395dafaf06dcaf29e2 by xdegaye in branch 'master': bpo-32031: Fix pydoc `test_mixed_case_module_names_are_lower_cased` (GH-4441) https://github.com/python/cpython/commit/ebfaa71c2e8c018f72c179395dafaf06dcaf29e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 12:21:38 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 18 Nov 2017 17:21:38 +0000 Subject: [issue32031] Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased In-Reply-To: <1510738661.72.0.213398074469.issue32031@psf.upfronthosting.co.za> Message-ID: <1511025698.03.0.213398074469.issue32031@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 13:02:04 2017 From: report at bugs.python.org (MosesofEgypt) Date: Sat, 18 Nov 2017 18:02:04 +0000 Subject: [issue32004] Allow specifying code packing order in audioop adpcm functions In-Reply-To: <1510357207.47.0.213398074469.issue32004@psf.upfronthosting.co.za> Message-ID: <1511028124.61.0.213398074469.issue32004@psf.upfronthosting.co.za> MosesofEgypt added the comment: Changed type to behavior as this is more of a bug fix than an enhancement. ---------- type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 13:04:15 2017 From: report at bugs.python.org (Jesse SHapiro) Date: Sat, 18 Nov 2017 18:04:15 +0000 Subject: [issue32070] Clarify the behavior of the staticmethod builtin Message-ID: <1511028255.0.0.213398074469.issue32070@psf.upfronthosting.co.za> New submission from Jesse SHapiro : It looks like the original staticmethod docstring might have been based on the classmethod docstring, and it seems like the current description might not be accurate. Current string: ...It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()); the instance is ignored except for its class... Proposed change: It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). Both the class and the instance are ignored, and neither is passed implicitly as the first argument to the method. ---------- assignee: docs at python components: Documentation messages: 306489 nosy: docs at python, haikuginger priority: normal pull_requests: 4391 severity: normal status: open title: Clarify the behavior of the staticmethod builtin type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 13:08:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 18:08:22 +0000 Subject: [issue32067] Deprecate accepting unrecognized braces in regular expressions In-Reply-To: <1511003547.89.0.213398074469.issue32067@psf.upfronthosting.co.za> Message-ID: <1511028502.58.0.213398074469.issue32067@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4392 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 13:12:40 2017 From: report at bugs.python.org (Jonas H.) Date: Sat, 18 Nov 2017 18:12:40 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest Message-ID: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> New submission from Jonas H. : I'd like to add test selection based on parts of the test class/method name to unittest. Similar to py.test's "-k" option: https://docs.pytest.org/en/latest/example/markers.html#using-k-expr-to-select-tests-based-on-their-name Here's a proof of concept implementation: https://github.com/jonashaag/cpython/compare/master...unittest-select Is this something others find useful as well? If so, I'd like to work on getting this into Python stdlib proper. This is my first time contributing to the unittest framework; is the general approach taken in my PoC implementation correct in terms of abstractions? How can I improve the implementation? Jonas ---------- components: Library (Lib) messages: 306490 nosy: jonash priority: normal severity: normal status: open title: Add py.test-like "-k" test selection to unittest type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 13:14:02 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 18:14:02 +0000 Subject: [issue32067] Deprecate accepting unrecognized braces in regular expressions In-Reply-To: <1511003547.89.0.213398074469.issue32067@psf.upfronthosting.co.za> Message-ID: <1511028842.61.0.213398074469.issue32067@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since this will require changing regular expressions in several places in the stdlib I have chosen emitting PendingDeprecationWarning and long deprecation period. But I'm now not sure that this is a good idea. Non-escaped braces can be used much in a wild. It may be better to use other heuristic for recognizing the fuzzy matching and other possible extensions that use braces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 13:18:05 2017 From: report at bugs.python.org (Jonas H.) Date: Sat, 18 Nov 2017 18:18:05 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511029085.88.0.213398074469.issue32071@psf.upfronthosting.co.za> Jonas H. added the comment: Just to be clear, the current implementation is limited to substring matches. It doesn't support py.test like "and/or" combinators. (Actually, py.test uses 'eval' to support arbitrary patterns.) So say we have test case SomeClass test_foo test_bar Then - python -m unittest -k fo matches "test_foo" - python -m unittest -k Some matches "test_foo" and "test_bar" - python -m unittest -k some matches nothing The -k option may be used multiple times, combining the patterns with "or": - python -m unittest -k fo -k b matches "test_foo" and "test_bar" It's also possible to use glob-style patterns, like -k "spam_*_eggs". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 14:06:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 19:06:16 +0000 Subject: [issue32072] Issues with binary plists Message-ID: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : plistlib creates a new objects when read references instead of using already read object. As result it doesn't preserve identity: >>> import plistlib >>> a = [['spam']]*2 >>> a[0] is a[1] True >>> b = plistlib.loads(plistlib.dumps(a, fmt=plistlib.FMT_BINARY)) >>> b == a True >>> b[0] is b[1] False And plistlib.loads() is vulnerable to plists containing cyclic references (as was exposed in issue31897). For example, plistlib.loads(b'bplist00\xa1\x00\x08\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a') could return a list containing itself, but it is failed with RecursionError. plistlib.dumps() preserves reference in the output, but it saves redundant copies. For example plistlib.dumps([[]]*5, fmt=plistlib.FMT_BINARY) saves a list containing 5 identical empty lists, but it saves an empty list 5 times, and only the last copy is used. The other 4 copies are not referenced and just spent the file volume and the space of reference numbers. Saving [[[[['spam']*100]*100]*100]*100]*100 will result in a multigigabyte, while less than a kilobyte would be enough for saving it. Loading properly saved [[[[['spam']*100]*100]*100]*100]*100 withe the current plistlib.loads() will cause consuming many gigabytes of memory. 1. The issues with plistlib.dumps() are: 1a) Inefficient saving data with references. This is minor resource usage issue. 1b) Impossibility to save a data with cyclic references. This is a lack of a feature. 2. The issues with plistlib.loads() are: 2a) Inefficient loading data with references. This can be not just a resource usage issue, but a security issue. Loading an malicious input data smaller than 100 byte ([[[...]*2]*2]*2) can cause consuming many gigabytes of memory. 2b) Impossibility to load a data with cyclic references. This is a lack of a feature, but can be lesser security issue. Small malicious input can cause RecursionError. If the recursion limit is set high and you are unlucky it can cause a stack overflow. Security issues affect you only when you load plists from untrusted sources. Adding the proper support of references could be considered a new feature, but taking to account security issues it should be backported up to 3.4 when the support of binary plists was added. ---------- assignee: serhiy.storchaka components: Library (Lib) messages: 306493 nosy: ned.deily, ronaldoussoren, serhiy.storchaka priority: normal severity: normal status: open title: Issues with binary plists type: security versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 14:13:27 2017 From: report at bugs.python.org (desbma) Date: Sat, 18 Nov 2017 19:13:27 +0000 Subject: [issue32073] Add copy_directory_metadata parameter to shutil.copytree Message-ID: <1511032407.02.0.213398074469.issue32073@psf.upfronthosting.co.za> New submission from desbma : I am sometimes using shutil.copytree to copy a directory to a destination that does not support setting metadata (like MTP mounts of Android devices). Using the copy_function parameter allows passing shutil.copy or a custom function to ignore file metadata, however currently shutil.copytree always tries to call copystat on directories, which can fail with OSError (errno set to ENOTSUPP). The code assumes copystat can fail on Windows, but propagates the error on other OS, even though the tree copy actually succeeds. See https://github.com/python/cpython/blob/9bb6fe52742340f6c92f0dda18599a4577a94e18/Lib/shutil.py#L352-L357 ---------- components: Library (Lib) messages: 306494 nosy: desbma priority: normal severity: normal status: open title: Add copy_directory_metadata parameter to shutil.copytree type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 14:16:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 19:16:37 +0000 Subject: [issue32072] Issues with binary plists In-Reply-To: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> Message-ID: <1511032597.49.0.213398074469.issue32072@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4393 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 14:27:13 2017 From: report at bugs.python.org (desbma) Date: Sat, 18 Nov 2017 19:27:13 +0000 Subject: [issue32073] Add copy_directory_metadata parameter to shutil.copytree In-Reply-To: <1511032407.02.0.213398074469.issue32073@psf.upfronthosting.co.za> Message-ID: <1511033233.21.0.213398074469.issue32073@psf.upfronthosting.co.za> Change by desbma : ---------- keywords: +patch pull_requests: +4394 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 15:24:50 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 18 Nov 2017 20:24:50 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511036690.87.0.213398074469.issue32071@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I think this would be a useful enhancement. Feel free to open a PR. I haven't looked at your implementation, but you'll also need to add tests for it. ---------- nosy: +ezio.melotti, michael.foord, pitrou, rbcollins stage: -> needs patch versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 17:44:07 2017 From: report at bugs.python.org (Jesse Bakker) Date: Sat, 18 Nov 2017 22:44:07 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1511045047.24.0.213398074469.issue32022@psf.upfronthosting.co.za> Jesse Bakker added the comment: On linux x86-64 with python 3.6.3 and python 3.7.0a2+ I get a RecursionError: maximum recursion depth exceeded. ---------- nosy: +Jesse Bakker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 00:57:56 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 19 Nov 2017 05:57:56 +0000 Subject: [issue31875] Error 0x80070642: Failed to install MSI package. In-Reply-To: <1509027387.81.0.213398074469.issue31875@psf.upfronthosting.co.za> Message-ID: <1511071076.16.0.213398074469.issue31875@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- keywords: +patch pull_requests: +4395 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 01:51:01 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 19 Nov 2017 06:51:01 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511074261.77.0.213398074469.issue1102@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- keywords: +patch pull_requests: +4396 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 01:51:49 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 19 Nov 2017 06:51:49 +0000 Subject: [issue32064] python msilib view.fetch is not returning none In-Reply-To: <1510951050.2.0.213398074469.issue32064@psf.upfronthosting.co.za> Message-ID: <1511074309.08.0.213398074469.issue32064@psf.upfronthosting.co.za> Berker Peksag added the comment: Issue 1102 is still open so this bug is not fixed yet. I've just opened PR 4459 to fix it. ---------- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add support for _msi.Record.GetString() and _msi.Record.GetInteger() type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 01:56:35 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 19 Nov 2017 06:56:35 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511074595.42.0.213398074469.issue1102@psf.upfronthosting.co.za> Berker Peksag added the comment: I've opened PR 4459 to fix this. Here's a simple reproducer I adapted from the script uploaded by uday kiran in issue 32064. ---------- nosy: +berker.peksag, uday kiran versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 02:05:24 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 19 Nov 2017 07:05:24 +0000 Subject: [issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character In-Reply-To: <1188943421.22.0.776458935296.issue1104@psf.upfronthosting.co.za> Message-ID: <1511075124.27.0.213398074469.issue1104@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 02:05:32 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 19 Nov 2017 07:05:32 +0000 Subject: [issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None) In-Reply-To: <1307024024.44.0.716968870376.issue12239@psf.upfronthosting.co.za> Message-ID: <1511075132.19.0.213398074469.issue12239@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 02:07:09 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 19 Nov 2017 07:07:09 +0000 Subject: [issue12382] [msilib] Obscure exception message when trying to open a non-existent MSI database In-Reply-To: <1308658337.05.0.630810191443.issue12382@psf.upfronthosting.co.za> Message-ID: <1511075229.32.0.213398074469.issue12382@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 02:09:04 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 19 Nov 2017 07:09:04 +0000 Subject: [issue12202] Check status returns in msilib.SummaryInformation.GetProperty() In-Reply-To: <1306591176.31.0.169874894705.issue12202@psf.upfronthosting.co.za> Message-ID: <1511075344.55.0.213398074469.issue12202@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 04:08:49 2017 From: report at bugs.python.org (Sai Bhargava Ramu) Date: Sun, 19 Nov 2017 09:08:49 +0000 Subject: [issue32074] Might be a wrong implementation Message-ID: <1511082529.04.0.213398074469.issue32074@psf.upfronthosting.co.za> New submission from Sai Bhargava Ramu : https://docs.python.org/2/library/itertools.html#itertools.combinations #The behaviour of combinations function in documentation is different and I think identation is missing with `else` #I didn't get the logic right is point out anything further. This might not be a real issue ---------- assignee: docs at python components: Documentation files: combinations.py messages: 306499 nosy: Sai Bhargava Ramu, docs at python priority: normal severity: normal status: open title: Might be a wrong implementation type: behavior versions: Python 3.5 Added file: https://bugs.python.org/file47273/combinations.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 04:27:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Nov 2017 09:27:44 +0000 Subject: [issue32074] Might be a wrong implementation In-Reply-To: <1511082529.04.0.213398074469.issue32074@psf.upfronthosting.co.za> Message-ID: <1511083664.13.0.213398074469.issue32074@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The implementation in the documentation is correct. Did you tested your implementation? The indentation of the "else" is correct. See https://docs.python.org/3/reference/compound_stmts.html#the-for-statement ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 05:10:23 2017 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 19 Nov 2017 10:10:23 +0000 Subject: [issue31808] tarfile.extractall fails to overwrite symlinks In-Reply-To: <1508315375.63.0.213398074469.issue31808@psf.upfronthosting.co.za> Message-ID: <1511086223.39.0.213398074469.issue31808@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- pull_requests: -4364 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 08:33:05 2017 From: report at bugs.python.org (Chris Albright) Date: Sun, 19 Nov 2017 13:33:05 +0000 Subject: [issue10761] tarfile.extractall fails to overwrite symlinks In-Reply-To: <1293063436.61.0.0994372418071.issue10761@psf.upfronthosting.co.za> Message-ID: <1511098385.01.0.213398074469.issue10761@psf.upfronthosting.co.za> Change by Chris Albright : ---------- components: +Unicode nosy: +ezio.melotti, vstinner type: behavior -> performance versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 08:54:54 2017 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 19 Nov 2017 13:54:54 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511099694.63.0.213398074469.issue1102@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 08:55:23 2017 From: report at bugs.python.org (Mark Lawrence) Date: Sun, 19 Nov 2017 13:55:23 +0000 Subject: [issue12202] Check status returns in msilib.SummaryInformation.GetProperty() In-Reply-To: <1306591176.31.0.169874894705.issue12202@psf.upfronthosting.co.za> Message-ID: <1511099723.94.0.213398074469.issue12202@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 09:35:40 2017 From: report at bugs.python.org (Jim Jewett) Date: Sun, 19 Nov 2017 14:35:40 +0000 Subject: [issue31040] mimetypes.add_type should complain when you give it an undotted ext In-Reply-To: <1501010741.93.0.952054126016.issue31040@psf.upfronthosting.co.za> Message-ID: <1511102140.16.0.213398074469.issue31040@psf.upfronthosting.co.za> Jim Jewett added the comment: Ideally, use .startswith('.') Instead if find, but this is a clear UI fix. First pull request fixes doc, second fixes code. OK to apply both. ---------- nosy: +Jim.Jewett stage: -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 10:06:38 2017 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 19 Nov 2017 15:06:38 +0000 Subject: [issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character In-Reply-To: <1188943421.22.0.776458935296.issue1104@psf.upfronthosting.co.za> Message-ID: <1511103998.87.0.213398074469.issue1104@psf.upfronthosting.co.za> Eric V. Smith added the comment: Despite the fact that as of now (or 6+ years ago!) the only way to trigger the malloc() is via VT_LPSTR, I still think the way the free() call is written is bad. What if another type is added? If that were fixed, I still think the basic idea of this patch in isolation of the other raised issues is a good idea. If it was converted to a PR, I'd support merging it (although I'd like to hear from the Windows folks). But it is curious that this bug is so old and it hasn't caused more problems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 11:00:52 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 19 Nov 2017 16:00:52 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1511107252.61.0.213398074469.issue32022@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 11:04:22 2017 From: report at bugs.python.org (Jesse Bakker) Date: Sun, 19 Nov 2017 16:04:22 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1511107462.62.0.213398074469.issue32042@psf.upfronthosting.co.za> Jesse Bakker added the comment: I think this would allow for inconsistency in docs (if implemented as suggested), as when actually running the code in the docs, one would get different results than suggested by the docs. Maybe there is some other way (with different docs syntax) that would work well. Cannot think of anything from the top of my head, but maybe someone more creative can? ---------- nosy: +Jesse Bakker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 11:46:55 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 19 Nov 2017 16:46:55 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1511110015.17.0.213398074469.issue32042@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 11:59:08 2017 From: report at bugs.python.org (Jesse Bakker) Date: Sun, 19 Nov 2017 16:59:08 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1511110748.29.0.213398074469.issue10049@psf.upfronthosting.co.za> Change by Jesse Bakker : ---------- versions: +Python 3.8 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 12:01:01 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 19 Nov 2017 17:01:01 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1511110861.46.0.213398074469.issue32042@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I recommend not going down this path. The intended purpose of doctest is to test examples in documentation. In particular, those examples should match what a user would *see* when running the examples. In essence, the proposal is to allow tests to pass even when the examples *don't* match what the user sees. ISTM, the str_fun() example *should* fail. It does not show *any* real interactive prompt session than can be reproduced by a user or anything that a user would ever see. IMO, that would be a documentation anti-pattern. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 12:13:33 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 19 Nov 2017 17:13:33 +0000 Subject: [issue32070] Clarify the behavior of the staticmethod builtin In-Reply-To: <1511028255.0.0.213398074469.issue32070@psf.upfronthosting.co.za> Message-ID: <1511111613.39.0.213398074469.issue32070@psf.upfronthosting.co.za> Raymond Hettinger added the comment: ISTM the current wording is correct and aims to describe how staticmethods differ from regular methods. With a regular methods we have "c.m(*a) -> type(c).m(c, *a)" and "C.m(*a) -> C.m(*s)". With a class method, only the first of those changes to "c.m(*a) -> type(c).m(*a)". Expressed in English, this change is "the instance is ignored except for its class...". That said, the staticmethod() docs could use a complete rewrite. They amble all over the place and don't directly speak to what a static method is for (attaching regular functions to classes to improve findability) or how they work (use descriptor logic to suppress the usual behavior of prepend "self" to the argument list when called from an instance) or a concise motivating example. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 12:46:11 2017 From: report at bugs.python.org (Jesse Bakker) Date: Sun, 19 Nov 2017 17:46:11 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1511113571.67.0.213398074469.issue10049@psf.upfronthosting.co.za> Change by Jesse Bakker : ---------- pull_requests: +4397 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 12:47:15 2017 From: report at bugs.python.org (Jesse Bakker) Date: Sun, 19 Nov 2017 17:47:15 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1511113635.15.0.213398074469.issue10049@psf.upfronthosting.co.za> Change by Jesse Bakker : ---------- nosy: +Jesse Bakker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:02:39 2017 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 19 Nov 2017 18:02:39 +0000 Subject: [issue30904] Python 3 logging HTTPHandler sends duplicate Host header In-Reply-To: <1499782260.84.0.538162652134.issue30904@psf.upfronthosting.co.za> Message-ID: <1511114559.18.0.213398074469.issue30904@psf.upfronthosting.co.za> Change by Vinay Sajip : ---------- keywords: +patch pull_requests: +4398 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:06:57 2017 From: report at bugs.python.org (Roundup Robot) Date: Sun, 19 Nov 2017 18:06:57 +0000 Subject: [issue30989] Sort only when needed in TimedRotatingFileHandler's getFilesToDelete In-Reply-To: <1500707842.79.0.354493990388.issue30989@psf.upfronthosting.co.za> Message-ID: <1511114817.51.0.213398074469.issue30989@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4399 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:25:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Nov 2017 18:25:35 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1511115935.16.0.213398074469.issue32042@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I concur with Raymond. Doctest should test the representation, not value. But I think it would be nice to support insignificant variations of the representation. Tracebacks already are treated specially, and different doctest options allow to ignore particular details. Of course ignoring the whole content of the dictionary will be not very useful. >>> dict_fun() # doctest: +ELLIPSIS {...} But maybe some option should make accepting some permutations in the output. E.g. >>> dict_fun() # doctest: +PERMUTATION {<'foo': 1>, <'bar': 2>} should accept both "{'foo': 1, 'bar': 2}" and "{'bar': 2, 'foo': 1}". ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:35:32 2017 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 19 Nov 2017 18:35:32 +0000 Subject: [issue26606] logging.baseConfig is missing the encoding parameter In-Reply-To: <1458598626.88.0.490041392552.issue26606@psf.upfronthosting.co.za> Message-ID: <1511116532.59.0.213398074469.issue26606@psf.upfronthosting.co.za> Change by Vinay Sajip : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:36:19 2017 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 19 Nov 2017 18:36:19 +0000 Subject: [issue30904] Python 3 logging HTTPHandler sends duplicate Host header In-Reply-To: <1499782260.84.0.538162652134.issue30904@psf.upfronthosting.co.za> Message-ID: <1511116579.81.0.213398074469.issue30904@psf.upfronthosting.co.za> Vinay Sajip added the comment: New changeset e96ba183c43ad6633b5d014b3dc57433e2802faf by Vinay Sajip in branch 'master': bpo-30904: Removed duplicated Host: header. (#4465) https://github.com/python/cpython/commit/e96ba183c43ad6633b5d014b3dc57433e2802faf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:42:24 2017 From: report at bugs.python.org (Roundup Robot) Date: Sun, 19 Nov 2017 18:42:24 +0000 Subject: [issue30904] Python 3 logging HTTPHandler sends duplicate Host header In-Reply-To: <1499782260.84.0.538162652134.issue30904@psf.upfronthosting.co.za> Message-ID: <1511116944.64.0.213398074469.issue30904@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:43:51 2017 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 19 Nov 2017 18:43:51 +0000 Subject: [issue30989] Sort only when needed in TimedRotatingFileHandler's getFilesToDelete In-Reply-To: <1500707842.79.0.354493990388.issue30989@psf.upfronthosting.co.za> Message-ID: <1511117031.7.0.213398074469.issue30989@psf.upfronthosting.co.za> Vinay Sajip added the comment: New changeset 65dffe58dd062385024eacbe75a0fa59ec12a993 by Vinay Sajip (Miss Islington (bot)) in branch '3.6': bpo-30989: Sort in TimedRotatingFileHandler only when needed. (GH-2812) (GH-4466) https://github.com/python/cpython/commit/65dffe58dd062385024eacbe75a0fa59ec12a993 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:50:47 2017 From: report at bugs.python.org (Jason) Date: Sun, 19 Nov 2017 18:50:47 +0000 Subject: [issue32051] Possible issue in multiprocessing doc In-Reply-To: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> Message-ID: <1511117447.04.0.213398074469.issue32051@psf.upfronthosting.co.za> Change by Jason : ---------- keywords: +patch pull_requests: +4401 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:58:20 2017 From: report at bugs.python.org (Jason) Date: Sun, 19 Nov 2017 18:58:20 +0000 Subject: [issue32051] Possible issue in multiprocessing doc In-Reply-To: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> Message-ID: <1511117900.29.0.213398074469.issue32051@psf.upfronthosting.co.za> Jason added the comment: Hi Berker, I didn't update "following examples with ``('', 50000)`` too." because this is different than the previous one, this is client connecting to server, so hostname cannot be empty string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 13:58:27 2017 From: report at bugs.python.org (Tim Peters) Date: Sun, 19 Nov 2017 18:58:27 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1511117907.83.0.213398074469.issue32042@psf.upfronthosting.co.za> Tim Peters added the comment: `doctest` is intended to be anal - there are few things more pointlessly confusing for a user than to see docs that don't match what they actually see when they run the doc's examples. "Is it a bug? Did I do it wrong? Why can't they document what it actually does?! ..." Things like +ELLIPSIS are intended for cases where the output is _known_ to vary across platforms or runs in ways that can't otherwise be easily hidden (like output that embeds the `id()` of an object), or where only a relatively tiny bit of enormous output is actually interesting. When someone wants unittest's `assertEqual()`, they should use unittest ;-) Although that functionality is already easily handled; for example, here's the OP's first example rewritten to be independent of the dict's representation ordering: >>> dict_fun() == {'foo': 1, 'bar': 2} True Now it's testing what you want to test: that the results of the expressions on both sides of `==` compare equal. And this is, to me, clearer on the face of it than introducing a new flag. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 14:16:19 2017 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 19 Nov 2017 19:16:19 +0000 Subject: [issue30904] Python 3 logging HTTPHandler sends duplicate Host header In-Reply-To: <1499782260.84.0.538162652134.issue30904@psf.upfronthosting.co.za> Message-ID: <1511118979.59.0.213398074469.issue30904@psf.upfronthosting.co.za> Vinay Sajip added the comment: New changeset b071a5e838a0e84c4e8a60448fbd40e8a7e5c882 by Vinay Sajip (Miss Islington (bot)) in branch '3.6': bpo-30904: Removed duplicated Host: header. (GH-4465) (#4468) https://github.com/python/cpython/commit/b071a5e838a0e84c4e8a60448fbd40e8a7e5c882 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 14:44:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Nov 2017 19:44:16 +0000 Subject: [issue6156] Error compiling valid regex In-Reply-To: <1243787162.44.0.999226480683.issue6156@psf.upfronthosting.co.za> Message-ID: <1511120656.11.0.213398074469.issue6156@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This issue was fixed in issue9179. The issue with 65535 repeats was fixed in issue13169. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 14:56:09 2017 From: report at bugs.python.org (Decorater) Date: Sun, 19 Nov 2017 19:56:09 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. Message-ID: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> New submission from Decorater : I would like to make an C extension module which basically would have the ZipImporter type defined in the ``zipimport.c`` which defines most things related to ZipImporter to be public so that way one can set it to ``.tp_base`` on their C extension. That should hopefully in the C side of things allow subclassing the zipimporter class outside of the Python layer as well. Otherwise I would have to manually copy the said definition from zipimport.c and that could be a huge risk if a bug or something in the ZipImporter was fixed that it wont automatically be fixed in the C version of the subclass. I want precisely this and for it to be exposed to other people who might want to subclass the zipimporter class outside of the Python layer as well. ---------- components: Extension Modules, Interpreter Core, Library (Lib) messages: 306513 nosy: Decorater priority: normal severity: normal status: open title: Expose ZipImporter Type Object in the include header files. versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 15:21:43 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 19 Nov 2017 20:21:43 +0000 Subject: [issue32076] Expose LockFile on Windows Message-ID: <1511122903.69.0.213398074469.issue32076@psf.upfronthosting.co.za> New submission from Antoine Pitrou : msvcrt.locking() is sometimes practically useless since its so-called "non-blocking" mode will still block for 1 second. Instead, the Windows API LockFile() function (and its companion UnlockFile()) allows real non-blocking locking. Right now you have to call LockFile() using ctypes (see https://github.com/mwilliamson/locket.py/pull/8/files for an example). It would be nice to expose it somewhere, for example in msvcrt or another module. ---------- components: Library (Lib), Windows messages: 306514 nosy: paul.moore, pitrou, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Expose LockFile on Windows type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 15:27:21 2017 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBQZXTFmcOtxI1law==?=) Date: Sun, 19 Nov 2017 20:27:21 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1511123241.02.0.213398074469.issue32042@psf.upfronthosting.co.za> Tom?? Pet???ek added the comment: I find the idea of combining documentation with examples and unit testing appealing. I see that this was not the original purpose of doctest but it seems to me as a reasonable use case for doctest. >>> dict_fun() == {'foo': 1, 'bar': 2} True Testing equality with single expression has the drawback that one cannot see what was wrong, i.e., what the actual value was. The result of such a test when it fails is very uninformative. I am not sure that I know any Python developer who would be confused by "string" matching 'string', or {'a': 1, 'b': 2} matching dict(a=1, b=2). Why True matching 1 is less confusing than "abc" matching 'abc'? "there are few things more pointlessly confusing for a user than to see docs that don't match what they actually see when they run the doc's examples" This is a bit tricky because what user actually sees very much depends on what console is used to run these examples, e.g., it varies between python and ipython, python and python3 etc. So the users will be confused by these variants anyway. Is it actually defined for basic types like str, dict or set, how the repr should look like (besides that it should be possible to "eval" the expression to get value)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 15:33:23 2017 From: report at bugs.python.org (Decorater) Date: Sun, 19 Nov 2017 20:33:23 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511123603.2.0.213398074469.issue32075@psf.upfronthosting.co.za> Change by Decorater : ---------- keywords: +patch pull_requests: +4402 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 17:27:39 2017 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 19 Nov 2017 22:27:39 +0000 Subject: [issue30904] Python 3 logging HTTPHandler sends duplicate Host header In-Reply-To: <1499782260.84.0.538162652134.issue30904@psf.upfronthosting.co.za> Message-ID: <1511130459.88.0.213398074469.issue30904@psf.upfronthosting.co.za> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 17:28:03 2017 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 19 Nov 2017 22:28:03 +0000 Subject: [issue30989] Sort only when needed in TimedRotatingFileHandler's getFilesToDelete In-Reply-To: <1500707842.79.0.354493990388.issue30989@psf.upfronthosting.co.za> Message-ID: <1511130483.74.0.213398074469.issue30989@psf.upfronthosting.co.za> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 18:36:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Nov 2017 23:36:58 +0000 Subject: [issue25054] Capturing start of line '^' In-Reply-To: <1441887596.73.0.766811958538.issue25054@psf.upfronthosting.co.za> Message-ID: <1511134618.43.0.213398074469.issue25054@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4403 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 18:36:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Nov 2017 23:36:58 +0000 Subject: [issue1647489] zero-length match confuses re.finditer() Message-ID: <1511134618.54.0.00913614298617.issue1647489@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4404 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 18:36:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Nov 2017 23:36:58 +0000 Subject: [issue852532] ^$ won't split on empty line Message-ID: <1511134618.72.0.0136706687182.issue852532@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4405 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 18:36:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 19 Nov 2017 23:36:58 +0000 Subject: [issue3262] re.split doesn't split with zero-width regex In-Reply-To: <1215036469.9.0.581701421463.issue3262@psf.upfronthosting.co.za> Message-ID: <1511134618.83.0.16826775903.issue3262@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4406 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 18:44:01 2017 From: report at bugs.python.org (Decorater) Date: Sun, 19 Nov 2017 23:44:01 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511135041.96.0.213398074469.issue32075@psf.upfronthosting.co.za> Change by Decorater : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 19:00:14 2017 From: report at bugs.python.org (Mathew M.) Date: Mon, 20 Nov 2017 00:00:14 +0000 Subject: [issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference Message-ID: <1511136014.35.0.213398074469.issue32077@psf.upfronthosting.co.za> New submission from Mathew M. : This is just something I've noticed when browsing the C API documentation for Unicode objects. For example, the documentation entry for PyUnicode_DecodeMBCSStateful lacks the "Return value: New reference", etc. ---------- assignee: docs at python components: Documentation messages: 306516 nosy: Mathew M., docs at python priority: normal severity: normal status: open title: Documentation: Some Unicode object functions don't indicate whether they return a new reference type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 19:04:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 00:04:13 +0000 Subject: [issue25054] Capturing start of line '^' In-Reply-To: <1441887596.73.0.766811958538.issue25054@psf.upfronthosting.co.za> Message-ID: <1511136253.44.0.213398074469.issue25054@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 4471 fixes this issue, issue1647489, and a couple of similar issues. The most visible change is the change in re.split(). This is compatibility breaking change, and it affects third-party code. But ValueError or FutureWarning were raised for patterns that will change the behavior in this PR for two Python releases, since Python 3.5. Developers had enough time for fixing them. In most cases this is so trivial as changing `*` to `+` in `\s*`. Changes in sub(), findall(), and finditer() are less visible. No one existing test needs modification for them. Was: >>> re.split(r"\b|:+", "a::bc") /usr/lib/python3.6/re.py:212: FutureWarning: split() requires a non-empty pattern match. return _compile(pattern, flags).split(string, maxsplit) ['a:', 'bc'] >>> re.sub(r"\b|:+", "-", "a::bc") '-a-:-bc-' >>> re.findall(r"\b|:+", "a::bc") ['', '', ':', '', ''] >>> list(re.finditer(r"\b|:+", "a::bc")) [<_sre.SRE_Match object; span=(0, 0), match=''>, <_sre.SRE_Match object; span=(1, 1), match=''>, <_sre.SRE_Match object; span=(2, 3), match=':'>, <_sre.SRE_Match object; span=(3, 3), match=''>, <_sre.SRE_Match object; span=(5, 5), match=''>] Fixed: >>> re.split(r"\b|:+", "a::bc") ['', 'a', '', 'bc', ''] >>> re.sub(r"\b|:+", "-", "a::bc") '-a--bc-' >>> re.findall(r"\b|:+", "a::bc") ['', '', '::', '', ''] >>> list(re.finditer(r"\b|:+", "a::bc")) [, , , , ] The behavior of re.split(), re.findall() and re.finditer() now is the same as in the regex module with the V1 flag. But the behavior of re.sub() left closer to the previous behavior, otherwise this would break existing tests. It is consistent with re.split() rather of re.findall() and re.finditer(). In regex with the V1 flag sub() is consistent with findall() and finditer(), but not with split(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 19:06:25 2017 From: report at bugs.python.org (Mathew M.) Date: Mon, 20 Nov 2017 00:06:25 +0000 Subject: [issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference In-Reply-To: <1511136014.35.0.213398074469.issue32077@psf.upfronthosting.co.za> Message-ID: <1511136385.84.0.213398074469.issue32077@psf.upfronthosting.co.za> Change by Mathew M. : ---------- keywords: +patch pull_requests: +4407 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 19:08:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 00:08:09 +0000 Subject: [issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference In-Reply-To: <1511136014.35.0.213398074469.issue32077@psf.upfronthosting.co.za> Message-ID: <1511136489.24.0.213398074469.issue32077@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: C API functions return new references by default. It needs to be explicitly documented only when the function returns a borrowed reference. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 19:11:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 00:11:06 +0000 Subject: [issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference In-Reply-To: <1511136014.35.0.213398074469.issue32077@psf.upfronthosting.co.za> Message-ID: <1511136666.28.0.213398074469.issue32077@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ah, you have changed just refcounts.dat! This is good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 19:50:30 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 20 Nov 2017 00:50:30 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1511139030.72.0.213398074469.issue32042@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Tom??, thank you for the suggestion, but we're going to decline for the reasons mentioned elsewhere in this thread. That said, it would be perfectly reasonable to post your own variant or extension on PyPI ( http://pypi.python.org ) to test the waters, to let the idea mature, and to see whether there is any uptake by the community. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 20:26:17 2017 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Mon, 20 Nov 2017 01:26:17 +0000 Subject: [issue32078] string result of str(bytes()) in Python3 Message-ID: <1511141176.94.0.213398074469.issue32078@psf.upfronthosting.co.za> New submission from Arno-Can Uestuensoez : Hello, I am currently writing some dual-version libraries and have to deal with str/unicode. The attached code example contains the str/unicode handling. The Python3.6.2 release behaves as I did not expected for all of the following the conversions: unicode = str # @ReservedAssignment # it is intentional mystring = "abc" u0 = unicode(bytes(mystring.encode())) # == str(mystring) mystring = "abc" u0 = unicode(bytes(mystring.encode('utf-8'))) # == str(mystring) mystring = "abc" u0 = unicode(bytes(mystring.encode('ascii'))) # == str(mystring) mystring = b"abc" u0 = unicode(mystring) # == str(mystring) results for Python3 in: type: len: 6 b'abc' while in Python2: type: len: 3 abc I am not sure whether this is the intended behavior because the manual could eventually be misinterpreted: 4.8.1. Bytes Objects Bytes objects are immutable sequences of single bytes. Since many major binary protocols are based on the ASCII text encoding, bytes objects offer several methods that are only valid when working with ASCII compatible data and are closely related to string objects in a variety of other ways. class bytes([source[, encoding[, errors]]]) Firstly, the syntax for bytes literals is largely the same as that for string literals, except that a b prefix is added: I expected the 'b'-prefix to be added to the input only, but I expect the output without a type-prefix, because it is just an attribute/property. The result for Python3 should be similar to Python2: type: len: 3 abc Regards Arno ---------- components: Unicode files: source_and_output.tar.gz messages: 306521 nosy: acue, ezio.melotti, vstinner priority: normal severity: normal status: open title: string result of str(bytes()) in Python3 type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47274/source_and_output.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 21:02:50 2017 From: report at bugs.python.org (Tim Peters) Date: Mon, 20 Nov 2017 02:02:50 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <1511143370.09.0.213398074469.issue32042@psf.upfronthosting.co.za> Tim Peters added the comment: Tom??, of course you can combine testing methods any way you like. Don't oversell this - there's nothing actually magical about comparing objects instead of strings ;-) I'm only -0 on this. It grates a bit against doctest's original intents, but I appreciate it could be quite useful at times. About the lack of showing the values when "expr1 == expr2" is false, I don't care. I can't recall any case where, e.g., assertEqual() showing both values was actually helpful. To the contrary, it more often filled the screen with giant reprs that were worse than useless. By its very nature, doctest comparing against an explicit string encourages tests with brief output. When a test fails, no matter how it's reported non-trivial work to repair it usually follows. By far the most important part is knowing _what_ failed. "True matching 1" is a case of practicality beats purity: a wart for sure, but standing out precisely because it's the only wart of its kind. I doubt most users are even aware of it, and it's certainly not something most users need to know. About different shells, it _is_ jarring to people at first that formatting differs among them. But since the differences show up on every single line of input and output, the differences quickly stop diluting attention. About how much of repr() output is defined, not really all that much. The purpose of doctest was never to accept any conceivable implementation that met the letter of the reference manual, but to capture the output CPython actually produced. That was intentional. Over time, I count it as a Good Thing that "but what about doctests out there?" has acted as a pressure against gratuitous changes in repr() outputs, and nudged other implementations to make "who cares?" output decisions that matched CPython's. Every silly difference incurs various costs, and doctest did aim to make the existence of those costs visible at once. It's a fact of life that relatively few users read the reference manual, let alone understand it - and I don't hate them for that ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 21:10:21 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 02:10:21 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511143821.59.0.213398074469.issue32075@psf.upfronthosting.co.za> Decorater added the comment: Seems that now this is detected as an smelly symbol: ./python Tools/scripts/smelly.py + nm -p libpython3.7dm.a Ignored symbol types: b, d, r, t Smelly symbol: ZipImporter_Type (type: D) ERROR: Found 1 smelly symbols! make: *** [smelly] Error 1 I think I need to find a fix to this now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 21:27:41 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 02:27:41 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511144861.79.0.213398074469.issue32075@psf.upfronthosting.co.za> Decorater added the comment: After looking in the smelly tool it seems that now I got to rename the _Type to ZipImporter to have the ``Py`` prefix. Since this will be a probable breaking change this might not be a good idea on backporting to 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 21:27:48 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 02:27:48 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511144868.59.0.213398074469.issue32075@psf.upfronthosting.co.za> Change by Decorater : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 22:24:27 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 03:24:27 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511148267.76.0.213398074469.issue32075@psf.upfronthosting.co.za> Change by Decorater : ---------- assignee: -> docs at python components: +Build, Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 22:56:19 2017 From: report at bugs.python.org (Tim Peters) Date: Mon, 20 Nov 2017 03:56:19 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1511150179.96.0.213398074469.issue31630@psf.upfronthosting.co.za> Tim Peters added the comment: Best I can tell, the fdlibm 5.3 on netlib was released in 2002, and essentially stopped existing as a maintained project then. Everyone else copied the source code, and made their own changes independently ever since :-( At least the folks behind the Julia language have made some effort to resurrect it as its own project: http://openlibm.org/ Mark noted that GCC does use a different math library for tan() calls it can evaluate at compile-time. That appears to have started in gcc 4.3: https://gcc.gnu.org/gcc-4.3/changes.html#mpfropts In any case ... are there are any test failures here on a _current_ OS/platform? If it's only on out-of-date platforms, I'd be content to just suppress the failures on those. Unless the number of affected systems is so large that their identifiers won't fit in a file ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 00:25:15 2017 From: report at bugs.python.org (=?utf-8?q?Ra=C3=BAl_Alvarez?=) Date: Mon, 20 Nov 2017 05:25:15 +0000 Subject: [issue32079] version install 3.6.3 hangs in test_socket Message-ID: <1511155515.69.0.213398074469.issue32079@psf.upfronthosting.co.za> New submission from Ra?l Alvarez : I'm trying to install python 3.6.3 from sources in Fedora 3.19.8-100.fc20.x86_64+debug x86_64 GNU/Linux, I did ./configure, then run make as normal user and then as root, in these two cases the installation hangs over more than 6 hours with no progress in step 298/405: 0:14:02 load avg: 1.32 [298/405] test_socket I can interrupt the process pressing CTRL-C, then the screen shows me: test_subprocess test_sunau test_sundry test_super test_symbol test_symtable test_syntax test_sys test_sys_setprofile test_sys_settrace test_sysconfig test_syslog test_tarfile test_tcl test_telnetlib test_tempfile test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading test_threading_local test_threadsignals test_time test_timeit test_timeout test_tix test_tk test_tokenize test_tools test_trace test_traceback test_tracemalloc test_ttk_guionly test_ttk_textonly test_tuple test_turtle test_typechecks test_typing test_ucn test_unary test_unicode test_unicode_file test_unicode_file_functions test_unicode_identifiers test_unicodedata test_univnewlines test_unpack test_unpack_ex test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib_response test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_utf8source test_uu test_uuid test_venv test_wait3 test_wait4 test_warnings test_wave test_weakref test_weakset test_webbrowser test_winconsoleio test_winreg test_winsound test_with test_wsgiref test_xdrlib test_xml_dom_minicompat test_xml_etree test_xml_etree_c test_xmlrpc test_xmlrpc_net test_yield_from test_zipapp test_zipfile test_zipfile64 test_zipimport test_zipimport_support test_zlib Total duration: 449 min 55 sec Tests result: FAILURE make: *** [profile-opt] Interrupci?n ---------- components: Installation messages: 306526 nosy: Ra?l Alvarez priority: normal severity: normal status: open title: version install 3.6.3 hangs in test_socket type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 00:37:48 2017 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Mon, 20 Nov 2017 05:37:48 +0000 Subject: [issue32078] string result of str(bytes()) in Python3 In-Reply-To: <1511141176.94.0.213398074469.issue32078@psf.upfronthosting.co.za> Message-ID: <1511156268.59.0.213398074469.issue32078@psf.upfronthosting.co.za> Arno-Can Uestuensoez added the comment: Hello, the following reduced example probably shows the issue a little better. I have currently not yet the 3.7+ environment, but guess the same behavior. Regards Arno ---------- versions: +Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47275/howto_bytes_005.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 00:46:44 2017 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Mon, 20 Nov 2017 05:46:44 +0000 Subject: [issue32078] string result of str(bytes()) in Python3 In-Reply-To: <1511141176.94.0.213398074469.issue32078@psf.upfronthosting.co.za> Message-ID: <1511156804.46.0.213398074469.issue32078@psf.upfronthosting.co.za> Arno-Can Uestuensoez added the comment: Sorry for the typo. ---------- Added file: https://bugs.python.org/file47276/howto_bytes_005typo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 01:05:50 2017 From: report at bugs.python.org (Sachin Pathave) Date: Mon, 20 Nov 2017 06:05:50 +0000 Subject: [issue32080] Error Installing Python 3.6.3 on ubuntu 16.04 Message-ID: <1511157949.99.0.213398074469.issue32080@psf.upfronthosting.co.za> New submission from Sachin Pathave : test failed when I run command $make test FAILED (failures=1, skipped=1) test test_re failed 2 tests failed again: test_re test_venv ---------- components: 2to3 (2.x to 3.x conversion tool) files: test.Screenshot from 2017-11-20 11-12-41.png messages: 306529 nosy: sachin priority: normal severity: normal status: open title: Error Installing Python 3.6.3 on ubuntu 16.04 type: resource usage versions: Python 3.6 Added file: https://bugs.python.org/file47277/test.Screenshot from 2017-11-20 11-12-41.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 02:32:35 2017 From: report at bugs.python.org (Christian Heimes) Date: Mon, 20 Nov 2017 07:32:35 +0000 Subject: [issue31834] BLAKE2: the (pure) SSE2 impl forced on x86_64 is slower than reference In-Reply-To: <1508572631.92.0.213398074469.issue31834@psf.upfronthosting.co.za> Message-ID: <1511163155.19.0.213398074469.issue31834@psf.upfronthosting.co.za> Change by Christian Heimes : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 02:50:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 07:50:04 +0000 Subject: [issue32042] Option for comparing values instead of reprs in doctest In-Reply-To: <1511117907.83.0.213398074469.issue32042@psf.upfronthosting.co.za> Message-ID: <2408081.UrF8LjUsE8@saraksh> Serhiy Storchaka added the comment: > Although that functionality is already easily handled; for example, here's the OP's first example rewritten to be independent of the dict's representation ordering: > >>> dict_fun() == {'foo': 1, 'bar': 2} > > True Oh, right. I remember the headache caused by dict order randomization, but forgot about this option. Currently doctests are rarely used in CPython tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 02:58:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 07:58:37 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1511164717.38.0.213398074469.issue31630@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Do you consider the recent stable releases of OpenBSD 6.1 (April 11, 2017) and NetBSD 7.1 (March 11, 2017) out-of-date platforms? The develop version of NetBSD 8 has the same failure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 03:18:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 08:18:03 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511165883.69.0.213398074469.issue32075@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: There is a plan of reimplementing zipimport in Python (see issue25711). What are you going to do with this? I think that C extensions should use a common import API. ---------- nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka, twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 03:25:19 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 08:25:19 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511166319.78.0.213398074469.issue32075@psf.upfronthosting.co.za> Decorater added the comment: That is true, but Well, I am using this in a project of mine currently where it loads up encrypted scripts from a zip file. However I must have the import hook itself be in an C extension and subclass the current zipimporter. However knowing a rewrite for it is best, I have not experienced any bugs with it so far actually. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 03:40:45 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 08:40:45 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511167245.28.0.213398074469.issue32075@psf.upfronthosting.co.za> Decorater added the comment: Well since issue25711 might be for 3.7 and newer I guess this patch might actually be for 3.6.4 or something then. And then the rewrite would take over on 3.7 and newer depending on if the rewrite makes it in to 3.7. ---------- versions: +Python 3.6 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 03:57:18 2017 From: report at bugs.python.org (Attila Nagy) Date: Mon, 20 Nov 2017 08:57:18 +0000 Subject: [issue32081] ipaddress should support fast IP lookups Message-ID: <1511168238.6.0.213398074469.issue32081@psf.upfronthosting.co.za> New submission from Attila Nagy : It would be nice if ipaddress could support fast IP lookups, like this: https://github.com/jsommers/pytricia ---------- components: Library (Lib) messages: 306535 nosy: Attila Nagy priority: normal severity: normal status: open title: ipaddress should support fast IP lookups type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 04:02:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 09:02:50 +0000 Subject: [issue32075] Expose ZipImporter Type Object in the include header files. In-Reply-To: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> Message-ID: <1511168570.1.0.213398074469.issue32075@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The C API cann't be changed in a bugfix release. Unless for fixing bugs, but even in that case we should be very very careful. There is no a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 04:54:41 2017 From: report at bugs.python.org (Erik Bray) Date: Mon, 20 Nov 2017 09:54:41 +0000 Subject: [issue32082] atexit module: allow getting/setting list of handlers directly Message-ID: <1511171681.08.0.213398074469.issue32082@psf.upfronthosting.co.za> New submission from Erik Bray : In Python 2 it was possible to directly manipulate the list of registered atexit handlers through atexit._exithandlers. Obviously I'm not complaining that this went away, as it was an underscored attribute. But this possibility was still useful in the context of testing. For example, we have a test suite that runs many test cases in subprocesses run with multiprocessing.Process. Since these call os._exit() any atexit handlers registered by the code under test are not run. It's useful, however, to test that either a) Expected atexit handlers ran correctly or b) No unexpected atexit handlers were registered To this end we would save and clear atexit._exithandlers, call atexit._run_exitfuncs(), then restore the original atexit._exithandlers. This is not possible on Python 3 since that all lives in the C module state for sub-interpreter support. For the time being it was necessary to work around this with a Cython module, but coding around internal extension module structures is hardly ideal: https://git.sagemath.org/sage.git/diff/src/sage/misc/_context_py3.pyx?id=85b17201255e9919eaa7b5cff367e8bc271c2a3f I think it would be useful--for testing purposes *only*--to add a _get_exitfuncs() function that returns a tuple of the registered handlers, and likewise a _set_exitfuncs(handlers) with sets the registered handlers from an iterable (the latter being little more than a shortcut for `atexit._clear(); for h in handlers: atexit.register(*h)`). I would propose that these be undocumented internal functions to emphasize that they are not how the module should be used in normal circumstances. At the same time it might be worth addressing https://bugs.python.org/issue22867 I can provide a patch if this idea is acceptable. ---------- components: Library (Lib) messages: 306537 nosy: erik.bray priority: normal severity: normal status: open title: atexit module: allow getting/setting list of handlers directly type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 08:05:58 2017 From: report at bugs.python.org (Per Fryking) Date: Mon, 20 Nov 2017 13:05:58 +0000 Subject: [issue25144] 3.5 Win install fails with "TARGETDIR" In-Reply-To: <1442424932.17.0.0389991499722.issue25144@psf.upfronthosting.co.za> Message-ID: <1511183158.03.0.213398074469.issue25144@psf.upfronthosting.co.za> Per Fryking added the comment: Got the same issue with the 3.6 installer from python.org The thing is that I can't elevate the priviliges to be administrator. So I'm stuck. Uploading the log. Running windows 7 ---------- nosy: +Per Fryking Added file: https://bugs.python.org/file47278/Python 3.6.3 (32-bit)_20171120135800.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 08:08:43 2017 From: report at bugs.python.org (Katsuhiko YOSHIDA) Date: Mon, 20 Nov 2017 13:08:43 +0000 Subject: [issue32083] sqlite3 Cursor.description can't return column types Message-ID: <1511183323.28.0.213398074469.issue32083@psf.upfronthosting.co.za> New submission from Katsuhiko YOSHIDA : My schema of sqlite3 table is the following. --- schema check start --- % sqlite3 sample.db SQLite version 3.16.0 2016-11-04 19:09:39 Enter ".help" for usage hints. sqlite> PRAGMA table_info(Employees); 0|EmployeeID|int|1||1 1|LastName|varchar(20)|1||0 2|FirstName|varchar(10)|1||0 (ommiting) sqlite> --- schema check end --- Then, I tried to output column types by calling Cursor.description. Like this. --- sample code start --- import sqlite3 con = sqlite3.connect("sample.db", detect_types=sqlite3.PARSE_DECLTYPES) cursor = con.cursor() cursor.execute("select LastName, FirstName from Employees limit 1;") print cursor.description cursor.close() con.close() --- sample code end --- The output is the following. (('LastName', None, None, None, None, None, None), ('FirstName', None, None, None, None, None, None)) When changing detect_types parameter to detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES the result is same. I expect to output a column type in second element. Could you tell me why? ---------- components: Library (Lib) messages: 306539 nosy: kyoshidajp priority: normal severity: normal status: open title: sqlite3 Cursor.description can't return column types type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 08:49:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 13:49:16 +0000 Subject: [issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL Message-ID: <1511185756.0.0.213398074469.issue32084@psf.upfronthosting.co.za> New submission from STINNER Victor : iDer reported a vulnerability in the HTTP server. (1) Start a local HTTP server (listen to tcp/8000): python3 -m http.server 8000 (2) Open a web browser and to go: http://localhost:8000//www.python.org/%2f.. => the browser is redirected to http://www.python.org/%2f../ (on this example, the python.org web server redirects to https://www.python.org/%2f../ ) Raw HTTP to see the HTTP redirection using netcat: --- $ echo -ne "GET //www.python.org/%2f.. HTTP/1.0\n\n" | nc localhost 8000 HTTP/1.0 301 Moved Permanently Server: SimpleHTTP/0.6 Python/3.6.2 Date: Mon, 20 Nov 2017 13:31:42 GMT Location: //www.python.org/%2f../ --- The problem is in the SimpleHTTPRequestHandler.send_head() function: * self.path = '//www.python.org/%2f..' * translate_path() translates '//www.python.org//..' path to self.directory (the current directory by default). * isdir(self.directory) is True but self.path doesn't send with '/', so send_head() creates a HTTP redirection (HTTP 301) * The redirection URL is '//www.python.org/%2f../'. Extract of the raw HTTP: "Location: //www.python.org/%2f../" The web browsers translates the URL '//www.python.org/%2f../' to "http://www.python.org/%2f../"... It surprised me, but ok, it's a fact. I'm not sure what is the best way to fix this vulnerability without rejecting valid HTTP requests. IMHO the root issue is the redirection URL starting with "//". I would expect something like "localhost//". The problem is that I'm not sure that the HTTP server knows its own "external" hostname. "localhost" is wrong is the server is accessed from the outside. Maybe the server must just fail on that case? This vulnerabilility was reported to the Python Security Response Team (PSRT) at October 18, 2017 (one month ago). Since no obvious fix was found, it was decided to make the vulnerability public to get more eyes on it to find a quick fix. Note: I'm not sure that this vulnerability is important, since the redirected URL ends with "/%2f../" which should be rejected by any correct HTTP Server (say, not the Python builtin "simple" HTTP server...). ---------- components: Library (Lib) messages: 306540 nosy: vstinner priority: normal severity: normal status: open title: [Security] http.server can be abused to redirect to (almost) arbitrary URL type: security versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 08:55:03 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 20 Nov 2017 13:55:03 +0000 Subject: [issue32083] sqlite3 Cursor.description can't return column types In-Reply-To: <1511183323.28.0.213398074469.issue32083@psf.upfronthosting.co.za> Message-ID: <1511186103.32.0.213398074469.issue32083@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for your report. According to https://github.com/python/cpython/blob/04dee2720851ec39e831beaa3edc0c59f228f461/Modules/_sqlite/cursor.c#L573 we always set the 'type_code' field described in PEP 249 to None. Setting it would be a new feature so it can only go into Python 3.7. ---------- nosy: +berker.peksag, ghaering, lemburg stage: -> needs patch type: behavior -> enhancement versions: +Python 3.7 -Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:02:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:02:11 +0000 Subject: [issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL In-Reply-To: <1511185756.0.0.213398074469.issue32084@psf.upfronthosting.co.za> Message-ID: <1511186531.52.0.213398074469.issue32084@psf.upfronthosting.co.za> STINNER Victor added the comment: Extract of send_head(): path = self.translate_path(self.path) f = None if os.path.isdir(path): parts = urllib.parse.urlsplit(self.path) ... urllib.parse.urlsplit('//www.python.org/%2f..') returns: SplitResult(scheme='', netloc='www.python.org', path='/%2f..', query='', fragment='') Is urlsplit() the correct function to call here? www.python.org is part of the path, not of the netloc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:15:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:15:17 +0000 Subject: [issue32085] [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! Message-ID: <1511187317.56.0.213398074469.issue32085@psf.upfronthosting.co.za> New submission from STINNER Victor : Vulnerabilities described below are likely these ones reported in bpo-30500, but it would be nice to double check if *all* reported vulnerabilities have been fixed! http://python-security.readthedocs.io/vuln/bpo-30500_urllib_connects_to_a_wrong_host.html -- At July 27, 2017, Orange Tsai (Security Consultant, DEVCORE) reported vulnerabilities in Python, in the code parsing URLs. Conference: https://www.blackhat.com/us-17/briefings/schedule/#a-new-era-of-ssrf---exploiting-url-parser-in-trending-programming-languages-6292 Slides: https://www.blackhat.com/docs/us-17/thursday/us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf His following blog post only contains the vulnerabilities in Python: http://blog.orange.tw/2017/07/how-i-chained-4-vulnerabilities-on.html Note: His twitter account, https://twitter.com/orange_8361 == Issue 1 == * CR-LF Injection on HTTP protocol * Smuggling SMTP protocol over HTTP protocol http://127.0.0.1:25/%0D%0AHELO orange.tw%0D%0AMAIL FROM >> GET / << 421 4.7.0 ubuntu Rejecting open proxy localhost [127.0.0.1] >> HELO orange.tw Connection closed => "SMTP Hates HTTP Protocol It Seems Unexploitable" "Gopher Is Good What If There Is No Gopher Support?" "HTTPS What Won't Be Encrypted in a SSL Handshake?" == Issue 2 == * HTTPS: What Won't Be Encrypted in a SSL Handshake? * Exploit the Unexploitable - Smuggling SMTP over TLS SNI https://127.0.0.1?%0D%0AHELO?orange.tw%0D%0AMAIL?FROM...:25/ (...) >< HELO orange.tw << 250 ubuntu Hello localhost [127.0.0.1], please meet you >> MAIL FROM: << 250 2.1.0 ... Sender ok == Big Picture == Python vulnerable to: * Python httplib: * CR-LF Injection: Path, Host and SNI * Python urllib: * CR-LF Injection: Host and SNI * Host Injection * Python urllib2 * CR-LF Injection: Host and SNI ---------- messages: 306543 nosy: vstinner priority: normal severity: normal status: open title: [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:21:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:21:16 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() Message-ID: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> New submission from STINNER Victor : See the python-dev thread: https://mail.python.org/pipermail/python-dev/2017-November/150605.html ---------- components: Interpreter Core messages: 306544 nosy: vstinner priority: normal severity: normal status: open title: C API: Clarify which C functions are safe to be called before Py_Initialize() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:24:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:24:07 +0000 Subject: [issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL In-Reply-To: <1511185756.0.0.213398074469.issue32084@psf.upfronthosting.co.za> Message-ID: <1511187847.75.0.213398074469.issue32084@psf.upfronthosting.co.za> STINNER Victor added the comment: I wrote this patch, but I'm not sure that it's ok to always reject redirection URLs starting with //: diff --git a/Lib/http/server.py b/Lib/http/server.py index 502bce0c7a..494031b8c2 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -673,10 +673,18 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): parts = urllib.parse.urlsplit(self.path) if not parts.path.endswith('/'): # redirect browser - doing basically what apache does - self.send_response(HTTPStatus.MOVED_PERMANENTLY) new_parts = (parts[0], parts[1], parts[2] + '/', parts[3], parts[4]) new_url = urllib.parse.urlunsplit(new_parts) + + # Browsers interpret "Location: //uri" as an absolute URI + # like "http://URI" + if new_url.startswith('//'): + self.send_error(HTTPStatus.BAD_REQUEST, + "URI must not start with //") + return None + + self.send_response(HTTPStatus.MOVED_PERMANENTLY) self.send_header("Location", new_url) self.end_headers() return None ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:24:41 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Mon, 20 Nov 2017 14:24:41 +0000 Subject: [issue32087] deprecated-removed directive generates overlapping msgids in .pot files Message-ID: <1511187880.98.0.213398074469.issue32087@psf.upfronthosting.co.za> New submission from KINEBUCHI Tomohiko : When gettext builder is invoked, deprecated-removed directive which is defined in Doc/tools/extensions/pyspecific.py generates overlapping msgids in .pot files. For example, the following .rst source (taken from Doc/library/dmb.rst L354):: .. deprecated-removed:: 3.6 3.8 Creating database in ``'r'`` and ``'w'`` modes. Modifying database in ``'r'`` mode. results to following .pot file entries:: #: ../../library/dbm.rst:357 msgid "Deprecated since version 3.6, will be removed in version 3.8: Creating database in 'r' and 'w' modes. Modifying database in 'r' mode." msgstr "" #: ../../library/dbm.rst:357 msgid "Creating database in ``'r'`` and ``'w'`` modes. Modifying database in ``'r'`` mode." msgstr "" using the command:: sphinx-build -E -b gettext -D gettext_compact=0 -w warnings.txt -d build/.doctrees . locale/pot The root cause is deprecated-removed directive constructs inappropriate sub-doctree for translation. First, above .rst source is compiled into following tree structure:: Deprecated since version 3.6, will be removed in version 3.8: Creating database in... and gettext builder picks up paragraph node and the second inline node as translation targets. Expected result is that two inline nodes are picked up as translation targets and the paragraph node is not, and expected .pot file entries are such as following:: #: ../../library/dbm.rst:357 msgid "Deprecated since version 3.6, will be removed in version 3.8:" msgstr "" #: ../../library/dbm.rst:357 msgid "Creating database in ``'r'`` and ``'w'`` modes. Modifying database in ``'r'`` mode." msgstr "" ---------- assignee: docs at python components: Documentation messages: 306546 nosy: cocoatomo, docs at python priority: normal severity: normal status: open title: deprecated-removed directive generates overlapping msgids in .pot files versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:26:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:26:42 +0000 Subject: [issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode Message-ID: <1511188002.91.0.213398074469.issue32088@psf.upfronthosting.co.za> New submission from STINNER Victor : Related python-dev thread: https://mail.python.org/pipermail/python-dev/2017-November/150608.html "[Python-Dev] Show DeprecationWarning in debug mode?" I propose to display Display DeprecationWarning, PendingDeprecationWarning and ImportWarning when Python is compiled in debug mode. Attached PR implements proposed change. ---------- components: Library (Lib) messages: 306547 nosy: vstinner priority: normal severity: normal status: open title: Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:46:23 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Mon, 20 Nov 2017 14:46:23 +0000 Subject: [issue32087] deprecated-removed directive generates overlapping msgids in .pot files In-Reply-To: <1511187880.98.0.213398074469.issue32087@psf.upfronthosting.co.za> Message-ID: <1511189183.32.0.213398074469.issue32087@psf.upfronthosting.co.za> Change by KINEBUCHI Tomohiko : ---------- keywords: +patch pull_requests: +4408 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:52:04 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 20 Nov 2017 14:52:04 +0000 Subject: [issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode In-Reply-To: <1511188002.91.0.213398074469.issue32088@psf.upfronthosting.co.za> Message-ID: <1511189524.52.0.213398074469.issue32088@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:52:07 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:52:07 +0000 Subject: [issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode In-Reply-To: <1511188002.91.0.213398074469.issue32088@psf.upfronthosting.co.za> Message-ID: <1511189527.97.0.213398074469.issue32088@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4409 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:57:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:57:20 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers Message-ID: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> New submission from STINNER Victor : The -X dev mode currently *hides* some ResourceWarning warnings: $ cat x.py def func(): open('/etc/issue') func() func() $ ./python x.py x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> open('/etc/issue') x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> open('/etc/issue') haypo at selma$ ./python -X dev x.py x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> open('/etc/issue') The problem is that the "-W default" inserted by -X dev overrides the final filter on ResourceWarning: $ ./python -X dev -c 'import warnings, pprint; pprint.pprint(warnings.filters)' [('default', re.compile('', re.IGNORECASE), , re.compile(''), 0), ('ignore', None, , None, 0), ('always', None, , None, 0)] ---------- messages: 306548 nosy: ncoghlan, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: In developer mode (-X dev), ResourceWarning is only emited once per line numbers versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:00:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:00:44 +0000 Subject: [issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode In-Reply-To: <1511188002.91.0.213398074469.issue32088@psf.upfronthosting.co.za> Message-ID: <1511190044.67.0.213398074469.issue32088@psf.upfronthosting.co.za> STINNER Victor added the comment: Warnings filters in debug mode. Reference (current code): $ ./python -c 'import warnings, pprint; pprint.pprint(warnings.filters)' [('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('always', None, , None, 0)] With my PR 4474: $ ./python -c 'import warnings, pprint; pprint.pprint(warnings.filters)' [('ignore', None, , None, 0), ('always', None, , None, 0)] BytesWarning is not modified by my PR since this specific warning is controlled by the -b option. Example with my PR. -b option, ignore => default: $ ./python -b -c 'import warnings, pprint; pprint.pprint(warnings.filters)' [('default', None, , None, 0), ('always', None, , None, 0)] -bb option, ignore => error: $ ./python -bb -c 'import warnings, pprint; pprint.pprint(warnings.filters)' [('error', None, , None, 0), ('always', None, , None, 0)] Note: While writing this comment, I also found a bug in the new developer mode (-X dev): bpo-32089. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:06:05 2017 From: report at bugs.python.org (Zoltan Krajcsovics) Date: Mon, 20 Nov 2017 15:06:05 +0000 Subject: [issue31790] double free or corruption (while using smem) In-Reply-To: <1508047232.57.0.213398074469.issue31790@psf.upfronthosting.co.za> Message-ID: <1511190365.86.0.213398074469.issue31790@psf.upfronthosting.co.za> Zoltan Krajcsovics added the comment: In a span of about 1 month, I had multiple errors: *** Error in `/usr/bin/python': free(): invalid next size (normal): 0x000055f9c9e7c970 *** *** Error in `/usr/bin/python': free(): invalid next size (normal): 0x000055e33fda3970 *** *** Error in `/usr/bin/python': free(): invalid next size (normal): 0x0000564d42335970 *** *** Error in `/usr/bin/python': double free or corruption (out): 0x0000561d8b9d4f80 *** *** Error in `/usr/bin/python': double free or corruption (out): 0x0000557700e74f80 *** *** Error in `/usr/bin/python': free(): invalid next size (normal): 0x0000564b6142e970 *** In the same time-period, I have been running the same code on another system, with a different python version, which did not produce any error: python version that causes issues: python --version Python 2.7.13 python version that is error-free: Python 2.7.9 ---------- Added file: https://bugs.python.org/file47279/logs.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:08:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:08:46 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511190526.77.0.213398074469.issue32050@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 733b5f3f2f2425fa939d71bc317f2e0f1968c2a0 by Victor Stinner in branch '2.7': bpo-32050: Fix -x option documentation (#4423) https://github.com/python/cpython/commit/733b5f3f2f2425fa939d71bc317f2e0f1968c2a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:10:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:10:48 +0000 Subject: [issue32050] Deprecated python3 -x option In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511190648.56.0.213398074469.issue32050@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4410 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:12:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:12:48 +0000 Subject: [issue32050] Fix -x option documentation In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511190768.2.0.213398074469.issue32050@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Deprecated python3 -x option -> Fix -x option documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:14:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:14:09 +0000 Subject: [issue32047] asyncio: enable debug mode when -X dev is used In-Reply-To: <1510833052.89.0.213398074469.issue32047@psf.upfronthosting.co.za> Message-ID: <1511190849.8.0.213398074469.issue32047@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 44862df2eeec62adea20672b0fe2a5d3e160569e by Victor Stinner in branch 'master': bpo-32047: -X dev enables asyncio debug mode (#4418) https://github.com/python/cpython/commit/44862df2eeec62adea20672b0fe2a5d3e160569e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:14:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:14:29 +0000 Subject: [issue32047] asyncio: enable debug mode when -X dev is used In-Reply-To: <1510833052.89.0.213398074469.issue32047@psf.upfronthosting.co.za> Message-ID: <1511190869.51.0.213398074469.issue32047@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:32:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:32:21 +0000 Subject: [issue32090] test_put() Message-ID: <1511191941.25.0.213398074469.issue32090@psf.upfronthosting.co.za> New submission from STINNER Victor : The test failed on AMD64 FreeBSD 10.x Shared 3.x: http://buildbot.python.org/all/#/builders/87/builds/200/steps/4/logs/stdio FAIL: test_put (test.test_multiprocessing_fork.WithProcessesTestQueue) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/_test_multiprocessing.py", line 809, in test_put self.assertEqual(queue_empty(queue), False) AssertionError: True != False -- I succeeded to reproduce the issue on Linux with this change: diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index dbca2d89ed..0754ac0d52 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -804,7 +804,7 @@ class _TestQueue(BaseTestCase): queue.put_nowait(6) # the values may be in buffer but not yet in pipe so sleep a bit - time.sleep(DELTA) + time.sleep(0) self.assertEqual(queue_empty(queue), False) self.assertEqual(queue_full(queue, MAXSIZE), True) ---------- components: Tests messages: 306553 nosy: vstinner priority: normal severity: normal status: open title: test_put() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:32:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:32:50 +0000 Subject: [issue32090] test_put() of test_multiprocessing queue tests has a race condition In-Reply-To: <1511191941.25.0.213398074469.issue32090@psf.upfronthosting.co.za> Message-ID: <1511191970.05.0.213398074469.issue32090@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: test_put() -> test_put() of test_multiprocessing queue tests has a race condition _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:35:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:35:38 +0000 Subject: [issue32091] test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6 Message-ID: <1511192138.79.0.213398074469.issue32091@psf.upfronthosting.co.za> New submission from STINNER Victor : Failure on x86 Gentoo Refleaks 3.6: http://buildbot.python.org/all/#/builders/72/builds/43 0:58:35 load avg: 5.21 [135/406/1] test_site failed -- running: test_multiprocessing_forkserver (483 sec) beginning 6 repetitions 123456 test test_site failed -- Traceback (most recent call last): File "/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/test_site.py", line 186, in test_s_option self.assertIn(usersite, sys.path) AssertionError: '/buildbot/buildarea/.local/lib/python3.6/site-packages' not found in ['', '/usr/local/lib/python36.zip', '/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib', '/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/build/lib.linux-i686-3.6-pydebug', '/usr/local/lib/python3.6/site-packages'] (...) Re-running test 'test_site' in verbose mode (...) FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/test_site.py", line 186, in test_s_option self.assertIn(usersite, sys.path) AssertionError: '/buildbot/buildarea/.local/lib/python3.6/site-packages' not found in ['', '/usr/local/lib/python36.zip', '/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib', '/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/build/lib.linux-i686-3.6-pydebug', '/usr/local/lib/python3.6/site-packages'] ---------- components: Tests messages: 306554 nosy: vstinner priority: normal severity: normal status: open title: test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:37:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:37:22 +0000 Subject: [issue32091] test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6 In-Reply-To: <1511192138.79.0.213398074469.issue32091@psf.upfronthosting.co.za> Message-ID: <1511192242.8.0.213398074469.issue32091@psf.upfronthosting.co.za> STINNER Victor added the comment: Same failure on x86 Gentoo Refleaks 2.7: FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/test/test_site.py", line 190, in test_s_option self.assertIn(usersite, sys.path) AssertionError: '/buildbot/buildarea/.local/lib/python2.7/site-packages' not found in ['/usr/local/lib/python27.zip', '/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib', '/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/plat-linux2', '/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/lib-tk', '/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/lib-old', '/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/build/lib.linux-i686-2.7-pydebug', '/usr/local/lib/python2.7/site-packages'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:37:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:37:29 +0000 Subject: [issue32091] test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6 In-Reply-To: <1511192138.79.0.213398074469.issue32091@psf.upfronthosting.co.za> Message-ID: <1511192249.61.0.213398074469.issue32091@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:37:35 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 15:37:35 +0000 Subject: [issue25711] Rewrite zipimport from scratch In-Reply-To: <1448296120.48.0.872112518039.issue25711@psf.upfronthosting.co.za> Message-ID: <1511192255.63.0.213398074469.issue25711@psf.upfronthosting.co.za> Decorater added the comment: So, after reviewing this it started to make me rethink about the zipimport.py file. So my question is how would that file work if it is an pyc file in python37.zip or something just to zipimport other modules? There is got to be some sort of low level api that can zip import the zip importer then on the rewrite. Am I right? Maybe the best bet is to wait for bug reports on the C Code and fixup the C Code if possible so that way there is no conflicts like the ones I just questioned. ---------- nosy: +Decorater _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:39:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:39:14 +0000 Subject: [issue31687] test_semaphore_tracker() of test_multiprocessing_spawn fails randomly (race condition?) In-Reply-To: <1507109795.91.0.213398074469.issue31687@psf.upfronthosting.co.za> Message-ID: <1511192354.37.0.213398074469.issue31687@psf.upfronthosting.co.za> STINNER Victor added the comment: Failure on x86 Gentoo Refleaks 3.6, two days ago: http://buildbot.python.org/all/#/builders/72/builds/41 ====================================================================== FAIL: test_semaphore_tracker (test.test_multiprocessing_spawn.TestSemaphoreTracker) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/_test_multiprocessing.py", line 4161, in test_semaphore_tracker _multiprocessing.sem_unlink(name2) AssertionError: OSError not raised ====================================================================== FAIL: test_sys_exit (test.test_multiprocessing_spawn.WithProcessesTestSubclassingProcess) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/_test_multiprocessing.py", line 584, in test_sys_exit self.assertEqual(p.exitcode, 1) AssertionError: None != 1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:41:51 2017 From: report at bugs.python.org (Tim Peters) Date: Mon, 20 Nov 2017 15:41:51 +0000 Subject: [issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD In-Reply-To: <1506675027.54.0.213398074469.issue31630@psf.upfronthosting.co.za> Message-ID: <1511192511.17.0.213398074469.issue31630@psf.upfronthosting.co.za> Tim Peters added the comment: I have no opinion about any version of xxxBSD, because I've never used one ;-) If current versions of those do have this failure, has anyone opened a bug report on _their_ tracker(s)? I've seen no reason yet to imagine these failures are a fault in Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:50:21 2017 From: report at bugs.python.org (Claudiu Belu) Date: Mon, 20 Nov 2017 15:50:21 +0000 Subject: [issue32092] mock.patch with autospec does not consume self / cls argument Message-ID: <1511193021.31.0.213398074469.issue32092@psf.upfronthosting.co.za> New submission from Claudiu Belu : Currently, the autospec=True argument can be passed to mock.patch, but when trying to make assertions on the call and its arguments, it can fail, as it expects an instance / class instance reference as the first argument (self / cls arguments are not consumed when autospec-ing). Steps to reproduce: >>> import mock >>> from mock.tests import testmock >>> >>> with mock.patch.object(testmock.Something, 'meth', autospec=True): ... smth = testmock.Something() ... smth.meth(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, mock.sentinel.d) ... smth.meth.assert_called_once_with(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, mock.sentinel.d) ... Traceback (most recent call last): File "", line 4, in File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 318, in assert_called_once_with return mock.assert_called_once_with(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 948, in assert_called_once_with return self.assert_called_with(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 937, in assert_called_with six.raise_from(AssertionError(_error_message(cause)), cause) File "/usr/local/lib/python2.7/dist-packages/six.py", line 718, in raise_from raise value AssertionError: Expected call: meth(sentinel.a, sentinel.b, sentinel.c, sentinel.d) Actual call: meth(, sentinel.a, sentinel.b, sentinel.c, sentinel.d) Expected result: no AssertionError. ---------- messages: 306559 nosy: cbelu priority: normal severity: normal status: open title: mock.patch with autospec does not consume self / cls argument versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:50:34 2017 From: report at bugs.python.org (Claudiu Belu) Date: Mon, 20 Nov 2017 15:50:34 +0000 Subject: [issue32092] mock.patch with autospec does not consume self / cls argument In-Reply-To: <1511193021.31.0.213398074469.issue32092@psf.upfronthosting.co.za> Message-ID: <1511193034.32.0.213398074469.issue32092@psf.upfronthosting.co.za> Change by Claudiu Belu : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:51:27 2017 From: report at bugs.python.org (Claudiu Belu) Date: Mon, 20 Nov 2017 15:51:27 +0000 Subject: [issue32092] mock.patch with autospec does not consume self / cls argument In-Reply-To: <1511193021.31.0.213398074469.issue32092@psf.upfronthosting.co.za> Message-ID: <1511193087.45.0.213398074469.issue32092@psf.upfronthosting.co.za> Change by Claudiu Belu : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:54:17 2017 From: report at bugs.python.org (Eric Snow) Date: Mon, 20 Nov 2017 15:54:17 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() In-Reply-To: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> Message-ID: <1511193257.77.0.213398074469.issue32086@psf.upfronthosting.co.za> Change by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:58:04 2017 From: report at bugs.python.org (Claudiu Belu) Date: Mon, 20 Nov 2017 15:58:04 +0000 Subject: [issue32092] mock.patch with autospec does not consume self / cls argument In-Reply-To: <1511193021.31.0.213398074469.issue32092@psf.upfronthosting.co.za> Message-ID: <1511193484.15.0.213398074469.issue32092@psf.upfronthosting.co.za> Claudiu Belu added the comment: Currently, the autospec=True argument can be passed to mock.patch, but when trying to make assertions on the call and its arguments, it can fail, as it expects an instance / class instance reference as the first argument (self / cls arguments are not consumed when autospec-ing). Steps to reproduce: ubuntu at ubuntu:/opt/stack/cpython$ ./python Python 3.7.0a2+ (heads/mock-add-autospec:51a9270, Nov 20 2017, 06:48:44) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from unittest import mock from unittest.test.testmock import testmock with mock.patch.object(testmock.Something, 'meth', autospec=True): smth = testmock.Something() smth.meth(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, mock.sentinel.d) smth.meth.assert_called_once_with(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, mock.sentinel.d) >>> >>> >>> ... ... ... ... Traceback (most recent call last): File "", line 4, in File "/opt/stack/cpython/Lib/unittest/mock.py", line 196, in assert_called_once_with return mock.assert_called_once_with(*args, **kwargs) File "/opt/stack/cpython/Lib/unittest/mock.py", line 856, in assert_called_once_with return self.assert_called_with(*args, **kwargs) File "/opt/stack/cpython/Lib/unittest/mock.py", line 845, in assert_called_with raise AssertionError(_error_message()) from cause AssertionError: Expected call: meth(sentinel.a, sentinel.b, sentinel.c, sentinel.d) Actual call: meth(, sentinel.a, sentinel.b, sentinel.c, sentinel.d) Expected result: no AssertionError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:02:34 2017 From: report at bugs.python.org (Claudiu Belu) Date: Mon, 20 Nov 2017 16:02:34 +0000 Subject: [issue30587] Mock with spec object does not ensure method call signatures In-Reply-To: <1496837046.98.0.920527641247.issue30587@psf.upfronthosting.co.za> Message-ID: <1511193754.13.0.213398074469.issue30587@psf.upfronthosting.co.za> Change by Claudiu Belu : ---------- keywords: +patch pull_requests: +4411 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:02:47 2017 From: report at bugs.python.org (Claudiu Belu) Date: Mon, 20 Nov 2017 16:02:47 +0000 Subject: [issue32092] mock.patch with autospec does not consume self / cls argument In-Reply-To: <1511193021.31.0.213398074469.issue32092@psf.upfronthosting.co.za> Message-ID: <1511193767.85.0.213398074469.issue32092@psf.upfronthosting.co.za> Change by Claudiu Belu : ---------- keywords: +patch pull_requests: +4412 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:08:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 16:08:05 +0000 Subject: [issue32050] Fix -x option documentation In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511194085.14.0.213398074469.issue32050@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c5a2071586f735d2a61d1756e7011cfbb6ce86c9 by Victor Stinner in branch 'master': bpo-32050: Fix -x option documentation (#4475) https://github.com/python/cpython/commit/c5a2071586f735d2a61d1756e7011cfbb6ce86c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:08:24 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 20 Nov 2017 16:08:24 +0000 Subject: [issue32050] Fix -x option documentation In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511194104.79.0.213398074469.issue32050@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:09:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 16:09:53 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() In-Reply-To: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> Message-ID: <1511194193.11.0.213398074469.issue32086@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +ned.deily priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:15:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 16:15:16 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for AIX - all versions In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1511194516.35.0.213398074469.issue28009@psf.upfronthosting.co.za> STINNER Victor added the comment: +531 elif sys.platform.startswith("aix"): +532 getters = [_netstat_getnode] LGTM. Do you want to write this a pull request? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:16:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 16:16:10 +0000 Subject: [issue32050] Fix -x option documentation In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511194570.25.0.213398074469.issue32050@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 60a376cf0023d1070329d0e861a5596637ff3275 by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-32050: Fix -x option documentation (GH-4475) (#4477) https://github.com/python/cpython/commit/60a376cf0023d1070329d0e861a5596637ff3275 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:18:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 16:18:22 +0000 Subject: [issue32050] Fix -x option documentation In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511194702.35.0.213398074469.issue32050@psf.upfronthosting.co.za> STINNER Victor added the comment: I removed the note from the documentation since it was outdated. Serhiy, Terry: Do you want to work on a patch to rephrase the "DOS specific hack only" sentence? > @py -3 -x %0 %* & exit /b I'm not a BATCH expert, so I don't know if this command works on all Windows version, or even on MS-DOS. So I'm not confident to propose such doc change myself, sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:22:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 16:22:22 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for AIX - all versions In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1511194942.57.0.213398074469.issue28009@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: _unixdll_getnode, _ifconfig_getnode, and _arp_getnode were changed recently. Are they still not working on AIX? ---------- nosy: +serhiy.storchaka versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 11:52:25 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 20 Nov 2017 16:52:25 +0000 Subject: [issue32050] Fix -x option documentation In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511196745.05.0.213398074469.issue32050@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I don't know either. Once of the Windows experts should review and revise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 12:09:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 17:09:57 +0000 Subject: [issue32078] string result of str(bytes()) in Python3 In-Reply-To: <1511141176.94.0.213398074469.issue32078@psf.upfronthosting.co.za> Message-ID: <1511197797.15.0.213398074469.issue32078@psf.upfronthosting.co.za> STINNER Victor added the comment: Calling str(bytes) is wrong in Python 3: $ python3 -bb Python 3.6.2 (default, Oct 2 2017, 16:51:32) >>> str(b'abc') BytesWarning: str() on a bytes instance Just don't do that :-) Use repr(bytes) if you want the b'...' format: >>> repr(b'abc') "b'abc'" ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 12:18:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 17:18:31 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1511198311.32.0.213398074469.issue32022@psf.upfronthosting.co.za> STINNER Victor added the comment: I don't think that we can fix this issue. I suggest to close it as WONTFIX. > sys.setrecursionlimit(3000) While Python does its best to catch stack overflow, the C implementation of CPython can exhaust the stack memory (8 MB in Linux?) and then crash with a "stack overflow". I suggest to rewrite your algorithm to reduce the maximum stack depth. Or maybe try to find a way to extend the maximum size of the stack (is it possible without rebuilding Python?). See for example RLIMIT_STACK of the resource module on Unix. > On linux x86-64 with python 3.6.3 and python 3.7.0a2+ I get a RecursionError: maximum recursion depth exceeded. The exact memory usage depends on the Python version and maybe compiler flags. We reduce the stack usage in Python 3.7, search for "Stack consumption" in: https://vstinner.github.io/contrib-cpython-2017q1.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 12:20:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 17:20:53 +0000 Subject: [issue32093] macOS: implement time.thread_time() using thread_info() Message-ID: <1511198453.26.0.213398074469.issue32093@psf.upfronthosting.co.za> New submission from STINNER Victor : bpo-32025 added time.thread_time() function. On macOS, CLOCK_THREAD_CPUTIME_ID is not available. I propose to add a macOS implementation using thread_info(): return the sum of user and system times. ---------- components: macOS messages: 306569 nosy: ned.deily, pitrou, ronaldoussoren, vstinner priority: normal severity: normal status: open title: macOS: implement time.thread_time() using thread_info() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 12:21:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 17:21:29 +0000 Subject: [issue32025] Add time.thread_time() In-Reply-To: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> Message-ID: <1511198489.03.0.213398074469.issue32025@psf.upfronthosting.co.za> STINNER Victor added the comment: I opened bpo-32093 for macOS. I close this one. Nice enhancement, I already like this new clock ;-) ---------- components: +FreeBSD -Library (Lib) nosy: +koobs resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 12:33:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 17:33:28 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1511199208.83.0.213398074469.issue32043@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4415 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 12:47:07 2017 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 20 Nov 2017 17:47:07 +0000 Subject: [issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode In-Reply-To: <1511188002.91.0.213398074469.issue32088@psf.upfronthosting.co.za> Message-ID: <1511200026.99.0.213398074469.issue32088@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset 895862aa01793a26e74512befb0c66a1da2587d6 by ?ukasz Langa (Victor Stinner) in branch 'master': bpo-32088: Display Deprecation in debug mode (#4474) https://github.com/python/cpython/commit/895862aa01793a26e74512befb0c66a1da2587d6 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 13:05:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 18:05:52 +0000 Subject: [issue12276] 3.x ignores sys.tracebacklimit=0 In-Reply-To: <1307436501.83.0.59684150491.issue12276@psf.upfronthosting.co.za> Message-ID: <1511201152.64.0.213398074469.issue12276@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Bugs in PyTraceBack_Print() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 13:08:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 18:08:17 +0000 Subject: [issue31897] Unexpected exceptions in plistlib.loads In-Reply-To: <1509336254.22.0.213398074469.issue31897@psf.upfronthosting.co.za> Message-ID: <1511201297.39.0.213398074469.issue31897@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Opened issue32072 for infinite recursion and related issues. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 13:18:46 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 20 Nov 2017 18:18:46 +0000 Subject: [issue32094] _args_from_interpreter_flags() doesn't keep -X options Message-ID: <1511201926.73.0.213398074469.issue32094@psf.upfronthosting.co.za> New submission from Antoine Pitrou : `subprocess._args_from_interpreter_flags()` is used to control the flags passed to child Python processes, for example launched by multiprocessing. Unfortunately, not all flags are actually recognized by this function: $ ./python -X dev Python 3.7.0a2+ (heads/master:895862a, Nov 20 2017, 19:15:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys._xoptions {'dev': True} >>> import subprocess >>> subprocess._args_from_interpreter_flags() ['-Wdefault'] ---------- components: Library (Lib) messages: 306574 nosy: barry, davin, pitrou, vstinner priority: normal severity: normal status: open title: _args_from_interpreter_flags() doesn't keep -X options type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 14:29:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 19:29:52 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511206192.23.0.213398074469.issue30855@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ah, this is Cygwin! This is a Tk bug (https://core.tcl.tk/tk/tktview?name=5ee8af61e5ef8e233158a43459624f4ecf58a6fe). It was fixed, but not completely. The fix doesn't work on Cygwin. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 14:31:45 2017 From: report at bugs.python.org (Zachary Ware) Date: Mon, 20 Nov 2017 19:31:45 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511206305.23.0.213398074469.issue30855@psf.upfronthosting.co.za> Zachary Ware added the comment: > Ah, this is Cygwin! Hmm, no; Cygwin isn't installed on ware-win81-release. When was the fix made? 2.7 on Windows currently uses 8.5.15, we can bump it up to latest 8.5 if that will help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 14:42:53 2017 From: report at bugs.python.org (Michael Felt) Date: Mon, 20 Nov 2017 19:42:53 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for AIX - all versions In-Reply-To: <1511194942.57.0.213398074469.issue28009@psf.upfronthosting.co.za> Message-ID: <2bb3271b-e13b-d3b5-a534-aff420d5d0c7@felt.demon.nl> Michael Felt added the comment: On 11/20/2017 5:22 PM, Serhiy Storchaka wrote: > Serhiy Storchaka added the comment: > > _unixdll_getnode, _ifconfig_getnode, and _arp_getnode were changed recently. Are they still not working on AIX? After a clone of master: a) _unixdll_getnode is renamed to _unix_getnode since the function _load_system_functions() still depends on find_library() - that always returns None, still not working. Note also - find_library('uuid') will not work on a standard AIX - as the library libuuid.a does not exist, neither have I ever seen a shared library with the name libuuid.so. FYI: Finally, "nm -Ae /usr/lib/libc.a | grep uuid" returns root at x071:[/root]nm -Ae /usr/lib/libc.a | grep uuid /usr/lib/libc.a[shr.o]: ._gen_localhost_uuid t???? 3248320 /usr/lib/libc.a[shr.o]: ._gen_localhost_uuid at AF22_8 t???? 3256928 /usr/lib/libc.a[shr.o]: .uuid__get_os_time?? T???? 3234208 /usr/lib/libc.a[shr.o]: .uuid__uemul???????? T???? 3236064 /usr/lib/libc.a[shr.o]: .uuid_compare??????? T???? 3237088 /usr/lib/libc.a[shr.o]: .uuid_copy?????????? T???? 3236224 /usr/lib/libc.a[shr.o]: .uuid_create???????? T???? 3240480 /usr/lib/libc.a[shr.o]: .uuid_create_nil???? T???? 3240160 /usr/lib/libc.a[shr.o]: .uuid_create_os????? T???? 3256608 /usr/lib/libc.a[shr.o]: .uuid_disk?????????? T???? 3252448 /usr/lib/libc.a[shr.o]: .uuid_equal????????? T???? 3238336 /usr/lib/libc.a[shr.o]: .uuid_equal_nc?????? T???? 3248384 /usr/lib/libc.a[shr.o]: .uuid_for_key??????? T???? 3249504 /usr/lib/libc.a[shr.o]: .uuid_from_string??? T???? 3238944 /usr/lib/libc.a[shr.o]: .uuid_from_string_nc T???? 3248960 /usr/lib/libc.a[shr.o]: .uuid_get_address??? t???? 3234720 /usr/lib/libc.a[shr.o]: .uuid_hash?????????? T???? 3236384 /usr/lib/libc.a[shr.o]: .uuid_is_nil???????? T???? 3237984 /usr/lib/libc.a[shr.o]: .uuid_is_nil_nc????? T???? 3249408 /usr/lib/libc.a[shr.o]: .uuid_is_valid_string_nc T???? 3248512 /usr/lib/libc.a[shr.o]: .uuid_is_valid_string_nc at AF23_10 t 3257184 /usr/lib/libc.a[shr.o]: .uuid_localhost????? T???? 3254208 /usr/lib/libc.a[shr.o]: .uuid_os_md5???????? t???? 3245248 /usr/lib/libc.a[shr.o]: .uuid_os_sha1??????? t???? 3245376 /usr/lib/libc.a[shr.o]: .uuid_to_string????? T???? 3239648 /usr/lib/libc.a[shr.o]: .uuid_to_string_nc?? T???? 3248608 /usr/lib/libc.a[shr.o]: _uuid_rmutex???????? B????? 548664 12 /usr/lib/libc.a[shr.o]: _uuid_rmutex???????? d????? 512480 4 /usr/lib/libc.a[shr.o]: getosuuid??????????? U?????????? - /usr/lib/libc.a[shr.o]: setosuuid??????????? U?????????? - /usr/lib/libc.a[shr.o]: uuid_c_version?????? D????? 503544 4 /usr/lib/libc.a[shr.o]: uuid_compare???????? D????? 498436 12 /usr/lib/libc.a[shr.o]: uuid_copy??????????? D????? 498412 12 /usr/lib/libc.a[shr.o]: uuid_create????????? D????? 498508 12 /usr/lib/libc.a[shr.o]: uuid_create_nil????? D????? 498496 12 /usr/lib/libc.a[shr.o]: uuid_create_os?????? D????? 498616 12 /usr/lib/libc.a[shr.o]: uuid_disk??????????? D????? 498592 12 /usr/lib/libc.a[shr.o]: uuid_equal?????????? D????? 498460 12 /usr/lib/libc.a[shr.o]: uuid_equal_nc??????? D????? 498520 12 /usr/lib/libc.a[shr.o]: uuid_for_key???????? D????? 498580 12 /usr/lib/libc.a[shr.o]: uuid_from_string???? D????? 498472 12 /usr/lib/libc.a[shr.o]: uuid_from_string_nc? D????? 498556 12 /usr/lib/libc.a[shr.o]: uuid_g_nil_uuid????? D????? 432472 16 /usr/lib/libc.a[shr.o]: uuid_g_nil_uuid????? d????? 512476 4 /usr/lib/libc.a[shr.o]: uuid_hash??????????? D????? 498424 12 /usr/lib/libc.a[shr.o]: uuid_is_nil????????? D????? 498448 12 /usr/lib/libc.a[shr.o]: uuid_is_nil_nc?????? D????? 498568 12 /usr/lib/libc.a[shr.o]: uuid_is_valid_string_nc D 498532????????? 12 /usr/lib/libc.a[shr.o]: uuid_localhost?????? D????? 498604 12 /usr/lib/libc.a[shr.o]: uuid_to_string?????? D????? 498484 12 /usr/lib/libc.a[shr.o]: uuid_to_string_nc??? D????? 498544 12 i.e., there is nothing with uuid_generate in it. _arp_getnode() AIX does not return any value for itself. Neither does Centos, (so I expect RHEL will also not), and my old debians do not either. So, after summary - these three functions still do nothing/do not work on AIX 6.1 or AIX 7.1 (cannot test AIX 7.2). And - as before, netstat -ia - when looking at ':', still returns 01:00:5e:00:00:01 for every interface. > > ---------- > nosy: +serhiy.storchaka > versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5 > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 14:48:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 19:48:43 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511207323.73.0.213398074469.issue30855@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The fix was made 2015-11-09. The tag core-8-5-15 was created 2013-09-16. I'm not well experienced with fossil and thought that 8.5.15 contains this fix, but now I see that this is not true. Yes, updating Tcl/Tk can help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 14:52:33 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 20 Nov 2017 19:52:33 +0000 Subject: [issue28538] _socket module cross-compilation error on android-24 In-Reply-To: <1477474733.85.0.0781476042155.issue28538@psf.upfronthosting.co.za> Message-ID: <1511207553.63.0.213398074469.issue28538@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4416 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 14:55:56 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 20 Nov 2017 19:55:56 +0000 Subject: [issue28538] _socket module cross-compilation error on android-24 In-Reply-To: <1477474733.85.0.0781476042155.issue28538@psf.upfronthosting.co.za> Message-ID: <1511207756.76.0.213398074469.issue28538@psf.upfronthosting.co.za> Xavier de Gaye added the comment: These changes are not needed anymore now that Unified Headers are supported by android-ndk-r14 (see issue 29040) ---------- resolution: fixed -> not a bug stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 15:01:10 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 20:01:10 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for AIX - all versions In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1511208070.25.0.213398074469.issue28009@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What return commands `ifconfig`, `ifconfig -a`, `ifconfig -av`, `ip link list`, `arp -an`, `lanscan -ai` (if not error)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 15:38:04 2017 From: report at bugs.python.org (Michael Felt) Date: Mon, 20 Nov 2017 20:38:04 +0000 Subject: [issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails Message-ID: <1511210284.67.0.213398074469.issue32095@psf.upfronthosting.co.za> New submission from Michael Felt : after git clone from master: make install fails to complete with: Important - python is not installed already. FYI: also note - build completes successfully with 2.7.14 (will download and check other python3 versions) if test "xupgrade" != "xno" ; then case upgrade in upgrade) ensurepip="--upgrade" ;; install|*) ensurepip="" ;; esac; ./python -E -m ensurepip $ensurepip --root=/ ; fi Traceback (most recent call last): File "/data/prj/python/git/src/python3-3.7.0.1/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/data/prj/python/git/src/python3-3.7.0.1/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__main__.py", line 5, in sys.exit(ensurepip._main()) File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", line 204, in _main default_pip=args.default_pip, File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", line 117, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 28, in File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/vcs/mercurial.py", line 9, in File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 36, in File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/utils/glibc.py", line 4, in File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ctypes/__init__.py", line 7, in from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes' make: 1254-004 The error code from the last command is 1. ---------- components: Build messages: 306581 nosy: Michael.Felt priority: normal severity: normal status: open title: AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 15:54:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 20:54:57 +0000 Subject: [issue32094] _args_from_interpreter_flags() doesn't keep -X options In-Reply-To: <1511201926.73.0.213398074469.issue32094@psf.upfronthosting.co.za> Message-ID: <1511211297.19.0.213398074469.issue32094@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4417 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 15:55:25 2017 From: report at bugs.python.org (Michael Felt) Date: Mon, 20 Nov 2017 20:55:25 +0000 Subject: [issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails In-Reply-To: <1511210284.67.0.213398074469.issue32095@psf.upfronthosting.co.za> Message-ID: <1511211325.53.0.213398074469.issue32095@psf.upfronthosting.co.za> Michael Felt added the comment: FYI: version 3.6.3 compiles and builds without this issue. + make install DESTDIR=/var/aixtools/python/Python/3.6.3.0 > .buildaix/install.out + mkinstallp.ksh /var/aixtools/python/Python/3.6.3.0 > .buildaix/mkinstallp.out ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 15:58:09 2017 From: report at bugs.python.org (Zachary Ware) Date: Mon, 20 Nov 2017 20:58:09 +0000 Subject: [issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails In-Reply-To: <1511210284.67.0.213398074469.issue32095@psf.upfronthosting.co.za> Message-ID: <1511211489.12.0.213398074469.issue32095@psf.upfronthosting.co.za> Zachary Ware added the comment: Do you have libffi (and its development headers) installed where the compiler can find it? Python 3.7 no longer bundles a copy of libffi (see #27979). ---------- nosy: +zach.ware versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 15:58:22 2017 From: report at bugs.python.org (Jonas H.) Date: Mon, 20 Nov 2017 20:58:22 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511211502.62.0.213398074469.issue32071@psf.upfronthosting.co.za> Jonas H. added the comment: Thanks Antoine. I will need some guidance as to what are the correct places to make these changes. I'm not quite sure about the abstractions here (runner, loader, suite, case, etc.) My PoC (see GitHub link in first post) uses a TestSuite subclass. (The subclass is only so that it's easier to assess the general implementation approach; I guess it should be put into the main class instead.) Things I'm unsure of: 1) Is suite the correct place for this kind of feature? 2) Is the hardcoded fnmatch-based pattern matcher ok, or do we need a new abstraction "NameMatcher"? 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped test cases OK? 4) The try...catch statement around 'test.id()' is needed because there are some unit tests (unit tests for the unittest module itself) that check for some error cases/error handling in the unittest framework, and crash if we try to call '.id()' on them. Please remove the try...catch to see these errors if you're interested in the details. Is the check OK like that, or is this a code smell? Thanks Jonas ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:28:36 2017 From: report at bugs.python.org (Eric Snow) Date: Mon, 20 Nov 2017 21:28:36 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. Message-ID: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> New submission from Eric Snow : (see the python-dev thread [1]) (related: issue #32086) When I consolidated the global runtime state into a single global, _PyRuntime, calls Py_DecodeLocale() started to break if the runtime hadn't been intialized yet. This is because that function relies on PyMem_RawMalloc() and PyMem_RawFree(), which rely on the raw allocator having been initialized as part of the runtime (it used to be intialized statically). The documentation for various "Process-wide parameters" [2] explicitly directs users to call Py_DecodeLocale() where necessary. The docs for Py_DecodeLocale(), in turn, explicitly refer to calling PyMem_RawFree(). So changing the pre-runtime-init behavior of Py_DecodeLocale() and PyMem_RawFree() is a regression that should be fixed. [1] https://mail.python.org/pipermail/python-dev/2017-November/150605.html [2] https://docs.python.org/3/c-api/init.html#process-wide-parameters ---------- assignee: eric.snow messages: 306585 nosy: eric.snow, ncoghlan, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Py_DecodeLocale() fails if used before the runtime is initialized. type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:32:32 2017 From: report at bugs.python.org (Michael Felt) Date: Mon, 20 Nov 2017 21:32:32 +0000 Subject: [issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails In-Reply-To: <1511210284.67.0.213398074469.issue32095@psf.upfronthosting.co.za> Message-ID: <1511213552.49.0.213398074469.issue32095@psf.upfronthosting.co.za> Michael Felt added the comment: no. I'll install what I have atm. Too bad - as now it will have an install dependency. re: https://bugs.python.org/issue27976#msg274628 -- seems a warning that libffi is not available might be useful after all. Question: is ffi still bundled for Darwin - even in 3.7? If yes, maybe it should also be bundled for AIX. In any case, just installing a libffi.a library fixed the install (i.e., make; make install) ---------- nosy: -zach.ware versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:33:08 2017 From: report at bugs.python.org (Eric Snow) Date: Mon, 20 Nov 2017 21:33:08 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511213588.95.0.213398074469.issue32096@psf.upfronthosting.co.za> Change by Eric Snow : ---------- keywords: +patch pull_requests: +4418 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:34:22 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 21:34:22 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511213662.01.0.213398074469.issue32096@psf.upfronthosting.co.za> Decorater added the comment: Interesting, on 3.6.3 on my embedded program it seems to work just fine. Did anything change in it since then? https://github.com/AraHaan/Els_kom_new/blob/master/PC/komextract_new.c ---------- nosy: +Decorater _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:40:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 20 Nov 2017 21:40:14 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511214014.64.0.213398074469.issue32096@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Interpreter Core versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:46:07 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 21:46:07 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() In-Reply-To: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> Message-ID: <1511214367.79.0.213398074469.issue32086@psf.upfronthosting.co.za> Decorater added the comment: For me, it looks like Py_DecodeLocal() is still safe (according to python 3.6.3 unless anything changed in it). ---------- nosy: +Decorater _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:46:59 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 21:46:59 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() In-Reply-To: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> Message-ID: <1511214419.38.0.213398074469.issue32086@psf.upfronthosting.co.za> STINNER Victor added the comment: > For me, it looks like Py_DecodeLocal() is still safe (according to python 3.6.3 unless anything changed in it). This issue is a regression in Python 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:49:26 2017 From: report at bugs.python.org (Decorater) Date: Mon, 20 Nov 2017 21:49:26 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() In-Reply-To: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> Message-ID: <1511214566.91.0.213398074469.issue32086@psf.upfronthosting.co.za> Decorater added the comment: Ah, I see now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 17:06:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 22:06:33 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511215593.9.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: Duplicate of bpo-32086. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> C API: Clarify which C functions are safe to be called before Py_Initialize() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 17:26:30 2017 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 20 Nov 2017 22:26:30 +0000 Subject: [issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional Message-ID: <1511216790.9.0.213398074469.issue32066@psf.upfronthosting.co.za> New submission from Yury Selivanov : New changeset 423fd362f8e4d6c867a5afc8ac7cbeeb66cac19c by Yury Selivanov in branch 'master': bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be optional (#4447) https://github.com/python/cpython/commit/423fd362f8e4d6c867a5afc8ac7cbeeb66cac19c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 17:26:51 2017 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 20 Nov 2017 22:26:51 +0000 Subject: [issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional In-Reply-To: <1511216790.9.0.213398074469.issue32066@psf.upfronthosting.co.za> Message-ID: <1511216811.98.0.213398074469.issue32066@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 17:30:07 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 20 Nov 2017 22:30:07 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511217007.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Antoine Pitrou added the comment: First, I should clarify that I'm not a unittest maintainer. However, as far as I can tell, the maintainers have not been very active lately. Also, this is a reasonably simple enhancement (at least conceptually), so I think can do without a maintainer's formal approval. To your questions: > 1) Is suite the correct place for this kind of feature? At its core, TestSuite is really a glorified collection of tests. The selection logic is inside the TestLoader, and indeed the TestLoader docstring says: """This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite""" So I would recommend putting this in TestLoader. > 2) Is the hardcoded fnmatch-based pattern matcher ok, or do we need a new abstraction "NameMatcher"? I think the hardcoded approach is ok. Though to benefit readability you may want to use a predicate function instead. > 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped test cases OK? I think this is the wrong approach. A test that isn't selected shouldn't be skipped, it should not appear in the output at all. Another reason for putting this in TestLoader :-) > 4) The try...catch statement around 'test.id()' is needed because there are some unit tests (unit tests for the unittest module itself) that check for some error cases/error handling in the unittest framework, and crash if we try to call '.id()' on them I'd ask the question differently: do you need to call .id() to do the matching at all? Intuitively, the TestLoader probably knows about the test names already, even before it instantiates TestCases for them. TestCases shouldn't be instantiated for tests that are not selected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 17:30:57 2017 From: report at bugs.python.org (Jonathan Schoonhoven) Date: Mon, 20 Nov 2017 22:30:57 +0000 Subject: [issue2504] Add gettext.pgettext() and variants support In-Reply-To: <1206756624.13.0.664664048525.issue2504@psf.upfronthosting.co.za> Message-ID: <1511217057.08.0.213398074469.issue2504@psf.upfronthosting.co.za> Jonathan Schoonhoven added the comment: Is there anything I can do to help get this into the codebase and out issue purgatory? We're not that far off from the 10 year anniversary of this issue. ---------- nosy: +Jonathan Schoonhoven _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 17:58:10 2017 From: report at bugs.python.org (Bert JW Regeer) Date: Mon, 20 Nov 2017 22:58:10 +0000 Subject: [issue32097] doctest does not consider \r\n a Message-ID: <1511218690.8.0.213398074469.issue32097@psf.upfronthosting.co.za> New submission from Bert JW Regeer : doctest fails to consider `\r\n` as a blank line. ---------- components: Library (Lib) files: test.py messages: 306595 nosy: X-Istence priority: normal severity: normal status: open title: doctest does not consider \r\n a versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47280/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 18:23:53 2017 From: report at bugs.python.org (Jonas H.) Date: Mon, 20 Nov 2017 23:23:53 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511220233.54.0.213398074469.issue32071@psf.upfronthosting.co.za> Jonas H. added the comment: > > 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped test cases OK? > I think this is the wrong approach. A test that isn't selected shouldn't be skipped, it should not appear in the output at all. Another reason for putting this in TestLoader :-) My first implementation actually was mostly the test loader. Two things made me change my mind and try to make the changes in the suite code: - The loader code really only deals with loading (i.e., finding + importing) tests. Yes it expects a file pattern like "test*.py" for identifying test case files. But apart from that it didn't "feel" right to put name based selection there. - In py.test you'll get a console output like "5 tests passed, 1 test failed, 12 tests deselected". We can't get anything similar without making bigger changes to the test loader, runner, etc. code. Using skip() we at least have some info on "skipped" tests, although they're technically not skipped. Are you still saying this should go to the test loader? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 18:24:58 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 23:24:58 +0000 Subject: [issue32094] _args_from_interpreter_flags() doesn't keep -X options In-Reply-To: <1511201926.73.0.213398074469.issue32094@psf.upfronthosting.co.za> Message-ID: <1511220298.38.0.213398074469.issue32094@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f39b674876d2bd47ec7fc106d673b60ff24092ca by Victor Stinner in branch 'master': bpo-32094: Update subprocess for -X dev (#4480) https://github.com/python/cpython/commit/f39b674876d2bd47ec7fc106d673b60ff24092ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 18:32:44 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 20 Nov 2017 23:32:44 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511220233.54.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <04b4cfc7-0d73-debd-2555-1e266c086784@free.fr> Antoine Pitrou added the comment: Le 21/11/2017 ? 00:23, Jonas H. a ?crit?: > > - The loader code really only deals with loading (i.e., finding + importing) tests. Yes it expects a file pattern like "test*.py" for identifying test case files. But apart from that it didn't "feel" right to put name based selection there. Take a look at TestLoader.loadTestsFromName(). It does much more than look up test files, it can also look up individual classes or methods. > - In py.test you'll get a console output like "5 tests passed, 1 test failed, 12 tests deselected". We can't get anything similar without making bigger changes to the test loader, runner, etc. code. Using skip() we at least have some info on "skipped" tests, although they're technically not skipped. I'm not sure what the point of displaying the number of "deselected" tests is: that information doesn't sound very useful in itself. But in any case, marking them skipped feels wrong to me. Most often, skipping a test is an indication that the current system is not fit to run it (such as not enough RAM, or lacking a third-party library, or being the wrong OS entirely). > Are you still saying this should go to the test loader? IMHO, yes. Looking at your posted implementation, at least I don't think TestSuite is the place for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 18:35:13 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 20 Nov 2017 23:35:13 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511220913.57.0.213398074469.issue32071@psf.upfronthosting.co.za> Antoine Pitrou added the comment: If it helps, think of TestLoader as collecting tests, rather than simply loading Python modules. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 18:39:34 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 20 Nov 2017 23:39:34 +0000 Subject: [issue2504] Add gettext.pgettext() and variants support In-Reply-To: <1206756624.13.0.664664048525.issue2504@psf.upfronthosting.co.za> Message-ID: <1511221174.38.0.213398074469.issue2504@psf.upfronthosting.co.za> ?ric Araujo added the comment: The patch would need to be applied on top of the current master to make a pull request. Then, the tasks outlined in that message should be addressed: https://bugs.python.org/issue2504#msg122439 ---------- assignee: loewis -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 18:43:33 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 23:43:33 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511221413.78.0.213398074469.issue32071@psf.upfronthosting.co.za> STINNER Victor added the comment: The internal Python test runner "regrtest" already implements the feature as the -m MATCH option and --matchfile FILENAME option. It's implemented in test.support._match_file(). See bpo-31324 for a recent issue on this feature: performance issue (it's going to be fixed). ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 18:43:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 23:43:51 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511221431.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4419 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 19:06:38 2017 From: report at bugs.python.org (hackan) Date: Tue, 21 Nov 2017 00:06:38 +0000 Subject: [issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess() Message-ID: <1511222798.09.0.213398074469.issue32098@psf.upfronthosting.co.za> New submission from hackan : The value of `count` is hardcoded to 16 in https://github.com/python/cpython/blob/6a55d09573e5c35c9e4a24a6f811120b41a2a994/Lib/test/test_os.py#L1324 ---------- messages: 306602 nosy: hackan priority: normal severity: normal status: open title: Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 19:42:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 00:42:16 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511224936.67.0.213398074469.issue32089@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached PR 4482 fixes warnings filters: haypo at selma$ ./python -X dev -c 'import warnings, pprint; pprint.pprint(warnings.filters)' [('ignore', None, , None, 0), ('always', None, , None, 0), ('default', None, , None, 0)] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 19:42:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 00:42:26 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511224946.65.0.213398074469.issue32089@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 19:43:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 00:43:12 +0000 Subject: [issue32094] _args_from_interpreter_flags() doesn't keep -X options In-Reply-To: <1511201926.73.0.213398074469.issue32094@psf.upfronthosting.co.za> Message-ID: <1511224992.87.0.213398074469.issue32094@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks for the bug report Antoine, it's now fixed! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 19:51:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 00:51:21 +0000 Subject: [issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess() In-Reply-To: <1511222798.09.0.213398074469.issue32098@psf.upfronthosting.co.za> Message-ID: <1511225481.84.0.213398074469.issue32098@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 19:54:27 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 21 Nov 2017 00:54:27 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe Message-ID: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> New submission from Terry J. Reedy : The itertools roundrobin recipe has an outer loop executed a preset number of times. It is currently implemented with two assignments and a while loop. https://docs.python.org/3/library/itertools.html#itertools-recipes These can be replaced with a for loop using a reversed range. def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" nexts = cycle(iter(it).__next__ for it in iterables) for current_len in reversed(range(1, len(iterables)+1)): try: for next in nexts: yield next() except StopIteration: nexts = cycle(islice(nexts, current_len - 1)) I think this is easier to understand. So do some other participants in the current python-ideas thread 'Rewriting the "roundrobin" recipe in the itertools documentation'. I changed 'pending' to 'current_len' because, to me, 'pending' should be the set of iter_nexts and not their number. I originally avoided the '-1' in the islice call by decrementing both range arguments by 1 and calling the loop variable 'reduced_len'. But having the loop variable be the size of the nexts iterable in the next outer iteration seemed confusing and not worth the trivial efficiency gain. An independent change would be to replace 'next' with 'iter' on the basis that reusing the builtin name is not good and because 'nexts' is awkward to pronounce. I will produce a PR if any version is preferred to the current one. --- The OP proposed, and some participants like, an accept-reject algorithm based on zip_longest. def roundrobin(*iters): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" # Perhaps "flat_zip_nofill" is a better name, or something similar sentinel = object() for tup in it.zip_longest(*iters, fillvalue=sentinel): yield from (x for x in tup if x is not sentinel) I dislike creating tuples we don't want, with values we don't want, with an arbitrarily small acceptance ratio. I also note that zip_longest is properly used in grouper, whereas roundrobin is the only recipe using cycle. ---------- assignee: docs at python components: Documentation messages: 306605 nosy: docs at python, rhettinger, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Use range in itertools roundrobin recipe type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:12:45 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 01:12:45 +0000 Subject: [issue31672] string.Template should use re.ASCII flag In-Reply-To: <1507029340.05.0.213398074469.issue31672@psf.upfronthosting.co.za> Message-ID: <1511226765.82.0.213398074469.issue31672@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- pull_requests: +4420 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:14:15 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 21 Nov 2017 01:14:15 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working Message-ID: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> New submission from Cheryl Sabella : Clicking on Path Browser in the File menu gives an error instead of opening the Path Browser. ---------- assignee: terry.reedy components: IDLE messages: 306606 nosy: csabella, terry.reedy priority: normal severity: normal status: open title: IDLE: PathBrowser isn't working type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:17:16 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 01:17:16 +0000 Subject: [issue31672] string.Template should use re.ASCII flag In-Reply-To: <1507029340.05.0.213398074469.issue31672@psf.upfronthosting.co.za> Message-ID: <1511227036.79.0.213398074469.issue31672@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: @inada.naoki - I think changing this to ?a will make things more clear. I submitted a PR for that, and then once it lands, we can close this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:23:48 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 21 Nov 2017 01:23:48 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511227428.94.0.213398074469.issue32100@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- keywords: +patch pull_requests: +4421 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:27:01 2017 From: report at bugs.python.org (Dubslow) Date: Tue, 21 Nov 2017 01:27:01 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511227621.81.0.213398074469.issue32099@psf.upfronthosting.co.za> Dubslow added the comment: Note that this follows a bit of discussion on python-ideas, in two threads: https://mail.python.org/pipermail/python-ideas/2017-November/047920.html https://mail.python.org/pipermail/python-ideas/2017-November/047989.html I agree the zip_longest-derived solution is both easier to read/understand and also not really accurate, especially in extreme cases. But, and see the second thread, I think it might just be better to add this funcitonality itself to itertools, under the name zip_flat -- per the second thread, there's a lot of confusion around the topic beyond just the suitability of the current recipe (including such things as lack of a clear name, legibility, efficiency, and brevity -- a fair number of people are looking for one or two liners, even if that doesn't really exist). (One alternative to zip_flat would be to add a second keyword argument to zip_longest that *doesn't* use a fillvalue, producing variable-length tuples when the supplied iters run out. Then the recipe and the entire conversation/topic could be replaced by "yield from zip_longest(*iters, usefill=False)".) Despite that opinion, this suggested change is better than nothing. ---------- nosy: +Dubslow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:32:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 01:32:05 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511227925.27.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4422 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:32:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 01:32:42 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511227962.32.0.213398074469.issue32089@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 09f3a8a1249308a104a89041d82fe99e6c087043 by Victor Stinner in branch 'master': bpo-32089: Fix warnings filters in dev mode (#4482) https://github.com/python/cpython/commit/09f3a8a1249308a104a89041d82fe99e6c087043 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:35:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 01:35:24 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511228124.07.0.213398074469.issue32089@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:45:15 2017 From: report at bugs.python.org (Brett Cannon) Date: Tue, 21 Nov 2017 01:45:15 +0000 Subject: [issue25711] Rewrite zipimport from scratch In-Reply-To: <1448296120.48.0.872112518039.issue25711@psf.upfronthosting.co.za> Message-ID: <1511228715.46.0.213398074469.issue25711@psf.upfronthosting.co.za> Brett Cannon added the comment: zipimport.py would be frozen just like importlib, so there's no bootstrapping issue if that's what you're asking. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:50:04 2017 From: report at bugs.python.org (Dubslow) Date: Tue, 21 Nov 2017 01:50:04 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511229004.82.0.213398074469.issue32099@psf.upfronthosting.co.za> Dubslow added the comment: Regarding the current bug more specifically, I think a few comments would go a long way to helping readers understand the code. And also, I do think the (1, +1, -1) is less readable, simply because it doesn't follow the most common usage patterns of range, where your first version using (0,0,0) (with implicit zeroes of course) is cleaner. It's much more apparent how long the loop is at first glance ("loop once per iter" vs "loop... from what to what? oh, once per iter"). Perhaps not using reversed() but instead setting step=-1 would be a better case to use the off-by-1 variant. Such a version with both proposed changes (which are independent and can be considered or accepted separately) looks like this: def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" # This recipe is also called other names like "alternate", "interleave", or # "merge". "zip_flat" would also be an accurate name. # Algorithm: cycle around the __next__ methods of each iterable. when an # iter runs out, remove its __next__ from the cycle. nexts = cycle(iter(it).__next__ for it in iterables) for reduced_len in reversed(range(len(iterables))): try: for next in nexts: yield next() except StopIteration: nexts = cycle(islice(nexts, reduced_len)) # This skips one round of the cycle, starting the next round # without the current iter The last comment is probably the least valuable, though it does point out the slight quirk of how the last line works. I suppose this is the case for having the loop variable be named the actual length, but I think most Python users are accustomed to the last element of a list having index length-1. At any rate, I think the readability gain in the for statement is more than the readability loss in the islice(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:51:13 2017 From: report at bugs.python.org (Dubslow) Date: Tue, 21 Nov 2017 01:51:13 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511229073.22.0.213398074469.issue32099@psf.upfronthosting.co.za> Dubslow added the comment: Perhaps the loop variable could be renamed to "len_minus_1" or some such something which is more semantic to the algorithm. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:54:21 2017 From: report at bugs.python.org (Dubslow) Date: Tue, 21 Nov 2017 01:54:21 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511229261.89.0.213398074469.issue32099@psf.upfronthosting.co.za> Dubslow added the comment: Er, in my first message, make that "(yield from tup for tup in zip_longest(*iters, usefill=False))" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:02:07 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 21 Nov 2017 02:02:07 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511229727.84.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: While they're definitely closely related, I don't think this and issue 32086 are actually duplicates: this issue is "fix the current Py_DecodeLocale regression in 3.7 by reverting back to the 3.6 behaviour", while issue 32086 is "Should we deprecate our implied support for calling Py_DecodeLocale() before calling Py_Initialize()?". The latter is certainly a valid question, but we should restore the 3.6 behaviour while we're considering it. ---------- resolution: duplicate -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:06:06 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 21 Nov 2017 02:06:06 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() In-Reply-To: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> Message-ID: <1511229966.72.0.213398074469.issue32086@psf.upfronthosting.co.za> Nick Coghlan added the comment: Issue 32096 covers reverting the change to PyDecode_Locale specifically for 3.7. We can use this issue to ask the broader question "Do we want to *deprecate* our previously implied support for calling PyDecode_Locale() before Py_Initialize()?" If the answer is "Yes", then we need to design a transition plan to a different API for setting config parameters that accept "wchar_t *". If the answer is "No", then we need to document that design constraint on the affected APIs. Either way, we should also improve the way we communicate the list of C API methods that can be safely called before Py_Initialize. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:12:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 02:12:29 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511230349.61.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 25420fe290b98171e6d30edf9350292c21ef700e by Victor Stinner in branch 'master': bpo-32030: Add more options to _PyCoreConfig (#4485) https://github.com/python/cpython/commit/25420fe290b98171e6d30edf9350292c21ef700e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:29:01 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Nov 2017 02:29:01 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511231341.93.0.213398074469.issue32099@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:54:03 2017 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Tue, 21 Nov 2017 02:54:03 +0000 Subject: [issue32078] string result of str(bytes()) in Python3 In-Reply-To: <1511141176.94.0.213398074469.issue32078@psf.upfronthosting.co.za> Message-ID: <1511232843.51.0.213398074469.issue32078@psf.upfronthosting.co.za> Arno-Can Uestuensoez added the comment: I got your point, missed it before, sorry. So just for completeness. My issue was basically about the ambiguity of the str()-constructor and the str()-built-in-function. Therefore the len/type prints. It works with parameters: (3.6.2) [acue at lap001 Desktop]$ python -bb Python 3.6.2 (default, Jul 29 2017, 14:24:56) [GCC 4.8.3 20140911 (Red Hat 4.8.3-7)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> str(b"abc") Traceback (most recent call last): File "", line 1, in BytesWarning: str() on a bytes instance >>> >>> >>> str(b"abc", "utf-8") 'abc' >>> >>> type(str(b"abc",'utf-8')) >>> Is there a common approach to force the use of the str()-constructor instead of the str()-built-in function and/or the __str__()-method? This would make the shared code of Python2/Python3 much easier, at least for unicode()->str(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:58:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 02:58:57 +0000 Subject: [issue32101] Add PYTHONDEVMODE=1 to enable the developer mode Message-ID: <1511233137.85.0.213398074469.issue32101@psf.upfronthosting.co.za> New submission from STINNER Victor : In the review of the PR 4478, Antoine Pitrou proposed to add an environment variable to enable the new Python "developer mode" to inherit the developer mode in child Python processes. I proposed to add PYTHONDEVMODE=1. Nick Coghlan proposed PYTHONXOPTIONS=dev. While -X is a new "catch all" for new CPython options, Python got new PYTHONxxx environment variables to enable new options: * -X faulthandler: PYTHONFAULTHANDLER=1 * -X tracemalloc=N: PYTHONTRACEMALLOC=n * -X importtime: PYTHONPROFILEIMPORTTIME=1 -- note that the names are different in this case, I don't know why I have a preference for PYTHONDEVMODE=1. If we start to use PYTHONXOPTIONS, users may want to use PYTHONXOPTIONS=tracemalloc, and then we have to decide which environment variable has the preference :-( Moreover, tracemalloc takes an argument, whereas environment variables with a value containing '=' are rare and so likely to cause issues in programs not carefully written to handle such variables. (Environment variables are inherited by all processes, not only Python processes.) ---------- messages: 306618 nosy: ncoghlan, pitrou, vstinner priority: normal severity: normal status: open title: Add PYTHONDEVMODE=1 to enable the developer mode type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:59:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 02:59:15 +0000 Subject: [issue32101] Add PYTHONDEVMODE=1 to enable the developer mode In-Reply-To: <1511233137.85.0.213398074469.issue32101@psf.upfronthosting.co.za> Message-ID: <1511233155.73.0.213398074469.issue32101@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4423 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:59:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 02:59:27 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1511233167.6.0.213398074469.issue32043@psf.upfronthosting.co.za> STINNER Victor added the comment: I created bpo-32101: Add PYTHONDEVMODE=1 to enable the developer mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:59:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 02:59:52 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1511233192.37.0.213398074469.issue32043@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset bc9b6e29cb52f8da15613f9174af2f603131b56d by Victor Stinner in branch 'master': bpo-32043: Rephrase -X dev documentation (#4478) https://github.com/python/cpython/commit/bc9b6e29cb52f8da15613f9174af2f603131b56d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 22:03:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 03:03:29 +0000 Subject: [issue32043] Add a new -X dev option: "developer mode" In-Reply-To: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> Message-ID: <1511233409.39.0.213398074469.issue32043@psf.upfronthosting.co.za> STINNER Victor added the comment: While the discussion is not done, I close this issue to focus on other more specific issues. I completed the documentation and fixed warnings filters (bpo-32089). The option now also enables asyncio debug mode (bpo-32047). It was proposed to add an environment variable to enable the developer mode: see bpo-32101 ("Add PYTHONDEVMODE=1 to enable the developer mode"). Note: I also fixed subprocess._args_from_interpreter_flags: bpo-32094. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 22:05:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 03:05:57 +0000 Subject: [issue32078] string result of str(bytes()) in Python3 In-Reply-To: <1511141176.94.0.213398074469.issue32078@psf.upfronthosting.co.za> Message-ID: <1511233557.03.0.213398074469.issue32078@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm sorry but the bug tracker is not the right place to ask such question. There are plenty of resources on the Internet explaining how to write code compatible with Python 2 and Python 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 22:15:21 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Nov 2017 03:15:21 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511234121.1.0.213398074469.issue32099@psf.upfronthosting.co.za> Raymond Hettinger added the comment: IMO, George Sakkis's original version is better than the TJR's proposed revision which has three separate adjustments by one and adds to extraneous functions which aren't central to the example. Dubslow's alternative at least avoids the three offsets by one; however, it has the disadvantage that meaning of the loop induction variable is somewhat indirect and creates its own source of confusion. I agree that some algorithmic comment should be added, probably just for the last line. Let's not add any of the listed alternative names to the comments. Each one is either confusing or wrong. The word "merge" already has an established, different meaning as in "sort/merge". For example, heapq.merge('ABC', 'D', 'EF') gives ['A', 'B', 'C', 'D', 'E', 'F']. The word "alternate" tends to mean "toggle back-and-forth" in common usage. The term "zip_flat" has no meaning to me, it has no hits on Google, and the closest match is a recipe on StackOverflow that does something different. And "interleave" is not suggestive of looping back over the iterables until each is exhausted. Also, we may yet use interleave() to mean something else. In contrast, "round robin" has a well established meaning that matches what this recipe does. Until now, not a single reader has ever claimed to not know what it means. https://en.wikipedia.org/wiki/Round-robin_scheduling FWIW, the recipe has several benefit. 1) Give a way to implement round robin iteration without re-inventing the wheel, 2) Demonstrate ways to use cycle() and islice(). 3) Demonstrate useful optimization technique of factoring the try/except out of the for-loop, 4) Demonstrate the useful optimization technique of calling bound methods, and 5) Be concise (I've left longer or more complex recipes for the ASPN cookbook or StackOverflow). Ideally, I would prefer to not add two extra builtin lookups (the recipe is sometime used on short inputs which would be affected by the extra overhead). Also, I prefer the visual weight to be on the central message of tight inner loops that exploit itertools rather than having the visual weight shift to the for-loop which is the least important part. Can you a suggest a concise single line comment that would make the last line clearer about what it is doing? Also, I'm open to changing the name of the "pending" variable but think "current_len" and "reduced_len" are not improvements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 22:30:25 2017 From: report at bugs.python.org (Tim Peters) Date: Tue, 21 Nov 2017 03:30:25 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511235025.92.0.213398074469.issue32099@psf.upfronthosting.co.za> Tim Peters added the comment: I agree the current recipe strikes a very nice balance among competing interests, and is educational on several counts. s/pending/numactive/ # Remove the iterator we just exhausted from the cycle. numactive -= 1 nexts = cycle(islice(nexts, numactive)) ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 22:48:22 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 21 Nov 2017 03:48:22 +0000 Subject: [issue32101] Add PYTHONDEVMODE=1 to enable the developer mode In-Reply-To: <1511233137.85.0.213398074469.issue32101@psf.upfronthosting.co.za> Message-ID: <1511236102.26.0.213398074469.issue32101@psf.upfronthosting.co.za> Nick Coghlan added the comment: Another argument against PYTHONXOPTIONS is that each implementation is free to decide which -X options it wants to support, and we don't really define what they're supposed to do with options they don't recognise. By contrast, there's an established behaviour for unknown environment variables: implementations that don't support them just ignore them. So +1 for PYTHONDEVMODE=1 from me - that also gives us more flexibility if we decide to add arguments to the option later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 23:10:49 2017 From: report at bugs.python.org (Steve Dower) Date: Tue, 21 Nov 2017 04:10:49 +0000 Subject: [issue25144] 3.5 Win install fails with "TARGETDIR" In-Reply-To: <1442424932.17.0.0389991499722.issue25144@psf.upfronthosting.co.za> Message-ID: <1511237449.16.0.213398074469.issue25144@psf.upfronthosting.co.za> Steve Dower added the comment: > Got the same issue with the 3.6 installer You've got a different issue, but I can't tell what it is without all of the logs. Can you look in your %TEMP% directory for the file you attached, and then also include those with the same prefix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 23:14:42 2017 From: report at bugs.python.org (Felipe) Date: Tue, 21 Nov 2017 04:14:42 +0000 Subject: [issue25144] 3.5 Win install fails with "TARGETDIR" In-Reply-To: <1442424932.17.0.0389991499722.issue25144@psf.upfronthosting.co.za> Message-ID: <1511237682.81.0.213398074469.issue25144@psf.upfronthosting.co.za> Change by Felipe : ---------- nosy: -fov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 23:17:45 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Nov 2017 04:17:45 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511237865.94.0.213398074469.issue32099@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +4424 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 01:13:47 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 21 Nov 2017 06:13:47 +0000 Subject: [issue32102] Add "capture_output=True" option to subprocess.run Message-ID: <1511244827.04.0.213398074469.issue32102@psf.upfronthosting.co.za> New submission from Nick Coghlan : I'm hesitant to suggest adding yet-another-option to any subprocess API, but I'm thinking it may be worth it in this case. The idea is to make it possible to replace: result = subprocess.run(cmd, stdout=PIPE, stderr=PIPE) with: result = subprocess.run(cmd, capture_output=True) That way, it would be possible for the raw stdin/stdout/stderr parameters to be treated as low level implementation details most of the time, since the most common configurations would be: # Use parent's stdin/stdout/stderr result = subprocess.run(cmd) # Use pipe for stdin, use parent's stdout/stderr result = subprocess.run(cmd, input=data) # Use parent's stdin, use pipe for stdout/stderr result = subprocess.run(cmd, capture_output=True) # Use pipe for stdin/stdout/stderr result = subprocess.run(cmd, input=data, capture_output=True) ---------- messages: 306627 nosy: gregory.p.smith, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add "capture_output=True" option to subprocess.run type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 01:37:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 06:37:27 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511246247.59.0.213398074469.issue32099@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: roundrobin() has quadratic computational complexity. For example list(roundrobin(*([[1]]*N))). Is there a way to make it with linear complexity? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 02:02:00 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Nov 2017 07:02:00 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511247720.83.0.213398074469.issue32099@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Serhiy, I think you're focusing on an irrelevant edge case and reading too much into the recipe. You could create an underlying binary tree with O(n) iteration and O(log n) deletion but then that completely misses the point of the itertools recipes and would likely be pointless in the real-world and likely perform worse than the current recipe in common cases unless you wrote a C extension for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 02:06:13 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Nov 2017 07:06:13 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511247973.85.0.213398074469.issue32099@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- Removed message: https://bugs.python.org/msg306629 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 02:16:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 07:16:56 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511248616.69.0.213398074469.issue32099@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I agree that using binary tree would be excessively here. I just wondering if there is a simple way to get rid of the quadratic complexity. In any case this does not matter much until you work with many hundreds or thousands of iterables. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 02:25:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 07:25:56 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511249156.97.0.213398074469.issue32099@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Actually I tried to test if this implementation can cause a crash due to using deeply nested iterators (like in issue14010). For example in next(roundrobin(*([[]]*N + [[1]]))). But if there is such problem here, roundrobin() becomes unusable due to quadratic time for smaller N (tens of thousands). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 02:35:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 07:35:15 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() In-Reply-To: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> Message-ID: <1511249715.85.0.213398074469.issue32086@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is there a *need* to break existing code? What is the benefit and how large it in comparison with the necessary of rewriting every code that embeds Python (and supporting both ways for long time)? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 02:40:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 07:40:34 +0000 Subject: [issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess() In-Reply-To: <1511222798.09.0.213398074469.issue32098@psf.upfronthosting.co.za> Message-ID: <1511250034.13.0.213398074469.issue32098@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Tests keywords: +easy stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 02:55:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 07:55:34 +0000 Subject: [issue32097] doctest does not consider \r\n a In-Reply-To: <1511218690.8.0.213398074469.issue32097@psf.upfronthosting.co.za> Message-ID: <1511250934.65.0.213398074469.issue32097@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It considers `\r\n` as a blank line. It just doesn't consider `\r\n` as `\n` in a non-blank line. If add `\r` after `some text` the test will pass. Or use NORMALIZE_WHITESPACE. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 03:27:03 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 21 Nov 2017 08:27:03 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511252823.42.0.213398074469.issue32099@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4425 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 04:05:27 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 21 Nov 2017 09:05:27 +0000 Subject: [issue28762] lockf() is available now on Android API level 24, but the F_LOCK macro is not defined In-Reply-To: <1479723589.5.0.525775136475.issue28762@psf.upfronthosting.co.za> Message-ID: <1511255127.59.0.213398074469.issue28762@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4426 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 04:07:00 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 21 Nov 2017 09:07:00 +0000 Subject: [issue28762] lockf() is available now on Android API level 24, but the F_LOCK macro is not defined In-Reply-To: <1479723589.5.0.525775136475.issue28762@psf.upfronthosting.co.za> Message-ID: <1511255220.07.0.213398074469.issue28762@psf.upfronthosting.co.za> Xavier de Gaye added the comment: This change is not needed anymore now that Unified Headers are supported by android-ndk-r14 (see issue 29040) ---------- resolution: fixed -> not a bug stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 05:11:39 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 21 Nov 2017 10:11:39 +0000 Subject: [issue29040] building Android with android-ndk-r14 In-Reply-To: <1482351865.89.0.655034997181.issue29040@psf.upfronthosting.co.za> Message-ID: <1511259099.67.0.213398074469.issue29040@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 06:38:16 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 21 Nov 2017 11:38:16 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511264296.63.0.213398074469.issue32089@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I don't agree with this. You're comparing "-X dev" with a pydebug build of Python, not with a normal Python. Your example shows the problem. If a program calls func() 1000 times in a row, they will show the same warning 1000 times. What does it bring to have the exact same warning (and line number) displayed 1000 times instead of once? Nothing. There is a reason the filter "default" isn't the same as "always", and it's that "always" can be completely overwhelming. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 08:35:16 2017 From: report at bugs.python.org (Jonathan Bastien-Filiatrault) Date: Tue, 21 Nov 2017 13:35:16 +0000 Subject: [issue27535] Memory leaks when opening tons of files In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511271316.29.0.213398074469.issue27535@psf.upfronthosting.co.za> Jonathan Bastien-Filiatrault added the comment: We just got hit by this. We had one specific case where files with unique names were not being closed and Python was leaking a lot of memory over a few days. ---------- nosy: +Jonathan Bastien-Filiatrault _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 08:46:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 13:46:03 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511271963.98.0.213398074469.issue32089@psf.upfronthosting.co.za> STINNER Victor added the comment: > If a program calls func() 1000 times in a row, they will show the same warning 1000 times. What does it bring to have the exact same warning (and line number) displayed 1000 times instead of once? Nothing. There is a reason the filter "default" isn't the same as "always", and it's that "always" can be completely overwhelming. I don't know the rationale of the "always" action rather than "default". The choice was made 7 years ago, when Georg Brandl implemented the new ResourceWarning category: commit 08be72d0aa0112118b79d271479598c218adfd23. The problem of ResourceWarning is that the warning logs where the last reference to the resource was cleared, or where the a garbage collection was triggered. Multiple resources can be created from different places, but all "die" at the same place. In Python 3.6, I enhanced ResourceWarning to log also the traceback where the leaked resource has been created, if the tracemalloc is tracing memory allocations. When tracemalloc is used, it's useful to log ResourceWarning multiple times even if the warning itself is logged multipletimes. Well, that's an unusual usage of the ResourceWarning, we can also suggest to use -W always::ResourceWarning in that case. > I don't agree with this. You're comparing "-X dev" with a pydebug build of Python, not with a normal Python. In general, I would like to offer the same experience in "development mode" (-X dev) and with a pydebug build. For ResourceWarning, your rationale only concerns pydebug build, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 08:50:47 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 21 Nov 2017 13:50:47 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511271963.98.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: Antoine Pitrou added the comment: Le 21/11/2017 ? 14:46, STINNER Victor a ?crit?: > > I don't know the rationale of the "always" action rather than "default". Neither do I. But I don't think it matters a lot. pydebug builds are almost only used by Python core developers. "developer mode" is target at every Python developer. > The problem of ResourceWarning is that the warning logs where the last reference to the resource was cleared, or where the a garbage collection was triggered. Multiple resources can be created from different places, but all "die" at the same place. If they have different names, they will be logged separately. >>> def f(fname): ... open(fname) ... >>> f('setup.py') __main__:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='setup.py' mode='r' encoding='UTF-8'> >>> f('setup.py') >>> f('LICENSE.txt') __main__:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='LICENSE.txt' mode='r' encoding='UTF-8'> >>> f('LICENSE.txt') >>> > For ResourceWarning, your rationale only concerns pydebug build, no? Why? I'm talking about "-X dev", not pydebug builds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 08:51:47 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 21 Nov 2017 13:51:47 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511272307.53.0.213398074469.issue32089@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I forgot: the snippet above was made with "python -Wdefault::ResourceWarning". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:01:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 14:01:17 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511272877.3.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: I created a list of all test cases using: ./python -m test --list-cases > all_cases The list contains 29,569 test cases. Sadly, the set().__contains__ matcher of my PR 4421 cannot be taken because test_json produces two test cases called "json". IMHO it's a bug in test_json, all test identifiers should be "fully qualified". test_builtin has a similar issue: it produces identifiers like "builtins.bin" instead of "test.test_builtin.builtins.bin". If I removed the two "json" from all_cases, "./python -u -m test.bisect -i all_cases -v" takes less than one second before running the first test method, and so it's fast enough. With PR 4420, it takes around 17 seconds before running the first test. The compilation of the giant regex and matching test identifiers are slow. My PR has the same bad performance when the regex path is taken. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:09:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 14:09:56 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511273396.72.0.213398074469.issue32089@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See also issue27535. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:13:55 2017 From: report at bugs.python.org (Carl) Date: Tue, 21 Nov 2017 14:13:55 +0000 Subject: [issue32103] Inconsistent text at TypeError in concatenation Message-ID: <1511273635.4.0.213398074469.issue32103@psf.upfronthosting.co.za> New submission from Carl : >>> a = b"jan" >>> b = "jan" >>> a+b Traceback (most recent call last): File "", line 1, in TypeError: can't concat str to bytes >>> b+a Traceback (most recent call last): File "", line 1, in TypeError: must be str, not bytes >>> IMHO The latter TypeError text should be "TypeError: can't concat bytes to str" ---------- components: Interpreter Core messages: 306642 nosy: wolfc01 priority: normal severity: normal status: open title: Inconsistent text at TypeError in concatenation type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:25:37 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 14:25:37 +0000 Subject: [issue32102] Add "capture_output=True" option to subprocess.run In-Reply-To: <1511244827.04.0.213398074469.issue32102@psf.upfronthosting.co.za> Message-ID: <1511274337.99.0.213398074469.issue32102@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Yeah, I find it pretty common to set both stdout and stderr to PIPE, but I'm with you in hesitating to add YAO to the subprocess API. If you do move forward with this though, I think capture_output would have to be mutually exclusive to stdout and stderr. You should not be allowed to provide either of the latter two if the former is given. ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:44:12 2017 From: report at bugs.python.org (Oleg K) Date: Tue, 21 Nov 2017 14:44:12 +0000 Subject: [issue32104] add method throw() to asyncio.Task Message-ID: <1511275452.66.0.213398074469.issue32104@psf.upfronthosting.co.za> New submission from Oleg K : currently there is no other way to interrupt task but to call cancel() which will: "This arranges for a CancelledError to be thrown into the wrapped coroutine on the next cycle through the event loop." in order to write advanced Tasks there should be a way to throw custom exceptions into active Task. so it can react accordingly. i am looking for the same thing as "generator.throw()" is providing, allowing to interrupt generators different way. ---------- components: asyncio messages: 306644 nosy: Oleg K2, yselivanov priority: normal severity: normal status: open title: add method throw() to asyncio.Task type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:46:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 14:46:11 +0000 Subject: [issue27535] Memory leaks when opening tons of files In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511275571.33.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: The problem is not the function displaying the warning, but warnings registries (__warningregistry__) no? The behaviour depends on the action of the filter matching the ResourceWarning warning: * always: don't touch the registry => no leak * ignore: add the key to registry => leak! * another action: add the key to registry => leak! The key is the tuple (text, category, lineno). I understand why always doesn't touch the registry. But why does "ignore" action touch the registry? Not only the user will not see the message, but the memory will slowly grow in the background. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:48:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 14:48:10 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511275690.94.0.213398074469.issue32089@psf.upfronthosting.co.za> STINNER Victor added the comment: Antoine: > If they have different names, they will be logged separately. Oh wow, nice behaviour, I like it :-) Antoine: >> For ResourceWarning, your rationale only concerns pydebug build, no? > Why? I'm talking about "-X dev", not pydebug builds. Oops sorry, typo (brain error), I mean: "also concerns". Serhiy: > See also issue27535. Oh, not leaking memory in warnings registies is a nice side effect of the "always" action :-) -- It's much more complicated than what I expected to get the "correct behaviour" for warnings :-/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:03:47 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 21 Nov 2017 15:03:47 +0000 Subject: [issue32104] add method throw() to asyncio.Task In-Reply-To: <1511275452.66.0.213398074469.issue32104@psf.upfronthosting.co.za> Message-ID: <1511276627.86.0.213398074469.issue32104@psf.upfronthosting.co.za> Yury Selivanov added the comment: > in order to write advanced Tasks there should be a way > to throw custom exceptions into active Task. > so it can react accordingly. What is an "advanced" task? Why CancelledError is not enough? What's the actual use case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:09:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:09:14 +0000 Subject: [issue27535] Memory leaks when opening tons of files In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511276954.44.0.213398074469.issue27535@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4427 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:15:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:15:14 +0000 Subject: [issue27535] Memory leaks when opening tons of files In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511277314.7.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: I created PR 4489 to fix the memory leak for the "ignore "action". IMHO it's interesting to modify the "ignore" action because Python uses ignore many warnings by default: haypo at selma$ python3 -c 'import pprint, warnings; pprint.pprint(warnings.filters)' [('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0)] I created memory2.py (based on attached memory.py) to measure the leak. Currently, the "always" action doesn't leak, but "ignore" and "default" actions leak: haypo at selma$ ./python -W always memory2.py Memory peak grow: +3.2 kB Warning filters: [('always', re.compile('', re.IGNORECASE), , re.compile(''), 0), ('ignore', None, , None, 0), ('always', None, , None, 0)] haypo at selma$ ./python -W ignore memory2.py Memory peak grow: +26692.3 kB Warning filters: [('ignore', re.compile('', re.IGNORECASE), , re.compile(''), 0), ('ignore', None, , None, 0), ('always', None, , None, 0)] haypo at selma$ ./python -W default memory2.py Memory peak grow: +26693.2 kB Warning filters: [('default', re.compile('', re.IGNORECASE), , re.compile(''), 0), ('ignore', None, , None, 0), ('always', None, , None, 0)] With my PR 4489, the "ignore" action doesn't leak anymore: haypo at selma$ ./python -W ignore memory2.py Memory peak grow: +2.4 kB Warning filters: [('ignore', re.compile('', re.IGNORECASE), , re.compile(''), 0), ('ignore', None, , None, 0), ('always', None, , None, 0)] ---------- Added file: https://bugs.python.org/file47281/memory2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:17:45 2017 From: report at bugs.python.org (Jonathan Bastien-Filiatrault) Date: Tue, 21 Nov 2017 15:17:45 +0000 Subject: [issue27535] Memory leaks when opening tons of files In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511277465.76.0.213398074469.issue27535@psf.upfronthosting.co.za> Jonathan Bastien-Filiatrault added the comment: @vstinner Yes, from what I saw, the leak was from the registry / deduplication logic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:24:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:24:40 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511277880.91.0.213398074469.issue27535@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: Memory leaks when opening tons of files -> Ignored ResourceWarning warnings leak memory in warnings registries _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:25:13 2017 From: report at bugs.python.org (Thomas Eldon Allred) Date: Tue, 21 Nov 2017 15:25:13 +0000 Subject: [issue32105] Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation Message-ID: <1511277913.62.0.213398074469.issue32105@psf.upfronthosting.co.za> New submission from Thomas Eldon Allred : asyncio.BaseEventLoop.connect_accepted_socket was added in v3.5.3 Please add a note to the documentation. ---------- assignee: docs at python components: Documentation messages: 306650 nosy: Thomas Eldon Allred, docs at python priority: normal severity: normal status: open title: Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:28:16 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 15:28:16 +0000 Subject: [issue31672] string.Template should use re.ASCII flag In-Reply-To: <1507029340.05.0.213398074469.issue31672@psf.upfronthosting.co.za> Message-ID: <1511278096.83.0.213398074469.issue31672@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: New changeset e256b408889eba867e1d90e5e1a0904843256255 by Barry Warsaw in branch 'master': bpo-31672 - Add one last minor clarification for idpattern (#4483) https://github.com/python/cpython/commit/e256b408889eba867e1d90e5e1a0904843256255 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:28:31 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 15:28:31 +0000 Subject: [issue31672] string.Template should use re.ASCII flag In-Reply-To: <1507029340.05.0.213398074469.issue31672@psf.upfronthosting.co.za> Message-ID: <1511278111.89.0.213398074469.issue31672@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:31:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:31:14 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511278274.93.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: > The best way to fix this is excluding file name from warning message. As a result, the message for every file will be the same and warnings registry will not grow. Your warning comes from the io module which uses the message: "unclosed file %r" % file. I dislike the idea of removing the filename from this warning message, since the filename is very useful to identify where the bug comes from. Different things are discussed here: * First of all, if an application is correctly written, ResourceWarning is not emitted, and so Python doesn't leak memory * Using the "always" action, ResourceWarning doesn't leak neither. * Using a different action like "default", ResourceWarning does leak memory in hidden warning registries. While I don't see how we can avoid "leaking memory" (growing the registry) for actions like "once", I think that it's ok to don't touch the registry for the "ignore" action. So at least, an application ignoring ResourceWarning will not leak anymore. But it will still "leak" when you display ResourceWarning warnings with an action different than "always". In this case, IMHO the root issue is more the code which doesn't close the resource, than Python itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:33:10 2017 From: report at bugs.python.org (Decorater) Date: Tue, 21 Nov 2017 15:33:10 +0000 Subject: [issue32105] Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation In-Reply-To: <1511277913.62.0.213398074469.issue32105@psf.upfronthosting.co.za> Message-ID: <1511278390.47.0.213398074469.issue32105@psf.upfronthosting.co.za> Decorater added the comment: Will see whhat I can do. ---------- nosy: +Decorater _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:46:14 2017 From: report at bugs.python.org (Eric Snow) Date: Tue, 21 Nov 2017 15:46:14 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511279174.05.0.213398074469.issue32096@psf.upfronthosting.co.za> Eric Snow added the comment: I see at least 3 ways to sort this out: 1. partially revert the _PyRuntime change, sort of temporarily ("revert the change on memory allocators, and retry later to fix it, once other initializations issues are fixed", as suggested by Victor in the email thread) 2. statically initialize the "raw" allocator with defaults, enough to make PyMem_RawMalloc() and PyMem_RawFree() work pre-init (this is what my PR does) 3. use hard-coded defaults in PyMem_RawMalloc() and PyMem_RawFree() if the runtime has not been initialized yet I considered implementing #3 instead, but wasn't sure about the performance impact. It would add a pointer comparison to NULL and a branch on each PyMem_RawMalloc() and PyMem_RawFree() call. I'm not convinved it would make much of a difference. Furthermore, I consider #3 to be the simplest solution, both to implement and to maintain, so I'll probably try it out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:47:39 2017 From: report at bugs.python.org (Eric Snow) Date: Tue, 21 Nov 2017 15:47:39 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511279259.56.0.213398074469.issue32096@psf.upfronthosting.co.za> Eric Snow added the comment: I thought issue #32086 was about documentation (which is worth having a separate issue for), not about a fix to the regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:48:37 2017 From: report at bugs.python.org (Decorater) Date: Tue, 21 Nov 2017 15:48:37 +0000 Subject: [issue32105] Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation In-Reply-To: <1511277913.62.0.213398074469.issue32105@psf.upfronthosting.co.za> Message-ID: <1511279317.49.0.213398074469.issue32105@psf.upfronthosting.co.za> Change by Decorater : ---------- keywords: +patch pull_requests: +4428 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:48:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:48:54 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511279334.68.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: "3. use hard-coded defaults in PyMem_RawMalloc() and PyMem_RawFree() if the runtime has not been initialized yet" I dislike this option since it can have a negative impact on performances. The PEP 445 already added a new level of indirection and so made memory allocations a little bit slower. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:49:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:49:51 +0000 Subject: [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() In-Reply-To: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> Message-ID: <1511279391.93.0.213398074469.issue32086@psf.upfronthosting.co.za> STINNER Victor added the comment: I mark this issue as a duplicate of bpo-32096. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Py_DecodeLocale() fails if used before the runtime is initialized. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:50:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:50:27 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511279427.48.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: I marked bpo-32096 as a duplicate of this one. I don't want to discuss the same issue in 3 places (2 bpo and python-dev). ---------- superseder: C API: Clarify which C functions are safe to be called before Py_Initialize() -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:52:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:52:10 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511279530.49.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: Nick: "Should we deprecate our implied support for calling Py_DecodeLocale() before calling Py_Initialize()?" Please don't do that. Py_DecodeLocale() is the best available function to decode paths and environment variables to initialize Python. The implementation of Py_DecodeLocale() is very complex, but we need this complexity to decode "correctly" OS data. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:53:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:53:24 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511279604.69.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: > 2. statically initialize the "raw" allocator with defaults, enough > to make PyMem_RawMalloc() and PyMem_RawFree() work pre-init (this > is what my PR does) As I explained, the code to initialize PyMem_Raw allocator is complex and I would really prefer to only initialize it "partially" to prevent bad surprises. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:54:01 2017 From: report at bugs.python.org (Jonathan Bastien-Filiatrault) Date: Tue, 21 Nov 2017 15:54:01 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511279641.2.0.213398074469.issue27535@psf.upfronthosting.co.za> Jonathan Bastien-Filiatrault added the comment: > But it will still "leak" when you display ResourceWarning warnings with an action different than "always". In this case, IMHO the root issue is more the code which doesn't close the resource, than Python itself. Not closing a file is a bug, but under normal circumstances it causes no leak by itself. The fact that the warnings module leaks in this case seems a problem. Had I logged warnings correctly, I would have found the bug by looking at the application log rather than by investigating the cause of the OOM killer invocation. IMHO, the warnings module should have upper bounds on memory consumption to avoid DOSing itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:56:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 15:56:05 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511279765.54.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: IMHO for the long term, the best would be to have a structure for pre-Py_Initialize configuration, maybe _PyCoreConfig, and pass it to functions that can be called before Py_Initialize(). For example, I'm working on a variant of Py_GetPath() which accepts a _PyCoreConfig to be able to pass the value of the PYTHONPATH environment variable. That's a more complex solution, so I proposed to first revert, to have more time to design the "correct API". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:03:30 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 21 Nov 2017 16:03:30 +0000 Subject: [issue29040] building Android with android-ndk-r14 In-Reply-To: <1482351865.89.0.655034997181.issue29040@psf.upfronthosting.co.za> Message-ID: <1511280210.24.0.213398074469.issue29040@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +4429 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:06:29 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 21 Nov 2017 16:06:29 +0000 Subject: [issue32105] Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation In-Reply-To: <1511277913.62.0.213398074469.issue32105@psf.upfronthosting.co.za> Message-ID: <1511280389.01.0.213398074469.issue32105@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset 431665bf1971e66c51f59abf0693f700ff7919e8 by Yury Selivanov (AraHaan) in branch 'master': bpo-32105: add asyncio.BaseEventLoop.connect_accepted_socket versionadded to documentation. (#4491) https://github.com/python/cpython/commit/431665bf1971e66c51f59abf0693f700ff7919e8 ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:06:42 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 21 Nov 2017 16:06:42 +0000 Subject: [issue32105] Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation In-Reply-To: <1511277913.62.0.213398074469.issue32105@psf.upfronthosting.co.za> Message-ID: <1511280402.18.0.213398074469.issue32105@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4430 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:08:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 16:08:14 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511280494.01.0.213398074469.issue27535@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > While I don't see how we can avoid "leaking memory" (growing the registry) for actions like "once", I think that it's ok to don't touch the registry for the "ignore" action. So at least, an application ignoring ResourceWarning will not leak anymore. This is a caching for speed. If the same line of code emits the same warning, it is enough to tests the registry and don't apply all warning filters. I think we should find better compromise between performance if all messages equal and memory usage if all messages are different. Since caching for the "ignore" action affects only performance, not semantic, we could check whether there are too much warnings for the "ignore" action are cached in the same line. The problem is how to make this effectively. And what is "too much". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:16:42 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 21 Nov 2017 16:16:42 +0000 Subject: [issue32105] Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation In-Reply-To: <1511277913.62.0.213398074469.issue32105@psf.upfronthosting.co.za> Message-ID: <1511281002.85.0.213398074469.issue32105@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset d7ed48c2b8c11bb99da3661e8fe0bf5ae7f6b8d7 by Yury Selivanov (Miss Islington (bot)) in branch '3.6': bpo-32105: add asyncio.BaseEventLoop.connect_accepted_socket versionadded to documentation. (GH-4491) (#4493) https://github.com/python/cpython/commit/d7ed48c2b8c11bb99da3661e8fe0bf5ae7f6b8d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:16:54 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 21 Nov 2017 16:16:54 +0000 Subject: [issue32105] Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation In-Reply-To: <1511277913.62.0.213398074469.issue32105@psf.upfronthosting.co.za> Message-ID: <1511281014.26.0.213398074469.issue32105@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:22:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 16:22:07 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511281327.55.0.213398074469.issue31324@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: We could split patterns on two parts and create both matchers. Then the final matching function could look like: return _match_test_patterns is None or test_id in id_set or regex_match(test_id) or any(map(regex_match, test_id.split("."))) I don't know whether it is worth to do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:34:58 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 21 Nov 2017 16:34:58 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511282098.82.0.213398074469.issue32100@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Error is printed in console window if IDLE started from one. >>> import idlelib.idle # Select pathbrowser in File menu Exception in Tkinter callback Traceback (most recent call last): File "F:\dev\3x\lib\tkinter\__init__.py", line 1699, in __call__ return self.func(*args) File "F:\dev\3x\lib\idlelib\editor.py", line 671, in open_path_browser pathbrowser.PathBrowser(self.flist) File "F:\dev\3x\lib\idlelib\pathbrowser.py", line 18, in __init__ self.init(flist) TypeError: init() takes 1 positional argument but 2 were given ---------- type: crash -> behavior versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 11:57:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 16:57:58 +0000 Subject: [issue32103] Inconsistent text at TypeError in concatenation In-Reply-To: <1511273635.4.0.213398074469.issue32103@psf.upfronthosting.co.za> Message-ID: <1511283478.1.0.213398074469.issue32103@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a duplicate of issue29116. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Make str and bytes error messages on concatenation conform with other sequences _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:00:24 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 21 Nov 2017 17:00:24 +0000 Subject: [issue28562] test_asyncio fails on Android upon calling getaddrinfo() In-Reply-To: <1477846363.43.0.193615088108.issue28562@psf.upfronthosting.co.za> Message-ID: <1511283624.78.0.213398074469.issue28562@psf.upfronthosting.co.za> Xavier de Gaye added the comment: test_create_connection_service_name does not fail on android-24-x86_64. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:04:18 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Nov 2017 17:04:18 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511283858.52.0.213398074469.issue32099@psf.upfronthosting.co.za> Raymond Hettinger added the comment: While we're on the topic, I had some thought of also adding a similar recipe to https://docs.python.org/3/library/collections.html#deque-recipes . The alternative recipe is slower is common cases but doesn't degrade when there are a huge number of iterables: def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" nexts = deque(iter(it).__next__ for it in iterables) while nexts: try: while True: yield nexts[0]() nexts.rotate(-1) except StopIteration: nexts.popleft() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:04:45 2017 From: report at bugs.python.org (Decorater) Date: Tue, 21 Nov 2017 17:04:45 +0000 Subject: [issue32106] Move sysmodule.c to Modules? Message-ID: <1511283885.9.0.213398074469.issue32106@psf.upfronthosting.co.za> New submission from Decorater : After looking in the folder Python sysmodule.c is in there instead of in Modules. I am wondering if it has any reason to be in that folder instead of in Modules/* with the other builtin modules in python. If not I think it is best to move it so that way it is easier to find for those who think sysmodule is in the Modules folder because it is an builtin module. ---------- messages: 306671 nosy: Decorater priority: normal severity: normal status: open title: Move sysmodule.c to Modules? versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:06:32 2017 From: report at bugs.python.org (Decorater) Date: Tue, 21 Nov 2017 17:06:32 +0000 Subject: [issue32106] Move sysmodule.c to Modules? In-Reply-To: <1511283885.9.0.213398074469.issue32106@psf.upfronthosting.co.za> Message-ID: <1511283992.32.0.213398074469.issue32106@psf.upfronthosting.co.za> Change by Decorater : ---------- components: +Interpreter Core, Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:10:23 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 17:10:23 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask Message-ID: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : The check_node() function in test_uuid.py uses the wrong bitmask, causing the tests to fail on valid MAC addresses. Also, the description in the comment is incorrect. From my reading of the wikipedia page, the test is trying to ensure that the MAC address is "universally administered", which is designated by a zero value in "the second least significant digit of the first octet". Thus the bitmask value *and* the comment are both wrong AFAICT, given that the original value is: % ./python.exe -c "from math import log2; print(log2(0x010000000000))" 40.0 I have a fix that passes on my machine, so I'll PR that and see if it passes on CI. ---------- assignee: barry components: Tests messages: 306672 nosy: barry priority: normal severity: normal status: open title: test_uuid uses the incorrect bitmask versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:11:55 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 17:11:55 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511284315.95.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- keywords: +patch pull_requests: +4431 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:28:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 17:28:56 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511285336.42.0.213398074469.issue32099@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Today I have published a similar recipe on Python-Ideas. It uses popleft/append instead of __getitem__/rotate. def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" nexts = deque(iter(it).__next__ for it in iterables) popleft = nexts.popleft append = nexts.append while nexts: next = popleft() try: yield next() except StopIteration: pass else: append(next) It is faster (10-25%) in all microbenchmarks that I did (Steven's benchmarks for small number of iterables and my examples for large number of iterables). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:43:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 17:43:34 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511286214.45.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm just wondering why tests were passing successfully before. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:46:10 2017 From: report at bugs.python.org (Simon Lambourn) Date: Tue, 21 Nov 2017 17:46:10 +0000 Subject: [issue32108] configparser bug: section is emptied if you assign a section to itself Message-ID: <1511286370.98.0.213398074469.issue32108@psf.upfronthosting.co.za> New submission from Simon Lambourn : If you assign a ConfigParser section back to the parent ConfigParser object (say after updating the section), the section is emptied. (I realise now that you don't need to assign the section back to the parent as it's a proxy for the section in the parent already - but still it does not behave as you would expect): code: from configparser import ConfigParser config = ConfigParser() config['test'] = {'key': 'value'} section = config['test'] section['key'] = 'different' print("before: config['test'] is %s" % dict(config['test'])) config['test'] = section print("after: config['test'] is %s" % dict(config['test'])) # the section is now printed as {} ---------- components: Library (Lib) messages: 306675 nosy: simonltwick priority: normal severity: normal status: open title: configparser bug: section is emptied if you assign a section to itself type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 13:43:15 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 21 Nov 2017 18:43:15 +0000 Subject: [issue32108] configparser bug: section is emptied if you assign a section to itself In-Reply-To: <1511286370.98.0.213398074469.issue32108@psf.upfronthosting.co.za> Message-ID: <1511289795.69.0.213398074469.issue32108@psf.upfronthosting.co.za> Change by R. David Murray : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 13:46:00 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 21 Nov 2017 18:46:00 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511289960.9.0.213398074469.issue32100@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The issue is this: 1. PathBrowser subclasses ModuleBrowser. 2. ModuleBrowser.init() has the common code for initializing both. 3. #31460 changed the signature of ModuleBrowser.__init__ *and* .init. 4. I must not have tested pathbrowser after the .init change. Bad. 5. test_pathbrowser needs a new gui test class that at least calls PathBrowser.__init__, which will call ModuleBrowser.init 3.6.3 is OK, 3.7.0a2 has this bug. 3.7.0a3 is due 11/27. Patch should be merged before this with or without new unittests. --- Module items can be expanded either by clicking [+] or double-clicking. The latter also opens the file so that lines can be highlighted. I have thought about disabling both, and opening a module browser instead, but I can see the usefulness of expanding several files one level deep to get an overview of parts or all of a package. On the other hand, we might have double-click open both the module and a module browser. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 14:03:57 2017 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 21 Nov 2017 19:03:57 +0000 Subject: [issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own. In-Reply-To: <1498813368.34.0.349011380575.issue30811@psf.upfronthosting.co.za> Message-ID: <1511291037.04.0.213398074469.issue30811@psf.upfronthosting.co.za> Vinay Sajip added the comment: Can you explain why virtualenv and venv need to be mixed in this way, other than as an academic exercise? If you use -m venv for both inner and outer venvs, then it seems to work as expected. I'm planning to close this as "not a bug" unless you can provide a reason why this use case needs to be supported. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 14:16:18 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 19:16:18 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511291778.45.0.213398074469.issue32107@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Pure chance I believe. It all depends on the MAC address of the machines the test runs on (which is perhaps an unacceptable environmental variability in the test suite, and should be fixed/mocked?). FWIW, I saw the failures on my 2017 MacBook Pro, where the MAC address did have that bit set on two of its interfaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 14:28:49 2017 From: report at bugs.python.org (Antony Lee) Date: Tue, 21 Nov 2017 19:28:49 +0000 Subject: [issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own. In-Reply-To: <1498813368.34.0.349011380575.issue30811@psf.upfronthosting.co.za> Message-ID: <1511292529.43.0.213398074469.issue30811@psf.upfronthosting.co.za> Antony Lee added the comment: Travis uses virtualenvs as toplevel containers for running CI. Some projects need (or would like to) set up venvs as part of their test suites. On example is https://github.com/airspeed-velocity/asv, which profiles a project's speed across revisions; in order to do so it sets up an environment for each revision to run the test suite. Currently, it can either set up a virtualenv or a conda env, but it would make sense for it to be able to set up a venv too (https://github.com/airspeed-velocity/asv/pull/526). But the unability to nest a venv into a virtualenv makes this impossible to test on Travis. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 14:35:04 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 21 Nov 2017 19:35:04 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511292904.25.0.213398074469.issue32099@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Really, I don't give a whit about the micro-benchmarks -- that completely misses the point. The recipes are primarily intended to have educational value on ways to use itertools, deques, and whatnot. For itertools, I'm satisfied with new variable name and the additional comment. For collections, there is an open question about whether adding an extra example would make users better off. Beyond that, I have little interest is exploring all the little variants or wasting further time on this (that is what ASPN, StackOverflow, and blog posts are for). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 14:39:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 19:39:49 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511293189.54.0.213398074469.issue32099@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: But why use less efficient code? Is my code worse? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 14:48:30 2017 From: report at bugs.python.org (Eric Snow) Date: Tue, 21 Nov 2017 19:48:30 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511293710.83.0.213398074469.issue32096@psf.upfronthosting.co.za> Change by Eric Snow : ---------- pull_requests: +4432 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 15:05:44 2017 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 21 Nov 2017 20:05:44 +0000 Subject: [issue32108] configparser bug: section is emptied if you assign a section to itself In-Reply-To: <1511286370.98.0.213398074469.issue32108@psf.upfronthosting.co.za> Message-ID: <1511294744.79.0.213398074469.issue32108@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Confirmed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 15:12:07 2017 From: report at bugs.python.org (Zachary Ware) Date: Tue, 21 Nov 2017 20:12:07 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511295127.49.0.213398074469.issue30855@psf.upfronthosting.co.za> Zachary Ware added the comment: If you'd like to do that update, there are some instructions at https://github.com/python/cpython-source-deps. You can get AppVeyor to use dependencies from your fork of `cpython-source-deps` by adjusting 2.7/PCbuild/get_externals.bat:32 to point to your username temporarily. If you don't want to mess with it, I'll get to it sooner or later :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 15:24:55 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 20:24:55 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511295895.74.0.213398074469.issue32107@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Yikes. It's entirely possible that these tests are tainted by environmental leakage. I was looking into why Travis fails on my PR: https://travis-ci.org/python/cpython/jobs/305433725 and stepping through _ifconfig_getnode() on my Mac. The "ibridge" interface is getting returned, which has a MAC address of: >>> from uuid import _ifconfig_getnode >>> mac = _ifconfig_getnode() >>> hex(mac) '0xacde48001122' That's for the en5 interface, which according to this article is the bridge to the Touch Bar, and *the same on every Mac*. https://discussions.apple.com/thread/7763102?start=0&tstart=0 Why I think that's problematic for this particular test is that whatever gets returned is going to be highly dependent on the hardware the test is run on, and it's entirely possible that the MAC address returned is indeed locally administered and not tied to a physical external (and thus required to be universally administered) MAC address. Mocking _ifconfig_*() probably isn't a good idea because these tests are worthless that way. But it's also true that the _ifconfig_*() methods can match unexpected interfaces which cause the test to fail incorrectly. It's a mess, and I'm not sure what to do about it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 15:47:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 20:47:24 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511297244.45.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If your fix is correct (and it looks correct to me), we should fix not only the test, but, first of all, the _*_getnode functions. Perhaps they should ignore locally administered MAC addresses and continue searching better variants or fall back to other method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 15:55:00 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 20:55:00 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511297244.45.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <8E98E5AD-D2B4-4E7B-9EF6-EAF48300A680@python.org> Barry A. Warsaw added the comment: On Nov 21, 2017, at 15:47, Serhiy Storchaka wrote: > If your fix is correct (and it looks correct to me), we should fix not only the test, but, first of all, the _*_getnode functions. Perhaps they should ignore locally administered MAC addresses and continue searching better variants or fall back to other method. I think it does make sense to ignore locally administered MACs from _getnode() and friends. E.g. there?s no use in returning the interface for the Touch Bar bridge :) I don?t have time right now to elaborate on that, but I?ll work on improving the PR with that change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 15:55:04 2017 From: report at bugs.python.org (Jonas H.) Date: Tue, 21 Nov 2017 20:55:04 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511297704.66.0.213398074469.issue32071@psf.upfronthosting.co.za> Jonas H. added the comment: Interesting, Victor. I've had a look at the code you mentioned, but I'm afraid it doesn't really make sense to re-use any of the code. Here's a new patch, implemented in the loader as suggested by Antoine, and with tests. I'm happy to write documentation etc. once we're through with code review. https://github.com/python/cpython/pull/4496 ---------- keywords: +patch pull_requests: +4433 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 16:01:54 2017 From: report at bugs.python.org (Zachary Ware) Date: Tue, 21 Nov 2017 21:01:54 +0000 Subject: [issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails In-Reply-To: <1511210284.67.0.213398074469.issue32095@psf.upfronthosting.co.za> Message-ID: <1511298114.84.0.213398074469.issue32095@psf.upfronthosting.co.za> Zachary Ware added the comment: You removed me from the nosy list, so I didn't see your reply until now when I happened to refresh the tab that happened to still be open :) The warning I was talking about in that message was a warning that libffi was found but is outdated, which wouldn't be any help to you here. There are already messages in the build log about libffi being missing and/or _ctypes not being built. We do still bundle libffi for OSX and Windows, but we're trying to remove them. I definitely don't want to add another bundled version. You already have some install dependencies, or are missing some optional modules. In particular, the lzma module depends on the xz package, readline depends on libreadline, _ssl depends on OpenSSL, _bz2 depends on bzip2, etc. There is a message at the end of `make` about which modules were not built and why. Another workaround you could use (at the expense of not having pip installed) is to configure with `./configure --without-ensurepip`. Finally, since we've nailed down that lack of libffi was in fact the source of the problem, this is a duplicate of #31652. ---------- nosy: +zach.ware resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> make install fails: no module _ctypes versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 16:06:16 2017 From: report at bugs.python.org (Eric Snow) Date: Tue, 21 Nov 2017 21:06:16 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511298376.61.0.213398074469.issue32096@psf.upfronthosting.co.za> Eric Snow added the comment: > IMHO for the long term, the best would be to have a structure for > pre-Py_Initialize configuration, maybe _PyCoreConfig, and pass it > to functions that can be called before Py_Initialize(). +1 As an alternative to that, we could also deprecate using any of those functions before initializing the runtime. Instead of calling them, you would set the relevant info on the runtime "config" struct that you pass to the replacement for PyInitialize(). At that point we would not need some of those functions any longer and we could remove them (eventually, once backward-compatibility is resolved). Given that the community of CPython embedders is relatively small, we're still in a position to iron this out Regardless, I see where you're coming from. I'm okay with reverting the Object/obmalloc.c parts, but, like I said, I'd rather avoid it if possible. Solution #2 (that I listed above), AKA PR #4481, is focused and effective. Unfortunately, it feels like a bit like a hack to me, though it is a well-contained hack. So I'm not convinced it's the best solution. However, I like it as much as I like reverting the allocators. Solution #3, AKA PR #4495, is nice and clean, but potentially adds a little overhead to all PyMem_RawMalloc() and PyMem_RawFree() calls. All the other PyMem_* functions are unaffected, so perhaps the overall impact is not significant enough to worry. >> 2. statically initialize the "raw" allocator with defaults, enough >> to make PyMem_RawMalloc() and PyMem_RawFree() work pre-init (this >> is what my PR does) > > As I explained, the code to initialize PyMem_Raw allocator is complex > and I would really prefer to only initialize it "partially" to prevent > bad surprises. The surprises would only be pre-initialization, right? After the runtime is initialized, the allocators are in the proper fully-initialized state. So it mostly boils down to what parts of the C-API embedders can use before initialization and how those functions interact with the raw memory allocator. Those constraints narrow down the scope of potential problems to a manageable size (I won't say small, but it feels that way). Ultimately, I favor solution #3 if we can see that it does not impact performance. If we can't come to an agreement in a timely fashion then I'll go along with #1 (revert), so that we don't leave the embedding story broken. If we go that route, do you think we could resolve the initialization issues within the 3.7 timeframe? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 16:21:14 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 21 Nov 2017 21:21:14 +0000 Subject: [issue32106] Move sysmodule.c to Modules? In-Reply-To: <1511283885.9.0.213398074469.issue32106@psf.upfronthosting.co.za> Message-ID: <1511299274.26.0.213398074469.issue32106@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The builtins and sys modules are special as they are directly initialized at interpreter startup. They are parts of the interpreter core and this is why they are in the Python directory. ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 16:51:51 2017 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 21 Nov 2017 21:51:51 +0000 Subject: [issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own. In-Reply-To: <1498813368.34.0.349011380575.issue30811@psf.upfronthosting.co.za> Message-ID: <1511301111.28.0.213398074469.issue30811@psf.upfronthosting.co.za> Vinay Sajip added the comment: The problem for venv is that it's tied to the running interpreter, which is (in the case you mention) the one from the outer virtualenv. Unlike virtualenv, venv does not provide a mechanism to restart itself with a different Python interpreter. I don't know how Conda works in detail, but virtualenv makes copies of parts of the stdlib; venv, on the other hand, doesn't, but keeps a reference to its original Python environment. That is, I think, the reason for the difference in behaviour. Instead of just using 'python' to invoke the command which runs the "-mvenv", you could get the underlying Python and create the venv using that. For example, using this script "upvenv.py": #!/usr/bin/env python def make_venv(venvpath): import os import subprocess import sysconfig python = os.path.join(sysconfig.get_config_var('BINDIR'), 'python3') cmd = [python, '-mvenv', venvpath] subprocess.run(cmd) if __name__ == '__main__': import sys assert len(sys.argv) == 2 try: rc = make_venv(sys.argv[1]) except Exception as e: print('Failed: %s' % e) rc = 1 sys.exit(rc) I get: vinay at ubuntu:/tmp$ cd /tmp vinay at ubuntu:/tmp$ ve15 --version 15.1.0 vinay at ubuntu:/tmp$ ve15 -p python3 outer Running virtualenv with interpreter /usr/bin/python3 Using base prefix '/usr' New python executable in /tmp/outer/bin/python3 Also creating executable in /tmp/outer/bin/python Installing setuptools, pip, wheel...done. vinay at ubuntu:/tmp$ source outer/bin/activate (outer) vinay at ubuntu:/tmp$ python upvenv.py inner (outer) vinay at ubuntu:/tmp$ source inner/bin/activate (inner) vinay at ubuntu:/tmp$ python -minspect -d pip Target: pip Origin: /tmp/inner/lib/python3.5/site-packages/pip/__init__.py Cached: /tmp/inner/lib/python3.5/site-packages/pip/__pycache__/__init__.cpython-35.pyc Loader: <_frozen_importlib_external.SourceFileLoader object at 0x7f6917e9e860> Submodule search path: ['/tmp/inner/lib/python3.5/site-packages/pip'] which seems OK. This approach can't be transplanted into venv because it doesn't have the ability to restart with a different interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 18:05:39 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 21 Nov 2017 23:05:39 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511305539.74.0.213398074469.issue32100@psf.upfronthosting.co.za> Cheryl Sabella added the comment: I added a test for PathBrowser, but I didn't change the existing tests, except to move them to their own test class. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 18:34:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 23:34:05 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511307245.31.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 803ddd8ce22f0de3ab42fb98a225a704c000ef06 by Victor Stinner in branch 'master': bpo-31324: Optimize support._match_test() (#4421) https://github.com/python/cpython/commit/803ddd8ce22f0de3ab42fb98a225a704c000ef06 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 18:38:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 23:38:18 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511307498.52.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: I merged my PR 4421 which is based on Serhiy's PR 4420. Thank you Serhiy for your reviews! -- Serhiy Storchaka: "We could split patterns on two parts and create both matchers (...) I don't know whether it is worth to do." My use bisect is to find a regression using the test.bisect tool. According to my tests, the fastest set().__contains__ matcher is always used, except of test_json. If you bisect a bug in test_json, it will work, but just be a little bit slower. Honestly, I don't think that we can go further in term of optimization. In my tests, it seems like creating the matcher function and filter all tests take less than 1 second, so it's enough for my use case ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 18:54:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 23:54:27 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511308467.69.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: Attached bench_ignore_warn.py: microbenchmark (using the perf module) to measure the performance of emitting a warning when the warning is ignored. I added two basic optimizations to my PR 4489. With these optimizations, the slowdown is +17% on such microbenchmark: $ ./python -m perf compare_to ref.json patch.json Mean +- std dev: [ref] 903 ns +- 70 ns -> [patch] 1.06 us +- 0.06 us: 1.17x slower (+17%) The slowdown was much larger without optimizations, +42%: $ ./python -m perf compare_to ref.json ignore.json Mean +- std dev: [ref] 881 ns +- 59 ns -> [ignore] 1.25 us +- 0.08 us: 1.42x slower (+42%) About the memory vs CPU tradeoff, we are talking around ~1000 ns. IMHO 1000 ns is "cheap" (fast) and emitting warnings is a rare event Python. I prefer to make warnings slower than "leaking" memory (current behaviour: warnings registry growing with no limit). ---------- Added file: https://bugs.python.org/file47282/bench_ignore_warn.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 19:10:06 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 22 Nov 2017 00:10:06 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511309406.33.0.213398074469.issue32099@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- pull_requests: +4434 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 19:23:10 2017 From: report at bugs.python.org (Decorater) Date: Wed, 22 Nov 2017 00:23:10 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511310190.49.0.213398074469.issue27535@psf.upfronthosting.co.za> Decorater added the comment: If it was me I would store the warning registry in an error log or something in the current directory that ran python itself. (maybe something like ``[main script name].log``? This way it generates the warnings like usual and does not eat up memory. And then the log could to turned off when they dont want any warnings (when ignored). ---------- nosy: +Decorater _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 19:29:20 2017 From: report at bugs.python.org (Dmitry Kazakov) Date: Wed, 22 Nov 2017 00:29:20 +0000 Subject: [issue31299] Add "ignore_modules" option to TracebackException.format() In-Reply-To: <1503992745.47.0.33675937395.issue31299@psf.upfronthosting.co.za> Message-ID: <1511310560.72.0.213398074469.issue31299@psf.upfronthosting.co.za> Change by Dmitry Kazakov : ---------- pull_requests: -3274 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 01:46:32 2017 From: report at bugs.python.org (YCmove) Date: Wed, 22 Nov 2017 06:46:32 +0000 Subject: [issue32109] Separated square brackets will generate a tuple instead of a list. Message-ID: <1511333192.34.0.213398074469.issue32109@psf.upfronthosting.co.za> Change by YCmove : ---------- assignee: docs at python components: Documentation nosy: YCmove, docs at python priority: normal severity: normal status: open title: Separated square brackets will generate a tuple instead of a list. type: enhancement versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 01:54:39 2017 From: report at bugs.python.org (YCmove) Date: Wed, 22 Nov 2017 06:54:39 +0000 Subject: [issue32109] Separated square brackets will generate a tuple instead of a list. Message-ID: <1511333679.58.0.213398074469.issue32109@psf.upfronthosting.co.za> Change by YCmove : ---------- keywords: +patch pull_requests: +4435 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 02:03:39 2017 From: report at bugs.python.org (Antony Lee) Date: Wed, 22 Nov 2017 07:03:39 +0000 Subject: [issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own. In-Reply-To: <1498813368.34.0.349011380575.issue30811@psf.upfronthosting.co.za> Message-ID: <1511334219.37.0.213398074469.issue30811@psf.upfronthosting.co.za> Antony Lee added the comment: > venv, on the other hand, doesn't, but keeps a reference to its original Python environment. That is, I think, the reason for the difference in behaviour. But for example, using the system Python to create a venv (no nesting), packages installed system-wide (e.g. using a linux package manager) are not visible in the venv. Or, as you note, nesting a venv into another works fine. I don't understand why things would be different when nesting? In any case thanks for the workaround. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 02:09:18 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 22 Nov 2017 07:09:18 +0000 Subject: [issue32109] Separated square brackets will generate a tuple instead of a list. Message-ID: <1511334558.68.0.213398074469.issue32109@psf.upfronthosting.co.za> New submission from Berker Peksag : Thank you for your report and for the PR, but I think you misunderstood documentation: Using square brackets, separating items with commas: [a], [a, b, c] The comma is used to show two different lists: a list with one item ``[a]`` *and* a list with three items ``[a, b, c]``, not a tuple with two lists ``[a], [a, b, c]`` (In Python, both ``(1,)`` and ``1,`` create a tuple) ---------- nosy: +berker.peksag resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 02:22:44 2017 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 22 Nov 2017 07:22:44 +0000 Subject: [issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own. In-Reply-To: <1498813368.34.0.349011380575.issue30811@psf.upfronthosting.co.za> Message-ID: <1511335364.88.0.213398074469.issue30811@psf.upfronthosting.co.za> Vinay Sajip added the comment: > I don't understand why things would be different when nesting? Specifically because venv keeps "a pointer" to the Python environment it was created from. Usually that's a system Python. If a venv ("inner") is created from a virtualenv's interpreter, the pointer points back to that environment ("outer", in this case). Also, virtualenv can re-invoke itself with a different interpreter easily - that's business as usual. However, the venv module is part of a specific Python stdlib and doesn't reinvoke itself with a different interpreter. To find the exact mechanisms which lead to these behaviours, you would need to examine the code of virtualenv and the venv module and perhaps do some stepping through in a debugger! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 02:27:12 2017 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 22 Nov 2017 07:27:12 +0000 Subject: [issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own. In-Reply-To: <1498813368.34.0.349011380575.issue30811@psf.upfronthosting.co.za> Message-ID: <1511335632.54.0.213398074469.issue30811@psf.upfronthosting.co.za> Vinay Sajip added the comment: Is it OK if I close this? It's not really a bug, nor a case that's been designed for (a stdlib module supporting specific external packages is very unusual - pip support via ensurepip is perhaps the one exception I can think of). Given there's a way to create a venv from a virtualenv's Python, as posted above, I'm not sure what more I can do. If, on the other hand, you look into the details and find something I've missed, I'll certainly look again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 02:40:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 07:40:16 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files Message-ID: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Usually the read() method of a file-like object takes one optional argument which limits the amount of data (the number of bytes or characters) returned if specified. codecs.StreamReader.read() also has such parameter. But this is the second parameter. The first parameter limits the number of bytes read for decoding. read(1) can return 70 characters, that will confuse most callers which expect either a single character or an empty string (at the end of stream). Some times ago codecs.open() was recommended as a replacement for the builtin open() in programs that should work in 2.x and 3.x (this was before adding io.open()), and it is still used in many programs. But this peculiarity makes it bad replacement of builtin open(). I wanted to fix this issue long time ago, but forgot, and the question on Stack Overflow has reminded me about this. https://stackoverflow.com/questions/46437761/codecs-openutf-8-fails-to-read-plain-ascii-file ---------- assignee: serhiy.storchaka components: IO, Library (Lib) messages: 306701 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Make codecs.StreamReader.read() more compatible with read() of other files type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 02:47:23 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 07:47:23 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: <1511336843.44.0.213398074469.issue32110@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4437 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 02:47:26 2017 From: report at bugs.python.org (Antony Lee) Date: Wed, 22 Nov 2017 07:47:26 +0000 Subject: [issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own. In-Reply-To: <1498813368.34.0.349011380575.issue30811@psf.upfronthosting.co.za> Message-ID: <1511336846.26.0.213398074469.issue30811@psf.upfronthosting.co.za> Antony Lee added the comment: I guess it's reasonable, I'll see whether we can use the workaround you proposed. (Could a fix on virtualenv's side help?) Thanks for the explanations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:03:53 2017 From: report at bugs.python.org (Michael Felt) Date: Wed, 22 Nov 2017 09:03:53 +0000 Subject: [issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails In-Reply-To: <1511210284.67.0.213398074469.issue32095@psf.upfronthosting.co.za> Message-ID: <1511341433.52.0.213398074469.issue32095@psf.upfronthosting.co.za> Michael Felt added the comment: If I removed you from nosy - purely accidental - probably because you answered and I still had a dialog open with you not in it. My apologies in any case. I'll be more careful should something like that happen again. I am aware of the other dependencies - the only one I really care about for "master" is _ssl. Surprised that it would be missing. Will need some research on my side. One of my "packaging" goals for python is to have it install by itself. So I'll look at linking libffi statically so another fileset is not needed. (And remember to check for new libffi code when a new python version is released). And - sorry for the duplicate! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:14:18 2017 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 22 Nov 2017 09:14:18 +0000 Subject: [issue32093] macOS: implement time.thread_time() using thread_info() In-Reply-To: <1511198453.26.0.213398074469.issue32093@psf.upfronthosting.co.za> Message-ID: <1511342058.92.0.213398074469.issue32093@psf.upfronthosting.co.za> Ronald Oussoren added the comment: CLOCK_THREAD_CPUTIME_ID should be available on macOS 10.12 and later (which is also when clock_gettime was introduced). I'm not sure if it is worthwhile to implement this fairly specialised function for older macOS releases due to the maintenance cost. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:20:56 2017 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 22 Nov 2017 09:20:56 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: Marc-Andre Lemburg added the comment: On 22.11.2017 08:40, Serhiy Storchaka wrote: > Usually the read() method of a file-like object takes one optional argument which limits the amount of data (the number of bytes or characters) returned if specified. > > codecs.StreamReader.read() also has such parameter. But this is the second parameter. The first parameter limits the number of bytes read for decoding. read(1) can return 70 characters, that will confuse most callers which expect either a single character or an empty string (at the end of stream). That's not true. .read(1) will at most read 1 byte from the stream and decode it. There's no way it will return 70 characters. It will usually return less chars than the number of bytes read. The reasoning here is the same as for .read() on regular byte streams in Python 2.x: the first argument size tells the reader how many bytes to read for decoding, since this is needed to properly work together with .seek(). The optional second parameter chars was added as convenience, since the user may not know how many bytes need to be read in order to decode a certain number of characters. That said, I see in your patch that you want to bind chars to size. That will work and also protect the user from the unlikely case where the codec returns more chars than bytes read. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From mal at egenix.com Wed Nov 22 04:20:47 2017 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 22 Nov 2017 10:20:47 +0100 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> References: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: On 22.11.2017 08:40, Serhiy Storchaka wrote: > Usually the read() method of a file-like object takes one optional argument which limits the amount of data (the number of bytes or characters) returned if specified. > > codecs.StreamReader.read() also has such parameter. But this is the second parameter. The first parameter limits the number of bytes read for decoding. read(1) can return 70 characters, that will confuse most callers which expect either a single character or an empty string (at the end of stream). That's not true. .read(1) will at most read 1 byte from the stream and decode it. There's no way it will return 70 characters. It will usually return less chars than the number of bytes read. The reasoning here is the same as for .read() on regular byte streams in Python 2.x: the first argument size tells the reader how many bytes to read for decoding, since this is needed to properly work together with .seek(). The optional second parameter chars was added as convenience, since the user may not know how many bytes need to be read in order to decode a certain number of characters. That said, I see in your patch that you want to bind chars to size. That will work and also protect the user from the unlikely case where the codec returns more chars than bytes read. -- Marc-Andre Lemburg eGenix.com From report at bugs.python.org Wed Nov 22 04:27:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 09:27:14 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511342834.83.0.213398074469.issue32107@psf.upfronthosting.co.za> STINNER Victor added the comment: > https://travis-ci.org/python/cpython/jobs/305433725 AssertionError: 2199023255552 is not false : 0242ac110051 AssertionError: 2199023255552 is not false : 0242ac110051 So the Travis CI MAC address is 02:42:ac:11:00:51. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:31:05 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 22 Nov 2017 09:31:05 +0000 Subject: [issue32033] The pwd module implementation incorrectly sets some attributes to None In-Reply-To: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: <1511343065.85.0.213398074469.issue32033@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Changing test_pwd does not correct the fact that the current implementation of the pwd module may break an existing Python application since this (old indeed) API states "The uid and gid items are integers, all others are strings". > returning an empty string instead of None will make impossible to distinguish NULL from "". AFAIK in the 50 years since the creation of the unix operating system, there has never been an implementation of pwd that states that a string field may be either an empty string or NULL. And it is doubtful that there will ever be one, since this would break all (all, not just the Python applications) existing applications using pwd. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:33:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 09:33:13 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511343193.76.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: > As an alternative to that, we could also deprecate using any of those functions before initializing the runtime. Instead of calling them, you would set the relevant info on the runtime "config" struct that you pass to the replacement for PyInitialize(). Currently, _PyCoreConfig is not complete: you cannot pass PYTHONPATH or PYTHONHOME. I'm working on patches to implement that. Moreover, there is the question how to decode a bytes path (for PYTHONPATH) into a wchar_t* string. Disallow calling Py_DecodeLocale() before Py_Initialize(): ok, but which alternative do you propose to decode OS data? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:46:06 2017 From: report at bugs.python.org (Balakrishnan Unnithan) Date: Wed, 22 Nov 2017 09:46:06 +0000 Subject: [issue32111] ObjectListView crashes on python3.5 Message-ID: <1511343966.35.0.213398074469.issue32111@psf.upfronthosting.co.za> Change by Balakrishnan Unnithan : ---------- components: Extension Modules nosy: Balakrishnan Unnithan priority: normal severity: normal status: open title: ObjectListView crashes on python3.5 type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:49:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 09:49:11 +0000 Subject: [issue32111] ObjectListView crashes on python3.5 Message-ID: <1511344151.47.0.213398074469.issue32111@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Could you provide more information Balakrishnan? ---------- nosy: +serhiy.storchaka status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:56:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 09:56:57 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: <1511344617.83.0.213398074469.issue32110@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > That's not true. .read(1) will at most read 1 byte from the stream > and decode it. There's no way it will return 70 characters. See the added tests. They are failed without changing the read() method. .read(1) currently returns all characters from the characters buffer. And this buffer can be not empty after .readline(). I understand the reason of having two limitation parameters in StreamReader.read(). But currently its behavior does not completely match the expected behavior of the read() method with one argument. Actually size already has been used instead of chars if chars < 0 for reading in a loop. The code can be simplified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:58:48 2017 From: report at bugs.python.org (Balakrishnan Unnithan) Date: Wed, 22 Nov 2017 09:58:48 +0000 Subject: [issue32111] ObjectListView crashes on python3.5 In-Reply-To: <1511344151.47.0.213398074469.issue32111@psf.upfronthosting.co.za> Message-ID: <1511344728.81.0.213398074469.issue32111@psf.upfronthosting.co.za> Balakrishnan Unnithan added the comment: Issue: On Python3.5, ObjectListView object crashes when double-clicked in cell to edit int type. ------------------------------------- Traceback (most recent call last): File "C:\DevEnv\Python35\lib\site-packages\ObjectListView\ObjectListView.py", line 1726, in _HandleLeftClickOrDoubleClick self._PossibleStartCellEdit(rowIndex, subItemIndex) File "C:\DevEnv\Python35\lib\site-packages\ObjectListView\ObjectListView.py", line 2048, in _PossibleStartCellEdit self.StartCellEdit(rowIndex, subItemIndex) File "C:\DevEnv\Python35\lib\site-packages\ObjectListView\ObjectListView.py", line 2114, in StartCellEdit self.cellEditor.SetValue(evt.cellValue) File "C:\DevEnv\Python35\lib\site-packages\ObjectListView\CellEditor.py", line 268, in SetValue if isinstance(value, (long, int, float)): NameError: name 'long' is not defined ------------------------------------- On debugging, I found that the actual root-cause of this bug lies in below code: File: ..lib\site-packages\ObjectListView\CellEditor.py Line: 100 ------------------------------------- def __init__(self): self.typeToFunctionMap = {} # Standard types and their creator functions self.typeToFunctionMap[str] = self._MakeStringEditor self.typeToFunctionMap[six.text_type] = self._MakeStringEditor self.typeToFunctionMap[bool] = self._MakeBoolEditor if six.PY2: self.typeToFunctionMap[int] = self._MakeIntegerEditor self.typeToFunctionMap[long] = self._MakeLongEditor else: #Line:100 self.typeToFunctionMap[int] = self._MakeLongEditor self.typeToFunctionMap[float] = self._MakeFloatEditor self.typeToFunctionMap[datetime.datetime] = self._MakeDateTimeEditor self.typeToFunctionMap[datetime.date] = self._MakeDateEditor self.typeToFunctionMap[datetime.time] = self._MakeTimeEditor ------------------------------------- Modified code: ------------------------------------- if six.PY2: self.typeToFunctionMap[int] = self._MakeIntegerEditor self.typeToFunctionMap[long] = self._MakeLongEditor else: #Line:100 self.typeToFunctionMap[int] = self._MakeIntegerEditor ------------------------------------- In place of integer type editor, long type editor is being created. As Python3.x does not support long type, the programme crashes here. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:04:00 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 22 Nov 2017 10:04:00 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511345040.21.0.213398074469.issue27535@psf.upfronthosting.co.za> Nick Coghlan added the comment: Touching the filesystem implicitly can have all sorts of unintentional side effects (especially in read-only environments), so we strongly prefer not to do that. The most general solution here would be to turn the warnings registry into an LRU cache - short-lived applications wouldn't see any changes, while long-lived applications with changing warning messages would hit the upper bound and then stay there. I also like Victor's change to have the "ignore" option skip touching the registry. If we decide we still want to optimise out the linear filter scan for those cases, then I'd suggest lazily building a dispatch table with separate per-category warnings filter lists (updating the dispatch table on the next emitted warning after the filter list changes), and then only falling back to scanning the full filter list for warning categories that aren't an exact match for anything in the dispatch table. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:04:03 2017 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 22 Nov 2017 10:04:03 +0000 Subject: [issue32111] ObjectListView crashes on python3.5 In-Reply-To: <1511344151.47.0.213398074469.issue32111@psf.upfronthosting.co.za> Message-ID: <1511345043.26.0.213398074469.issue32111@psf.upfronthosting.co.za> Ronald Oussoren added the comment: This appears to be an issue with a 3th-party library (https://pypi.python.org/pypi/ObjectListView), not CPython itself. The repository (and issue tracker) for that library is at . @Balakrishnan: could you confirm that you are using this library? And if so, please file an issue with that project. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:07:27 2017 From: report at bugs.python.org (Balakrishnan Unnithan) Date: Wed, 22 Nov 2017 10:07:27 +0000 Subject: [issue32111] ObjectListView crashes on python3.5 In-Reply-To: <1511344151.47.0.213398074469.issue32111@psf.upfronthosting.co.za> Message-ID: <1511345247.21.0.213398074469.issue32111@psf.upfronthosting.co.za> Balakrishnan Unnithan added the comment: Yes, I am using this 3rd party library. Okay, I shall withdraw the issue from here. I'm new to Python and hence do not know the various groups and their purpose. Apologies! Thanks for the support. Version info: ObjectListView 1.3.1 Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:07:06) [MSC v.1900 32 bit (Intel)] on win32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:08:04 2017 From: report at bugs.python.org (Christian Heimes) Date: Wed, 22 Nov 2017 10:08:04 +0000 Subject: [issue32111] ObjectListView crashes on python3.5 In-Reply-To: <1511344151.47.0.213398074469.issue32111@psf.upfronthosting.co.za> Message-ID: <1511345284.08.0.213398074469.issue32111@psf.upfronthosting.co.za> Change by Christian Heimes : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:10:40 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 10:10:40 +0000 Subject: [issue32033] The pwd module implementation incorrectly sets some attributes to None In-Reply-To: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: <1511345440.76.0.213398074469.issue32033@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: On your second link it is documented explicitly that pw_dir and pw_shell might be NULL. And at least for pw_shell the behavior for NULL and "" are different. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:23:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 10:23:57 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511346237.58.0.213398074469.issue27535@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I think it is common if filters don't depend on the warning test. In this case we can test and set the key (None, category, lineno) before (text, category, lineno). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:26:49 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 22 Nov 2017 10:26:49 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511346409.35.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Victor, please stop trying to conflate the two questions of "How should we fix the current Py_DecodeLocale regression before 3.7.0a3?" and "What do we want to do long term?". They're far from being the same question, and answering the second one properly is going to be much harder and more involved than just doing the bare minimum needed to make the previously supported embedding logic work again (even if it means postponing some of the dynamic allocator changes we'd like to make). Omitting PYTHONHOME and PYTHONPATH from the core config is deliberate, as the interpreter doesn't support external imports yet when just the core has been initialized - only builtin and frozen ones. Anything related to external imports should ultimately end up in the main interpreter configuration: https://www.python.org/dev/peps/pep-0432/#supported-configuration-settings Longer term, I also want to rewrite getpath.c in Python (or at least primarily using Python lists and strings via the C API instead of relaying C arrays and C string manipulation functions). However, our work on refactoring Py_Main has also shown me that we're going to need some additional structs to hold the raw(ish) command line arguments and environment variables in order to easily pass them around to other internal configuration APIs. Modules/main.c already defines _Py_CommandLineDetails for the command line settings: https://github.com/python/cpython/blob/master/Modules/main.c#L382 We *don't* currently have anything like that for environment variables, not even the ones which are "read once at startup, then never read them again". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:37:31 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 22 Nov 2017 10:37:31 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511347051.73.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Speaking of surprises with static initialization of the runtime allocations: both PRs are failing in CI, suggesting that the changes that Py_Initialize makes to the allocator settings aren't being reverted in Py_Finalize, so there's a mismatch between the allocation function and the deallocation function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:52:36 2017 From: report at bugs.python.org (Martijn Pieters) Date: Wed, 22 Nov 2017 10:52:36 +0000 Subject: [issue32112] Should uuid.UUID() accept another UUID() instance? Message-ID: <1511347956.68.0.213398074469.issue32112@psf.upfronthosting.co.za> New submission from Martijn Pieters : When someone accidentally passes in an existing uuid.UUID() instance into uuid.UUID(), an attribute error is thrown because it is not a hex string: >>> import uuid >>> value = uuid.uuid4() >>> uuid.UUID(value) Traceback (most recent call last): File "", line 1, in File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python2.7/uuid.py", line 133, in __init__ hex = hex.replace('urn:', '').replace('uuid:', '') AttributeError: 'UUID' object has no attribute 'replace' This happened in the Stack Overflow question at https://stackoverflow.com/q/47429929/100297, because the code there didn't take into account that some database drivers may already have mapped the PostgreSQL UUID column to a Python uuid.UUID() object. The fix could be as simple as: if hex is not None: if isinstance(hex, uuid.UUID): int = hex.int else: hex = hex.replace('urn:', '').replace('uuid:', '') hex = hex.strip('{}').replace('-', '') if len(hex) != 32: raise ValueError('badly formed hexadecimal UUID string') int = int_(hex, 16) Or we could add a uuid=None keyword argument, and use if hex is not None: if isinstance(hex, uuid.UUID): uuid = hex else: hex = hex.replace('urn:', '').replace('uuid:', '') hex = hex.strip('{}').replace('-', '') if len(hex) != 32: raise ValueError('badly formed hexadecimal UUID string') int = int_(hex, 16) if uuid is not None: int = uuid.int ---------- messages: 306719 nosy: mjpieters priority: normal severity: normal status: open title: Should uuid.UUID() accept another UUID() instance? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 06:07:26 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 22 Nov 2017 11:07:26 +0000 Subject: [issue32109] Separated square brackets will generate a tuple instead of a list. In-Reply-To: <1511334558.68.0.213398074469.issue32109@psf.upfronthosting.co.za> Message-ID: <1511348846.67.0.213398074469.issue32109@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Perhaps this is what the YCMove meant? >>> a = [1], [2, 3, 4] >>> a ([1], [2, 3, 4]) >>> ---------- nosy: +csabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 06:09:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 11:09:52 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511348992.75.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: > $ ./python -m perf compare_to ref.json patch.json > Mean +- std dev: [ref] 903 ns +- 70 ns -> [patch] 1.06 us +- 0.06 us: 1.17x slower (+17%) We are talking about a difference of 157 nanoseconds. On the same laptop, a Python function call which does nothing already takes 76.6 ns +- 4.1 ns. So the overhead of my PR 4489 is the cost of two Python function calls which do nothing. Do you think that it's an inacceptable overhead? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 06:12:55 2017 From: report at bugs.python.org (Antti Haapala) Date: Wed, 22 Nov 2017 11:12:55 +0000 Subject: [issue32112] Should uuid.UUID() accept another UUID() instance? In-Reply-To: <1511347956.68.0.213398074469.issue32112@psf.upfronthosting.co.za> Message-ID: <1511349175.02.0.213398074469.issue32112@psf.upfronthosting.co.za> Antti Haapala added the comment: I've been hit by this too, in similar contexts, and several times. It is really annoying that it is easier to coerce an UUID or UUID-string to a string than to coerce to a UUID. Usually when the copy semantics are clear and the class is plain old data, Python lets you execute the constructor with an instance of the same class: >>> bytes(bytes()) b'' >>> bytearray(bytearray()) bytearray(b'') >>> int(int()) 0 >>> complex(complex()) 0j >>> tuple(tuple()) () I don't to see why this shouldn't be true with UUID as well. ---------- nosy: +ztane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 06:29:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 11:29:35 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511350175.11.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: The performance bottleneck of warnings.warn() is the dance between the C _warnings module and the Python warnings module. The C code retrieves many attributes, like warnings.filters, at each call, and does conversion from Python objects to C objects. There is already a mecanism to invalidate a "cache" in the C module: warnings._filters_mutated() is called by warnings.filterwarnings() for example. Maybe the C module could convert all filters at once into an efficient C structure, but throw this away once on cache invalidation. The problem is that I'm not sure that it's ok to implement such deeper cache at C level. Is it part of the warnings "semantics" to allow users to modify directly warnings.filters? Must the C module always lookup in sys.modules if the 'warnings' modules didn't change? Outside test_warnings, do you know an use case where lookup for the 'warnings' module and 'warnings.filters' must be done at *each* warnings.warn() call? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 06:37:01 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 22 Nov 2017 11:37:01 +0000 Subject: [issue32109] Separated square brackets will generate a tuple instead of a list. In-Reply-To: <1511334558.68.0.213398074469.issue32109@psf.upfronthosting.co.za> Message-ID: <1511350620.99.0.213398074469.issue32109@psf.upfronthosting.co.za> Berker Peksag added the comment: That's why I mentioned ``[a], [a, b, c]`` in my earlier message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 07:23:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 12:23:34 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511353414.42.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: I implemented a cache for warnings.filters in C. With my WIP patch which doesn't touch the registry for the ignore action, warnings.warn() is now faster than the current code ;-) haypo at selma$ ./python -m perf compare_to ref.json patch.json Mean +- std dev: [ref] 938 ns +- 72 ns -> [patch] 843 ns +- 57 ns: 1.11x faster (-10%) There is a single test in test_warnings which modifies directly warnings.filters: @support.cpython_only def test_issue31416(self): # warn_explicit() shouldn't cause an assertion failure in case of a # bad warnings.filters or warnings.defaultaction. wmod = self.module with original_warnings.catch_warnings(module=wmod): wmod.filters = [(None, None, Warning, None, 0)] with self.assertRaises(TypeError): wmod.warn_explicit('foo', Warning, 'bar', 1) wmod.filters = [] with support.swap_attr(wmod, 'defaultaction', None), \ self.assertRaises(TypeError): wmod.warn_explicit('foo', Warning, 'bar', 1) I don't think that it's common to modify warnings.filters directly. Maybe we can make this sequence immutable in the public API to prevent misuse of the warnings API? To force users to use warnings.simplefilter() and warnings.filterwarnings()? IMHO the main usage of modifying directyl warnings.filters it to save/restore filters. But there is already an helper for that: warnings.catch_warnings(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 07:52:18 2017 From: report at bugs.python.org (Dmitry Kazakov) Date: Wed, 22 Nov 2017 12:52:18 +0000 Subject: [issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses In-Reply-To: <1508701595.06.0.213398074469.issue31841@psf.upfronthosting.co.za> Message-ID: <1511355138.96.0.213398074469.issue31841@psf.upfronthosting.co.za> Change by Dmitry Kazakov : ---------- keywords: +patch pull_requests: +4438 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 08:04:32 2017 From: report at bugs.python.org (Dmitry Kazakov) Date: Wed, 22 Nov 2017 13:04:32 +0000 Subject: [issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses In-Reply-To: <1508701595.06.0.213398074469.issue31841@psf.upfronthosting.co.za> Message-ID: <1511355872.51.0.213398074469.issue31841@psf.upfronthosting.co.za> Dmitry Kazakov added the comment: I added a PR. FWIW, I still think it would make sense to change the return type of UserString.join, and maybe *split* and *partition methods (to return list/tuple of UserString objects) for the sake of consistency. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 08:28:59 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 22 Nov 2017 13:28:59 +0000 Subject: [issue32109] Separated square brackets will generate a tuple instead of a list. In-Reply-To: <1511334558.68.0.213398074469.issue32109@psf.upfronthosting.co.za> Message-ID: <1511357339.61.0.213398074469.issue32109@psf.upfronthosting.co.za> R. David Murray added the comment: Yes, the markup (and therefore how the code is displayed in the docs) clearly indicates that the , between the lists is not part of the python syntax being discussed. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 08:35:50 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 13:35:50 +0000 Subject: [issue32112] Should uuid.UUID() accept another UUID() instance? In-Reply-To: <1511347956.68.0.213398074469.issue32112@psf.upfronthosting.co.za> Message-ID: <1511357750.71.0.213398074469.issue32112@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Not always the constructor accept an instance of the same class. I'm sure that this is not true in the majority of cases. The constructor of int accepts an instance of int and the constructor of tuple accepts an instance of tuple because the constructor of int accepts an arbitrary real number, and the constructor of tuple accepts an arbitrary iterable, and int and tuple are a real number and an iterable correspondingly. There is no reason to forbid accepting an instance of the same class in these cases. In contrary, the UUID constructor accepts a hexadecimal string, but UUID itself is not a hexadecimal string. Similarly the range constructor doesn't accept a range instance, and the file constructor doesn't accept a file instance. >>> range(range(3)) Traceback (most recent call last): File "", line 1, in TypeError: 'range' object cannot be interpreted as an integer >>> io.FileIO(io.FileIO('/dev/null')) Traceback (most recent call last): File "", line 1, in TypeError: expected str, bytes or os.PathLike object, not _io.FileIO For converting an existing UUID instance to UUID you can can first convert it to str: newvalue = uuid.UUID(str(oldvalue)) Or better avoid the conversion at all. if isisnstance(oldvalue, uuid.UUID): newvalue = oldvalue else: newvalue = uuid.UUID(oldvalue) ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 08:38:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 13:38:13 +0000 Subject: [issue32033] The pwd module implementation incorrectly sets some attributes to None In-Reply-To: <1511345440.76.0.213398074469.issue32033@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: > And at least for pw_shell the behavior for NULL and "" are different. What is the difference between the two? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 08:42:20 2017 From: report at bugs.python.org (Pam McA'Nulty) Date: Wed, 22 Nov 2017 13:42:20 +0000 Subject: [issue5710] ctypes should return composite types from callbacks In-Reply-To: <1239038926.27.0.792638874347.issue5710@psf.upfronthosting.co.za> Message-ID: <1511358140.95.0.213398074469.issue5710@psf.upfronthosting.co.za> Pam McA'Nulty added the comment: In the example code, the 'result' variable is declared on the stack in the callback() function. So it will be effectively when callback() returns. Also the "result" variable in main() is never referenced. A pointer main()'s "result" variable should be passed to callback() as an argument ("&result") and `callback(struct helloStruct *result)` should populate it (via `result->i = 10;` etc) ```struct helloStruct callback () { struct helloStruct result; result.i = 10; result.f = 3.14159; return result; }``` ---------- nosy: +Pam.McANulty _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 09:11:30 2017 From: report at bugs.python.org (Pam McA'Nulty) Date: Wed, 22 Nov 2017 14:11:30 +0000 Subject: [issue5710] ctypes should return composite types from callbacks In-Reply-To: <1239038926.27.0.792638874347.issue5710@psf.upfronthosting.co.za> Message-ID: <1511359890.73.0.213398074469.issue5710@psf.upfronthosting.co.za> Pam McA'Nulty added the comment: oops - "In the example code, the 'result' variable is declared on the stack in the callback() function. So it will be effectively when callback() returns." should be "In the example code, the 'result' variable is declared on the stack in the callback() function. So it will be effectively DESTROYED when callback() returns." I hate waking up at 4:15a. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 09:12:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 14:12:55 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511359975.21.0.213398074469.issue10544@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka versions: +Python 3.6, Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 09:42:41 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 22 Nov 2017 14:42:41 +0000 Subject: [issue32113] Strange behavior with await in a generator expression Message-ID: <1511361761.52.0.213398074469.issue32113@psf.upfronthosting.co.za> New submission from Ivan Levkivskyi : PEP 530 is not very clear about `await` in generator expressions. But when I try it, the error is a bit confusing: >>> async def g(i): ... print(i) ... >>> async def f(): ... result = list(await g(i) for i in range(3)) ... print(result) ... >>> f().send(None) Traceback (most recent call last): File "", line 1, in File "", line 2, in f TypeError: 'async_generator' object is not iterable At the same time a (seemingly) equivalent list comprehension works fine: >>> async def f(): ... result = [await g(i) for i in range(3)] ... print(result) ... >>> f().send(None) 0 1 2 [None, None, None] Traceback (most recent call last): File "", line 1, in StopIteration I would say that the first case should either behave as a second one, or raise a syntax error. Or is it actually an intended behavior? ---------- components: Interpreter Core messages: 306732 nosy: levkivskyi, yselivanov priority: normal severity: normal status: open title: Strange behavior with await in a generator expression type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 10:44:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 15:44:08 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests In-Reply-To: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> Message-ID: <1511365448.78.0.213398074469.issue32055@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4439 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 10:46:59 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 22 Nov 2017 15:46:59 +0000 Subject: [issue32113] Strange behavior with await in a generator expression In-Reply-To: <1511361761.52.0.213398074469.issue32113@psf.upfronthosting.co.za> Message-ID: <1511365618.99.0.213398074469.issue32113@psf.upfronthosting.co.za> Yury Selivanov added the comment: > ... result = list(await g(i) for i in range(3)) This is equivalent to this code: async def ait(): for i in range(3): v = await g(i) yield v result = list(ait()) Where 'ait' is an async generator function. You can't iterate it with the regular 'for x in ...' syntax, and you can't pass it to functions that expect a synchronous iterator (such as 'list'). Similarly, with synchronous code: a = (i for i in range(3)) a[0] Traceback (most recent call last): File "", line 1, in TypeError: 'generator' object is not subscriptable where '(' for ... ')' is another syntax for defining a synchronous generator. > ... result = [await g(i) for i in range(3)] This is equivalent to this code: result = [] for i in range(3): v = await g(i) result.append(v) I agree that PEP 530 is a bit vague about this and can be updated. I'll take a look into that. Perhaps we can make the "TypeError: 'async_generator' object is not iterable" error message a bit clearer. Any ideas to improve it are welcome. > I would say that the first case should either behave as a second one, or raise a syntax error. No, but we can improve error messages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 10:47:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 15:47:58 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests In-Reply-To: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> Message-ID: <1511365678.92.0.213398074469.issue32055@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 4501 makes the parser emitting a SyntaxWarning for chained `in` and `not in` comparison operators. In future it can be turned into a SyntaxError. But this should be first discussed on Python-Dev. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 11:34:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 16:34:31 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511368471.4.0.213398074469.issue27535@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4440 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 11:35:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 16:35:27 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511368527.01.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: I published my WIP work on optimizing warnings: PR 4502, it's based on PR 4489. The code should be cleaned up, especially the "_PyRuntime" part. The default action caching should be fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 11:50:44 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 22 Nov 2017 16:50:44 +0000 Subject: [issue32113] Strange behavior with await in a generator expression In-Reply-To: <1511361761.52.0.213398074469.issue32113@psf.upfronthosting.co.za> Message-ID: <1511369444.71.0.213398074469.issue32113@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: A first simple idea that comes to my mind is special-case async generators/iterators in PyObject_GetIter to say something like: TypeError: asynchronous iterable can't be used where an iterable is expected If it is possible to detect that an async generator is resulting from a generator expression, then we can say: TypeError: asynchronous generator expression can't be used as an iterable ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 12:00:38 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 22 Nov 2017 17:00:38 +0000 Subject: [issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user In-Reply-To: <1479069574.19.0.731580166174.issue28684@psf.upfronthosting.co.za> Message-ID: <1511370038.89.0.213398074469.issue28684@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4441 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 12:34:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 17:34:31 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511372071.25.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: > We *don't* currently have anything like that for environment variables, not even the ones which are "read once at startup, then never read them again". I changed Py_Main() in bpo-32030. Now multiple environment variables are read once at startup and put into _PyCoreConfig: https://github.com/python/cpython/blob/803ddd8ce22f0de3ab42fb98a225a704c000ef06/Modules/main.c#L1365-L1413 I added new fields to _PyCoreConfig: https://github.com/python/cpython/blob/803ddd8ce22f0de3ab42fb98a225a704c000ef06/Include/pystate.h#L27-L39 I suggest to continue to add more fields to _PyCoreConfig to move all code to configure Python before Py_Initialize(), and later to let users embedding Python to configure Python as they want, without losing features. For example, to enable the new "development mode" (-X dev), now you "just" have to set _PyCoreConfig.dev_mode to 1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 12:37:55 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 22 Nov 2017 17:37:55 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1511372275.81.0.213398074469.issue32022@psf.upfronthosting.co.za> Mark Dickinson added the comment: > I suggest to close it as WONTFIX. Agreed. If you use sys.setrecursionlimit, you're deliberately bypassing Python's safety mechanisms. A crash due to stack overflow shouldn't be considered a bug under these circumstances. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 12:40:20 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 22 Nov 2017 17:40:20 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1511372420.79.0.213398074469.issue32022@psf.upfronthosting.co.za> Mark Dickinson added the comment: I was going to suggest that this might be a documentation issue, but the existing documentation already looks sufficient to me: > A user may need to set the limit higher when they have a program that > requires deep recursion and a platform that supports a higher limit. > This should be done with care, because a too-high limit can lead to a > crash. >From https://docs.python.org/3/library/sys.html#sys.setrecursionlimit ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 12:50:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 17:50:29 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511373029.52.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4442 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 12:51:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 17:51:28 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511373088.03.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: I created a new PR adding a a new _PyCoreConfig.pythonpath field: https://github.com/python/cpython/pull/4504 Once it will be merged, I will work on a new PR for PYTHONHOME (add a new _PyCoreConfig.pythonhome field). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 12:52:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 17:52:13 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1511373133.23.0.213398074469.issue32022@psf.upfronthosting.co.za> STINNER Victor added the comment: I close the issue for the reasons given in the latest comments. Sorry! ---------- resolution: -> fixed stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 12:52:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 17:52:26 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1511373146.06.0.213398074469.issue32022@psf.upfronthosting.co.za> STINNER Victor added the comment: (Oops, must be closed as "wont fix".) ---------- resolution: fixed -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:05:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 18:05:50 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511373950.51.0.213398074469.issue31324@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4443 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:06:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 18:06:32 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511373992.09.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: Oops, the commit 803ddd8ce22f0de3ab42fb98a225a704c000ef06 broke the GCC job on Travis CI: --- Run tests sequentially 0:00:00 load avg: 48.91 [ 1/404] test_grammar 0:00:00 load avg: 48.91 [ 2/404] test_opcodes 0:00:00 load avg: 48.91 [ 3/404] test_dict 0:00:00 load avg: 48.91 [ 4/404] test_builtin 0:00:00 load avg: 48.91 [ 5/404] test_exceptions 0:00:01 load avg: 48.91 [ 6/404] test_types 0:00:01 load avg: 48.91 [ 7/404] test_unittest 0:00:03 load avg: 48.91 [ 8/404] test_doctest 0:00:04 load avg: 48.11 [ 9/404] test_doctest2 0:00:04 load avg: 48.11 [ 10/404] test_support 0:00:07 load avg: 48.11 [ 11/404] test___all__ Traceback (most recent call last): File "/home/travis/build/python/cpython/Lib/test/__main__.py", line 2, in main() File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 585, in main Regrtest().main(tests=tests, **kwargs) File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 510, in main self._main(tests, kwargs) File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 536, in _main self.run_tests() File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 458, in run_tests self.run_tests_sequential() File "/home/travis/build/python/cpython/Lib/test/libregrtest/main.py", line 379, in run_tests_sequential result = runtest(self.ns, test) File "/home/travis/build/python/cpython/Lib/test/libregrtest/runtest.py", line 105, in runtest support.set_match_tests(ns.match_tests) File "/home/travis/build/python/cpython/Lib/test/support/__init__.py", line 1958, in set_match_tests _match_test_patterns = tuple(patterns) TypeError: 'NoneType' object is not iterable --- Attached PR 4505 fixes it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:28:35 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 22 Nov 2017 18:28:35 +0000 Subject: [issue32114] The get_event_loop change in bpo28613 did not update the documentation Message-ID: <1511375315.05.0.213398074469.issue32114@psf.upfronthosting.co.za> New submission from R. David Murray : No changes were made to the documentation of get_event_loop when its behavior was modified to return the loop running the future/coroutine when called from that context. The documentation still says it gets the loop associated with the thread unconditionally. ---------- components: Demos and Tools messages: 306744 nosy: r.david.murray, yselivanov priority: normal severity: normal stage: needs patch status: open title: The get_event_loop change in bpo28613 did not update the documentation type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:32:12 2017 From: report at bugs.python.org (rogpeppe) Date: Wed, 22 Nov 2017 18:32:12 +0000 Subject: [issue32115] Ignored SIGCHLD causes asyncio.Process.wait to hang forever Message-ID: <1511375532.97.0.213398074469.issue32115@psf.upfronthosting.co.za> New submission from rogpeppe : If some parent process has disabled SIGCHLD, that signal is inherited and stops that signal being delivered, which means that asyncio.Process.wait will never complete. As an example, the plan9port terminal window, 9term, (https://9fans.github.io/plan9port/man/man1/9term.html) does this, and hence causes async Python processes to hang forever. Python should probably code defensively against this and ensure that SIGCHLD is enabled regardless. Attached is some C code that demonstrates the issue when the following python code is saved to "tst.py". #!/usr/bin/env python3 import asyncio async def do_exec(): cmd = ['echo', 'hello, world'] process = await asyncio.create_subprocess_exec(*cmd, env={}) await process.wait() loop=asyncio.get_event_loop() try: loop.run_until_complete(do_exec()) finally: loop.close() demonstration of the issue. ---------- components: asyncio files: tst.c messages: 306745 nosy: rogpeppe, yselivanov priority: normal severity: normal status: open title: Ignored SIGCHLD causes asyncio.Process.wait to hang forever type: behavior versions: Python 3.5 Added file: https://bugs.python.org/file47283/tst.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:36:31 2017 From: report at bugs.python.org (Paul Long) Date: Wed, 22 Nov 2017 18:36:31 +0000 Subject: [issue32116] CSV import and export simplified Message-ID: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> New submission from Paul Long : It would be helpful if the CSV module included standard functions that simplify the import of CSV files to a list and the export of CSV files to a list. Here's an example of what they could be: def csv2list(file_name): list_name=[] with open(file_name) as csvfile: readerfile = reader(csvfile) for row in readerfile: list_name.append(row) return list_name def list2csv(list_name,file_name): with open(file_name, 'w', newline='') as csvfile: writerfile = csv.writer(csvfile) writerfile.writerows(list_name) ---------- components: Library (Lib) messages: 306746 nosy: paullongnet priority: normal severity: normal status: open title: CSV import and export simplified type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:44:30 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 22 Nov 2017 18:44:30 +0000 Subject: [issue32116] CSV import and export simplified In-Reply-To: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> Message-ID: <1511376270.8.0.213398074469.issue32116@psf.upfronthosting.co.za> R. David Murray added the comment: Thanks for the suggestion, but I'm -0.5. I don't think these are compelling enough to be worth adding to the module API. The number of times I've done this kind of operation is far smaller than the number of times I've had other code in both the input and output loops. *Far* smaller. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:50:15 2017 From: report at bugs.python.org (Paul Long) Date: Wed, 22 Nov 2017 18:50:15 +0000 Subject: [issue32116] CSV import and export simplified In-Reply-To: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> Message-ID: <1511376615.24.0.213398074469.issue32116@psf.upfronthosting.co.za> Paul Long added the comment: I should have added that there are thousands of 15 year old students completing GCSE Computer Science who would benefit massively from this. All the exam boards in England require students to be able to read from and write to CSV files. The complicated way of doing it in Python is making this quite inaccessible to most students and so although many programmers in general wouldn't need this very often, there are literally thousands of students who would benefit from this enhancement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 14:32:51 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 22 Nov 2017 19:32:51 +0000 Subject: [issue32116] CSV import and export simplified In-Reply-To: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> Message-ID: <1511379171.94.0.213398074469.issue32116@psf.upfronthosting.co.za> R. David Murray added the comment: Um. If they aren't expected to understand how to write this code, why isn't it being provided to them as a canned function as part of the test environment? To succeed in getting something like this added, I suspect you will need to show that it has more general utility, or there is something analogous that can be added that has more general utility. I recommend starting a discussion on the python-ideas mailing list. By the way, if I needed this in my code, I'd write: with open(file_name, newline="") as csvfile: my_list = list(csv.reader(csvfile)) with open(file_name, 'w', newline="") as csvfile: csv.writer(csvfile).writerows(my_list) Only if I needed it more than once would I bother wrapping it in a function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 14:36:15 2017 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Wed, 22 Nov 2017 19:36:15 +0000 Subject: [issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers) In-Reply-To: <1384514692.62.0.115546674646.issue19610@psf.upfronthosting.co.za> Message-ID: <1511379375.37.0.213398074469.issue19610@psf.upfronthosting.co.za> Henk-Jaap Wagenaar added the comment: This is still present, and also silently affects Python 2.7 as evidenced here: https://github.com/pypa/setuptools/issues/1163 I am happy to adapt Berker Peksags patch to a PR, if he is? ---------- nosy: +Henk-Jaap Wagenaar versions: +Python 3.6, Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 14:36:30 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 22 Nov 2017 19:36:30 +0000 Subject: [issue32022] Python crashes with mutually recursive code In-Reply-To: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> Message-ID: <1511379390.93.0.213398074469.issue32022@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I confirmed that increasing the recursion limit can change recursion behavior on Windows. >>> def f(): g() ... >>> def g(): f() ... >>> f() With the default limit or 1000 or increase to 3000, I get a recursion error. With the limit set to 10000, I get 'MemoryError: stack overflow'. It is not too surprising that the more complicated code prevents getting even that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 14:40:44 2017 From: report at bugs.python.org (Paul Long) Date: Wed, 22 Nov 2017 19:40:44 +0000 Subject: [issue32116] CSV import and export simplified In-Reply-To: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> Message-ID: <1511379644.19.0.213398074469.issue32116@psf.upfronthosting.co.za> Paul Long added the comment: Thanks for your advice. The reason it's not provided as a canned function is because different schools can use different programming languages, although the vast majority choose to use Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 14:42:54 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 22 Nov 2017 19:42:54 +0000 Subject: [issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers) In-Reply-To: <1384514692.62.0.115546674646.issue19610@psf.upfronthosting.co.za> Message-ID: <1511379774.1.0.213398074469.issue19610@psf.upfronthosting.co.za> ?ric Araujo added the comment: Latest patch seems good. Berker, would you have the time to adapt for 3.7 and submit as a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 14:46:18 2017 From: report at bugs.python.org (Michael Felt) Date: Wed, 22 Nov 2017 19:46:18 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for AIX - all versions In-Reply-To: <1511208070.25.0.213398074469.issue28009@psf.upfronthosting.co.za> Message-ID: <945bb375-80c3-835f-5ef0-74c0d37e44a6@felt.demon.nl> Michael Felt added the comment: x064 is AIX 5.3, x071 is AIX 6.1, x072 is AIX 7.1 - in the following output On 11/20/2017 9:01 PM, Serhiy Storchaka wrote: > Serhiy Storchaka added the comment: > > What return commands `ifconfig`, `ifconfig -a`, `ifconfig -av`, `ip link list`, `arp -an`, `lanscan -ai` (if not error)? ifconfig: ichael at x071:[/home/michael]dsh -n x064,x071,x072 ifconfig x071: usage: ifconfig -a [ -d ] [ -u ] [ af ] x071:??????? ifconfig -l [ -d ] [ -u ] x071:??????? ifconfig interface x071:???????? [ af [ address [ dest_addr ] ] [ netmask mask ] [ broadcast addr ] x071:????????????? [ alias ] [ delete ] ] x071:???????? [ up ] [ down ] [ detach ] x071:???????? [ af first[alias] address [ ... ] ] x071:???????? [ site6 site_number ] x071:???????? [ metric n ] x071:???????? [ mtu n ] x071:???????? [ arp | -arp ] x071:???????? [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ] x071:???????? [ tcp_low_rto n | -tcp_low_rto ] x071:???????? [ inet6 scope n zone n ] x071:???????? [[ inet4 | inet6 ][address transfer newinterface]] x071:??????? ifconfig tap_interface [ create | destroy ] x064: usage: ifconfig -a [ -m ] [ -d ] [ -u ] [ af ] x064:??????? ifconfig -l [ -d ] [ -u ] x064:??????? ifconfig [ -m ] interface x064:???????? [ af [ address [ dest_addr ] ] [ netmask mask ] [ broadcast addr ] x064:????????????? [ alias ] [ delete ] ] x064:???????? [ up ] [ down ] [ detach ] x064:???????? [ af first[alias] address [ ... ] ] x064:???????? [ site6 site_number ] x064:???????? [ metric n ] x064:???????? [ mtu n ] x064:???????? [ arp | -arp ] x064:???????? [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ] x064:???????? [ tcp_low_rto n | -tcp_low_rto ] x072: usage: ifconfig -a [ -d ] [ -u ] [ af ] x072:??????? ifconfig -l [ -d ] [ -u ] x072:??????? ifconfig interface x072:???????? [ af [ address [ dest_addr ] ] [ netmask mask ] [ broadcast addr ] x072:????????????? [ alias ] [ delete ] ] x072:???????? [ up ] [ down ] [ detach ] x072:???????? [ af first[alias] address [ ... ] ] x072:???????? [ site6 site_number ] x072:???????? [ metric n ] x072:???????? [ mtu n ] x072:???????? [ arp | -arp ] x072:???????? [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ] x072:???????? [ tcp_low_rto n | -tcp_low_rto ] x072:???????? [ inet6 scope n zone n ] x072:??????? ifconfig tap_interface [ create | destroy ] ifconfig -a: michael at x071:[/home/michael]dsh -n x064,x071,x072 "ifconfig -a" x071: en0: flags=1e084863,14c0 x071:?? inet 192.168.129.71 netmask 0xffffff00 broadcast 192.168.129.255 x071:?? inet 192.168.90.71 netmask 0xffffff00 broadcast 192.168.90.255 x071:?? inet6 fe80::f8d1:8cff:fef7:6204%2/64 x071:??? tcp_sendspace 262144 tcp_recvspace 262144 tcp_nodelay 1 rfc1323 1 x071: en1: flags=1e084863,480 x071:?? inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255 x071:??? tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1 x071: lo0: flags=e08084b,c0 x071:?? inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 x071:?? inet6 ::1%1/128 x071:??? tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1 x064: en0: flags=1e080863,c0 x064:?? inet 192.168.129.64 netmask 0xffffff00 broadcast 192.168.129.255 x064:??? tcp_sendspace 131072 tcp_recvspace 65536 x064: lo0: flags=e08084b x064:?? inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 x064:?? inet6 ::1/0 x064:??? tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1 x072: en0: flags=1e084863,480 x072:?? inet 192.168.129.72 netmask 0xffffff00 broadcast 192.168.129.255 x072:??? tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1 x072: lo0: flags=e08084b,c0 x072:?? inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 x072:?? inet6 ::1%1/64 x072:??? tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1 ifconfig -av: michael at x071:[/home/michael]dsh -n x064,x071,x072 "ifconfig -av" x071: ifconfig: illegal option -- v x071: usage: ifconfig -a [ -d ] [ -u ] [ af ] x071:??????? ifconfig -l [ -d ] [ -u ] x071:??????? ifconfig interface x071:???????? [ af [ address [ dest_addr ] ] [ netmask mask ] [ broadcast addr ] x071:????????????? [ alias ] [ delete ] ] x071:???????? [ up ] [ down ] [ detach ] x071:???????? [ af first[alias] address [ ... ] ] x071:???????? [ site6 site_number ] x071:???????? [ metric n ] x071:???????? [ mtu n ] x071:???????? [ arp | -arp ] x071:???????? [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ] x071:???????? [ tcp_low_rto n | -tcp_low_rto ] x071:???????? [ inet6 scope n zone n ] x071:???????? [[ inet4 | inet6 ][address transfer newinterface]] x071:??????? ifconfig tap_interface [ create | destroy ] x064: ifconfig: illegal option -- v x064: usage: ifconfig -a [ -m ] [ -d ] [ -u ] [ af ] x064:??????? ifconfig -l [ -d ] [ -u ] x064:??????? ifconfig [ -m ] interface x064:???????? [ af [ address [ dest_addr ] ] [ netmask mask ] [ broadcast addr ] x064:????????????? [ alias ] [ delete ] ] x064:???????? [ up ] [ down ] [ detach ] x064:???????? [ af first[alias] address [ ... ] ] x064:???????? [ site6 site_number ] x064:???????? [ metric n ] x064:???????? [ mtu n ] x064:???????? [ arp | -arp ] x064:???????? [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ] x064:???????? [ tcp_low_rto n | -tcp_low_rto ] x072: ifconfig: illegal option -- v x072: usage: ifconfig -a [ -d ] [ -u ] [ af ] x072:??????? ifconfig -l [ -d ] [ -u ] x072:??????? ifconfig interface x072:???????? [ af [ address [ dest_addr ] ] [ netmask mask ] [ broadcast addr ] x072:????????????? [ alias ] [ delete ] ] x072:???????? [ up ] [ down ] [ detach ] x072:???????? [ af first[alias] address [ ... ] ] x072:???????? [ site6 site_number ] x072:???????? [ metric n ] x072:???????? [ mtu n ] x072:???????? [ arp | -arp ] x072:???????? [ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ] x072:???????? [ tcp_low_rto n | -tcp_low_rto ] x072:???????? [ inet6 scope n zone n ] x072:??????? ifconfig tap_interface [ create | destroy ] ip link list: michael at x071:[/home/michael]dsh -n x064,x071,x072 "ip link list" x071: /bin/sh: ip:? not found x064: ksh: ip:? not found x072: ksh: ip:? not found arp -an: michael at x071:[/home/michael]dsh -n x064,x071,x072 "arp -an" x071:?? ? (192.168.129.254) at e0:28:6d:d6:eb:7b [ethernet] stored in bucket 27 x071: x071:?? ? (192.168.129.53) at 0:8:9b:c8:6:e6 [ethernet] stored in bucket 124 x071: x071:?? ? (192.168.129.61) at 0:14:5e:c7:f:ca [ethernet] stored in bucket 132 x071: x071:?? ? (192.168.129.64) at 0:21:5e:a3:c7:44 [ethernet] stored in bucket 135 x071: x071:?? ? (192.168.129.72) at fa:d1:83:60:33:4 [ethernet] stored in bucket 143 x071: x071:?? ? (192.168.2.254) at 94:a7:b7:4a:ad:a7 [ethernet] stored in bucket 146 x071: x071: bucket:??? 0???? contains:??? 0 entries x071: bucket:??? 1???? contains:??? 0 entries x071: bucket:??? 2???? contains:??? 0 entries ... x071: bucket:? 145???? contains:??? 0 entries x071: bucket:? 146???? contains:??? 1 entries x071: bucket:? 147???? contains:??? 0 entries x071: bucket:? 148???? contains:??? 0 entries x071: x071: There are 6 entries in the arp table. x064:?? ? (192.168.129.254) at e0:28:6d:d6:eb:7b [ethernet] stored in bucket 27 x064: x064:?? ? (192.168.129.71) at fa:d1:8c:f7:62:4 [ethernet] stored in bucket 142 x064: x064: bucket:??? 0???? contains:??? 0 entries x064: bucket:??? 1???? contains:??? 0 entries x064: bucket:??? 2???? contains:??? 0 entries x064: bucket:??? 3???? contains:??? 0 entries x064: bucket:??? 4???? contains:??? 0 entries x064: bucket:??? 5???? contains:??? 0 entries ... x064: bucket:? 147???? contains:??? 0 entries x064: bucket:? 148???? contains:??? 0 entries x064: x064: There are 2 entries in the arp table. x064: x072:?? ? (192.168.129.254) at e0:28:6d:d6:eb:7b [ethernet] stored in bucket 27 x072: x072:?? ? (192.168.129.2) at 28:d2:44:1e:ca:c8 [ethernet] stored in bucket 73 x072: x072:?? ? (192.168.129.61) at 0:14:5e:c7:f:ca [ethernet] stored in bucket 132 x072: x072:?? ? (192.168.129.63) at fa:d1:86:d4:97:4 [ethernet] stored in bucket 134 x072: x072:?? ? (192.168.129.71) at fa:d1:8c:f7:62:4 [ethernet] stored in bucket 142 x072: x072: bucket:??? 0???? contains:??? 0 entries x072: bucket:??? 1???? contains:??? 0 entries x072: bucket:??? 2???? contains:??? 0 entries x072: bucket:??? 3???? contains:??? 0 entries x072: bucket:??? 4???? contains:??? 0 entries ... x072: bucket:? 141???? contains:??? 0 entries x072: bucket:? 142???? contains:??? 1 entries x072: bucket:? 143???? contains:??? 0 entries x072: bucket:? 144???? contains:??? 0 entries x072: bucket:? 145???? contains:??? 0 entries x072: bucket:? 146???? contains:??? 0 entries x072: bucket:? 147???? contains:??? 0 entries x072: bucket:? 148???? contains:??? 0 entries x072: x072: There are 5 entries in the arp table. x072: lanscan -ai: michael at x071:[/home/michael]dsh -n x064,x071,x072 "lanscan -ai" x071: /bin/sh: lanscan:? not found x064: ksh: lanscan:? not found x072: ksh: lanscan:? not found > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 14:51:16 2017 From: report at bugs.python.org (Berker Peksag) Date: Wed, 22 Nov 2017 19:51:16 +0000 Subject: [issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers) In-Reply-To: <1384514692.62.0.115546674646.issue19610@psf.upfronthosting.co.za> Message-ID: <1511380276.56.0.213398074469.issue19610@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the ping and for the review! I will open a PR this week. ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 14:59:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 19:59:05 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511380745.26.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset bb11c3c967afaf263e00844d4ab461b7fafd6d36 by Victor Stinner in branch 'master': bpo-31324: Fix test.support.set_match_tests(None) (#4505) https://github.com/python/cpython/commit/bb11c3c967afaf263e00844d4ab461b7fafd6d36 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 15:35:31 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 22 Nov 2017 20:35:31 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511382931.12.0.213398074469.issue10544@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- assignee: levkivskyi -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 16:10:20 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 22 Nov 2017 21:10:20 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511385020.6.0.213398074469.issue32100@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The reason double-clicking got worse from 3.6.3 to now is this. Previously, browser.ModuleBrowserTreeItem.OnDoubleClick ignored the file_open global (set to pyshell.flist.open in .__init__) and called pyshell.flist.open. The Class and Method OnDoubleClick called file_open. So double-clicking a file name in pathbrowser opened the file, but expanding a file and double-clicking a class or function name raised "'NoneType' object is not callable". I don't know if I ever tried the latter before. We subsequently changed the Module DoubleClick to also use file_open, so double clicking a file name also raises. (I meant to submit this yesterday.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 16:38:49 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 22 Nov 2017 21:38:49 +0000 Subject: [issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX) In-Reply-To: <1456413023.18.0.874865601403.issue26439@psf.upfronthosting.co.za> Message-ID: <1511386729.27.0.213398074469.issue26439@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4444 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 16:56:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 21:56:09 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511387769.7.0.213398074469.issue27535@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4445 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 17:51:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 22:51:45 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511391105.87.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 82656276caf4cb889193572d2d14dbc5f3d2bdff by Victor Stinner in branch 'master': bpo-27535: Optimize warnings.warn() (#4508) https://github.com/python/cpython/commit/82656276caf4cb889193572d2d14dbc5f3d2bdff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 18:12:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 22 Nov 2017 23:12:11 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511392331.41.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset d4341109746aa15e1909e63b30b93b6133ffe401 by Victor Stinner in branch 'master': bpo-32030: Add _PyCoreConfig.module_search_path_env (#4504) https://github.com/python/cpython/commit/d4341109746aa15e1909e63b30b93b6133ffe401 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 18:18:19 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 22 Nov 2017 23:18:19 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests In-Reply-To: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> Message-ID: <1511392699.69.0.213398074469.issue32055@psf.upfronthosting.co.za> Nick Coghlan added the comment: If we do decide to do this, I'm inclined to eventually make the change at the Grammar level rather than the AST level. Current: comparison: expr (comp_op expr)* comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' Future: comparison: expr (comp_op expr)* | (containment_check) comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'is'|'is' 'not' containment_check: ('in'|'not' 'in') expr However, we'd still need an intermediate step like your PR in order to emit SyntaxWarning while still retaining the current semantics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 18:31:49 2017 From: report at bugs.python.org (David Cuthbert) Date: Wed, 22 Nov 2017 23:31:49 +0000 Subject: [issue32117] Tuple unpacking in return and yield statements Message-ID: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> New submission from David Cuthbert : This stems from a query on StackOverflow: https://stackoverflow.com/questions/47272460/python-tuple-unpacking-in-return-statement/ Specifically, the following syntax is allowed: def f(): rest = (4, 5, 6) t = 1, 2, 3, *rest While the following result in SyntaxError: def g(): rest = (4, 5, 6) return 1, 2, 3, *rest def h(): rest = (4, 5, 6) yield 1, 2, 3, *rest Looking at the original commit that enabled tuple unpacking in assignment statements: https://github.com/python/cpython/commit/4905e80c3d2f6abb613d212f0313d1dfe09475dc I don't believe this difference is intentional. My GitHub repo incorporates a fix for this; I'll file a pull request momentarily. ---------- components: Interpreter Core messages: 306761 nosy: dacut priority: normal severity: normal status: open title: Tuple unpacking in return and yield statements type: behavior versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 18:39:10 2017 From: report at bugs.python.org (David Cuthbert) Date: Wed, 22 Nov 2017 23:39:10 +0000 Subject: [issue32117] Tuple unpacking in return and yield statements In-Reply-To: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> Message-ID: <1511393950.46.0.213398074469.issue32117@psf.upfronthosting.co.za> Change by David Cuthbert : ---------- keywords: +patch pull_requests: +4446 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 18:48:29 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 22 Nov 2017 23:48:29 +0000 Subject: [issue31299] Add "ignore_modules" option to TracebackException.format() In-Reply-To: <1503992745.47.0.33675937395.issue31299@psf.upfronthosting.co.za> Message-ID: <1511394509.23.0.213398074469.issue31299@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I have prepared a patch (attached) with a possible implementation of the C function that can filter traceback objects modifying the traceback chain. I can make a PR if the patch looks good enough to start iterating over it. In case an alternative implementation is needed I am more than happy to prepare another patch/PR. ---------- keywords: +patch nosy: +pablogsal Added file: https://bugs.python.org/file47284/traceback_filter.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 18:56:08 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 22 Nov 2017 23:56:08 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511394968.97.0.213398074469.issue32030@psf.upfronthosting.co.za> Nick Coghlan added the comment: Victor, *please* don't add the external import settings to CoreConfig. That struct should only contain the absolute bare minimum of settings needed to get an interpreter that *can't* access the filesystem, such that builtin modules and frozen modules work, but nothing else does. If you need some extra structures to hold command line and environment state, that's fine, but the full external import system attributes should go in the main interpreter config, as described in https://www.python.org/dev/peps/pep-0432/#supported-configuration-settings ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:04:42 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 00:04:42 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511395482.65.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Victor, I think you're fundamentally misunderstanding the goals of PEP 432. The entire point is to let people have a *mostly working Python runtime* during CPython startup. Moving everything that Py_Initialize needs to instead have to happen before Py_InitializeRuntime (aka _Py_CoreInitialize) defeats that point. CoreConfig should thus contain *as little as possible*, with most of the environmental querying work moving into Py_ReadMainInterpreterConfig. So could you please move everything you've added to CoreConfig (that isn't genuinely required to from the moment the runtime starts doing anything) out again, and either put it into the main interpreter config as Python objects (as described in PEP 432), or else into a new intermediate configuration struct? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:05:27 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 23 Nov 2017 00:05:27 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511395527.94.0.213398074469.issue32100@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 20d48a44a54ed5e4a6df00e89ae27e3983128265 by Terry Jan Reedy (Cheryl Sabella) in branch 'master': bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (#4484) https://github.com/python/cpython/commit/20d48a44a54ed5e4a6df00e89ae27e3983128265 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:08:57 2017 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 23 Nov 2017 00:08:57 +0000 Subject: [issue32114] The get_event_loop change in bpo28613 did not update the documentation In-Reply-To: <1511375315.05.0.213398074469.issue32114@psf.upfronthosting.co.za> Message-ID: <1511395737.96.0.213398074469.issue32114@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +4447 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:11:51 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 00:11:51 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511395911.37.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Also, the basic rules of thumb I use for deciding whether or not a setting belongs in CoreConfig: * does `PyUnicode_New` need this? (If yes, then include it) * does the importlib bootstrapping need this? (If yes, then include it) Everything else goes in MainInterpreterConfig as a real Python object. We may need other structs internally to help manage the way Py_Main populates MainInterpreterConfig, but those should be made a required part of the future public initialization API (although we may decide to expose them as "use them if you want to better emulate CPython's default behaviour" helper APIs). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:14:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 00:14:37 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511396077.84.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4448 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:16:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 00:16:43 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511396203.81.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: Nick: Ok, I created PR 4511. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:18:17 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 00:18:17 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511396297.6.0.213398074469.issue32030@psf.upfronthosting.co.za> Nick Coghlan added the comment: Nice, thanks for that. Good call on keeping the current data types for now, so we can focus on consolidating the configuration settings first, and then look at upgrading from C level types to Python level types later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:19:33 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 23 Nov 2017 00:19:33 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511396373.11.0.213398074469.issue32100@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- pull_requests: +4449 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:21:14 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 00:21:14 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511396474.22.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Follow up: this also came up on https://bugs.python.org/issue32030#msg306763, and I think Victor and I are on the same page now :) Since MainInterpreterConfig is currently still a private struct, we can store the existing C level config state directly in there for now, and then look at upgrading to Python types on a case by case basis. Once they're all both consolidated *and* upgraded, then we can consider making the new incremental configuration API public. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:23:31 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 00:23:31 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1511396611.1.0.213398074469.issue10049@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 0784a2e5b174d2dbf7b144d480559e650c5cf64c by Nick Coghlan (Jesse-Bakker) in branch 'master': bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464) https://github.com/python/cpython/commit/0784a2e5b174d2dbf7b144d480559e650c5cf64c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:27:28 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 00:27:28 +0000 Subject: [issue10049] Add a "no-op" (null) context manager to contextlib In-Reply-To: <1286536426.03.0.247784217987.issue10049@psf.upfronthosting.co.za> Message-ID: <1511396848.93.0.213398074469.issue10049@psf.upfronthosting.co.za> Nick Coghlan added the comment: Thanks to Jesse Bakker for the PR implementing this for 3.7! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:29:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 00:29:45 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511396985.98.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: "Victor, I think you're fundamentally misunderstanding the goals of PEP 432. The entire point is to let people have a *mostly working Python runtime* during CPython startup. (...)" While the PEP 432 is nice, all changes are currently done in private APIs, symbols starting with _Py. I would prefer that nobody uses these new APIs before the conversion is complete. And from what I saw, I can say that the conversion just started, there are still a lot of changes that should be done. While having _PyRuntime.mem is nice to have in the long term, it doesn't add any value *right now*, except of making the existing C API harder to use. I would prefer to do things in this order: * Revert _PyRutime.mem * Finish PEP 432 implementation * Recreate _PyRutime.mem Maybe we can complete these 3 steps before Python 3.7, but I'm not sure about that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:43:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 00:43:39 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511397819.18.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: My PR 4502 implements all optimizations, but also converts warnings.filters to a tuple, to detect when detect attempts to modify directly warnings.filters, rather than using function calls. Problem: test.libregrtest module uses a pattern like this: old_filters = warnings.filters[:] # in function 1 (...) warnings.filters[:] = old_filters # in function 2 While this pattern is perfectly fine when filters is a list, "warnings.filters[:] = old_filters" fails since a tuple is immutable. Again, the question is if it's ok to break such code. I'm no more sure that catch_warnings() handles completly this use case, and a context manager is not convenient in the specific case of test.libregrest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:44:22 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 00:44:22 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511397862.61.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Even the public implementation of PEP 432 is going to bound by the requirement to keep existing embedding logic working, and that's encapsulated in the new test Eric added in his PR: wchar_t *program = Py_DecodeLocale("spam", NULL); Py_SetProgramName(program); Py_Initialize(); Py_Finalize(); PyMem_RawFree(program); So even if we were to revert the _PyRuntime.mem change in 3.7, we'd still face the same problem in 3.8, because we'd still be exposing the traditional configuration API - the new multi-step configuration API would be *optional* for folks that wanted to override the default settings more easily, rather than a backwards compatibility break with the previously supported way of doing things. As a result, my preferred option is now to make exactly the promises we need to ensure that the above code works correctly, and then have Py_Initialize and Py_Finalize enforce those constraints: * the public Py_Initialize API should fail if the memory allocators have already been set to something other than the default * Py_Finalize should revert the memory allocators to their default setting ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 19:49:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 00:49:47 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511398187.14.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e32e79f7d8216b78ac9e61bb1f2eee693108d4ee by Victor Stinner in branch 'master': bpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511) https://github.com/python/cpython/commit/e32e79f7d8216b78ac9e61bb1f2eee693108d4ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 20:05:37 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 23 Nov 2017 01:05:37 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511399137.42.0.213398074469.issue32100@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset ae3c5c7b9e5e5ba53213e12cc100e32415d5762c by Terry Jan Reedy in branch '3.6': [3.6] bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (GH-4484) (#4512) https://github.com/python/cpython/commit/ae3c5c7b9e5e5ba53213e12cc100e32415d5762c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 20:09:23 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 23 Nov 2017 01:09:23 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511399363.8.0.213398074469.issue32100@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thanks for catching and fixing this. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 20:30:53 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 01:30:53 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511400653.37.0.213398074469.issue10544@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 20:44:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 01:44:13 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511401453.15.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4450 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 21:04:38 2017 From: report at bugs.python.org (Russell Keith-Magee) Date: Thu, 23 Nov 2017 02:04:38 +0000 Subject: [issue5710] ctypes should return composite types from callbacks In-Reply-To: <1239038926.27.0.792638874347.issue5710@psf.upfronthosting.co.za> Message-ID: <1511402678.98.0.213398074469.issue5710@psf.upfronthosting.co.za> Russell Keith-Magee added the comment: For those interested, we developed a workaround for this in Rubicon: https://github.com/pybee/rubicon-objc/pull/85/files The fix involves using ctypes to access ctypes own internals, and build a modified version of the Structure data type that is able to perform a copy when used as returned value. Hopefully we'll be able to get this into the form of a patch for ctypes that is acceptable to Python core. ---------- nosy: +freakboy3742 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 21:10:39 2017 From: report at bugs.python.org (YCmove) Date: Thu, 23 Nov 2017 02:10:39 +0000 Subject: [issue32109] Separated square brackets will generate a tuple instead of a list. In-Reply-To: <1511334558.68.0.213398074469.issue32109@psf.upfronthosting.co.za> Message-ID: <1511403039.51.0.213398074469.issue32109@psf.upfronthosting.co.za> YCmove added the comment: Yes, what Cheryl Sabella says is what I was misled to. Took me a while to understand that ``[a]``, ``[a, b, c]`` is not ``[a], [a, b, c]``, how about replace comma to "or" for more clarity? just like it used in [tuple documention](https://github.com/python/cpython/blob/master/Doc/library/stdtypes.rst#tuples) Here is my rephrased version, and I add one more example of comma separated lists in tuple according to R. David Murray. ---------- hgrepos: +374 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 23:27:01 2017 From: report at bugs.python.org (Dubslow) Date: Thu, 23 Nov 2017 04:27:01 +0000 Subject: [issue32118] Docs: add note about sequence comparisons containing non-orderable elements Message-ID: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> New submission from Dubslow : In sequence comparisons, the enforcement of reflexivity of elements means that only non-identical elements are actually compared. The docs then note, with example, that non-reflexive elements thus always "compare" equal inside the sequence. This patch adds a second corollary, that non-orderable singletons (e.g. None) will also not break sequence comparison. Yes, the consequence is logically derivable from the statement "element identity is compared first, and element comparison is performed only for distinct elements", but the first example is given because "For non-reflexive elements, the result is different than for strict element comparison, and may be surprising", which also holds for the example I add here: different from strict element comparison, which may lead to otherwise surprising results (it sure was surprising to me when I expected a list with Nones to fail to compare, hence why I went trawling through the docs). In the manner of the first example, explicit is better than implicit, and (I believe) it will be helpful for readers to have this second consequence demonstrated. ---------- assignee: docs at python components: Documentation messages: 306780 nosy: Dubslow, docs at python priority: normal severity: normal status: open title: Docs: add note about sequence comparisons containing non-orderable elements versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 23:28:15 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 23 Nov 2017 04:28:15 +0000 Subject: [issue32118] Docs: add note about sequence comparisons containing non-orderable elements In-Reply-To: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> Message-ID: <1511411295.04.0.213398074469.issue32118@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +4451 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 23:35:42 2017 From: report at bugs.python.org (Dubslow) Date: Thu, 23 Nov 2017 04:35:42 +0000 Subject: [issue32118] Docs: add note about sequence comparisons containing non-orderable elements In-Reply-To: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> Message-ID: <1511411742.34.0.213398074469.issue32118@psf.upfronthosting.co.za> Dubslow added the comment: The PR includes an unrelated one word grammar fix in the same file, that can be removed (by me or by someone else, IDC). This is possibly backportable but I wouldn't know, and leave such decisions for someone who do. ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 01:16:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 06:16:52 +0000 Subject: [issue32117] Tuple unpacking in return and yield statements In-Reply-To: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> Message-ID: <1511417812.74.0.213398074469.issue32117@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since this changes the grammar, it should be first discussed on Python-Dev and approved by BDFL. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 01:17:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 06:17:21 +0000 Subject: [issue32117] Tuple unpacking in return and yield statements In-Reply-To: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> Message-ID: <1511417841.3.0.213398074469.issue32117@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.7 -Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 01:34:21 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 06:34:21 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511418861.58.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: "Just fix the issue" is easier said than done for the same reason that comprehensions were implemented the way they are now: lambda expressions still have to work. That is, we need to maintain the invariant that: [x for x in iterable] {x for x in iterable} (k:v for k, v in iterable) (x for x in iterable) give the same results (respectively) as: [(lambda: x)() for x in iterable] {(lambda: x)() for x in iterable} ((lambda: k)():(lambda: v)() for k, v in iterable) ((lambda: x)() for x in iterable) Once you work through the implications of "We need the loop variable to visible to lexically nested scopes, but invisible in the containing scope", you're going to end up with something that looks enough like a nested function that the easiest to implement and explain option is to have it *be* a nested function. I'd be fine with a resolution that forbade yield expressions directly inside implicit scopes, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 02:06:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 07:06:21 +0000 Subject: [issue30230] Move quick test in PyObject_IsSubClass outside of PyType_CheckExact guard In-Reply-To: <1493735445.03.0.987403403044.issue30230@psf.upfronthosting.co.za> Message-ID: <1511420781.67.0.213398074469.issue30230@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, please move this to Python-Dev. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 02:20:50 2017 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 23 Nov 2017 07:20:50 +0000 Subject: [issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own. In-Reply-To: <1498813368.34.0.349011380575.issue30811@psf.upfronthosting.co.za> Message-ID: <1511421650.8.0.213398074469.issue30811@psf.upfronthosting.co.za> Vinay Sajip added the comment: > I guess it's reasonable, I'll see whether we can use the workaround you proposed. OK, please post your findings here. > (Could a fix on virtualenv's side help?) Probably not, as it's not behaving unexpectedly. It might be worth asking the Travis devs for an enhancement to allow the choice of -m venv rather than virtualenv to create venvs for Python >= 3.3, via an option in .travis.yml. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 03:32:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 08:32:46 +0000 Subject: [issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" Message-ID: <1511425966.52.0.213398074469.issue32119@psf.upfronthosting.co.za> New submission from STINNER Victor : test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer": http://buildbot.python.org/all/#/builders/46/builds/60 0:52:21 load avg: 1.46 [378/406/1] test_multiprocessing_forkserver crashed (Exit code 1) Traceback (most recent call last): File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/forkserver.py", line 196, in main _serve_one(s, listener, alive_r, old_handlers) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/forkserver.py", line 231, in _serve_one code = spawn._main(child_r) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 114, in _main prepare(preparation_data) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 223, in prepare _fixup_main_from_name(data['init_main_from_name']) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 249, in _fixup_main_from_name alter_sys=True) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 201, in run_module mod_name, mod_spec, code = _get_module_details(mod_name) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 153, in _get_module_details code = loader.get_code(mod_name) File "", line 762, in get_code ValueError: cannot convert float NaN to integer Timeout (0:25:00)! Thread 0xa000d000 (most recent call first): File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/connection.py", line 379 in _recv File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/connection.py", line 407 in _recv_bytes File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/connection.py", line 250 in recv File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/managers.py", line 757 in _callmethod File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/managers.py", line 987 in acquire File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 1044 in test_notify_all File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/case.py", line 605 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/case.py", line 653 in __call__ File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 122 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 122 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 122 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/runner.py", line 176 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/support/__init__.py", line 1888 in _run_suite File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/support/__init__.py", line 1932 in run_unittest File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/runtest.py", line 172 in test_runner File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/runtest.py", line 173 in runtest_inner File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/runtest.py", line 127 in runtest File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/runtest_mp.py", line 71 in run_tests_slave File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/main.py", line 516 in _main File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/main.py", line 509 in main File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/main.py", line 584 in main File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/regrtest.py", line 46 in _main File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/regrtest.py", line 50 in File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 85 in _run_code File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 193 in _run_module_as_main Moreover, when test_multiprocessing_forkserver was run a second time, a different test failed, test_forkserver_sigkill(): Re-running test 'test_multiprocessing_forkserver' in verbose mode (...) test_forkserver_sigint (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ... ok test_forkserver_sigkill (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ... FAIL test_lose_target_ref (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ... ok (...) ====================================================================== FAIL: test_forkserver_sigkill (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 496, in test_forkserver_sigkill self.check_forkserver_death(signal.SIGKILL) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 486, in check_forkserver_death self.assertTrue(evt.is_set()) AssertionError: False is not true ---------- components: Tests messages: 306787 nosy: vstinner priority: normal severity: normal status: open title: test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 03:44:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 08:44:11 +0000 Subject: [issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" In-Reply-To: <1511425966.52.0.213398074469.issue32119@psf.upfronthosting.co.za> Message-ID: <1511426651.66.0.213398074469.issue32119@psf.upfronthosting.co.za> STINNER Victor added the comment: "ValueError: cannot convert float NaN to integer": this error occurred on int(float), where the float comes from os.stat() File "", line 762, in get_code Lib/importlib/_bootstrap_external.py: def get_code(self, fullname): ... st = self.path_stats(source_path) ... source_mtime = int(st['mtime']) <~~~~~~ HERE ... def path_stats(self, path): st = _path_stat(path) return {'mtime': st.st_mtime, 'size': st.st_size} def _path_stat(path): return _os.stat(path) => The float NaN comes from os.stat().st_mtime. Implementation of os.stat().st_mtime in Modules/posixmodule.c: static PyObject* _pystat_fromstructstat(STRUCT_STAT *st) { ... #if defined(HAVE_STAT_TV_NSEC) ansec = st->st_atim.tv_nsec; mnsec = st->st_mtim.tv_nsec; cnsec = st->st_ctim.tv_nsec; #elif defined(HAVE_STAT_TV_NSEC2) ansec = st->st_atimespec.tv_nsec; mnsec = st->st_mtimespec.tv_nsec; cnsec = st->st_ctimespec.tv_nsec; #elif defined(HAVE_STAT_NSEC) ansec = st->st_atime_nsec; mnsec = st->st_mtime_nsec; cnsec = st->st_ctime_nsec; #else ansec = mnsec = cnsec = 0; #endif fill_time(v, 7, st->st_atime, ansec); fill_time(v, 8, st->st_mtime, mnsec); fill_time(v, 9, st->st_ctime, cnsec); ... } static void fill_time(PyObject *v, int index, time_t sec, unsigned long nsec) { ... float_s = PyFloat_FromDouble(sec + 1e-9*nsec); <~~~~~~ HERE ... PyStructSequence_SET_ITEM(v, index+3, float_s); ... } Extract of the ./configure script output: checking for tv_nsec in struct stat... no checking for tv_nsec2 in struct stat... yes => configure defines HAVE_STAT_TV_NSEC2 We need sec and nsec values from fill_time() to debug this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 03:48:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 08:48:51 +0000 Subject: [issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" In-Reply-To: <1511425966.52.0.213398074469.issue32119@psf.upfronthosting.co.za> Message-ID: <1511426931.16.0.213398074469.issue32119@psf.upfronthosting.co.za> STINNER Victor added the comment: It may also be compiler issue. * CPU: Intel x86 * compiler: GCC 4.0.1 (Apple Computer, Inc. build 5367) * CFLAGS: -fno-strict-aliasing -Wsign-compare -g -O0 -Wall -Wstrict-prototypes * OS: macOS Tiger * Kernel: Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 Extract of pythoninfo: os.uname: posix.uname_result(sysname='Darwin', nodename='osx', release='8.11.1', version='Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386', machine='i386') platform.architecture: 32bit platform.platform: Darwin-8.11.1-i386-32bit platform.python_implementation: CPython sys.version: 3.6.3+ (heads/3.6:ae3c5c7, Nov 22 2017, 20:39:07) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] sysconfig[CFLAGS]: -fno-strict-aliasing -Wsign-compare -g -O0 -Wall -Wstrict-prototypes ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 03:49:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 08:49:38 +0000 Subject: [issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" In-Reply-To: <1511425966.52.0.213398074469.issue32119@psf.upfronthosting.co.za> Message-ID: <1511426978.07.0.213398074469.issue32119@psf.upfronthosting.co.za> STINNER Victor added the comment: This issue is very similar, likely the same bug, than bpo-13986. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 03:49:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 08:49:46 +0000 Subject: [issue13986] ValueError: cannot convert float NaN to integer In-Reply-To: <1328874238.47.0.897260032056.issue13986@psf.upfronthosting.co.za> Message-ID: <1511426986.85.0.213398074469.issue13986@psf.upfronthosting.co.za> STINNER Victor added the comment: See also bpo-32119. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 03:57:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 08:57:27 +0000 Subject: [issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" In-Reply-To: <1511425966.52.0.213398074469.issue32119@psf.upfronthosting.co.za> Message-ID: <1511427447.08.0.213398074469.issue32119@psf.upfronthosting.co.za> STINNER Victor added the comment: Similar error: bpo-14028, "Using a 32-bit Python 2.6.5 on a Linux system", reported at 2012-02-16. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 04:24:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 09:24:09 +0000 Subject: [issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" In-Reply-To: <1511425966.52.0.213398074469.issue32119@psf.upfronthosting.co.za> Message-ID: <1511429049.98.0.213398074469.issue32119@psf.upfronthosting.co.za> STINNER Victor added the comment: Interesting info about NaN on Intel x86: https://stackoverflow.com/questions/14021763/c-multiplication-or-addition-floats-results-nan "The multiplication is being performed in the x87 registers, and a floating-point stack overflow has occurred due to (possibly unrelated) earlier operations in your program's execution. When the processor is in this failure state, all computations performed on the x87 registers produce NaN results." -- For FreeBSD, Python main() starts with: /* 754 requires that FP exceptions run in "no stop" mode by default, * and until C vendors implement C99's ways to control FP exceptions, * Python requires non-stop mode. Alas, some platforms enable FP * exceptions by default. Here we disable them. */ #ifdef __FreeBSD__ fedisableexcept(FE_OVERFLOW); #endif ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 04:24:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 09:24:15 +0000 Subject: [issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" In-Reply-To: <1511425966.52.0.213398074469.issue32119@psf.upfronthosting.co.za> Message-ID: <1511429055.71.0.213398074469.issue32119@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 04:33:08 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 09:33:08 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511429588.05.0.213398074469.issue27535@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4453 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 04:43:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 09:43:16 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511430196.95.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 1f15111a6e15d52f6b08907576ec61493cd59358 by Victor Stinner in branch 'master': bpo-32030: Add _PyMainInterpreterConfig.pythonhome (#4513) https://github.com/python/cpython/commit/1f15111a6e15d52f6b08907576ec61493cd59358 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 04:53:46 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 23 Nov 2017 09:53:46 +0000 Subject: [issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character In-Reply-To: <1188943421.22.0.776458935296.issue1104@psf.upfronthosting.co.za> Message-ID: <1511430826.88.0.213398074469.issue1104@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4454 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 04:59:53 2017 From: report at bugs.python.org (Tzu-ping Chung) Date: Thu, 23 Nov 2017 09:59:53 +0000 Subject: [issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character In-Reply-To: <1188943421.22.0.776458935296.issue1104@psf.upfronthosting.co.za> Message-ID: <1511431193.44.0.213398074469.issue1104@psf.upfronthosting.co.za> Tzu-ping Chung added the comment: I have created a PR #4517 from the patch. Would it be better to track the malloc problem in a new issue? As for why this never caused any problems? msilib is pretty standalone, and not one of the most used modules. It is also pretty trivial to roll your own solution with ctypes (or any FFI library), which is what I did when I hit this bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 05:13:25 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 23 Nov 2017 10:13:25 +0000 Subject: [issue28538] _socket module cross-compilation error on android-24 In-Reply-To: <1477474733.85.0.0781476042155.issue28538@psf.upfronthosting.co.za> Message-ID: <1511432005.12.0.213398074469.issue28538@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 5ad7ef8e420de8a54fb30ed37362194c6b96012c by xdegaye in branch 'master': bpo-28538: Revert all the changes (now using Android Unified Headers) (GH-4479) https://github.com/python/cpython/commit/5ad7ef8e420de8a54fb30ed37362194c6b96012c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 05:15:27 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 23 Nov 2017 10:15:27 +0000 Subject: [issue28538] _socket module cross-compilation error on android-24 In-Reply-To: <1477474733.85.0.0781476042155.issue28538@psf.upfronthosting.co.za> Message-ID: <1511432127.2.0.213398074469.issue28538@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: not a bug -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 05:19:11 2017 From: report at bugs.python.org (Tzu-ping Chung) Date: Thu, 23 Nov 2017 10:19:11 +0000 Subject: [issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character In-Reply-To: <1188943421.22.0.776458935296.issue1104@psf.upfronthosting.co.za> Message-ID: <1511432351.35.0.213398074469.issue1104@psf.upfronthosting.co.za> Tzu-ping Chung added the comment: I made a shot to address the free() call. Hopefully this makes sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 05:44:40 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 23 Nov 2017 10:44:40 +0000 Subject: [issue29040] building Android with android-ndk-r14 In-Reply-To: <1482351865.89.0.655034997181.issue29040@psf.upfronthosting.co.za> Message-ID: <1511433880.47.0.213398074469.issue29040@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset c06c22e9a9fb9326e79fcf1551601eacc1fd457d by xdegaye in branch 'master': bpo-29040: Support building Android with Unified Headers (GH-4492) https://github.com/python/cpython/commit/c06c22e9a9fb9326e79fcf1551601eacc1fd457d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 05:46:12 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 23 Nov 2017 10:46:12 +0000 Subject: [issue29040] building Android with android-ndk-r14 In-Reply-To: <1482351865.89.0.655034997181.issue29040@psf.upfronthosting.co.za> Message-ID: <1511433972.57.0.213398074469.issue29040@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 05:47:02 2017 From: report at bugs.python.org (Pierre Quentel) Date: Thu, 23 Nov 2017 10:47:02 +0000 Subject: [issue30576] http.server should support HTTP compression (gzip) In-Reply-To: <1496691724.59.0.955308322691.issue30576@psf.upfronthosting.co.za> Message-ID: <1511434022.29.0.213398074469.issue30576@psf.upfronthosting.co.za> Pierre Quentel added the comment: On the Github site Raymond Hettinger is mentioned as the reviewer. I don't know how to contact him, can anyone ask him if he can review the PR on time for inclusion in Python 3.7 ? I understand that it's difficult to find time for this and that there are many pending PRs ; I can't judge if this one is more or less important than the others, but the issue has been discussed for a few months now, the code has been improved after many iterations, so hopefully it should not be too far from approval. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:01:43 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 23 Nov 2017 11:01:43 +0000 Subject: [issue28762] lockf() is available now on Android API level 24, but the F_LOCK macro is not defined In-Reply-To: <1479723589.5.0.525775136475.issue28762@psf.upfronthosting.co.za> Message-ID: <1511434903.65.0.213398074469.issue28762@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 5ce1069a6ff0d5443074d33ba1d403ccd2eaf3d3 by xdegaye in branch 'master': bpo-28762: Revert last commit (now using Android Unified Headers) (GH-4488) https://github.com/python/cpython/commit/5ce1069a6ff0d5443074d33ba1d403ccd2eaf3d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:02:01 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 23 Nov 2017 11:02:01 +0000 Subject: [issue28762] lockf() is available now on Android API level 24, but the F_LOCK macro is not defined In-Reply-To: <1479723589.5.0.525775136475.issue28762@psf.upfronthosting.co.za> Message-ID: <1511434921.4.0.213398074469.issue28762@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: not a bug -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:07:19 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 11:07:19 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511435239.82.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: Also see https://bugs.python.org/issue1660500 for the original Python 3.0 change to hide the iteration variable. While the test suite already covers some interesting scoping edge cases as result of that initial patch, I think one we're currently missing is the nested comprehension case: >>> [[x for x in range(1, i)] for i in range(2, 5)] [[1], [1, 2], [1, 2, 3]] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:14:19 2017 From: report at bugs.python.org (Abinaya) Date: Thu, 23 Nov 2017 11:14:19 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 Message-ID: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> New submission from Abinaya : Hi, We have installed python-3.6.0 on our RedHat 6 machine. when we are trying to import sqlite module in python_v36 we could see below issue, [root at euca-10-254-72-197 rpmbuild]$ python Python 3.6.0 (default, Nov 23 2017, 12:46:54) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. import sqlite3 Traceback (most recent call last): File "", line 1, in File "/opt/python/x86_64/3.6.0-1/lib/python3.6/sqlite3/init.py", line 23, in from sqlite3.dbapi2 import * File "/opt/python/x86_64/3.6.0-1/lib/python3.6/sqlite3/dbapi2.py", line 27, in from _sqlite3 import * ModuleNotFoundError: No module named '_sqlite3' While installing the python manually we could see below line on installation log **************************************** Failed to build these modules: _hashlib _ssl Following modules built successfully but were removed because they could not be imported: _sqlite3 **************************************** It seems to be sqlite is getting broken. Below sqlite versions are already installed on my machine: ******************************************** [root at euca-10-254-72-197 rpmbuild]$ rpm -qa | grep sqlite qt-sqlite-4.6.2-28.el6_5.x86_64 sqlite-devel-3.6.20-1.el6_7.2.x86_64 sqlite-3.6.20-1.el6_7.2.x86_64 libdbi-dbd-sqlite-0.8.3-5.1.el6.x86_64 ********************************************** Also sqlite3 seems to be working fine without any issue on python2. Can anyone please help me on this. Regards, Abinaya ---------- components: Build messages: 306803 nosy: abinaya priority: normal severity: normal status: open title: python 3.6.0 is not importing sqlite3 type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:27:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 11:27:57 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511436477.22.0.213398074469.issue10544@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I see nothing special in `[[x for x in range(1, i)] for i in range(2, 5)]`. This should be equivalent to: __result = []; __i = None try: for __i in range(2, 5): __result2 = []; __x = None try: for __x in range(1, __i) __result2.append(__x) __result.append(__result2) finally: del __result2, __x finally: del __i ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:28:58 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 11:28:58 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511436538.03.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: Another slight variant to that test case to make sure the inner comprehension actually generates a closure reference in the current implementation: >>> [[x+y for x in range(2) for y in range(1, i)] for i in range(2, 5)] [[1, 2], [1, 2, 2, 3], [1, 2, 3, 2, 3, 4]] These are the kind of challenges that drove of us towards the current implementation. While the status quo definitely has its downsides, those downsides at least all flow directly from "There's an implicit nested function there that you're not expecting". Yury took all this into account when designing the interaction between `await` and comprehensions (which is why that's in a better state), but for `yield` we inherited the existing behaviour of any other nested function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:37:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 11:37:35 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511437055.06.0.213398074469.issue10544@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is straightforward. __result = []; __i = None try: for __i in range(2, 5): __result2 = []; __x = __y = None try: for __x in range(2): for __y in range(1, __i): __result2.append(__x + __y) __result.append(__result2) finally: del __result2, __x, __y finally: del __i ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:38:01 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 23 Nov 2017 11:38:01 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511437081.86.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: Sure, you can technically do that, but you'll have to rewrite most of the symtable pass in the compiler, since you won't be able to re-use the current recursive descent algorithms (which are designed to handle function scopes). That ran afoul of "If the implementation is hard to explain, it's a bad idea." Where that gets particularly nasty is when you nest comprehensions with the *same* iteration variable name: >>> [[i for i in range(2)] for i in range(2)] [[0, 1], [0, 1]] Now your name generator needs to be clever enough to account for how many levels deep it is. You also run into the lexical scoping problem anyway once a lambda expression shows up: >>> [[(lambda i=i: i)() for i in range(2)] for i in range(2)] [[0, 1], [0, 1]] >>> [[(lambda: i)() for i in range(2)] for i in range(2)] [[0, 1], [0, 1]] As noted earlier, not impossible to resolve, but for from the "simple" option that folks seem to believe it is (and which I thought it would be before I actually tried to implement it while respecting Python's lexical scoping rules). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:47:34 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 11:47:34 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511437654.49.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Nick, > Yury took all this into account when designing the interaction between `await` and comprehensions (which is why that's in a better state), but for `yield` we inherited the existing behaviour of any other nested function. Actually the fact that `await` in comprehensions already works right is one of my main arguments that we can also fix `yield`. So I am totally with Serhiy here. ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:55:23 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 11:55:23 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511438123.65.0.213398074469.issue32120@psf.upfronthosting.co.za> Berker Peksag added the comment: 3.6.0 was required sqlite 3.7.4 but the requirement was lifted in Python 3.6.1. 3.6.3 is the latest release of Python 3.6. Please try Python 3.6.3. Also, this is a duplicate of issue 29098. ---------- components: +Extension Modules -Build nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> document minimum sqlite version type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 07:00:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 12:00:03 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511438403.45.0.213398074469.issue10544@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Consider this as a sort of optimization. A function inlining. In general case we can't inline a function because it can be rebinded at any time, but in this particular case we call a just created function that doesn't have any references and live only on the stack a, and we have all information for generating an inlined code. This will allow to get rid of the overhead for creating and calling a one-time function. The naming problem is the hardest problem. We should assign unique names for internal variables, like '.0.x'. We already do this for the single parameter of a one-time function. Or we could just use a stack (this requires more work but has additional benefits). If you want to think about comprehensions as about calling inner functions, you can do this. And you can think about comprehensions as about loops which don't leak inner variables. The behavior should be absolutely identical until you will use "yield" which would turn your list producing function into a generator. If make "yield" turning into a generator not an implicit inner function, but an explicit enclosing function, a comprehension could be represented via an implicit inner function. Currently there is no way to express this in Python syntax, but before introducing "yield" there was no way to express its semantic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 07:00:10 2017 From: report at bugs.python.org (Abinaya) Date: Thu, 23 Nov 2017 12:00:10 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511438410.51.0.213398074469.issue32120@psf.upfronthosting.co.za> Abinaya added the comment: Thanks for the update. Could you please let me know if we build latest python_v363 then sqlite will be work right. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 07:03:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 12:03:43 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511438623.29.0.213398074469.issue10544@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I concur with Ivan. It would be nice to me to disallow "yield" in comprehensions and generator expressions, but the fact that "await" in comprehensions already works right, and this behavior is intentional and useful, make me thinking that "yield" should work in comprehensions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 07:44:57 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 12:44:57 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511441097.8.0.213398074469.issue32120@psf.upfronthosting.co.za> Berker Peksag added the comment: > Could you please let me know if we build latest python_v363 then sqlite > will be work right. It should build fine with Python 3.6.3. Let us know if you can't get it working. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 07:47:35 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 12:47:35 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511441255.91.0.213398074469.issue1102@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset bdb8315c21825487b54852ff0511fb4881ea2181 by Berker Peksag in branch 'master': bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459) https://github.com/python/cpython/commit/bdb8315c21825487b54852ff0511fb4881ea2181 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 07:48:15 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 12:48:15 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511441295.59.0.213398074469.issue1102@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- stage: patch review -> backport needed versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 08:12:22 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 13:12:22 +0000 Subject: [issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers) In-Reply-To: <1384514692.62.0.115546674646.issue19610@psf.upfronthosting.co.za> Message-ID: <1511442742.06.0.213398074469.issue19610@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +4456 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 08:12:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 13:12:53 +0000 Subject: [issue32039] timeit documentation should describe caveats In-Reply-To: <1510774996.46.0.213398074469.issue32039@psf.upfronthosting.co.za> Message-ID: <1511442773.77.0.213398074469.issue32039@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yet one mistake: https://stackoverflow.com/questions/35014951/why-is-max-slower-than-sort $ python3 -m timeit -s 'import random;a=list(range(10000));random.shuffle(a)' 'a.sort();a[-1]' Here the list is sorted at first iteration, and all following iterations measure the speed of sorting a sorted list. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 08:22:18 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 13:22:18 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511443338.97.0.213398074469.issue1102@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +4457 stage: backport needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 08:23:58 2017 From: report at bugs.python.org (uday kiran) Date: Thu, 23 Nov 2017 13:23:58 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511443438.05.0.213398074469.issue1102@psf.upfronthosting.co.za> uday kiran added the comment: Will it be added to 3.6 also? And when it will be available in the windows installations you release? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 08:27:30 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 13:27:30 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511443650.31.0.213398074469.issue1102@psf.upfronthosting.co.za> Berker Peksag added the comment: > Will it be added to 3.6 also? Yes, I've created a backport PR: PR 4520 > And when it will be available in the windows installations you release? The dates for 3.6.4 release is listed at https://www.python.org/dev/peps/pep-0494/#id4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 08:28:46 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 13:28:46 +0000 Subject: [issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers) In-Reply-To: <1384514692.62.0.115546674646.issue19610@psf.upfronthosting.co.za> Message-ID: <1511443726.22.0.213398074469.issue19610@psf.upfronthosting.co.za> Berker Peksag added the comment: ?ric and Henk-Jaap: I've now opened PR 4519. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 08:40:02 2017 From: report at bugs.python.org (Abinaya) Date: Thu, 23 Nov 2017 13:40:02 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511444402.74.0.213398074469.issue32120@psf.upfronthosting.co.za> Abinaya added the comment: Thanks for the help. If we import pysqlite2 I could see the error that pysqlite2 module not found. Please let us know is there anyway to get pysqlite2 in python_v363. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 09:00:42 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 14:00:42 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511445642.24.0.213398074469.issue32120@psf.upfronthosting.co.za> Berker Peksag added the comment: pysqlite2 only works in Python 2: https://github.com/ghaering/pysqlite/blob/e728ffbcaeb7bfae1d6b7165369bd0ae16cabf95/setup.py#L25-L28 You don't need to install pysqlite2 in Python 3. The latest release of Python 3.6 (which is 3.6.3, not 3.6.0) should work fine with sqlite3 3.6.20. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 09:33:14 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 14:33:14 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511447594.06.0.213398074469.issue1102@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 4b3042900e7e8dc120408bab86642c09c9d25a5a by Berker Peksag in branch '3.6': bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459) https://github.com/python/cpython/commit/4b3042900e7e8dc120408bab86642c09c9d25a5a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 09:34:19 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 14:34:19 +0000 Subject: [issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger() In-Reply-To: <1188940010.27.0.383470464739.issue1102@psf.upfronthosting.co.za> Message-ID: <1511447659.81.0.213398074469.issue1102@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you, Anthony. I added a test case and committed your patch to 3.6 and master branches. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 09:52:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 14:52:25 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511448745.52.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4458 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 10:11:00 2017 From: report at bugs.python.org (Leo kirotawa silva) Date: Thu, 23 Nov 2017 15:11:00 +0000 Subject: [issue30657] Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511449860.88.0.213398074469.issue30657@psf.upfronthosting.co.za> Leo kirotawa silva added the comment: I couldn't reproduce using the poc, but seems python3.5 is also vulnerable to this bug. The code from py3.5 are quite similar to 2.7. In py3.5: Objects/bytesobject.c PyBytes_DecodeEscape ---------- nosy: +Leo kirotawa silva _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 10:35:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 15:35:34 +0000 Subject: [issue29512] regrtest refleak: implement bisection feature In-Reply-To: <1486640763.77.0.630012847727.issue29512@psf.upfronthosting.co.za> Message-ID: <1511451334.4.0.213398074469.issue29512@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4459 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 10:41:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 15:41:51 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511451711.53.0.213398074469.issue31324@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4460 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:03:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 16:03:22 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511453002.43.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 0327bde9da203bb256b58218d012ca76ad0db4e4 by Victor Stinner in branch 'master': bpo-32030: Rewrite calculate_path() (#4521) https://github.com/python/cpython/commit/0327bde9da203bb256b58218d012ca76ad0db4e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:04:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 16:04:37 +0000 Subject: [issue29512] regrtest refleak: implement bisection feature In-Reply-To: <1486640763.77.0.630012847727.issue29512@psf.upfronthosting.co.za> Message-ID: <1511453077.18.0.213398074469.issue29512@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 448c6739877a4143a2c3599f041fa6127f354044 by Victor Stinner in branch '2.7': bpo-29512: Fix Lib/test/bisect.py shebang (#4522) https://github.com/python/cpython/commit/448c6739877a4143a2c3599f041fa6127f354044 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:06:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 16:06:05 +0000 Subject: [issue30657] Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511453165.01.0.213398074469.issue30657@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Right, but it is not easy to exploit this bug. You need to parse Python sources longer than 512 MiB in 32-bit Python. Python 3.5 currently takes only fixes for security bugs. I left on to Larry to decide whether it is worth to port the fix to 3.5. ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:12:57 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 23 Nov 2017 16:12:57 +0000 Subject: [issue32118] Docs: add note about sequence comparisons containing non-orderable elements In-Reply-To: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> Message-ID: <1511453577.32.0.213398074469.issue32118@psf.upfronthosting.co.za> R. David Murray added the comment: The surprising thing is the behavior of NaN, which is *not equal* to itself. The statement about orderability says "...are ordered the same as their first unequal elements". This is explicit and unambiguous, there is no difference in this context between the number 1 and the singleton None, or the reflexivity enforced on NaN: all are equal to the corresponding element from the other sequence. The whole point of the paragraph is that *no order test is done until the first unequal element is encountered*. If we want to make this *more* explicit, I would suggest simply adding the following sentence after the first example in the original paragraph: "This means that reflexive elements that are otherwise unorderable (such as None and NaN) do not trigger a TypeError during a comparison." ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:13:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 16:13:46 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511453626.7.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b98f1715a35d2cbd1e9e45e1e7ae51a39e00dc4a by Victor Stinner in branch 'master': bpo-27535: Cleanup create_filter() (#4516) https://github.com/python/cpython/commit/b98f1715a35d2cbd1e9e45e1e7ae51a39e00dc4a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:21:14 2017 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 23 Nov 2017 16:21:14 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1511438623.29.0.213398074469.issue10544@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Remind me what happens when you use `await` in a generator expression that survives the async function's scope? async def f(xs): return (await x for x in xs) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:24:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 16:24:12 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511454252.42.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Wait, now I understand the purpose of the current test! There is just a typo in a comment, should be 41 instead of 47. The test itself is correct. If the address is obtained from network cards, it should have the 41 bit clear. If it is generated randomly, it should have the 41 bit set, to avoid conflicts with addresses obtained from network cards. There is nothing about the 42 bit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:26:26 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 16:26:26 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511454386.24.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: > Remind me what happens when you use `await` in a generator expression that survives the async function's scope? Awaiting on f([1, 2]) will result in an async generator (even though yield never appears here). Yury explained why this happens in https://bugs.python.org/issue32113 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:29:33 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 16:29:33 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511454573.73.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: (Of course there should be not [1, 2] in the argument, but a list of some awaitables, otherwise there will be an error later.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:32:06 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 23 Nov 2017 16:32:06 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511454726.11.0.213398074469.issue10544@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Yury explained why this happens in https://bugs.python.org/issue32113 It happens because '(x for x in xs)' creates a synchronous generator. So when there's an 'await' in it, it creates an asynchronous generator. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:33:09 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 23 Nov 2017 16:33:09 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511454789.47.0.213398074469.issue10544@psf.upfronthosting.co.za> Yury Selivanov added the comment: It's also important to note, that in 3.7, this is legal: def foo(): return (await x for x in xs) Note that 'foo' is a regular function, not 'async def'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:36:33 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 16:36:33 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511454993.17.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: ... but [await x for x in xs] is still valid _only_ inside async def. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:38:06 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 23 Nov 2017 16:38:06 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511455086.18.0.213398074469.issue10544@psf.upfronthosting.co.za> Yury Selivanov added the comment: > ... but [await x for x in xs] is still valid _only_ inside async def. Yes, because it's computed right where it is defined. a = [x for x in xs] # `a` is a list object a = (x for x in xs) # `a` is a generator Do you understand the difference? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:40:00 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 16:40:00 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511455200.71.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Well, after all I am thinking maybe it is indeed makes sense to ban `yield` inside both sync/async and both comprehensions/generator expressions. Since we already have a sm?rg?sbord of intuitive behaviors. This, _together_ with extensive clarification to the docs and error messages can fix the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:42:07 2017 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 23 Nov 2017 16:42:07 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1511454993.17.0.213398074469.issue10544@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: I honestly think we went too far here. Asynchronous generators are still provisional. Though the PEP is silent about this, the acceptance notice is clear: https://mail.python.org/pipermail/python-dev/2016-September/146267.html. I propose to rip them out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:42:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 16:42:11 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511455331.35.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 70b2f8797146a56a6880743424f0bedf4fc30c62 by Victor Stinner in branch '3.6': [3.6] bpo-31324: Optimize support._match_test() (#4523) https://github.com/python/cpython/commit/70b2f8797146a56a6880743424f0bedf4fc30c62 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:42:36 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 23 Nov 2017 16:42:36 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511455356.53.0.213398074469.issue10544@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Well, after all I am thinking maybe it is indeed makes sense to ban `yield` inside both sync/async and both comprehensions/generator expressions. I agree, as I can't imagine a real use case for a = ((yield a) for a in as) which is really equivalent to def a(): for a in as: yield (yield a) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:44:07 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 16:44:07 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511455447.74.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: > Do you understand the difference? Yury, sorry, but what is your problem? Have I said something about that this is bad. Your tone is clearly insulting, and this is not the first time. Maybe it makes sense to have some respect? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:47:52 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 23 Nov 2017 16:47:52 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511455672.98.0.213398074469.issue10544@psf.upfronthosting.co.za> Yury Selivanov added the comment: >> Do you understand the difference? > Yury, sorry, but what is your problem? Have I said something about that this is bad. Your tone is clearly insulting, and this is not the first time. Maybe it makes sense to have some respect? Sorry, I didn't mean to insult anybody. I asked an honest question with an intent to clarify if there's some misunderstanding of the topic that I'm partially responsible for in CPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:50:02 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 16:50:02 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511455802.42.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Yury OK, sorry then this is a misunderstanding from my side. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:52:02 2017 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 23 Nov 2017 16:52:02 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511455922.19.0.213398074469.issue10544@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Yury OK, sorry then this is a misunderstanding from my side. NP. Again, sorry if I sounded that way to you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:54:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 16:54:19 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511456059.07.0.213398074469.issue31324@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4461 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:54:38 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 16:54:38 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511456078.42.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Guido, I am not sure about the complete removal, this is probably to radical. What I think we are missing more detailed docs that would be clear about the corner cases. (I already mentioned this in https://bugs.python.org/issue32113) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 11:56:25 2017 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 23 Nov 2017 16:56:25 +0000 Subject: [issue13986] ValueError: cannot convert float NaN to integer In-Reply-To: <1328874238.47.0.897260032056.issue13986@psf.upfronthosting.co.za> Message-ID: <1511456185.88.0.213398074469.issue13986@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- nosy: -gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 12:03:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 17:03:34 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511456614.28.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4462 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 12:05:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 17:05:56 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex In-Reply-To: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> Message-ID: <1511456756.17.0.213398074469.issue31979@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4463 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 12:09:03 2017 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 23 Nov 2017 17:09:03 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1511456078.42.0.213398074469.issue10544@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: I think we all need to calm down a bit. How about not posting about this topic for 24 hours. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 12:10:51 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 23 Nov 2017 17:10:51 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511457051.56.0.213398074469.issue10544@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: > How about not posting about this topic for 24 hours. OK, makes sense :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 12:34:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 17:34:03 +0000 Subject: [issue32055] Reconsider comparison chaining for containment tests In-Reply-To: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> Message-ID: <1511458443.12.0.213398074469.issue32055@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm reading the list of most rated in a week questions on StackOverflow (https://python-weekly.blogspot.com/), and it seems to me that the question about chained "in" and "not in" is raised every few months. This may be the one of the most confusing quirks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 12:35:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 17:35:05 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511458505.67.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 35d99830f1878867e3964577741d9a2d5a7fc8f7 by Victor Stinner in branch '2.7': bpo-31324: Optimize support._match_test() (#4523) (#4524) https://github.com/python/cpython/commit/35d99830f1878867e3964577741d9a2d5a7fc8f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 12:36:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 17:36:02 +0000 Subject: [issue31324] support._match_test() used by test.bisect is very inefficient In-Reply-To: <1504278662.09.0.172151395724.issue31324@psf.upfronthosting.co.za> Message-ID: <1511458562.82.0.213398074469.issue31324@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested set_match_tests() on python2.7 with: python2.7 -m test --list-cases > cases python2.7 -m test.bisect -i cases Good news: the set().__contains__ matcher can be used! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 13:02:06 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 18:02:06 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511460126.42.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b9197959c186f9061bd74d0adc20e96556426db4 by Victor Stinner in branch 'master': bpo-32030: Fix calculate_path() on macOS (#4526) https://github.com/python/cpython/commit/b9197959c186f9061bd74d0adc20e96556426db4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 13:02:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 18:02:25 +0000 Subject: [issue31979] Simplify converting non-ASCII strings to int, float and complex In-Reply-To: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> Message-ID: <1511460145.91.0.213398074469.issue31979@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 6a54c676e63517653d3d4a1e164bdd0fd45132d8 by Victor Stinner in branch 'master': bpo-31979: Remove unused align_maxchar() function (#4527) https://github.com/python/cpython/commit/6a54c676e63517653d3d4a1e164bdd0fd45132d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 13:34:22 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 18:34:22 +0000 Subject: [issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers) In-Reply-To: <1384514692.62.0.115546674646.issue19610@psf.upfronthosting.co.za> Message-ID: <1511462062.58.0.213398074469.issue19610@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset dcaed6b2d954786eb5369ec2e8dfdeefe3cdc6ae by Berker Peksag in branch 'master': bpo-19610: setup() now raises TypeError for invalid types (GH-4519) https://github.com/python/cpython/commit/dcaed6b2d954786eb5369ec2e8dfdeefe3cdc6ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 13:34:50 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 18:34:50 +0000 Subject: [issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers) In-Reply-To: <1384514692.62.0.115546674646.issue19610@psf.upfronthosting.co.za> Message-ID: <1511462090.76.0.213398074469.issue19610@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 13:53:20 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 18:53:20 +0000 Subject: [issue12382] [msilib] Obscure exception message when trying to open a non-existent MSI database In-Reply-To: <1308658337.05.0.630810191443.issue12382@psf.upfronthosting.co.za> Message-ID: <1511463200.44.0.213398074469.issue12382@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +4464 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 14:23:37 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 19:23:37 +0000 Subject: [issue31325] req_rate is a namedtuple type rather than instance In-Reply-To: <1504278922.84.0.0240979311873.issue31325@psf.upfronthosting.co.za> Message-ID: <1511465017.77.0.213398074469.issue31325@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- keywords: +patch pull_requests: +4465 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 14:31:23 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 23 Nov 2017 19:31:23 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511454252.42.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <90E15E6B-3908-4F17-AB0A-EE8C6C8DE159@python.org> Barry A. Warsaw added the comment: On Nov 23, 2017, at 11:24, Serhiy Storchaka wrote: > Wait, now I understand the purpose of the current test! There is just a typo in a comment, should be 41 instead of 47. The test itself is correct. If the address is obtained from network cards, it should have the 41 bit clear. If it is generated randomly, it should have the 41 bit set, to avoid conflicts with addresses obtained from network cards. There is nothing about the 42 bit. It?s not just a typo in the comment, it?s a typo in the bitmask, at least if the intent of the test is to ensure that the MAC address is universally administered. That is defined as having a 0 in the ?second least significant bit of the first octet?. Here?s a way to make that clearer. # Second least significant bit of the first octet of the 48-bit MAC address >>> 0b00000010_00000000_00000000_00000000_00000000_00000000 2199023255552 # Constant from the PR >>> 1<<41 2199023255552 # Literal bit mask from the original code. >>> 0x010000000000 1099511627776 The latter is off by 1 place. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 14:51:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 23 Nov 2017 19:51:53 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511466713.46.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm sorry, but this tests and the typo were added by me in issue23015. This check is a pair of the check for _random_getnode(). They use the same mask and test the same bit. I forgot about this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 15:10:20 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 23 Nov 2017 20:10:20 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback Message-ID: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Right now tracemalloc.Traceback.format() returns the frames in "most recent call first" order. This is not intuitive since ordinary Python tracebacks are displayed in "most recent call last" order. It would be nice to add a `reverse` argument to change that. ---------- components: Library (Lib) messages: 306856 nosy: pitrou, vstinner priority: normal severity: normal stage: needs patch status: open title: tracemalloc.Traceback.format() should have an option to reverse the traceback type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 15:21:40 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 20:21:40 +0000 Subject: [issue30456] 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses In-Reply-To: <1495629480.46.0.852726762555.issue30456@psf.upfronthosting.co.za> Message-ID: <1511468500.89.0.213398074469.issue30456@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- keywords: +patch pull_requests: +4466 stage: backport needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 15:27:27 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 20:27:27 +0000 Subject: [issue30456] 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses In-Reply-To: <1495629480.46.0.852726762555.issue30456@psf.upfronthosting.co.za> Message-ID: <1511468847.89.0.213398074469.issue30456@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset a645b23ffc76073a2eb4e77b88cb7648cfc6ef77 by Berker Peksag in branch '3.6': bpo-30456: Clarify example for duplicates in second argument of isinstance (GH-1699) https://github.com/python/cpython/commit/a645b23ffc76073a2eb4e77b88cb7648cfc6ef77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 15:28:32 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 23 Nov 2017 20:28:32 +0000 Subject: [issue30456] 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses In-Reply-To: <1495629480.46.0.852726762555.issue30456@psf.upfronthosting.co.za> Message-ID: <1511468912.54.0.213398074469.issue30456@psf.upfronthosting.co.za> Berker Peksag added the comment: Looks like I forgot to backport this 3.6 branch. Now it's done. Thanks, Eli. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 16:29:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 21:29:20 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511472560.23.0.213398074469.issue32121@psf.upfronthosting.co.za> STINNER Victor added the comment: The option seems reasonable. Would you like to work on a pull request? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 16:30:50 2017 From: report at bugs.python.org (privatwolke) Date: Thu, 23 Nov 2017 21:30:50 +0000 Subject: [issue29302] add contextlib.AsyncExitStack In-Reply-To: <1484693382.32.0.211448130443.issue29302@psf.upfronthosting.co.za> Message-ID: <1511472650.66.0.213398074469.issue29302@psf.upfronthosting.co.za> Change by privatwolke : ---------- nosy: +privatwolke _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 16:32:25 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 23 Nov 2017 21:32:25 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511472745.16.0.213398074469.issue32099@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 0858495a50e19defde786a4ec050ec182e920f46 by Raymond Hettinger in branch 'master': bpo-32099 Add deque variant of roundrobin() recipe (#4497) https://github.com/python/cpython/commit/0858495a50e19defde786a4ec050ec182e920f46 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 16:33:29 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 23 Nov 2017 21:33:29 +0000 Subject: [issue32099] Use range in itertools roundrobin recipe In-Reply-To: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> Message-ID: <1511472809.56.0.213398074469.issue32099@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 18:11:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 23:11:54 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511478714.76.0.213398074469.issue32096@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4467 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 18:11:54 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 23:11:54 +0000 Subject: [issue30860] Consolidate stateful C globals under a single struct. In-Reply-To: <1499286630.32.0.878971862649.issue30860@psf.upfronthosting.co.za> Message-ID: <1511478714.87.0.00913614298617.issue30860@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4468 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 18:40:28 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 23 Nov 2017 23:40:28 +0000 Subject: [issue31325] req_rate is a namedtuple type rather than instance In-Reply-To: <1504278922.84.0.0240979311873.issue31325@psf.upfronthosting.co.za> Message-ID: <1511480428.89.0.213398074469.issue31325@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 3df02dbc8e197053105f9dffeae40b04ec66766e by Raymond Hettinger (Berker Peksag) in branch 'master': bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (#4529) https://github.com/python/cpython/commit/3df02dbc8e197053105f9dffeae40b04ec66766e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 18:40:40 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 23 Nov 2017 23:40:40 +0000 Subject: [issue31325] req_rate is a namedtuple type rather than instance In-Reply-To: <1504278922.84.0.0240979311873.issue31325@psf.upfronthosting.co.za> Message-ID: <1511480440.91.0.213398074469.issue31325@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4469 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 18:58:00 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 23 Nov 2017 23:58:00 +0000 Subject: [issue31325] req_rate is a namedtuple type rather than instance In-Reply-To: <1504278922.84.0.0240979311873.issue31325@psf.upfronthosting.co.za> Message-ID: <1511481480.38.0.213398074469.issue31325@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset ff847d1ac7e6a8ee1fb6f8883cfb4aec4b4a9b03 by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (GH-4529) (#4533) https://github.com/python/cpython/commit/ff847d1ac7e6a8ee1fb6f8883cfb4aec4b4a9b03 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 18:58:51 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 23 Nov 2017 23:58:51 +0000 Subject: [issue31325] req_rate is a namedtuple type rather than instance In-Reply-To: <1504278922.84.0.0240979311873.issue31325@psf.upfronthosting.co.za> Message-ID: <1511481531.96.0.213398074469.issue31325@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 19:06:18 2017 From: report at bugs.python.org (Jesse Bakker) Date: Fri, 24 Nov 2017 00:06:18 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511481978.11.0.213398074469.issue32121@psf.upfronthosting.co.za> Change by Jesse Bakker : ---------- keywords: +patch pull_requests: +4470 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 19:08:38 2017 From: report at bugs.python.org (Jesse Bakker) Date: Fri, 24 Nov 2017 00:08:38 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511482118.54.0.213398074469.issue32121@psf.upfronthosting.co.za> Jesse Bakker added the comment: I can work on this if you want. Can have a PR ready in a few minutes. ---------- nosy: +Jesse Bakker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:08:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:08:11 +0000 Subject: [issue18835] Add PyMem_AlignedAlloc() In-Reply-To: <1377484371.18.0.399621580043.issue18835@psf.upfronthosting.co.za> Message-ID: <1511485691.82.0.213398074469.issue18835@psf.upfronthosting.co.za> STINNER Victor added the comment: Because of the lack of strong motivition compared to the size of the change and the cost to maintain it, I reject this issue. For the archives, I attach a copy of the latest version of my implementation. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed Added file: https://bugs.python.org/file47285/pymem_alignedalloc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:10:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:10:38 +0000 Subject: [issue31543] Optimize wrapper descriptors using FASTCALL In-Reply-To: <1506000331.12.0.134767574734.issue31543@psf.upfronthosting.co.za> Message-ID: <1511485838.63.0.213398074469.issue31543@psf.upfronthosting.co.za> STINNER Victor added the comment: It seems like these specific descriptors are rare, so the added complexity is not worth it. I close my issue as rejected. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:13:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:13:28 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1511486008.12.0.213398074469.issue31626@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ed4743a2f2bb8d88f7f1aa9307794be9a44f1e0f by Victor Stinner in branch '2.7': bpo-31626: Fix _PyObject_DebugReallocApi() (#4310) https://github.com/python/cpython/commit/ed4743a2f2bb8d88f7f1aa9307794be9a44f1e0f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:15:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:15:15 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1511486115.65.0.213398074469.issue31626@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: I added a Py_FatalError() to Python 2.7 if the case that must not happen does happen. Are you ok to apply the same change for Python 3.6 (commit ed4743a2f2bb8d88f7f1aa9307794be9a44f1e0f), or do you prefer to backport your more complex patch using a small buffer allocated on the stack? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:22:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:22:43 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511486563.23.0.213398074469.issue32089@psf.upfronthosting.co.za> STINNER Victor added the comment: Antoine: What do you think of using the "default" action for pydebug build and -X dev? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:24:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:24:27 +0000 Subject: [issue32050] Fix -x option documentation In-Reply-To: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> Message-ID: <1511486667.93.0.213398074469.issue32050@psf.upfronthosting.co.za> STINNER Victor added the comment: The initial proposition was to *deprecate* the option. In the meanwhile, I removed an outdated note. While the documentation is not perfect, I don't feel confortable to fix it, so I left it unchanged. I close this PR. Please open a new issue (with a PR if possible ;-)) if you want to enhance -x option documentation. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:26:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:26:37 +0000 Subject: [issue31911] Use malloc_usable_size() in pymalloc for realloc In-Reply-To: <1509472664.46.0.213398074469.issue31911@psf.upfronthosting.co.za> Message-ID: <1511486797.11.0.213398074469.issue31911@psf.upfronthosting.co.za> STINNER Victor added the comment: I agree. I don't think that it's worth it to overcompilates the API. I proposed this change since we may change the API to add PyMem_AlignedAlloc(). Since I just rejected bpo-18835, it's no more the case. I close this issue as rejected. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:28:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:28:20 +0000 Subject: [issue31520] ResourceWarning: unclosed warning In-Reply-To: <1505838609.92.0.689981315301.issue31520@psf.upfronthosting.co.za> Message-ID: <1511486900.81.0.213398074469.issue31520@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm not confortable to expose the value of the private _io_refs attribute in repr(socket.socket). I'm not sure that anything should really be done here. I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:29:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:29:19 +0000 Subject: [issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot In-Reply-To: <1508269635.57.0.213398074469.issue31805@psf.upfronthosting.co.za> Message-ID: <1511486959.51.0.213398074469.issue31805@psf.upfronthosting.co.za> STINNER Victor added the comment: The issue is gone. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:32:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:32:23 +0000 Subject: [issue23719] PEP 475: port test_eintr to Windows In-Reply-To: <1426853391.45.0.421512531157.issue23719@psf.upfronthosting.co.za> Message-ID: <1511487143.16.0.213398074469.issue23719@psf.upfronthosting.co.za> STINNER Victor added the comment: Sorry, I lost track of this idea, and I was unable to review win32-sleep-test.diff :-( While it would be "nice to have", the code is well tested on Unix. I close the issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:34:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:34:39 +0000 Subject: [issue27068] Add a detach() method to subprocess.Popen In-Reply-To: <1463739584.18.0.0161123331788.issue27068@psf.upfronthosting.co.za> Message-ID: <1511487279.17.0.213398074469.issue27068@psf.upfronthosting.co.za> STINNER Victor added the comment: Sorry, but I'm not sure that it's a good idea to add a detach() method. It's hard to follow who owns all resources attached to a process, not only it's pid, but also streams which may be buffered. I propose the close the issue. The webbrowser issue can be fixed differently without detach(). ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:34:56 2017 From: report at bugs.python.org (Larry Hastings) Date: Fri, 24 Nov 2017 01:34:56 +0000 Subject: [issue30657] Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511487296.42.0.213398074469.issue30657@psf.upfronthosting.co.za> Larry Hastings added the comment: I would welcome a backport of this for 3.5 and even 3.4 (if it's vulnerable, which it probably is). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 20:39:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 01:39:25 +0000 Subject: [issue29512] regrtest refleak: implement bisection feature In-Reply-To: <1486640763.77.0.630012847727.issue29512@psf.upfronthosting.co.za> Message-ID: <1511487565.29.0.213398074469.issue29512@psf.upfronthosting.co.za> STINNER Victor added the comment: Python 2.7.14 was released with test.bisect. While there are corner cases, do we really have to do something? The simplest fix is just to rename Lib/test/bisect.py to Lib/test/bisect_cmd.py in Python 2.7. It's a tool written for CPython developer, it's CLI is not stable nor documented. It just mean replacing "./python -m test.bisect ..." with "./python -m test.bisect_cmd ...", not a big deal. What do you think of renaming the script? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 01:12:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 06:12:39 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1511503959.46.0.213398074469.issue31626@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I prefer to keep the current code as is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 01:26:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 06:26:48 +0000 Subject: [issue32122] Improve -x option documentation Message-ID: <1511504808.14.0.213398074469.issue32122@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The documentation of the -x option is virtually not existing. The current short line of the description was enough to me for understanding what is the purpose of this option and how it can be used (I didn't use Windows for more than 10 years). But I was surprised not founding more detailed information about this feature in the documentation. Definitely it should be better documented. Most of users will have no ideas about this feature. The purpose of this option is turning Python scripts into Windows batch files which can be ran as other executables. Similarly as adding she-bang and setting the executable bit allows to run them on Unix. The extension of the Python script should be changed to ".bat", and the following line should be added at the start of the script: @path\to\python -x %0 %* & exit /b Or @py -3 -x %0 %* & exit /b Unlike a she-bang line which is a Python comment, this line is not valid Python syntax, and the -x option is used for skipping it. ---------- assignee: docs at python components: Documentation, Windows messages: 306878 nosy: docs at python, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Improve -x option documentation type: enhancement versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 04:21:04 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 09:21:04 +0000 Subject: [issue28334] netrc does not work if $HOME is not set In-Reply-To: <1475336154.44.0.44449733804.issue28334@psf.upfronthosting.co.za> Message-ID: <1511515264.97.0.213398074469.issue28334@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +4471 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 04:53:23 2017 From: report at bugs.python.org (Bernhard10) Date: Fri, 24 Nov 2017 09:53:23 +0000 Subject: [issue32123] Make the API of argparse.HelpFormatter public Message-ID: <1511517203.18.0.213398074469.issue32123@psf.upfronthosting.co.za> New submission from Bernhard10 : Since there have not been any significant change to the code of argparse.HelpFormatter in the last few years but there are still some open issues where people want to customize formatting, I would like to ask: What is required before parts of the API of argparse.HelpFormatter can be made public? Related issues: https://bugs.python.org/issue17113 RawDescriptionHelpFormatter removes blank lines https://bugs.python.org/issue12806 and https://bugs.python.org/issue22029 request a formatter that (partly) wraps lines but keeps newlines. https://bugs.python.org/issue11695 costumize usage https://bugs.python.org/issue28742 Improve ArgumentDefaultsHelpFormatter All this issues could be fixed outside the standard library by sub-classing HelpFormatter, which would require a public and documented API for it. So my question: What is missing before HelpFormatter can get a public API and how can I help? ---------- components: Library (Lib) messages: 306879 nosy: Bernhard10 priority: normal severity: normal status: open title: Make the API of argparse.HelpFormatter public type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 04:54:04 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 09:54:04 +0000 Subject: [issue12382] [msilib] Obscure exception message when trying to open a non-existent MSI database In-Reply-To: <1308658337.05.0.630810191443.issue12382@psf.upfronthosting.co.za> Message-ID: <1511517244.75.0.213398074469.issue12382@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 4864a619dc1cc9092780ccf5a6327e8abf66133d by Berker Peksag in branch 'master': bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528) https://github.com/python/cpython/commit/4864a619dc1cc9092780ccf5a6327e8abf66133d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 04:55:10 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 24 Nov 2017 09:55:10 +0000 Subject: [issue12382] [msilib] Obscure exception message when trying to open a non-existent MSI database In-Reply-To: <1308658337.05.0.630810191443.issue12382@psf.upfronthosting.co.za> Message-ID: <1511517310.27.0.213398074469.issue12382@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4472 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 04:55:44 2017 From: report at bugs.python.org (Abinaya) Date: Fri, 24 Nov 2017 09:55:44 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511517344.57.0.213398074469.issue32120@psf.upfronthosting.co.za> Abinaya added the comment: Is there any bug in python_v360. Please let me know why its not supporting sqlite3. Python-3.6.3 seems to working but It would be better if you give some clarification about python3.6.0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 05:03:27 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 10:03:27 +0000 Subject: [issue30987] Support for ISO-TP protocol in SocketCAN In-Reply-To: <1500696791.75.0.683510511028.issue30987@psf.upfronthosting.co.za> Message-ID: <1511517807.37.0.213398074469.issue30987@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 05:06:24 2017 From: report at bugs.python.org (Chi Hsuan Yen) Date: Fri, 24 Nov 2017 10:06:24 +0000 Subject: [issue29556] Remove unused #include In-Reply-To: <1487088413.61.0.441314459396.issue29556@psf.upfronthosting.co.za> Message-ID: <1511517984.74.0.213398074469.issue29556@psf.upfronthosting.co.za> Chi Hsuan Yen added the comment: As https://github.com/python/cpython/pull/98 is merged, this issue is fixed. Thanks haypo for the review! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 05:31:23 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 10:31:23 +0000 Subject: [issue12382] [msilib] Obscure exception message when trying to open a non-existent MSI database In-Reply-To: <1308658337.05.0.630810191443.issue12382@psf.upfronthosting.co.za> Message-ID: <1511519483.94.0.213398074469.issue12382@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset bfa89b21e119bac7fed4a5decc26f1fff8ec359e by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528) https://github.com/python/cpython/commit/bfa89b21e119bac7fed4a5decc26f1fff8ec359e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 05:32:50 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 10:32:50 +0000 Subject: [issue12382] [msilib] Obscure exception message when trying to open a non-existent MSI database In-Reply-To: <1308658337.05.0.630810191443.issue12382@psf.upfronthosting.co.za> Message-ID: <1511519570.14.0.213398074469.issue12382@psf.upfronthosting.co.za> Berker Peksag added the comment: Thank you for your patch, William. I added a test case, a NEWS entry and committed it to 3.6 and master branches. ---------- components: +Library (Lib) nosy: +paul.moore, steve.dower, zach.ware resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 05:53:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 10:53:00 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511520780.59.0.213398074469.issue32121@psf.upfronthosting.co.za> STINNER Victor added the comment: tracemalloc.Traceback contains "raw" data from the C _tracemalloc module. But since we are at Python level, we are free to change how data is rendered to user. Since Antoine Pitrou was surprised by the current frame order in Traceback.format() ("This is not intuitive since ordinary Python tracebacks are displayed in "most recent call last" order"), what do you think of adding a new parameter but also **reverse frames by default**? Maybe we can go further and even reverse frames in Traceback constructor? This is a backward incompatible change, but I don't think that a lot of code in the wild uses the tracemalloc *API*. About the parameter name: I'm ok with "reverse". *But* if we reverse by default, the "reverse" name can be confusing. Maybe we can use a less confusing name like "most_recent_last=True" (or "most_recent_first=False")? -- Note: The faulthandler module also dumps starting with the "(most recent call first)", but I don't want to change that. It's for technical reason: faulthandler is called when something really bad happens and so Python internal structures may be corrupted. Moreover, frames is a single chained list, it's hard to iterate over them in the backward order (especially in faulthandler code where heap memory allocations are denied). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 05:57:28 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 24 Nov 2017 10:57:28 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511521048.86.0.213398074469.issue32121@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > what do you think of adding a new parameter but also **reverse frames by default**? This would be fine with me. I didn't want to suggest it because it would break compatibility but obviously I find the current behaviour annoying :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 06:08:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 11:08:20 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1511521700.94.0.213398074469.issue31626@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, let me summarize: * 2.7: memset() *before* realloc() if shrinking a memory block, but crash when Py_FatalError() if realloc() fails on shrinking --> cannot corrupt memory, but can crash if realloc() fails on shrinking * master (3.7): memset() *before* realloc() if shrinking a memory block, but save erased bytes, and restore erased bytes if realloc() fails --> always correct * 3.6: don't memset() --> correct, but don't detect "use after free" bug when a memory block is skrinked Python 3.6 release manager, Ned Deily, rejected the proposal to backport the complex fix from master to 3.6. Victor (me): > Serhiy: I added a Py_FatalError() to Python 2.7 if the case that must not happen does happen. Are you ok to apply the same change for Python 3.6 (...) Sorry, when I asked the question, I expected that Python 3.6 still erased bytes before realloc(). But it's not the case. I agree that Py_FatalError() would be a bad idea for Python 3.6. Serhiy: Thank you for fixing Python 3.6 (don't memset() *after* realloc, which crashed on OpenBSD) and "fix" the feature in master (restore erased bytes if realloc fails)! I close the issue. I don't think that Python 2.7 or 3.6 need further changes. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 06:08:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 11:08:27 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1506666550.42.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <1511521707.04.0.213398074469.issue31626@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 06:09:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 11:09:31 +0000 Subject: [issue30860] Consolidate stateful C globals under a single struct. In-Reply-To: <1499286630.32.0.878971862649.issue30860@psf.upfronthosting.co.za> Message-ID: <1511521770.99.0.213398074469.issue30860@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9e87e7776f7ace66baaf7247233afdabd00c2b44 by Victor Stinner in branch 'master': bpo-32096: Remove obj and mem from _PyRuntime (#4532) https://github.com/python/cpython/commit/9e87e7776f7ace66baaf7247233afdabd00c2b44 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 06:09:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 11:09:31 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511521771.2.0.912454111764.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9e87e7776f7ace66baaf7247233afdabd00c2b44 by Victor Stinner in branch 'master': bpo-32096: Remove obj and mem from _PyRuntime (#4532) https://github.com/python/cpython/commit/9e87e7776f7ace66baaf7247233afdabd00c2b44 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 06:13:44 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 11:13:44 +0000 Subject: [issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None) In-Reply-To: <1307024024.44.0.716968870376.issue12239@psf.upfronthosting.co.za> Message-ID: <1511522024.52.0.213398074469.issue12239@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +4473 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 06:21:24 2017 From: report at bugs.python.org (Leo kirotawa silva) Date: Fri, 24 Nov 2017 11:21:24 +0000 Subject: [issue30657] Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511522484.29.0.213398074469.issue30657@psf.upfronthosting.co.za> Leo kirotawa silva added the comment: Python 3.4 also has the similar code as 3.5, but applying the same patch tests for it results in test errors: +====================================================================== +ERROR: test_anydbm_creation (test.test_dbm.TestCase-dbm.ndbm) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/<>/Lib/test/test_dbm.py", line 74, in test_anydbm_creation^M + self.read_helper(f)^M + File "/<>/Lib/test/test_dbm.py", line 115, in read_helper + self.assertEqual(self._dict[key], f[key.encode("ascii")]) +KeyError: b'0' + +====================================================================== +ERROR: test_anydbm_modification (test.test_dbm.TestCase-dbm.ndbm) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/<>/Lib/test/test_dbm.py", line 89, in test_anydbm_modification + self.read_helper(f) + File "/<>/Lib/test/test_dbm.py", line 115, in read_helper + self.assertEqual(self._dict[key], f[key.encode("ascii")]) +KeyError: b'0' + +====================================================================== +ERROR: test_anydbm_read (test.test_dbm.TestCase-dbm.ndbm) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/<>/Lib/test/test_dbm.py", line 95, in test_anydbm_read + self.read_helper(f) + File "/<>/Lib/test/test_dbm.py", line 115, in read_helper + self.assertEqual(self._dict[key], f[key.encode("ascii")]) +KeyError: b'0' ---------- versions: +Python 3.4 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 06:57:24 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 11:57:24 +0000 Subject: [issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block In-Reply-To: <1511521700.94.0.213398074469.issue31626@psf.upfronthosting.co.za> Message-ID: <50385869.k4QUalCzGx@saraksh> Serhiy Storchaka added the comment: > * 3.6: don't memset() --> correct, but don't detect "use after free" bug > when a memory block is skrinked And doesn't detect "use after free" bug when a memory block is expanded. And 2.7 doesn't detect this. Only 3.7 detects this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 07:16:26 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 12:16:26 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511525786.15.0.213398074469.issue32121@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: While we are here, what if make a negative limit truncating from the opposite side, as in the traceback module? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 07:41:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 12:41:22 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511527282.35.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: > New changeset 9e87e7776f7ace66baaf7247233afdabd00c2b44 by Victor Stinner in branch 'master': > bpo-32096: Remove obj and mem from _PyRuntime (#4532) The newly added test failed on AMD64 Debian root 3.x: http://buildbot.python.org/all/#/builders/27/builds/226 ====================================================================== FAIL: test_pre_initialization_api (test.test_capi.EmbeddingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_capi.py", line 602, in test_pre_initialization_api out, err = self.run_embedded_interpreter("pre_initialization_api", env=env) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_capi.py", line 464, in run_embedded_interpreter (p.returncode, err)) AssertionError: -6 != 0 : bad returncode -6, stderr is "Could not find platform independent libraries \nCould not find platform dependent libraries \nConsider setting $PYTHONHOME to [:]\nFatal Python error: initfsencoding: Unable to get the locale encoding\nModuleNotFoundError: No module named 'encodings'\n\nCurrent thread 0x00007f6456f8c700 (most recent call first):\n" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 08:06:18 2017 From: report at bugs.python.org (Armin Rigo) Date: Fri, 24 Nov 2017 13:06:18 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511528778.12.0.213398074469.issue10544@psf.upfronthosting.co.za> Change by Armin Rigo : ---------- nosy: -arigo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 08:19:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 13:19:16 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() Message-ID: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> New submission from STINNER Victor : Follow-up of bpo-32086, bpo-32096 and "[Python-Dev] Python initialization and embedded Python" thread: https://mail.python.org/pipermail/python-dev/2017-November/150605.html I propose to explicitly list functions that can be safetely called before Py_Initialize(). This safety warranty must be part of the C API. Maybe we should even test all tests function in test_capi using Programs/_testembed, as we did for Py_DecodeLocale() and Py_SetProgramName() in commit 9e87e7776f7ace66baaf7247233afdabd00c2b44 ("pre_initialization_api" test). Attached PR adds proposed documentation. It also documents "global configuration variables" like Py_DebugFlag. ---------- assignee: docs at python components: Documentation messages: 306894 nosy: docs at python, eric.snow, ncoghlan, vstinner priority: normal severity: normal status: open title: Document functions safe to be called before Py_Initialize() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 08:22:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 13:22:20 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511529740.78.0.213398074469.issue32124@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4474 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 08:24:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 13:24:52 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511529892.51.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: We now check that Py_DecodeLocale() can be called before Py_Initialize(). IMHO we need to document this property in the documentation: I opened bpo-32124 and wrote a PR for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 08:29:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 13:29:20 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511530160.26.0.213398074469.issue32096@psf.upfronthosting.co.za> STINNER Victor added the comment: The test also failed on x86 Tiger 3.x: http://buildbot.python.org/all/#/builders/30/builds/212 ====================================================================== FAIL: test_pre_initialization_api (test.test_capi.EmbeddingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_capi.py", line 602, in test_pre_initialization_api out, err = self.run_embedded_interpreter("pre_initialization_api", env=env) File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_capi.py", line 464, in run_embedded_interpreter (p.returncode, err)) AssertionError: -6 != 0 : bad returncode -6, stderr is "Could not find platform independent libraries \nCould not find platform dependent libraries \nConsider setting $PYTHONHOME to [:]\nFatal Python error: initfsencoding: unable to load the file system codec\nModuleNotFoundError: No module named 'encodings'\n\nCurrent thread 0xa000d000 (most recent call first):\n" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 08:31:11 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 13:31:11 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511530271.41.0.213398074469.issue32121@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: > While we are here, what if make a negative limit truncating from the opposite side, as in the traceback module? Why not. I'm not opposed to that :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 09:09:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 14:09:12 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511532552.38.0.213398074469.issue32124@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Are you sure about PyMem_Malloc() and PyObject_Malloc()? What functions require them? I thought only PyMem_RawMalloc() can be called before Py_Initialize(). I think that for all functions that *can* or *should* be called before Py_Initialize() this should be explicitly documented in the documentation of this function, like for Py_SetProgramName() and PyImport_AppendInittab(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 09:52:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 14:52:13 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511535133.48.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4475 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 10:11:20 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 15:11:20 +0000 Subject: [issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None) In-Reply-To: <1307024024.44.0.716968870376.issue12239@psf.upfronthosting.co.za> Message-ID: <1511536280.53.0.213398074469.issue12239@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 19fb134185ce155bc53f517116fca73093ba55e9 by Berker Peksag in branch 'master': bpo-12239: Make GetProperty() return None for VT_EMPTY (GH-4539) https://github.com/python/cpython/commit/19fb134185ce155bc53f517116fca73093ba55e9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 10:19:47 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 15:19:47 +0000 Subject: [issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None) In-Reply-To: <1307024024.44.0.716968870376.issue12239@psf.upfronthosting.co.za> Message-ID: <1511536787.08.0.213398074469.issue12239@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +4476 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 10:20:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 15:20:05 +0000 Subject: [issue32125] Remove global configuration variable Py_UseClassExceptionsFlag Message-ID: <1511536805.74.0.213398074469.issue32125@psf.upfronthosting.co.za> New submission from STINNER Victor : The Py_UseClassExceptionsFlag flag was added by the commit 035574d755bfc306704e9975dc10e4e05a47b3bb. The commit 757af0e7bb7c7d56670fbc84f1f5b0182a54e3d5 started to use this flag: + /* if Python was started with -X, initialize the class exceptions */ + if (Py_UseClassExceptionsFlag) + init_class_exc(dict); Later followed by commit 98b6246c0c60f2831b0c7a66d8c0659ebac1ec32. The flag was finally deprecated in the commit 3ce096459e348c95c2c3348f8d84720f25c1a4c9 in 2000. All these changes are older than Python 2.0. In Python 2.7 and 3.6, the flag is not used at all. I think that it's time to remove it :-) ---------- components: Interpreter Core messages: 306900 nosy: vstinner priority: normal severity: normal status: open title: Remove global configuration variable Py_UseClassExceptionsFlag versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 11:04:42 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 16:04:42 +0000 Subject: [issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None) In-Reply-To: <1307024024.44.0.716968870376.issue12239@psf.upfronthosting.co.za> Message-ID: <1511539482.3.0.213398074469.issue12239@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 412f00b839eae2bc07ca08a8e615c3d7dc870646 by Berker Peksag in branch '3.6': [3.6] bpo-12239: Make GetProperty() return None for VT_EMPTY (GH-4539) https://github.com/python/cpython/commit/412f00b839eae2bc07ca08a8e615c3d7dc870646 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 11:05:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 16:05:00 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511539500.4.0.213398074469.issue32124@psf.upfronthosting.co.za> STINNER Victor added the comment: > Are you sure about PyMem_Malloc() and PyObject_Malloc()? Technically, the pymalloc memory allocator is initialized statically by the compiler, from the first instruction of the process. But maybe we should not suggest users to call them, especially because the allocator can be modified by the PYTHONMALLOC environment variable. > What functions require them? No function to initalize Python require PyMem or PyObject allocators. Only PyMem_Raw allocator is needed. Py_EncodeLocale() uses it, but this function also uses Python objects (str, bytes), and so Py_EncodeLocale() must no be called before Py_Initialize(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 11:05:42 2017 From: report at bugs.python.org (Berker Peksag) Date: Fri, 24 Nov 2017 16:05:42 +0000 Subject: [issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None) In-Reply-To: <1307024024.44.0.716968870376.issue12239@psf.upfronthosting.co.za> Message-ID: <1511539542.08.0.213398074469.issue12239@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks for the patch, Mark. I updated the test code and commit it to 3.6 and master branches. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 11:27:06 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 24 Nov 2017 16:27:06 +0000 Subject: [issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user In-Reply-To: <1479069574.19.0.731580166174.issue28684@psf.upfronthosting.co.za> Message-ID: <1511540826.28.0.213398074469.issue28684@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 11:35:58 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 24 Nov 2017 16:35:58 +0000 Subject: [issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user In-Reply-To: <1479069574.19.0.731580166174.issue28684@psf.upfronthosting.co.za> Message-ID: <1511541358.68.0.213398074469.issue28684@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 0f86cd38f4a38f25a4aed3759a654a4b7fa49031 by xdegaye in branch 'master': bpo-28684: asyncio tests handle PermissionError raised on binding unix sockets (GH-4503) https://github.com/python/cpython/commit/0f86cd38f4a38f25a4aed3759a654a4b7fa49031 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 11:36:58 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 24 Nov 2017 16:36:58 +0000 Subject: [issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user In-Reply-To: <1479069574.19.0.731580166174.issue28684@psf.upfronthosting.co.za> Message-ID: <1511541418.39.0.213398074469.issue28684@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 11:55:55 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 24 Nov 2017 16:55:55 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511542555.11.0.213398074469.issue32089@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Antoine: What do you think of using the "default" action for pydebug build and -X dev? That would be fine with me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:02:05 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 24 Nov 2017 17:02:05 +0000 Subject: [issue32126] [asyncio] test failure when the platform lacks a functional sem_open() Message-ID: <1511542925.3.0.213398074469.issue32126@psf.upfronthosting.co.za> New submission from Xavier de Gaye : test_get_event_loop_new_process fails on Android API 24 with the error: ====================================================================== ERROR: test_get_event_loop_new_process (test.test_asyncio.test_events.EPollEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/multiprocessing/synchronize.py", line 29, in from _multiprocessing import SemLock, sem_unlink ImportError: cannot import name 'sem_unlink' from '_multiprocessing' (/data/local/tmp/python/lib/pyt hon3.7/lib-dynload/_multiprocessing.cpython-37dm.so) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_asyncio/test_events.py", line 2239, in test_get_e vent_loop_new_process self.loop.run_until_complete(main()), File "/sdcard/org.python/lib/python3.7/asyncio/base_events.py", line 466, in run_until_complete return future.result() File "/sdcard/org.python/lib/python3.7/test/test_asyncio/test_events.py", line 2230, in main pool = concurrent.futures.ProcessPoolExecutor() File "/sdcard/org.python/lib/python3.7/concurrent/futures/process.py", line 410, in __init__ self._call_queue = mp_context.Queue(queue_size) File "/sdcard/org.python/lib/python3.7/multiprocessing/context.py", line 102, in Queue return Queue(maxsize, ctx=self.get_context()) File "/sdcard/org.python/lib/python3.7/multiprocessing/queues.py", line 42, in __init__ self._rlock = ctx.Lock() File "/sdcard/org.python/lib/python3.7/multiprocessing/context.py", line 66, in Lock from .synchronize import Lock File "/sdcard/org.python/lib/python3.7/multiprocessing/synchronize.py", line 34, in " function, see issue 3770.") ImportError: This platform lacks a functioning sem_open implementation, therefore, the required sync hronization primitives needed will not function, see issue 3770. ---------- components: Tests, asyncio messages: 306906 nosy: xdegaye, yselivanov priority: normal severity: normal stage: needs patch status: open title: [asyncio] test failure when the platform lacks a functional sem_open() type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:06:12 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 24 Nov 2017 17:06:12 +0000 Subject: [issue32126] [asyncio] test failure when the platform lacks a functional sem_open() In-Reply-To: <1511542925.3.0.213398074469.issue32126@psf.upfronthosting.co.za> Message-ID: <1511543172.15.0.213398074469.issue32126@psf.upfronthosting.co.za> Xavier de Gaye added the comment: See also the related issues: #3770: test_multiprocessing fails on systems with HAVE_SEM_OPEN=0 #28668: instanciation of multiprocessing.Queue raises ImportError in test_logging #26924: android: test_concurrent_futures fails ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:20:46 2017 From: report at bugs.python.org (=?utf-8?q?Fran=C3=A7ois_Freitag?=) Date: Fri, 24 Nov 2017 17:20:46 +0000 Subject: [issue31706] urlencode should accept generator as values for mappings when doseq=True In-Reply-To: <1507234372.12.0.213398074469.issue31706@psf.upfronthosting.co.za> Message-ID: <1511544046.83.0.213398074469.issue31706@psf.upfronthosting.co.za> Fran?ois Freitag added the comment: I updated the PR to allow any iterable of two-elements iterables to be passed to urlencode. If anyone has the time and interest, the PR is ready for review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:36:45 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 24 Nov 2017 17:36:45 +0000 Subject: [issue32112] Should uuid.UUID() accept another UUID() instance? In-Reply-To: <1511347956.68.0.213398074469.issue32112@psf.upfronthosting.co.za> Message-ID: <1511545005.98.0.213398074469.issue32112@psf.upfronthosting.co.za> ?ric Araujo added the comment: I don?t see a downside in accepting the feature request here. Maybe ask on python-ideas to get more feedback? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:38:09 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 24 Nov 2017 17:38:09 +0000 Subject: [issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user In-Reply-To: <1479069574.19.0.731580166174.issue28684@psf.upfronthosting.co.za> Message-ID: <1511545089.17.0.213398074469.issue28684@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4477 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:51:14 2017 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 24 Nov 2017 17:51:14 +0000 Subject: [issue32067] Deprecate accepting unrecognized braces in regular expressions In-Reply-To: <1511003547.89.0.213398074469.issue32067@psf.upfronthosting.co.za> Message-ID: <1511545874.93.0.213398074469.issue32067@psf.upfronthosting.co.za> Change by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:56:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 17:56:06 +0000 Subject: [issue32112] Should uuid.UUID() accept another UUID() instance? In-Reply-To: <1511347956.68.0.213398074469.issue32112@psf.upfronthosting.co.za> Message-ID: <1511546166.12.0.213398074469.issue32112@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Growing the size of the code and the documentation, complicating the mental model, slowing down all other cases, the risk of introducing bugs. This is the cost that we should pay for adding a new feature. The benefit of adding a feature should be larger than this cost. I'm not sure this is a case. But if you think it is worth, you can add it. Note that by adding this feature you can open a can of worms and will need to add support of time(time), date(date), namedtuple(namedtuple), etc for the same reason, because some database drivers already do mapping for you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:56:24 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 24 Nov 2017 17:56:24 +0000 Subject: [issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user In-Reply-To: <1479069574.19.0.731580166174.issue28684@psf.upfronthosting.co.za> Message-ID: <1511546184.91.0.213398074469.issue28684@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 5742f674f7561dc9a1fc66d650e18e31b941183b by xdegaye in branch 'master': bpo-28684: Remove useless import added by the previous commit (GH-4547) https://github.com/python/cpython/commit/5742f674f7561dc9a1fc66d650e18e31b941183b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 13:28:07 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 18:28:07 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511548087.69.0.213398074469.issue32124@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Should PyMem_SetAllocator() and PyObject_SetArenaAllocator() be called before Py_Initialize(), or they can be called after it? If PyMem_Malloc() and PyObject_Malloc() are not needed for pre-initialization, should we support calling them before Py_Initialize()? There are other functions and macros that can be safely used before Py_Initialize(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 13:46:16 2017 From: report at bugs.python.org (Paul Long) Date: Fri, 24 Nov 2017 18:46:16 +0000 Subject: [issue32116] CSV import and export simplified In-Reply-To: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> Message-ID: <1511549176.89.0.213398074469.issue32116@psf.upfronthosting.co.za> Change by Paul Long : ---------- keywords: +patch pull_requests: +4478 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 14:14:29 2017 From: report at bugs.python.org (Toby Berla) Date: Fri, 24 Nov 2017 19:14:29 +0000 Subject: [issue32127] tutorial on dictionaries has error in example Message-ID: <1511550869.58.0.213398074469.issue32127@psf.upfronthosting.co.za> New submission from Toby Berla : in https://docs.python.org/3/tutorial/datastructures.html: ----- 5.5. Dictionaries ... Here is a small example using a dictionary: >>> >>> tel = {'jack': 4098, 'sape': 4139} >>> tel['guido'] = 4127 >>> tel {'sape': 4139, 'guido': 4127, 'jack': 4098} ----- I think the order of dictionary elements shown after 'guido' is inserted is wrong. The correct order is: {'jack': 4098, 'sape': 4139, 'guido': 4127} ---------- assignee: docs at python components: Documentation messages: 306913 nosy: docs at python, tberla priority: normal severity: normal status: open title: tutorial on dictionaries has error in example versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 14:16:52 2017 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 24 Nov 2017 19:16:52 +0000 Subject: [issue32127] tutorial on dictionaries has error in example In-Reply-To: <1511550869.58.0.213398074469.issue32127@psf.upfronthosting.co.za> Message-ID: <1511551012.71.0.213398074469.issue32127@psf.upfronthosting.co.za> Eric V. Smith added the comment: dict makes no guarantees on ordering, so I think the example is fine. There is no "correct" ordering. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 14:25:53 2017 From: report at bugs.python.org (Toby Berla) Date: Fri, 24 Nov 2017 19:25:53 +0000 Subject: [issue32127] tutorial on dictionaries has error in example In-Reply-To: <1511550869.58.0.213398074469.issue32127@psf.upfronthosting.co.za> Message-ID: <1511551553.69.0.213398074469.issue32127@psf.upfronthosting.co.za> Toby Berla added the comment: Thanks, Eric. (I'm new to Python.) Perhaps I should have paid closer attention to the description of the dictionary data structure -- "Performing list(d.keys()) on a dictionary returns a list of all the keys used in the dictionary, in arbitrary order" -- rather than just jumping ahead to the code example. ;-) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 14:31:55 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Nov 2017 19:31:55 +0000 Subject: [issue32080] Re locale test fails after installing Python 3.6.3 on ubuntu 16.04 In-Reply-To: <1511157949.99.0.213398074469.issue32080@psf.upfronthosting.co.za> Message-ID: <1511551915.53.0.213398074469.issue32080@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- components: +Installation, Library (Lib) -2to3 (2.x to 3.x conversion tool) nosy: +serhiy.storchaka title: Error Installing Python 3.6.3 on ubuntu 16.04 -> Re locale test fails after installing Python 3.6.3 on ubuntu 16.04 type: resource usage -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 14:33:14 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Nov 2017 19:33:14 +0000 Subject: [issue32097] doctest does not consider \r\n a In-Reply-To: <1511218690.8.0.213398074469.issue32097@psf.upfronthosting.co.za> Message-ID: <1511551994.27.0.213398074469.issue32097@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- versions: -Python 3.4, Python 3.5, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 15:24:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 20:24:53 +0000 Subject: [issue32125] Remove global configuration variable Py_UseClassExceptionsFlag In-Reply-To: <1511536805.74.0.213398074469.issue32125@psf.upfronthosting.co.za> Message-ID: <1511555093.46.0.213398074469.issue32125@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4479 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 15:38:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 20:38:22 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511555902.55.0.213398074469.issue32124@psf.upfronthosting.co.za> STINNER Victor added the comment: > Should PyMem_SetAllocator() and PyObject_SetArenaAllocator() be called before Py_Initialize(), or they can be called after it? I'm quite sure that calling PyMem_SetAllocator() or PyObject_SetArenaAllocator() after Py_Initialize() will quickly crash. > If PyMem_Malloc() and PyObject_Malloc() are not needed for pre-initialization, should we support calling them before Py_Initialize()? We don't have to support them. Ok, I remove them from the pre-init documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 15:43:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 20:43:35 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511555902.55.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1919935.nP2zlzugBP@saraksh> Serhiy Storchaka added the comment: > I'm quite sure that calling PyMem_SetAllocator() or > PyObject_SetArenaAllocator() after Py_Initialize() will quickly crash. Then document this explicitly like for other functions that *should* be called before Py_Initialize() if called at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:06:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 21:06:40 +0000 Subject: [issue32125] Remove global configuration variable Py_UseClassExceptionsFlag In-Reply-To: <1511536805.74.0.213398074469.issue32125@psf.upfronthosting.co.za> Message-ID: <1511557600.84.0.213398074469.issue32125@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset da9c8c36aeb60ad8f7748a735c372bf993d2e4f3 by Victor Stinner in branch 'master': bpo-32125: Remove Py_UseClassExceptionsFlag flag (#4544) https://github.com/python/cpython/commit/da9c8c36aeb60ad8f7748a735c372bf993d2e4f3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:17:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 21:17:29 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511558249.0.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: New benchmark on the emitting a warning which is ignored. Benchmark the PR 4489. Warning emitted in Python, warnings.warn(): vstinner at apu$ ./python -m perf compare_to master.json ignore.json Mean +- std dev: [master] 705 ns +- 24 ns -> [ignore] 838 ns +- 18 ns: 1.19x slower (+19%) ==> +133 ns Warning emitted in C, PyErr_WarnEx(): vstinner at apu$ python3 -m perf compare_to master2.json ignore2.json Mean +- std dev: [master2] 702 ns +- 9 ns -> [ignore2] 723 ns +- 9 ns: 1.03x slower (+3%) ==> +21 ns C benchmark, attached files: * bench_c_warn.patch * bench_ignore_warn_c.py ---------- Added file: https://bugs.python.org/file47286/bench_c_warn.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:17:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 21:17:36 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511558256.81.0.213398074469.issue27535@psf.upfronthosting.co.za> Change by STINNER Victor : Added file: https://bugs.python.org/file47287/bench_ignore_warn_c.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:22:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 21:22:12 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511558532.39.0.213398074469.issue27535@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: These results look strange to me. I expected the same difference but smaller the base time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:30:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 21:30:29 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511559029.8.0.213398074469.issue32124@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 84c4b1938fade2b425ac906730beabd413de094d by Victor Stinner in branch 'master': bpo-32124: Document C functions safe before init (#4540) https://github.com/python/cpython/commit/84c4b1938fade2b425ac906730beabd413de094d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:33:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 21:33:03 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511559183.6.0.213398074469.issue32124@psf.upfronthosting.co.za> STINNER Victor added the comment: > Then document this explicitly like for other functions that *should* be called before Py_Initialize() if called at all. I agree that it would be even better to document if a function must not be called after Py_Initialize(). *But* I'm not sure of what I wrote, I have to check the code, and maybe even test manually to "see what happens" (ensure that it works) :-) So I decided to push my first PR, and will work on a second PR later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:37:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 21:37:01 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511559421.24.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: > These results look strange to me. I expected the same difference but smaller the base time. Honestly, I was also surprised. I checked the whole benchmark twice. I also rebased the PR locally to make sure that it's not a side effect of a recent change in master. Results are reliable and reproductible. FYI I ran the C benchmark on my laptop "apu" using CPU isolation. -- I reproduced the benchmark on my other "selma" laptop, without CPU isolation (so less reliable). C benchmark: haypo at selma$ python3 -m perf compare_to master.json ignore.json Mean +- std dev: [master] 932 ns +- 66 ns -> [ignore] 1.01 us +- 0.05 us: 1.09x slower (+9%) ==> +78 ns ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:37:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 21:37:21 +0000 Subject: [issue32125] Remove global configuration variable Py_UseClassExceptionsFlag In-Reply-To: <1511536805.74.0.213398074469.issue32125@psf.upfronthosting.co.za> Message-ID: <1511559441.76.0.213398074469.issue32125@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 16:55:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 21:55:43 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511560543.57.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 46972b7bc385ec2bdc7f567bbd22c9e56ffdf003 by Victor Stinner in branch 'master': bpo-32030: Add _PyMainInterpreterConfig_ReadEnv() (#4542) https://github.com/python/cpython/commit/46972b7bc385ec2bdc7f567bbd22c9e56ffdf003 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 17:05:36 2017 From: report at bugs.python.org (Eric Snow) Date: Fri, 24 Nov 2017 22:05:36 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511561136.47.0.213398074469.issue32124@psf.upfronthosting.co.za> Eric Snow added the comment: I've left a review (writing it as you merged the PR). My main concern is that we not promise more than we must. Every pre-init function or variable we promise to embedders represents global state that is hard to get rid of. It also entrenches pre-init API and state that we're aiming to deprecate (via PEP 432). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 17:06:57 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 24 Nov 2017 22:06:57 +0000 Subject: [issue32123] Make the API of argparse.HelpFormatter public In-Reply-To: <1511517203.18.0.213398074469.issue32123@psf.upfronthosting.co.za> Message-ID: <1511561217.27.0.213398074469.issue32123@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I suggest that you open a thread on python-ideas list: something like 'Make argparse.HelpFormatter public'. Explain what you would like to have happen and why. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 17:33:00 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 24 Nov 2017 22:33:00 +0000 Subject: [issue32116] CSV import and export simplified In-Reply-To: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> Message-ID: <1511562780.8.0.213398074469.issue32116@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'm also -1 on this feature request. The open and closing of files is orthogonal to what you do with an open file. Likewise, iterators are orthogonal to how they are consumed (for-loops, list(), set(), etc). FWIW, csv.Reader object is an iterator that can be fed directly to list(): result = list(csv.reader(fileobj) ---------- nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 17:36:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 22:36:22 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511562982.86.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4480 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 17:48:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 24 Nov 2017 22:48:20 +0000 Subject: [issue32118] Docs: add note about sequence comparisons containing non-orderable elements In-Reply-To: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> Message-ID: <1511563700.97.0.213398074469.issue32118@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This whole section has become a mess an is now more complex that the underlying code. Adding more caveats, special cases, and atypical examples will make it worse (rather like the U.S. tax code, another example of bad technical writing). I recommend the whole section be rewritten, extracting the most general rules and with examples that cover the general rules. There can then be brief separate paragraphs for language lawyers that cover what makes NaNs and None unusual (none of the comparison logic special cases these value -- their interesting behaviors are intrinsic to the object itself). ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 18:01:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 23:01:27 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511564487.33.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset f04ebe2a4d68b194deeb438e9185efdafc10a832 by Victor Stinner in branch 'master': bpo-32030: Add _PyMainInterpreterConfig.program_name (#4548) https://github.com/python/cpython/commit/f04ebe2a4d68b194deeb438e9185efdafc10a832 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 19:05:26 2017 From: report at bugs.python.org (Decorater) Date: Sat, 25 Nov 2017 00:05:26 +0000 Subject: [issue30396] Document the PyClassMethod* C API functions. In-Reply-To: <1495072171.73.0.812244452186.issue30396@psf.upfronthosting.co.za> Message-ID: <1511568326.0.0.213398074469.issue30396@psf.upfronthosting.co.za> Change by Decorater : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 19:09:17 2017 From: report at bugs.python.org (Decorater) Date: Sat, 25 Nov 2017 00:09:17 +0000 Subject: [issue29885] Allow GMT timezones to be used in datetime. In-Reply-To: <1490250908.5.0.958278371805.issue29885@psf.upfronthosting.co.za> Message-ID: <1511568557.28.0.213398074469.issue29885@psf.upfronthosting.co.za> Change by Decorater : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 19:21:11 2017 From: report at bugs.python.org (Zachary Ware) Date: Sat, 25 Nov 2017 00:21:11 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511569271.47.0.213398074469.issue30855@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- pull_requests: +4481 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 19:33:30 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Nov 2017 00:33:30 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511570010.92.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4482 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 20:23:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Nov 2017 01:23:42 +0000 Subject: [issue32128] test_nntplib: test_article_head_body() fails in SSL mode Message-ID: <1511573022.36.0.213398074469.issue32128@psf.upfronthosting.co.za> New submission from STINNER Victor : The news.trigofacile.com NNTP server used by test_nntplib currently has troubles on SSL: $ ./python -m test -u all -v test_nntplib -m test_article_head_body ====================================================================== FAIL: test_article_head_body (test.test_nntplib.NetworkedNNTP_SSLTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/haypo/prog/python/3.6/Lib/test/test_nntplib.py", line 242, in wrapped meth(self) File "/home/haypo/prog/python/3.6/Lib/test/test_nntplib.py", line 187, in test_article_head_body self.check_article_resp(resp, body, art_num) File "/home/haypo/prog/python/3.6/Lib/test/test_nntplib.py", line 167, in check_article_resp self.assertNotIn(article.lines[-1], (b".", b".\n", b".\r\n")) AssertionError: b'.' unexpectedly found in (b'.', b'.\n', b'.\r\n') See also bpo-19613. ---------- components: Tests messages: 306930 nosy: vstinner priority: normal severity: normal status: open title: test_nntplib: test_article_head_body() fails in SSL mode versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 20:27:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Nov 2017 01:27:20 +0000 Subject: [issue32128] test_nntplib: test_article_head_body() fails in SSL mode In-Reply-To: <1511573022.36.0.213398074469.issue32128@psf.upfronthosting.co.za> Message-ID: <1511573240.16.0.213398074469.issue32128@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4483 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 20:42:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Nov 2017 01:42:21 +0000 Subject: [issue32128] test_nntplib: test_article_head_body() fails in SSL mode In-Reply-To: <1511573022.36.0.213398074469.issue32128@psf.upfronthosting.co.za> Message-ID: <1511574141.56.0.213398074469.issue32128@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 706cb3162e15271ecfeba15909ed48a3a437009f by Victor Stinner in branch 'master': bpo-32128: Skip test_nntplib.test_article_head_body() (#4552) https://github.com/python/cpython/commit/706cb3162e15271ecfeba15909ed48a3a437009f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 20:42:28 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 25 Nov 2017 01:42:28 +0000 Subject: [issue32128] test_nntplib: test_article_head_body() fails in SSL mode In-Reply-To: <1511573022.36.0.213398074469.issue32128@psf.upfronthosting.co.za> Message-ID: <1511574148.27.0.213398074469.issue32128@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4484 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 20:42:56 2017 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 25 Nov 2017 01:42:56 +0000 Subject: [issue32127] tutorial on dictionaries has error in example In-Reply-To: <1511550869.58.0.213398074469.issue32127@psf.upfronthosting.co.za> Message-ID: <1511574176.1.0.213398074469.issue32127@psf.upfronthosting.co.za> Eric V. Smith added the comment: No problem. Welcome to Python! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 21:02:49 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Nov 2017 02:02:49 +0000 Subject: [issue32128] test_nntplib: test_article_head_body() fails in SSL mode In-Reply-To: <1511573022.36.0.213398074469.issue32128@psf.upfronthosting.co.za> Message-ID: <1511575369.44.0.213398074469.issue32128@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset dde38b9cb3ff24f2f1f17cb681d30741e0090f51 by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-32128: Skip test_nntplib.test_article_head_body() (GH-4552) (#4553) https://github.com/python/cpython/commit/dde38b9cb3ff24f2f1f17cb681d30741e0090f51 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 21:13:30 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 25 Nov 2017 02:13:30 +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: <1511576010.47.0.213398074469.issue26228@psf.upfronthosting.co.za> Martin Panter added the comment: If it helps, here is a basic test case I wrote for ?pty.spawn?. I hope that it exposes the problem on Free BSD, but I have only tested it on Linux. parent = r'''\ import pty, sys pty.spawn((sys.executable, "-c", sys.argv[1])) ''' child = r'''\ import sys # Read input first of all to minimize output buffering input = sys.stdin.readline() print("isatty: {}, {}, {}".format( sys.stdin.isatty(), sys.stdout.isatty(), sys.stderr.isatty())) print("input: " + repr(input)) sys.stdout.write("stdout data\n") sys.stderr.write("stderr data\n") ''' args = (sys.executable, "-c", parent, child) parent = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE) try: parent.stdin.write(b"stdin data\n") parent.stdin.flush() # Leave input open. When the child closes the slave terminal on # Free BSD, ?spawn? used to keep waiting for input (BPO 26228). output = parent.stdout.read() finally: parent.stdout.close() parent.stdin.close() parent.wait() self.assertEqual(0, parent.returncode, repr(output)) self.assertIn(b"isatty: True, True, True", output) self.assertIn(br"input: 'stdin data\n'", output) self.assertIn(b"stdout data", output) self.assertIn(b"stderr data", output) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 21:17:59 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Nov 2017 02:17:59 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511576279.14.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 9316ee4da2dcc217351418fc4dbe9205995689e0 by Victor Stinner in branch 'master': bpo-32030: Add _PyPathConfig_Init() (#4551) https://github.com/python/cpython/commit/9316ee4da2dcc217351418fc4dbe9205995689e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 21:51:54 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 25 Nov 2017 02:51:54 +0000 Subject: [issue19613] test_nntplib: sporadic failures, test_article_head_body() In-Reply-To: <1384536645.9.0.862907413915.issue19613@psf.upfronthosting.co.za> Message-ID: <1511578314.65.0.213398074469.issue19613@psf.upfronthosting.co.za> Martin Panter added the comment: Victor opened Issue 32128 with the same complaint. I think I found the offending article: >>> server = NNTP_SSL("nntp.aioe.org") >>> [response, count, first, last, name] = server.group("comp.lang.python") >>> last 199267 >>> pprint(server.article(199265)[1].lines) [. . . b'Date: Fri, 24 Nov 2017 15:44:26 -0800 (PST)', . . . b'Message-ID: ', b'Subject: Re: Python loop and web server (bottle) in the same script (Posting', b' On Python-List Prohibited)', . . . b'Content-Transfer-Encoding: quoted-printable', . . . b'If processing is I/O bound and not CPU bound, then asyncio should work fine=', b'.'] The body uses Quoted-printable encoding, and the previous line ends with an equals sign ?=?, meaning a soft line break. So the full stop is on its own because the encoder didn?t want to fit it on the previous line. This is valid (albeit quirky) encoding, and not a problem with the NNTP library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 22:32:11 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 25 Nov 2017 03:32:11 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511580731.2.0.213398074469.issue32124@psf.upfronthosting.co.za> Nick Coghlan added the comment: Key point to note regarding PEP 432: at least personally, I'm not actually aiming to deprecate the legacy embedding API. Instead, I'm just aiming to eventually stop *adding* to it, with new config structs replacing the current ad hoc mix of pre-init function calls, C globals, environment variables, and filesystem state. That means I'm quite willing to accept maintaining compatibility for applications using the current single phase initialisation approach as a design constraint for the PEP. We have a similar constraint in place for extension modules: even though any *new* features we introduce are likely to be dependent on switching over to PEP 489's multi-phase initialisation APIs, we still ensure that single-phase initialisation continues working for existing modules. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 22:45:39 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 25 Nov 2017 03:45:39 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511581539.67.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Huh, those crashes are interesting - I'd guess that it means we have a platform-dependent dependency from Py_DecodeLocale on to Py_SetPythonHome in order to locate the encodings module. If I'm right, that dependency would then mean that embedding applications can only rely on Py_DecodeLocale to do "char *" to "wchar_t *" conversions if they can also rely on the locale encoding always being a builtin one that bypasses the search for the encodings module. Perhaps we should be recommending temporarily doing 'setenv("PYTHONHOME", home)' (and then reverting that after calling Py_Initialize so it doesn't get inherited by subprocesses) as the preferred approach to handling platforms with "char *" based native filesystem APIs, and adding such a setting to that particular `_testembed` test? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 22:57:17 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 25 Nov 2017 03:57:17 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511582237.93.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: Given the direction of the python-dev thread, should we split this question into two issues? Issue 1: a yield expression inside a comprehension changes the type of the expression result (returning a generator-iterator instead of the expected container type) Issue 2: a yield expression inside a generator expression interacts weirdly with the genexp's implicit yield expression I ask, as it seems to me that issue 1 can be addressed by wrapping the affected cases in an implicit 'yield from' expression, which will both fix the return type of the expression and turn the outer function into a generator (if it isn't one already). (I'm going to put together a proof-of-concept for that idea this weekend) By contrast, the interaction between generator expressions and explicit yield expressions seems intrinsically confusing, so I'm not sure we can do any better than declaring it a syntax error to try to combine them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 23:34:28 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 25 Nov 2017 04:34:28 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511584468.88.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: I realised that even without modifying the compiler first, I could illustrate the proposed `yield from` based resolution for the comprehension case by way of explicit yield from clauses: ``` def get_gen_result(gen, inputs): try: yield_value = next(gen) for send_value in inputs: print(f"Received: {yield_value}; Sending: {send_value}") yield_value = gen.send(send_value) except StopIteration as exc: return exc.value raise RuntimeError("Failed to exhaust generator") def example(): comp1 = yield from [str((yield x)) for x in ('1st', '2nd')] comp2 = yield from [int((yield x)) for x in ('3rd', '4th')] return comp1, comp2 >>> result = get_gen_result(example(), range(4)) Received: 1st; Sending: 0 Received: 2nd; Sending: 1 Received: 3rd; Sending: 2 Received: 4th; Sending: 3 >>> result (['0', '1'], [2, 3]) ``` So if we decided to make yield-in-a-comprehension imply the use of yield from, we'd only need: - DeprecationWarning in 3.7 to say "this is going to imply 'yield from (comprehension)' in 3.8+" - making the 'yield from' implicit in 3.8 (thus ensuring that comprehensions always return the correct container type, even when they include yield expressions) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 23:49:36 2017 From: report at bugs.python.org (Kevin Walzer) Date: Sat, 25 Nov 2017 04:49:36 +0000 Subject: [issue32129] Icon on macOS Message-ID: <1511585376.3.0.213398074469.issue32129@psf.upfronthosting.co.za> New submission from Kevin Walzer : The trunk and 8.6.7 branch of Tk on macOS have recently implemented the wm_iconphoto command, which had not previously been supported on macOS. This means that versions of IDLE that link to this version of Tk will inherit the iconphoto behavior on Windows and X11, which results in a extremely blurry icon image in the Dock. It would probably be best to make this command conditional on macOS to just retain the standard app icon, or else add a sharper image. ---------- assignee: terry.reedy components: IDLE files: Screen Shot 2017-11-24 at 11.44.31 PM.png messages: 306941 nosy: terry.reedy, wordtech priority: normal severity: normal status: open title: Icon on macOS type: behavior Added file: https://bugs.python.org/file47288/Screen Shot 2017-11-24 at 11.44.31 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 23:56:02 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 25 Nov 2017 04:56:02 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1511585762.76.0.213398074469.issue30004@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 610e5afdcbe3eca906ef32f4e0364e20e1b1ad23 by Mariatta (Mandeep Bhutani) in branch 'master': bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443) https://github.com/python/cpython/commit/610e5afdcbe3eca906ef32f4e0364e20e1b1ad23 ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 23:56:10 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 25 Nov 2017 04:56:10 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1511585770.84.0.213398074469.issue30004@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4485 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 23:57:10 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 25 Nov 2017 04:57:10 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1511585830.1.0.213398074469.issue30004@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4486 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 00:01:42 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 25 Nov 2017 05:01:42 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1511586102.76.0.213398074469.issue30004@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset c02037d62284f4d4ca6b22f2ed05165ce2014951 by Mariatta (Miss Islington (bot)) in branch '2.7': bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443) (GH-4555) https://github.com/python/cpython/commit/c02037d62284f4d4ca6b22f2ed05165ce2014951 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 00:03:06 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 25 Nov 2017 05:03:06 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1511586186.73.0.213398074469.issue30004@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 3e60747025edc34b503397ab8211be59cfdd05cd by Mariatta (Miss Islington (bot)) in branch '3.6': bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443) (GH-4554) https://github.com/python/cpython/commit/3e60747025edc34b503397ab8211be59cfdd05cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 00:03:50 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sat, 25 Nov 2017 05:03:50 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1511586230.44.0.213398074469.issue30004@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: Thanks everyone. I merged the PR, and it's been backported to 3.6 and 2.7 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 00:12:51 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 25 Nov 2017 05:12:51 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511586771.03.0.213398074469.issue32089@psf.upfronthosting.co.za> Nick Coghlan added the comment: +1 from me for using "default" instead of "always" for ResourceWarning. Folks can always combine "-X tracemalloc" with "-W always::ResourceWarning" if want to ensure they see absolutely every resource warning, rather than only representative ones. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 02:03:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Nov 2017 07:03:29 +0000 Subject: [issue30004] in regex-howto, improve example on grouping In-Reply-To: <1491453642.54.0.802330198745.issue30004@psf.upfronthosting.co.za> Message-ID: <1511593409.83.0.213398074469.issue30004@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Cristian for reporting this issue. Thank you Mandeep for your patch. Thank you Mariatta for merging. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 02:28:57 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Nov 2017 07:28:57 +0000 Subject: [issue32129] Icon on macOS In-Reply-To: <1511585376.3.0.213398074469.issue32129@psf.upfronthosting.co.za> Message-ID: <1511594937.18.0.213398074469.issue32129@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Here is the current code in idlelib.pyshell.main. # set application icon icondir = os.path.join(os.path.dirname(__file__), 'Icons') if system() == 'Windows': iconfile = os.path.join(icondir, 'idle.ico') root.wm_iconbitmap(default=iconfile) else: ext = '.png' if TkVersion >= 8.6 else '.gif' iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext)) for size in (16, 32, 48)] icons = [PhotoImage(master=root, file=iconfile) for iconfile in iconfiles] root.wm_iconphoto(True, *icons) IDLE uses wm_iconbitmap on Windows and wm_iconphoto with PhotoImages from .gif or .png on everything else. It appears that wm_iconphoto is already used on macOS with tk 8.5. The uploaded PM.png looks like it might be idle16.png zoomed out at least 3x. Anything that does that instead of using the much sharper 32 or 48 bit versions is, to me, buggy. The bigger images stay much sharper even when zoomed. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 03:50:00 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Nov 2017 08:50:00 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511581539.67.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: The test calls Py_SetProgramName(). IMHO the bug is that the program name is needed to locate the Python std lib. I don't think that the bug is triggered by Py_DecodeLocale(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 05:37:26 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 25 Nov 2017 10:37:26 +0000 Subject: [issue28334] netrc does not work if $HOME is not set In-Reply-To: <1475336154.44.0.44449733804.issue28334@psf.upfronthosting.co.za> Message-ID: <1511606246.25.0.213398074469.issue28334@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 8d9bb11d8fcbf10cc9b1eb0a647bcf3658a4e3dd by Berker Peksag in branch 'master': bpo-28334: netrc() now uses expanduser() to find .netrc file (GH-4537) https://github.com/python/cpython/commit/8d9bb11d8fcbf10cc9b1eb0a647bcf3658a4e3dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 05:39:33 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 25 Nov 2017 10:39:33 +0000 Subject: [issue28334] netrc does not work if $HOME is not set In-Reply-To: <1475336154.44.0.44449733804.issue28334@psf.upfronthosting.co.za> Message-ID: <1511606373.78.0.213398074469.issue28334@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks, Dimitri. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 05:56:04 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 10:56:04 +0000 Subject: [issue32126] [asyncio] test failure when the platform lacks a functional sem_open() In-Reply-To: <1511542925.3.0.213398074469.issue32126@psf.upfronthosting.co.za> Message-ID: <1511607364.09.0.213398074469.issue32126@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +4487 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 06:05:53 2017 From: report at bugs.python.org (Shamal Faily) Date: Sat, 25 Nov 2017 11:05:53 +0000 Subject: [issue32130] xml.sax parser validation sometimes fails when obtaining DTDs from https sites Message-ID: <1511607953.88.0.213398074469.issue32130@psf.upfronthosting.co.za> New submission from Shamal Faily : If an XML document is externally validated against a DTD from a https site then, depending on the security posture of the hosting site, validation might fail. This seems to be due to the lack of user agent information received by the host when the request for the DTD is sent. Relaxing the security rules on the host does get around this problem, but this might not always be a solution for some. I've observed with this issue with xml.sax. I don't know how general this problem is in other XML handling components of Python2 or Python 3. ---------- components: XML messages: 306952 nosy: failys priority: normal severity: normal status: open title: xml.sax parser validation sometimes fails when obtaining DTDs from https sites versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 06:06:40 2017 From: report at bugs.python.org (Shamal Faily) Date: Sat, 25 Nov 2017 11:06:40 +0000 Subject: [issue32130] xml.sax parser validation sometimes fails when obtaining DTDs from https sites In-Reply-To: <1511607953.88.0.213398074469.issue32130@psf.upfronthosting.co.za> Message-ID: <1511608000.69.0.213398074469.issue32130@psf.upfronthosting.co.za> Change by Shamal Faily : ---------- type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 06:48:22 2017 From: report at bugs.python.org (Jean-Michel) Date: Sat, 25 Nov 2017 11:48:22 +0000 Subject: [issue32131] Missing encoding parameter in urllib/parse.py Message-ID: <1511610502.45.0.213398074469.issue32131@psf.upfronthosting.co.za> New submission from Jean-Michel : Here is the patch, working for me in Python 3.4.2 610,611c703 < #~ value = _coerce_result(value) < value = _coerce_result(value,encoding=encoding) --- > value = _coerce_result(value) ---------- messages: 306953 nosy: jmbc priority: normal severity: normal status: open title: Missing encoding parameter in urllib/parse.py type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 06:52:49 2017 From: report at bugs.python.org (Jean-Michel) Date: Sat, 25 Nov 2017 11:52:49 +0000 Subject: [issue32131] Missing encoding parameter in urllib/parse.py In-Reply-To: <1511610502.45.0.213398074469.issue32131@psf.upfronthosting.co.za> Message-ID: <1511610769.78.0.213398074469.issue32131@psf.upfronthosting.co.za> Jean-Michel added the comment: Sorry, the description was missing. parse.py crashes if provided with unicode data like "voil?" : [wsgi:error] [pid 20335] [client 127.0.0.1:44658] UnicodeEncodeError: 'ascii' codec can't encode character '\\xe0' in position 314: ordinal not in range(128) The "encoding" parameters looks missing in parse.py, so I included it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:31:46 2017 From: report at bugs.python.org (Klon666) Date: Sat, 25 Nov 2017 13:31:46 +0000 Subject: [issue32132] Android5 Message-ID: <1511616706.91.0.213398074469.issue32132@psf.upfronthosting.co.za> Change by Klon666 : ---------- components: Demos and Tools, Extension Modules, IO, Installation files: 18.7z nosy: Tu madre priority: normal severity: normal status: open title: Android5 type: resource usage versions: Python 3.5 Added file: https://bugs.python.org/file47289/18.7z _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:33:21 2017 From: report at bugs.python.org (Klon666) Date: Sat, 25 Nov 2017 13:33:21 +0000 Subject: [issue32132] Android5 Message-ID: <1511616801.96.0.213398074469.issue32132@psf.upfronthosting.co.za> Change by Klon666 : Added file: https://bugs.python.org/file47290/radio fftt.apk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:34:46 2017 From: report at bugs.python.org (Klon666) Date: Sat, 25 Nov 2017 13:34:46 +0000 Subject: [issue32132] Android5 Message-ID: <1511616886.36.0.213398074469.issue32132@psf.upfronthosting.co.za> Change by Klon666 : ---------- resolution: -> third party Added file: https://bugs.python.org/file47291/radio fftt.apk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:38:29 2017 From: report at bugs.python.org (Klon666) Date: Sat, 25 Nov 2017 13:38:29 +0000 Subject: [issue32132] Android5 Message-ID: <1511617109.0.0.213398074469.issue32132@psf.upfronthosting.co.za> Change by Klon666 : Added file: https://bugs.python.org/file47292/de.robv.android.xposed.installer_v33_36570c.apk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:38:44 2017 From: report at bugs.python.org (Kevin Walzer) Date: Sat, 25 Nov 2017 13:38:44 +0000 Subject: [issue32129] Icon on macOS In-Reply-To: <1511585376.3.0.213398074469.issue32129@psf.upfronthosting.co.za> Message-ID: <1511617124.64.0.213398074469.issue32129@psf.upfronthosting.co.za> Kevin Walzer added the comment: wm_iconphoto is a no-op on Tk 8.5 on MacOS; the C function returns true with no action. That's why this has not cropped up before. As implemented, the command on macOS only takes the first image in the parameters to use; the Cocoa mechanism in use for displaying images as app icons does not pack multiple sizes in the image. This will be documented in the man page for the next release of Tk. That's why the image currently looks very bad, because, as you note, it's scaling up a 16px image. The 48px would look better, albeit a bit jagged. The attached patch proposes to simply bypass this call in Tk-Mac. The wm_iconphoto command is most useful for a) replacing a generic Windows or X11 icon with something more customized or b) displaying a change in application state. On Mac OS, option is already addressed by the bundled application icon that looks much more polished; most users will not be calling idle from the command line (where this call can make sense). Option b is not applicable in this context. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:39:19 2017 From: report at bugs.python.org (Kevin Walzer) Date: Sat, 25 Nov 2017 13:39:19 +0000 Subject: [issue32129] Icon on macOS In-Reply-To: <1511585376.3.0.213398074469.issue32129@psf.upfronthosting.co.za> Message-ID: <1511617159.3.0.213398074469.issue32129@psf.upfronthosting.co.za> Kevin Walzer added the comment: Adding proposed patch. ---------- keywords: +patch Added file: https://bugs.python.org/file47293/pyshell.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:39:58 2017 From: report at bugs.python.org (Klon666) Date: Sat, 25 Nov 2017 13:39:58 +0000 Subject: [issue32132] Android5 Message-ID: <1511617198.17.0.213398074469.issue32132@psf.upfronthosting.co.za> Change by Klon666 : ---------- hgrepos: +375 Added file: https://bugs.python.org/file47294/YouTube Max.apk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:48:20 2017 From: report at bugs.python.org (Klon666) Date: Sat, 25 Nov 2017 13:48:20 +0000 Subject: [issue31233] socketserver.ThreadingMixIn leaks running threads after server_close() In-Reply-To: <1503073499.39.0.93886151367.issue31233@psf.upfronthosting.co.za> Message-ID: <1511617700.23.0.213398074469.issue31233@psf.upfronthosting.co.za> Change by Klon666 : ---------- hgrepos: +376 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:56:24 2017 From: report at bugs.python.org (Klon666) Date: Sat, 25 Nov 2017 13:56:24 +0000 Subject: [issue31233] socketserver.ThreadingMixIn leaks running threads after server_close() In-Reply-To: <1503073499.39.0.93886151367.issue31233@psf.upfronthosting.co.za> Message-ID: <1511618184.54.0.213398074469.issue31233@psf.upfronthosting.co.za> Change by Klon666 : ---------- components: +Build nosy: +Tu madre type: resource usage -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 09:30:40 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 25 Nov 2017 14:30:40 +0000 Subject: [issue31233] socketserver.ThreadingMixIn leaks running threads after server_close() In-Reply-To: <1503073499.39.0.93886151367.issue31233@psf.upfronthosting.co.za> Message-ID: <1511620240.47.0.213398074469.issue31233@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- components: -Build nosy: -Tu madre type: security -> resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 09:33:14 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 14:33:14 +0000 Subject: [issue28668] instanciation of multiprocessing.Queue raises ImportError in test_logging In-Reply-To: <1478879280.84.0.810360820826.issue28668@psf.upfronthosting.co.za> Message-ID: <1511620394.06.0.213398074469.issue28668@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4489 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 09:35:19 2017 From: report at bugs.python.org (Berker Peksag) Date: Sat, 25 Nov 2017 14:35:19 +0000 Subject: [issue32132] Android5 Message-ID: <1511620519.25.0.213398074469.issue32132@psf.upfronthosting.co.za> New submission from Berker Peksag : Android is not yet a fully supported platform. It's not clear what are you reporting here. Could you give us more information? ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 09:40:48 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 14:40:48 +0000 Subject: [issue28668] instanciation of multiprocessing.Queue raises ImportError in test_logging In-Reply-To: <1478879280.84.0.810360820826.issue28668@psf.upfronthosting.co.za> Message-ID: <1511620848.64.0.213398074469.issue28668@psf.upfronthosting.co.za> Xavier de Gaye added the comment: The multiprocessing module is not functional when the multiprocessing.synchronize module cannot be imported and all the multiprocessing tests are skipped in that case. Use the same idiom (i.e. test.support.import_module('multiprocessing.synchronize')) to skip the tests when the platform sem_open implementation is broken and remove test.support.requires_multiprocessing_queue. ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 10:23:54 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 25 Nov 2017 15:23:54 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511623434.79.0.213398074469.issue32071@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 5b48dc638b7405fd9bde4d854bf477dfeaaddf44 by Antoine Pitrou (Jonas Haag) in branch 'master': bpo-32071: Add unittest -k option (#4496) https://github.com/python/cpython/commit/5b48dc638b7405fd9bde4d854bf477dfeaaddf44 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 10:24:31 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 25 Nov 2017 15:24:31 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511623471.65.0.213398074469.issue32071@psf.upfronthosting.co.za> Antoine Pitrou added the comment: The enhancement is now pushed to git master. Thank you Jonas for contributing this! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 10:38:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Nov 2017 15:38:22 +0000 Subject: [issue24641] Log type of unserializable value when raising JSON TypeError In-Reply-To: <1436993372.93.0.482029912936.issue24641@psf.upfronthosting.co.za> Message-ID: <1511624302.3.0.213398074469.issue24641@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset cfa797c0681b7fef47cf93955fd06b54ddd09a7f by Serhiy Storchaka in branch 'master': bpo-24641: Improved error message for JSON unserializible keys. (#4364) https://github.com/python/cpython/commit/cfa797c0681b7fef47cf93955fd06b54ddd09a7f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 10:48:26 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 15:48:26 +0000 Subject: [issue26856] android does not have pwd.getpwall() In-Reply-To: <1461677345.21.0.582848799296.issue26856@psf.upfronthosting.co.za> Message-ID: <1511624906.17.0.213398074469.issue26856@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +4490 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 10:50:09 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 15:50:09 +0000 Subject: [issue26856] android does not have pwd.getpwall() In-Reply-To: <1461677345.21.0.582848799296.issue26856@psf.upfronthosting.co.za> Message-ID: <1511625009.75.0.213398074469.issue26856@psf.upfronthosting.co.za> Xavier de Gaye added the comment: The pwd module is broken when a member of the 'passwd? data structure is NULL (issue 32033). Remove _getpwall() and therefore skip test_pwd on Android until issue 32033 is fixed. ---------- dependencies: +The pwd module implementation incorrectly sets some attributes to None resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 10:53:30 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Nov 2017 15:53:30 +0000 Subject: [issue24641] Log type of unserializable value when raising JSON TypeError In-Reply-To: <1436993372.93.0.482029912936.issue24641@psf.upfronthosting.co.za> Message-ID: <1511625210.35.0.213398074469.issue24641@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:01:53 2017 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 25 Nov 2017 16:01:53 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1511584468.88.0.213398074469.issue10544@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: No to both. See python-dev. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:05:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Nov 2017 16:05:13 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511625913.07.0.213398074469.issue10544@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Here is a sample of the implementation of the Nick's idea. ---------- keywords: +patch Added file: https://bugs.python.org/file47296/yield-in-comprehensions.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:10:50 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 25 Nov 2017 16:10:50 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511626250.83.0.213398074469.issue10544@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- nosy: -levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:25:33 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 16:25:33 +0000 Subject: [issue32059] detect_modules() in setup.py must also search the sysroot paths In-Reply-To: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> Message-ID: <1511627133.05.0.213398074469.issue32059@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 77f5139954a878b856b0ac4c76486b27b6f4ec26 by xdegaye in branch 'master': bpo-32059: setup.py now also searches the sysroot paths (GH-4452) https://github.com/python/cpython/commit/77f5139954a878b856b0ac4c76486b27b6f4ec26 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:26:38 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 16:26:38 +0000 Subject: [issue32059] detect_modules() in setup.py must also search the sysroot paths In-Reply-To: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> Message-ID: <1511627198.35.0.213398074469.issue32059@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:26:49 2017 From: report at bugs.python.org (Roundup Robot) Date: Sat, 25 Nov 2017 16:26:49 +0000 Subject: [issue32059] detect_modules() in setup.py must also search the sysroot paths In-Reply-To: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> Message-ID: <1511627209.67.0.213398074469.issue32059@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4491 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:32:29 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 16:32:29 +0000 Subject: [issue26856] android does not have pwd.getpwall() In-Reply-To: <1461677345.21.0.582848799296.issue26856@psf.upfronthosting.co.za> Message-ID: <1511627549.41.0.213398074469.issue26856@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 76fdac4c9f53eb8433a54bd3daf9f5cc2e702a44 by xdegaye in branch 'master': bpo-26856: Skip test_pwd on Android until issue 32033 is fixed (GH-4561) https://github.com/python/cpython/commit/76fdac4c9f53eb8433a54bd3daf9f5cc2e702a44 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:33:07 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 16:33:07 +0000 Subject: [issue26856] android does not have pwd.getpwall() In-Reply-To: <1461677345.21.0.582848799296.issue26856@psf.upfronthosting.co.za> Message-ID: <1511627587.82.0.213398074469.issue26856@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 11:52:23 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 25 Nov 2017 16:52:23 +0000 Subject: [issue32059] detect_modules() in setup.py must also search the sysroot paths In-Reply-To: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> Message-ID: <1511628743.06.0.213398074469.issue32059@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset 04af8ace86d4396bc64fc401f36049ab745fd8c1 by xdegaye (Miss Islington (bot)) in branch '3.6': bpo-32059: setup.py now also searches the sysroot paths (GH-4452) (#4562) https://github.com/python/cpython/commit/04af8ace86d4396bc64fc401f36049ab745fd8c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 12:51:09 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Nov 2017 17:51:09 +0000 Subject: [issue32129] Icon on macOS In-Reply-To: <1511585376.3.0.213398074469.issue32129@psf.upfronthosting.co.za> Message-ID: <1511632269.54.0.213398074469.issue32129@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Ned, do you agree that simply changing 'else' to 'elif not macosx.isAquaTk()' is the best resolution? Backporting such a change to 3.6 would be trivial; to 2.7, not. Is there any need for the latter? Kevin, thanks for the explanation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 13:06:28 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Nov 2017 18:06:28 +0000 Subject: [issue32129] Icon on macOS In-Reply-To: <1511585376.3.0.213398074469.issue32129@psf.upfronthosting.co.za> Message-ID: <1511633188.5.0.213398074469.issue32129@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If on OS X only first picture is taken, what if change the order of pictures? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 13:31:43 2017 From: report at bugs.python.org (abcdef) Date: Sat, 25 Nov 2017 18:31:43 +0000 Subject: [issue32133] documentation: numbers module nitpick Message-ID: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> New submission from abcdef : Documentation of the numbers module: https://docs.python.org/3/library/numbers.html states "None of the types defined in this module can be instantiated." This is true for Complex, Real, Rational, Integral but not for Number: >>> numbers.Number() >>> numbers.Real() Traceback (most recent call last): File "", line 1, in TypeError: Can't instantiate abstract class Real... Since Number doesn't have any abstract methods, the correct fix seems to be changing the documentation. I would try to convey something like this: "The types defined in this module can be used for subclassing and checking whether a specific class is in the numeric hierarchy; they are not used directly for instantiation. For this, you can use types such as `complex` or `fractions.Fraction`". ---------- assignee: docs at python components: Documentation messages: 306970 nosy: abcdef, docs at python priority: normal severity: normal status: open title: documentation: numbers module nitpick type: enhancement versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 13:39:46 2017 From: report at bugs.python.org (Jonas) Date: Sat, 25 Nov 2017 18:39:46 +0000 Subject: [issue32134] Crash on OSX Message-ID: <1511635184.55.0.213398074469.issue32134@psf.upfronthosting.co.za> New submission from Jonas : The Idle Editor or Idle Python Shell crashes if ` character is typed in. Character looks like an ` with underscore. How to repeat this problem: 1. In OSX open any .py file or the Idle Shell with Idle. 2. Switch to german keyboard layout 3. Type the letter by pressing shift and the += button, left of the delete button. (Keyboard hardware layout is US) I attached only the crash report of version 3.6.3. This issue happens also to all previous versions. I didn't checked with versions higher than 3.6.3. Info from shell (not crashed yet): Python 3.6.3 (v3.6.3:2c5fed86e0, Oct 3 2017, 00:32:08) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or "license()" for more information. >>> ---------- assignee: terry.reedy components: IDLE files: Idle363_crash_report.txt messages: 306971 nosy: jonasfinke at aol.com, terry.reedy priority: normal severity: normal status: open title: Crash on OSX type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47297/Idle363_crash_report.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 13:46:52 2017 From: report at bugs.python.org (Jonas) Date: Sat, 25 Nov 2017 18:46:52 +0000 Subject: [issue32134] Crash on OSX In-Reply-To: <1511635184.55.0.213398074469.issue32134@psf.upfronthosting.co.za> Message-ID: <1511635612.72.0.213398074469.issue32134@psf.upfronthosting.co.za> Jonas added the comment: See screenshot from character: without: ` and with underscore: ` (underscore is not shown as text in comment. See screen shot) ---------- Added file: https://bugs.python.org/file47298/Screen Shot 2017-11-25 at 19.45.50.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 15:35:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Nov 2017 20:35:11 +0000 Subject: [issue28071] Stop set.difference when set is empty In-Reply-To: <1473546124.61.0.846799872363.issue28071@psf.upfronthosting.co.za> Message-ID: <1511642111.98.0.213398074469.issue28071@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This optimization caused a behavior change: Python 3.5: >>> set().difference([[]]) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'list' Python 3.6: >>> set().difference([[]]) set() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 16:14:20 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Nov 2017 21:14:20 +0000 Subject: [issue32134] Crash on OSX In-Reply-To: <1511635184.55.0.213398074469.issue32134@psf.upfronthosting.co.za> Message-ID: <1511644460.77.0.213398074469.issue32134@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This is a duplicate of previous reports. The problem, visible in the crash report, is that you are using the buggy Apple installed tcl/tk 8.5.9 and missed the upgrade instructions on https://www.python.org/download/mac/tcltk/ Ned, the web page implies that only 8.5.7 is 'not recommended' and lists 8.5.9 as an acceptible 'alternate'. But empirically, by multiple reports like this, it leads to crashes. Can we get that page updated? ---------- components: +Tkinter, macOS -IDLE nosy: +ned.deily, ronaldoussoren resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 16:34:11 2017 From: report at bugs.python.org (Martin Panter) Date: Sat, 25 Nov 2017 21:34:11 +0000 Subject: [issue28778] wsgiref HTTP Response Header Injection: CRLF Injection In-Reply-To: <1479891172.05.0.173710900147.issue28778@psf.upfronthosting.co.za> Message-ID: <1511645651.96.0.213398074469.issue28778@psf.upfronthosting.co.za> Martin Panter added the comment: Issue 11671 is closely related and has a patch proposing to ban control characters including CRLF (but not spaces). Also see Issue 22928 which added header field validation to the HTTP client module. ---------- dependencies: +Security hole in wsgiref.headers.Headers nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 17:49:18 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 25 Nov 2017 22:49:18 +0000 Subject: [issue32118] Doc for comparison of sequences with non-orderable elements In-Reply-To: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> Message-ID: <1511650158.88.0.213398074469.issue32118@psf.upfronthosting.co.za> Terry J. Reedy added the comment: (Raymond, I wrote this before reading your message, but I believe it provides what you requested. There is nothing special about None that is relevant to sequence comparison. Nans just happen to be the only built-in non-reflexive objects (that I know of, thank goodness).) This issue is about order comparisons *also* being defined on a single object in a sequence and therefore also possibly giving a different result. Title revised to be clearer and short enough to all be visible. Demonstration: >>> a = object() >>> a == a, a != a # but a < a, a <= a, a >= a, a > a raise TypeError (True, False) >>> la = [a] >>> la == la, la != la, la < la, la <= la, la >= la, la > la (True, False, False, True, True, False) Comparison of two sequences infers from identity all 6 rich comparison results on a single object in corresponding positions of the two sequences. This has nothing to do with the object being a singleton, other than a singleton being a single object. The enforcement of reflexivity and enforcement of consistent order on single objects are related, but the latter did not have to follow from the first. The presentation of order, in the patch, by reference to singletons and reflexivity, does not work. As I said in review, the example is too long and wrongly placed. I think using a generic object instead of None would also be better. I would like to rewrite the sequence comparison paragraphs after the first as something like the following. --- Sequences compare lexicographically using comparison of corresponding elements. The two objects are first compared for identity. If they are distinct, they are compared normally. If they are the same object, the self comparisons are inferred: '==', '>=', and '<=' are true, while '!=', '>', and '<' are false. By design, the inferred self comparisons for sequences sometimes give different results than would strict element comparison. Instances of an unordered class become ordered with respect to themselves instead of raising a TypeError. >>> a = object() >>> a < a # By default, objects are not ordered Traceback (most recent call last): File "", line 1, in TypeError: '>=' not supported between instances of 'object' and 'object' >>> [a] < [a] False # Sequence comparison orders an object versus itself Even anti-reflexive not-a-number values, for example, are treated as reflexive (meaning a == a always). --- This re-write describes sequence comparison in one paragraph, instead of putting the details in the middle of the next paragraph. The next paragraph describes the two possible consequences of inferring comparisons from identify: a result instead of a raise, and a different result. ---------- nosy: +terry.reedy title: Docs: add note about sequence comparisons containing non-orderable elements -> Doc for comparison of sequences with non-orderable elements _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 17:56:23 2017 From: report at bugs.python.org (Martin) Date: Sat, 25 Nov 2017 22:56:23 +0000 Subject: [issue32135] Dict creation with update will result to NoneType Message-ID: <1511650583.53.0.213398074469.issue32135@psf.upfronthosting.co.za> New submission from Martin : >>> x = {"x":123}.update({"abc":123}) >>> type(x) ---------- messages: 306977 nosy: thedemz priority: normal severity: normal status: open title: Dict creation with update will result to NoneType type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 17:57:01 2017 From: report at bugs.python.org (=?utf-8?q?Anders_Hovm=C3=B6ller?=) Date: Sat, 25 Nov 2017 22:57:01 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1511650621.3.0.213398074469.issue22490@psf.upfronthosting.co.za> Change by Anders Hovm?ller : ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 17:57:57 2017 From: report at bugs.python.org (=?utf-8?q?Anders_Hovm=C3=B6ller?=) Date: Sat, 25 Nov 2017 22:57:57 +0000 Subject: [issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile In-Reply-To: <1411623045.52.0.589017779939.issue22490@psf.upfronthosting.co.za> Message-ID: <1511650677.4.0.213398074469.issue22490@psf.upfronthosting.co.za> Change by Anders Hovm?ller : ---------- nosy: +Anders.Hovm?ller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 18:06:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Nov 2017 23:06:05 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511651165.49.0.213398074469.issue10544@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4492 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 18:07:44 2017 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 25 Nov 2017 23:07:44 +0000 Subject: [issue32135] Dict creation with update will result to NoneType In-Reply-To: <1511650583.53.0.213398074469.issue32135@psf.upfronthosting.co.za> Message-ID: <1511651264.51.0.213398074469.issue32135@psf.upfronthosting.co.za> Eric V. Smith added the comment: dict.update() returns None, so this is expected. Maybe you want: >>> x = {"X":123} >>> x.update({"abc":123}) >>> x {'X': 123, 'abc': 123} >>> ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 18:14:09 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 25 Nov 2017 23:14:09 +0000 Subject: [issue32135] Dict creation with update will result to NoneType In-Reply-To: <1511650583.53.0.213398074469.issue32135@psf.upfronthosting.co.za> Message-ID: <1511651649.44.0.213398074469.issue32135@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The update() method returns None. This is a correct behavior. The rationale is the same as for list.sort(), see https://docs.python.org/3/faq/design.html#why-doesn-t-list-sort-return-the-sorted-list. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 19:03:14 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 26 Nov 2017 00:03:14 +0000 Subject: [issue30458] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1511654594.14.0.213398074469.issue30458@psf.upfronthosting.co.za> Change by Martin Panter : ---------- type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 20:00:28 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 26 Nov 2017 01:00:28 +0000 Subject: [issue32085] [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! In-Reply-To: <1511187317.56.0.213398074469.issue32085@psf.upfronthosting.co.za> Message-ID: <1511658028.71.0.213398074469.issue32085@psf.upfronthosting.co.za> Martin Panter added the comment: The square ? in the strings represents a space. Issue 1 (CRLF in HTTP request path): it looks like the %0D%0A would have to be decoded by an earlier step in the chain to "http://127.0.0.1:25/\r\nHELO . . .". This becomes like the header injection I mentioned in Issue 30458. Issue 2 (CRLF in HTTPS host): it seems this doesn?t work in Python as a side effect of Issue 22928 blocking generation of the Host field. But if you add a space you bypass that: "https://host%0D%0A%20SLAVEOF . . .:6379". ---------- dependencies: +CRLF Injection in httplib nosy: +martin.panter, orange _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 20:04:36 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 26 Nov 2017 01:04:36 +0000 Subject: [issue30458] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1511658276.61.0.213398074469.issue30458@psf.upfronthosting.co.za> Martin Panter added the comment: Actually, the CRLF + space can be injected via percent encoding, so just dealing with literal CRLFs and spaces wouldn?t be enough. You would have to validate the hostname after it is decoded. urlopen("http://127.0.0.1%0D%0A%20SLAVEOF . . . :6379/") >>> pprint(conn.recv(300).splitlines(keepends=True)) [b'GET / HTTP/1.1\r\n', b'Accept-Encoding: identity\r\n', b'Host: 127.0.0.1\r\n', b' SLAVEOF . . . :6379\r\n', b'Connection: close\r\n', b'User-Agent: Python-urllib/2.7\r\n', b'\r\n'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 20:17:45 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 01:17:45 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511659065.92.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Ah, you're right - I forgot about this little hack in the other embedding tests: https://github.com/vstinner/cpython/blob/3fda852ba4d4040657a1b616a1ef60ad437b7845/Programs/_testembed.c#L11 I'll add "./" to the program name in the new test as well, and see if that's enough to make the failing build bots happy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 21:01:22 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 02:01:22 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511661682.14.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: Serhiy's PR now implements the "Prohibit yield & yield from in generator expressions and comprehensions" approach discussed on python-dev (currently as a hard SyntaxError, but it could be amended to be a warning instead without too much difficulty). The PR does highlight an interesting subtlety though: the easiest way to implement this still allows yield expressions in the outermost iterator, since that gets compiled in a different scope from the rest of the comprehension body (it's evaluated eagerly and passed in to the implicit nested function). I'm thinking we probably don't want to expose that detail to end users, and will instead want to include a second check that prohibits yield expressions in the outermost iterator as well. However, I'm not entirely sure how we could implement such a check, short of adding a new "yield expression prohibited" counter in the AST generation and/or symbol analysis pass. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 21:48:49 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 02:48:49 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1511664529.81.0.213398074469.issue11063@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- pull_requests: +4493 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 21:50:35 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 02:50:35 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1511664635.56.0.213398074469.issue11063@psf.upfronthosting.co.za> Nick Coghlan added the comment: The header file check in setup.py incorrectly reported "not found" if `uuid.h` was in one of the standard include directories, so I've submitted a tweak to fix that: https://github.com/python/cpython/pull/4565 ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 22:04:48 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 03:04:48 +0000 Subject: [issue11063] Rework uuid module: lazy initialization and add a new C extension In-Reply-To: <1296321060.32.0.846037411239.issue11063@psf.upfronthosting.co.za> Message-ID: <1511665488.51.0.213398074469.issue11063@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 53efbf3977a44e382397e7994a2524b4f8c9d053 by Nick Coghlan in branch 'master': bpo-11063: Handle uuid.h being in default include path (GH-4565) https://github.com/python/cpython/commit/53efbf3977a44e382397e7994a2524b4f8c9d053 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 22:16:50 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 03:16:50 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511666210.23.0.213398074469.issue32096@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- pull_requests: +4494 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 22:59:48 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 26 Nov 2017 03:59:48 +0000 Subject: [issue10231] SimpleHTTPRequestHandler directory bugs In-Reply-To: <1288357835.63.0.535261040588.issue10231@psf.upfronthosting.co.za> Message-ID: <1511668788.14.0.213398074469.issue10231@psf.upfronthosting.co.za> Martin Panter added the comment: The first two bugs ("foo/dir?baz" and "foo/dir?baz/") were solved by Issue 23112. The third (".../foo.html/") was solved by Issue 17324. That leaves the fourth complaint, which I don?t understand: ?translate_path() does not handle initial "."/".." on non-Posix systems?. As far as I know, in 2010 (and still in 2017) the only non-Posix system Python supported was Windows. But Windows has os.curdir = "." and os.pardir = "..", just like Posix. There is a quirk where requests like ?GET .? and ?GET ../path? will retain the dots after passing through ?posixpath.normpath?. If there was a platform where a single or double dot was a legal file or directory name, the server will access the corresponding file or directory in these cases. But this does not seem like a problem. I propose to close this, unless there really is a bug with non-Posix systems. ---------- nosy: +martin.panter resolution: -> out of date stage: -> resolved status: open -> pending superseder: -> SimpleHTTPServer/http.server adds trailing slash after query string _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 23:19:15 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 04:19:15 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511669955.87.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 4274609e1856facd80b7ee588b0791fe8963b9e0 by Nick Coghlan in branch 'master': bpo-32096: Ensure new embedding test can find the encodings module (GH-4566) https://github.com/python/cpython/commit/4274609e1856facd80b7ee588b0791fe8963b9e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 23:37:15 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 04:37:15 +0000 Subject: [issue32136] Move embedding tests to their own test module Message-ID: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> New submission from Nick Coghlan : We currently run the runtime embedding tests as a subsection of "test_capi". I'm thinking it may make more sense to clearly separate them out as their own CPython-only test file, "test_runtime_embedding". I'm also thinking we should add a new "Runtime embedding" entry to the experts index, with myself, Victor Stinner, Eric Snow, and Steve Dower as the initial members. ---------- components: Tests messages: 306988 nosy: eric.snow, ncoghlan, steve.dower, vstinner priority: normal severity: normal stage: needs patch status: open title: Move embedding tests to their own test module type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 23:42:25 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 04:42:25 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511671345.07.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Looking more closely at the code, I've realised Victor's right - there's no way for Py_DecodeLocale() to accidentally trigger an attempt to import the "encodings" module. Instead, the error is likely coming from the init_sys_streams step towards the end of the initialization process. The way the embedded test cases are currently being run unfortunately truncated that traceback. Rather than trying to improve the test case error reporting under the scope of this issue, I've instead filed https://bugs.python.org/issue32136 to cover factoring the runtime embedding tests out to their own test file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 23:43:41 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 04:43:41 +0000 Subject: [issue32136] Move embedding tests to their own test module In-Reply-To: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> Message-ID: <1511671421.34.0.213398074469.issue32136@psf.upfronthosting.co.za> Nick Coghlan added the comment: As noted in https://bugs.python.org/issue32096#msg306989, it would also be good to ensure that the full traceback from a failed `_testembed` call is always visible when running in verbose mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 00:16:29 2017 From: report at bugs.python.org (Hallvard B Furuseth) Date: Sun, 26 Nov 2017 05:16:29 +0000 Subject: [issue10231] SimpleHTTPRequestHandler directory bugs In-Reply-To: <1511668788.14.0.213398074469.issue10231@psf.upfronthosting.co.za> Message-ID: <5dc4ac29-d8f2-2af7-a5ec-32c40894aa4d@mail.uio.no> Hallvard B Furuseth added the comment: On 26/11/17 04:59, Martin Panter wrote: > That leaves the fourth complaint, which I don?t understand: ?translate_path() does not handle initial "."/".." on non-Posix systems?. > > As far as I know, in 2010 (and still in 2017) the only non-Posix system Python supported was Windows. But Windows has os.curdir = "." and os.pardir = "..", just like Posix. os.macpath has ":" and "::". I don't remember if that's what I was thinking though. Maybe just "non-posixpath.py". A generic problem - you have to think about each os.path implementation to see if the translate_path() is valid. If you someday add support for another OS, that can break a working translate_path(). My proposed code would fix that, at least for that particular code. > There is a quirk where requests like ?GET .? and ?GET ../path? will retain the dots after passing through ?posixpath.normpath?. If there was a platform where a single or double dot was a legal file or directory name, the server will access the corresponding file or directory in these cases. But this does not seem like a problem. More generally, translate_path() ought to escape characters and character combinations which have special meaning in the filesystem. But that can be hairy, as the *url2path.py modules demonstrate, and it would break compatibility with people's existing directory structures. And with ospath->URL transation elsewhere, I'm sure. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 00:28:23 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 26 Nov 2017 05:28:23 +0000 Subject: [issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL In-Reply-To: <1511185756.0.0.213398074469.issue32084@psf.upfronthosting.co.za> Message-ID: <1511674103.3.0.213398074469.issue32084@psf.upfronthosting.co.za> Martin Panter added the comment: Maybe a good fix would be to ?escape? the double slash with ?/.?: if os.path.isdir(path): url = self.path if url.startswith('//'): # E.g. "//www.python.org/%2f.." url = "/." + url # Becomes "/.//www.python.org/%2f.." parts = urllib.parse.urlsplit(url) ... When this ?escaped? URL is resolved with the base URL, it should give the right result: >>> base = "http://localhost:8000//www.python.org/%2f.." >>> redirect = "/.//www.python.org/%2f../" >>> urljoin(base, redirect) 'http://localhost:8000//www.python.org/%2f../' A simpler idea is to strip off all but one of the leading slashes, so you end up with "/www.python.org/%2f..". That would technically be a different URL, but would access the same file through the default SimpleHTTPRequestHandler behaviour, so most people wouldn?t notice. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 00:41:53 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 05:41:53 +0000 Subject: [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. In-Reply-To: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> Message-ID: <1511674913.57.0.213398074469.issue32096@psf.upfronthosting.co.za> Nick Coghlan added the comment: Successful test run on the Debian machine that failed above: * http://buildbot.python.org/all/#/builders/27/builds/242 And for the macOS Tiger machine: * http://buildbot.python.org/all/#/builders/30/builds/227 So I think we can call the regression fixed, which is where we wanted to get to before the next alpha release. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 01:03:07 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 26 Nov 2017 06:03:07 +0000 Subject: [issue10231] SimpleHTTPRequestHandler directory bugs In-Reply-To: <1288357835.63.0.535261040588.issue10231@psf.upfronthosting.co.za> Message-ID: <1511676187.14.0.213398074469.issue10231@psf.upfronthosting.co.za> Martin Panter added the comment: I read in PEP 11 that Mac OS 9 support was dropped in Python 2.4. I agree that eliminating ?.? and ?..? components makes sense, since that is how they should be handled when resolving relative URLs. But it seems low priority, since this doesn?t happen on current supported platforms, and would only be triggered by an invalid HTTP request. ---------- priority: normal -> low stage: resolved -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 01:22:42 2017 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 26 Nov 2017 06:22:42 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1511661682.14.0.213398074469.issue10544@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: No. On Nov 25, 2017 18:01, "Nick Coghlan" wrote: > > Nick Coghlan added the comment: > > Serhiy's PR now implements the "Prohibit yield & yield from in generator > expressions and comprehensions" approach discussed on python-dev (currently > as a hard SyntaxError, but it could be amended to be a warning instead > without too much difficulty). > > The PR does highlight an interesting subtlety though: the easiest way to > implement this still allows yield expressions in the outermost iterator, > since that gets compiled in a different scope from the rest of the > comprehension body (it's evaluated eagerly and passed in to the implicit > nested function). > > I'm thinking we probably don't want to expose that detail to end users, > and will instead want to include a second check that prohibits yield > expressions in the outermost iterator as well. However, I'm not entirely > sure how we could implement such a check, short of adding a new "yield > expression prohibited" counter in the AST generation and/or symbol analysis > pass. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 02:12:26 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 07:12:26 +0000 Subject: [issue32136] Move embedding tests to their own test module In-Reply-To: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> Message-ID: <1511680346.21.0.213398074469.issue32136@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- keywords: +patch pull_requests: +4495 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 02:20:20 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 26 Nov 2017 07:20:20 +0000 Subject: [issue13153] IDLE crashes when pasting non-BMP unicode char on Py3 In-Reply-To: <1318363292.9.0.682519731008.issue13153@psf.upfronthosting.co.za> Message-ID: <1511680820.11.0.213398074469.issue13153@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 02:32:43 2017 From: report at bugs.python.org (Sanyam Khurana) Date: Sun, 26 Nov 2017 07:32:43 +0000 Subject: [issue22671] Typo in class io.BufferedIOBase docs In-Reply-To: <1413711352.27.0.0253692424247.issue22671@psf.upfronthosting.co.za> Message-ID: <1511681563.36.0.213398074469.issue22671@psf.upfronthosting.co.za> Change by Sanyam Khurana : ---------- pull_requests: +4496 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 03:03:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Sun, 26 Nov 2017 08:03:38 +0000 Subject: [issue32136] Move embedding tests to their own test module In-Reply-To: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: What about a shorter name like test_embed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 03:53:30 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 08:53:30 +0000 Subject: [issue32137] Stack overflow in repr of deeply nested dicts Message-ID: <1511686410.56.0.213398074469.issue32137@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : repr() of deeply nested dicts and dictviews can cause a stack overflow. >>> x = {} >>> for i in range(100000): ... x = {1: x} ... >>> repr(x) Segmentation fault >>> x = {} >>> for i in range(100000): ... x = {1: x} ... >>> repr(x.values()) Segmentation fault repr() of virtually all other deeply nested collections are guarded by using Py_EnterRecursiveCall(). >>> x = () >>> for i in range(100000): ... x = (x,) ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a tuple >>> x = [] >>> for i in range(100000): ... x = [x] ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a list >>> x = frozenset() >>> for i in range(100000): ... x = frozenset({x}) ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a list >>> from collections import OrderedDict >>> x = {} >>> for i in range(100000): ... x = OrderedDict({1: x}) ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a list >>> from collections import deque >>> x = deque() >>> for i in range(100000): ... x = deque([x]) ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a list But the case of infinite recursion already is handled: >>> x = {} >>> x[1] = x >>> repr(x) '{1: {...}}' Only finite but very deep recursion causes a crash. The one possible solution -- add Py_EnterRecursiveCall() in the implementation of dict.__repr__(), like it already is added in list.__repr__() and tuple.__repr__(). The more general solution -- add Py_EnterRecursiveCall() in PyObject_Repr(). In any case it is called before calling PyObject_Repr() for every item in the repr of most collections except dict. And it is already added in PyObject_Str(). Therefore adding it will not add much overhead, but can handle more corner cases. See also issue18533 and issue25240. ---------- components: Interpreter Core messages: 306997 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Stack overflow in repr of deeply nested dicts type: crash versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 04:31:51 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 26 Nov 2017 09:31:51 +0000 Subject: [issue32126] [asyncio] test failure when the platform lacks a functional sem_open() In-Reply-To: <1511542925.3.0.213398074469.issue32126@psf.upfronthosting.co.za> Message-ID: <1511688711.34.0.213398074469.issue32126@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset a6fba9b827e395fc9583c07bc2d15cd11f684439 by xdegaye in branch 'master': bpo-32126: Skip asyncio test when sem_open() is not functional (GH-4559) https://github.com/python/cpython/commit/a6fba9b827e395fc9583c07bc2d15cd11f684439 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 04:32:18 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 26 Nov 2017 09:32:18 +0000 Subject: [issue32126] [asyncio] test failure when the platform lacks a functional sem_open() In-Reply-To: <1511542925.3.0.213398074469.issue32126@psf.upfronthosting.co.za> Message-ID: <1511688738.25.0.213398074469.issue32126@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 04:58:59 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 26 Nov 2017 09:58:59 +0000 Subject: [issue32138] android: test_faulthandler fails also on API 24 Message-ID: <1511690339.03.0.213398074469.issue32138@psf.upfronthosting.co.za> New submission from Xavier de Gaye : Issue 26934 skipped some tests of test_faulthandler on Android API < 24 to fix the problem that python does not crash upon _sigsegv(). But the same problem occurs on API 24 except randomly, you need to run test_faulthandler many times before reproducing it, see below few results in that case. I propose to skip those tests whatever the value of the Android API level. In that case the test.support.requires_android_level decorator is not used anymore and should be removed. 1 test failed: test_faulthandler generic_x86_64:/data/local/tmp/python $ python -m test test_faulthandler Run tests sequentially 0:00:00 [1/1] test_faulthandler test test_faulthandler failed -- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 265, in test_enable_file filename=filename) File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 114, in check_fatal_error self.check_error(code, line_number, fatal_error, **kw) File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 107, in check_error output, exitcode = self.get_output(code, filename=filename, fd=fd) File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 67, in get_output self.assertEqual(output, '') AssertionError: "sys:1: ResourceWarning: unclosed file <_[49 chars]c3'>" != '' - sys:1: ResourceWarning: unclosed file <_io.BufferedWriter name='/data/local/tmp/tmp17fv9xc3'> + ====================================================================== FAIL: test_disable (test.test_faulthandler.FaultHandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 307, in test_disable self.assertNotEqual(exitcode, 0) AssertionError: 0 == 0 ====================================================================== FAIL: test_gil_released (test.test_faulthandler.FaultHandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 252, in test_gil_released 'Segmentation fault') File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 114, in check_fatal_error self.check_error(code, line_number, fatal_error, **kw) File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 110, in check_error self.assertNotEqual(exitcode, 0) AssertionError: 0 == 0 ---------- components: Tests messages: 306999 nosy: vstinner, xdegaye priority: normal severity: normal stage: needs patch status: open title: android: test_faulthandler fails also on API 24 type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 05:44:43 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 26 Nov 2017 10:44:43 +0000 Subject: [issue32139] android: locale is modified by test_strftime Message-ID: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> New submission from Xavier de Gaye : Test results: ------------ 1 test altered the execution environment: test_strftime Warning -- locale was modified by test_strftime Before: [(6, 'C.UTF-8'), (3, 'C.UTF-8'), (0, 'C.UTF-8'), (5, 'C.UTF-8'), (4, 'C.UTF-8'), (1, 'C.UTF-8'), (2, 'C.UTF-8')] After: [(6, 'C'), (3, 'C'), (0, 'C'), (5, 'C'), (4, 'C'), (1, 'C'), (2, 'C')] test_strftime failed (env changed) It seems that the tests indeed modify the environment. To understand the above results one must be aware that the implementation of setlocale() is broken on Android: generic_x86_64:/data/local/tmp/python $ python Python 3.7.0a2+ (heads/bpo-30386:ebb493ac4e, Nov 25 2017, 18:58:20) [Clang 3.8.275480 ] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from locale import setlocale, LC_TIME, LC_ALL >>> setlocale(LC_TIME) 'C.UTF-8' >>> setlocale(LC_ALL) 'C.UTF-8' >>> setlocale(LC_TIME, 'C') 'C' >>> setlocale(LC_TIME) 'C' >>> setlocale(LC_ALL) 'C' >>> setlocale(LC_TIME, 'C.UTF-8') 'C.UTF-8' >>> setlocale(LC_ALL) 'C.UTF-8' ---------- components: Tests messages: 307000 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: android: locale is modified by test_strftime type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 06:05:46 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 26 Nov 2017 11:05:46 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511694346.98.0.213398074469.issue32139@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +4497 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 06:46:13 2017 From: report at bugs.python.org (Camion) Date: Sun, 26 Nov 2017 11:46:13 +0000 Subject: [issue32140] Probable bug in all python3 / idle3 debugger Message-ID: <1511696773.06.0.213398074469.issue32140@psf.upfronthosting.co.za> New submission from Camion : Hello all, I have been investigating a bug with a generator, which crashed, reporting that "TypeError: 'Fraction' object is not iterable". Then I have tried to find it with the debugger and/or to reproduce it with a simpler program, but, I have not managed to reproduce the bug in my test program and I have been stopped by the fact that the debugger crashes with another error: I have reproduced it on version 3.4.2 ans 3.6.3, BUT NOT on version 2.7.9. So I suspect it has been introduced with version 3. Here is how to reproduce it : 1/ Open Idle 2/ create and save this text program (or open if you already did - or don't do anything if it's already opened X-D) from fractions import Fraction U=Fraction(1) def test(x): for i in range(1, x.denominator): x*=x yield i, i*x for m, n in test(U*3/5): print (m, n) 3/ Run/check module (F5) in Idle editors window : it works perfectly 4/ start the debugger from Idle menus 5/ activate the "source" checkbox 6/ Run/check module (F5) in Idle editors window 7/ Click 3 times on [over] to get to the "for m, n in test(U*3/5):" line 8/ Click 6 times on [step], to get to the line 116 ("for m, n in test(U*3/5):") in the fractions.py files 9/ Click a seventh time on [step] and your program will crash with the folowing error (here with 3.6.3) Traceback (most recent call last): File "/raid/ArcFolder/Mes documents/Mes Textes/Mes programmes/Machin/Test_it?rateur_et_fractions.py", line 12, in for m, n in test(U*3/5): File "/usr/local/lib/python3.6/fractions.py", line 376, in forward return monomorphic_operator(a, b) File "/usr/local/lib/python3.6/fractions.py", line 419, in _mul return Fraction(a.numerator * b.numerator, a.denominator * b.denominator) File "/usr/local/lib/python3.6/fractions.py", line 117, in __new__ if denominator is None: File "/usr/local/lib/python3.6/fractions.py", line 117, in __new__ if denominator is None: File "/usr/local/lib/python3.6/bdb.py", line 48, in trace_dispatch return self.dispatch_line(frame) File "/usr/local/lib/python3.6/bdb.py", line 66, in dispatch_line self.user_line(frame) File "/usr/local/lib/python3.6/idlelib/debugger.py", line 24, in user_line self.gui.interaction(message, frame) AttributeError: _numerator5/ Run/check module (F5) in Idle editors window I have observed once 3.4.2 that the same operation without activating the source checkbox, lead to a full idle freeze, but I have not been able to reproduce it. ---------- assignee: terry.reedy components: IDLE messages: 307001 nosy: Camion, terry.reedy priority: normal severity: normal status: open title: Probable bug in all python3 / idle3 debugger type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 06:50:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 11:50:08 +0000 Subject: [issue31937] Add the term "dunder" to the glossary In-Reply-To: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> Message-ID: <1511697008.92.0.213398074469.issue31937@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The term "dunder" is used in PEPs: PEP 8, PEP 408, PEP 435, PEP 505, PEP 520, PEP 526, and in the enum module documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 07:01:19 2017 From: report at bugs.python.org (Antonio Valentino) Date: Sun, 26 Nov 2017 12:01:19 +0000 Subject: [issue29670] argparse: does not respect required args pre-populated into namespace In-Reply-To: <1488227590.23.0.0462095560451.issue29670@psf.upfronthosting.co.za> Message-ID: <1511697679.9.0.213398074469.issue29670@psf.upfronthosting.co.za> Change by Antonio Valentino : ---------- nosy: +avalentino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 07:04:05 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 12:04:05 +0000 Subject: [issue32136] Move embedding tests to their own test module In-Reply-To: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> Message-ID: <1511697845.02.0.213398074469.issue32136@psf.upfronthosting.co.za> Nick Coghlan added the comment: I guess the shorted name would also better match the naming scheme used for the C API test module: Modules/_testcapi.c -> Lib/test/test_capi.py Progams/_testembed.c -> Lib/test/test_embed.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 07:37:52 2017 From: report at bugs.python.org (Phil Thompson) Date: Sun, 26 Nov 2017 12:37:52 +0000 Subject: [issue32141] configure with Spaces in Directory Name on macOS Message-ID: <1511699872.51.0.213398074469.issue32141@psf.upfronthosting.co.za> New submission from Phil Thompson : When configure searches for a C compiler on macOS it fails to handle spaces in directory name on PATH. The fix is to enclose $as_dir in quotes. ---------- components: Build messages: 307004 nosy: philthompson10 priority: normal severity: normal status: open title: configure with Spaces in Directory Name on macOS type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 07:42:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 12:42:44 +0000 Subject: [issue32137] Stack overflow in repr of deeply nested dicts In-Reply-To: <1511686410.56.0.213398074469.issue32137@psf.upfronthosting.co.za> Message-ID: <1511700164.43.0.213398074469.issue32137@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4498 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 09:13:51 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 26 Nov 2017 14:13:51 +0000 Subject: [issue10231] SimpleHTTPRequestHandler directory bugs In-Reply-To: <1288357835.63.0.535261040588.issue10231@psf.upfronthosting.co.za> Message-ID: <1511705631.89.0.213398074469.issue10231@psf.upfronthosting.co.za> Berker Peksag added the comment: Note that the macpath module has been deprecated in Python 3.7 in issue 9850 and it's going to be removed in Python 3.8 (and Python 3.6 is the only Python 3 release that accepts bug fixes at the moment) Perhaps it's not worth to fix the macpath case at all. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 11:05:48 2017 From: report at bugs.python.org (Scott Queen) Date: Sun, 26 Nov 2017 16:05:48 +0000 Subject: [issue32142] heapq.heappop - documentation misleading or doesn't work Message-ID: <1511712348.11.0.213398074469.issue32142@psf.upfronthosting.co.za> New submission from Scott Queen : The documentation for heapq.heappop(heap) says: "Pop and return the smallest item from the heap, maintaining the heap invariant. If the heap is empty, IndexError is raised. To access the smallest item without popping it, use heap[0]." yet, in the following code, the resultant heap doesn't reflect the heap invariant: import heapq li = [5, 7, 9, 1, 4, 3] heapq.heapify(li) #change a couple values in the heap li[3] = 16 li[4] = 2 print (heapq.heappop(li)) print ("The heap after pop is : ",end="") print (list(li)) This prints: The heap after pop is : [3, 4, 9, 16, 2] The documentation implies to me that heapify would be called internally after heappop, but I may be misreading. Perhaps heappop could say that the heap invariant is maintained if the heap is properly sorted before the heappop invocation. ---------- assignee: docs at python components: Documentation messages: 307006 nosy: docs at python, scooter4j priority: normal severity: normal status: open title: heapq.heappop - documentation misleading or doesn't work type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 11:17:33 2017 From: report at bugs.python.org (Giuseppe Scrivano) Date: Sun, 26 Nov 2017 16:17:33 +0000 Subject: [issue32143] os.statvfs lacks f_fsid Message-ID: <1511713053.6.0.213398074469.issue32143@psf.upfronthosting.co.za> New submission from Giuseppe Scrivano : the os.statvfs() function doesn't return f_fsid. The POSIX definition of statvfs() has f_fsid: http://pubs.opengroup.org/onlinepubs/009604599/basedefs/sys/statvfs.h.html ---------- components: Library (Lib) messages: 307007 nosy: gscrivano priority: normal severity: normal status: open title: os.statvfs lacks f_fsid type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 11:19:17 2017 From: report at bugs.python.org (Giuseppe Scrivano) Date: Sun, 26 Nov 2017 16:19:17 +0000 Subject: [issue32143] os.statvfs lacks f_fsid In-Reply-To: <1511713053.6.0.213398074469.issue32143@psf.upfronthosting.co.za> Message-ID: <1511713157.53.0.213398074469.issue32143@psf.upfronthosting.co.za> Change by Giuseppe Scrivano : ---------- keywords: +patch pull_requests: +4499 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 11:24:10 2017 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 26 Nov 2017 16:24:10 +0000 Subject: [issue32142] heapq.heappop - documentation misleading or doesn't work In-Reply-To: <1511712348.11.0.213398074469.issue32142@psf.upfronthosting.co.za> Message-ID: <1511713450.24.0.213398074469.issue32142@psf.upfronthosting.co.za> Eric V. Smith added the comment: The heap invariant is also required in order to even meet the documented behavior of returning the smallest item. >>> import heapq >>> li = [5, 7, 9, 1, 4, 3] >>> heapq.heapify(li) >>> li [1, 4, 3, 7, 5, 9] >>> li[2] = 0 >>> heapq.heappop(li) 1 >>> li [0, 4, 9, 7, 5] >>> I guess the argument could be made that docs say "from the heap", and by modifying the list yourself it's no longer a heap. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 12:40:25 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 17:40:25 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511718025.96.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If I understand correctly, the original problem was that tests failed in some environments, right? In that case we should either change the environment or just remove this check. I had added it in assumption that it is never failed for addresses obtained from network cards. If my assumption is wrong, it should be just removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 12:50:56 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 26 Nov 2017 17:50:56 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511718025.96.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: Barry A. Warsaw added the comment: On Nov 26, 2017, at 12:40, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > If I understand correctly, the original problem was that tests failed in some environments, right? In that case we should either change the environment or just remove this check. I had added it in assumption that it is never failed for addresses obtained from network cards. If my assumption is wrong, it should be just removed. I think your assumption is generally true in that *real* network cards (i.e. ethernet ports or wireless adapters) will always have universally administered MAC addresses. But what you probably didn?t expect is that certain environments can also have locally administered MAC addresses (e.g. MBP?s Touch Bar interfaces - that one surprised me too!) and some may *only* have local MACs (e.g. Travis). We can fix the first assumption by preferentially returning universal MACs, and only return local MACs if there are no other interfaces available. My latest changes do this. (Remember, I only started seeing the failures on my 2017 MBP with Touch Bar.) I can?t think of any way of solving the second one, short of just skipping those tests on Travis. I think any reasonable machine with real interfaces will have at least one universal MAC, so it?s just Travis being weird. My latest commit adds a skip for Travis. (That test is still running, so we?ll see.) The original problem really was that the test for universal vs. local MAC address was using the incorrect bitmask. The comment was also wrong, so my changes fix both the comment and the bitmask. Another problem I found was that the UUID1 spec says that if a random MAC is used as a fallback, then the multicast bit must be set, so my changes also do this. For now, I?d prefer to take the narrower approach of enabling the tests everywhere but Travis. What I don?t know is whether any of the buildbots will fail in a similar way, but I?m hoping they?ll be okay. If we see buildbot failures because they also lack universal MACs, then yes, we?ll have to reevaluate whether the tests make sense, or whether we should mock out the environment at a lower level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 12:51:24 2017 From: report at bugs.python.org (abcdef) Date: Sun, 26 Nov 2017 17:51:24 +0000 Subject: [issue32142] heapq.heappop - documentation misleading or doesn't work In-Reply-To: <1511712348.11.0.213398074469.issue32142@psf.upfronthosting.co.za> Message-ID: <1511718684.79.0.213398074469.issue32142@psf.upfronthosting.co.za> abcdef added the comment: > Perhaps heappop could say that the heap invariant is maintained if the heap is properly sorted before the heappop invocation. Honestly I like this wording less. "Properly sorted" would suggest sorted in the sense of heap.sort() [as the docs refer to this earlier], but the array doesn't have to be sorted; it's enough if it's a heap. The function always maintains the invariant - this means that if the invariant is true as a precondition, it will be true as a postcondition. Maybe you have a different idea? ---------- nosy: +abcdef _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 12:55:49 2017 From: report at bugs.python.org (Zachary Ware) Date: Sun, 26 Nov 2017 17:55:49 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511718949.32.0.213398074469.issue30855@psf.upfronthosting.co.za> Zachary Ware added the comment: New changeset be1faabeef0821f188a28dd7cc6b744b89e85e94 by Zachary Ware in branch '2.7': bpo-30855: Bump Tcl/Tk to 8.5.19 on Windows (GH-4550) https://github.com/python/cpython/commit/be1faabeef0821f188a28dd7cc6b744b89e85e94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 12:58:23 2017 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 26 Nov 2017 17:58:23 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: Message-ID: Guido van Rossum added the comment: To clarify, the outermost iterator is marked here: [func(x, y) for x in for y in ] and it is evaluated before the comprehension proper is started. This is just part of how the language works (it's a similar rule as "in an assignment the RHS is evaluated before it is assigned to the LHS"). I see no benefit in banning `yield` in . On Sat, Nov 25, 2017 at 10:22 PM, Guido van Rossum wrote: > > Guido van Rossum added the comment: > > No. > > On Nov 25, 2017 18:01, "Nick Coghlan" wrote: > > > > > Nick Coghlan added the comment: > > > > Serhiy's PR now implements the "Prohibit yield & yield from in generator > > expressions and comprehensions" approach discussed on python-dev > (currently > > as a hard SyntaxError, but it could be amended to be a warning instead > > without too much difficulty). > > > > The PR does highlight an interesting subtlety though: the easiest way to > > implement this still allows yield expressions in the outermost iterator, > > since that gets compiled in a different scope from the rest of the > > comprehension body (it's evaluated eagerly and passed in to the implicit > > nested function). > > > > I'm thinking we probably don't want to expose that detail to end users, > > and will instead want to include a second check that prohibits yield > > expressions in the outermost iterator as well. However, I'm not entirely > > sure how we could implement such a check, short of adding a new "yield > > expression prohibited" counter in the AST generation and/or symbol > analysis > > pass. > > > > ---------- > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 14:07:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 19:07:53 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511723273.85.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Universally/locally administered MAC addresses doesn't have relation to this issue. My assumption was about the multicast bit (1<<40). If my assumption was correct, the test is correct, and only the comment should be fixed. If it was wrong, the test should be removed. That's all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 14:19:10 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 26 Nov 2017 19:19:10 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511723273.85.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1E32F7E6-62DA-4832-BCE6-A34F060278C2@python.org> Barry A. Warsaw added the comment: On Nov 26, 2017, at 14:07, Serhiy Storchaka wrote: > > Universally/locally administered MAC addresses doesn't have relation to this issue. My assumption was about the multicast bit (1<<40). AFAICT, the multicast bit is only required to be set on random MAC. > If my assumption was correct, the test is correct, and only the comment should be fixed. If it was wrong, the test should be removed. That's all. I don?t understand. Are you saying that _find_mac() should return whatever random MAC is found first, as the original code does? That doesn?t seem right either, since as the MacBook Pro case shows, it?s entirely possible to get a MAC address that is the same on every single laptop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 15:17:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 20:17:13 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511727433.91.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a different issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 15:24:25 2017 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 26 Nov 2017 20:24:25 +0000 Subject: [issue32142] heapq.heappop - documentation misleading or doesn't work In-Reply-To: <1511712348.11.0.213398074469.issue32142@psf.upfronthosting.co.za> Message-ID: <1511727865.92.0.213398074469.issue32142@psf.upfronthosting.co.za> Eric V. Smith added the comment: By "sorted" I meant "sorted by the heap functions so as to maintain their invariants". I don't have any suggestion for the actual specific language to use. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 15:27:58 2017 From: report at bugs.python.org (Zachary Ware) Date: Sun, 26 Nov 2017 20:27:58 +0000 Subject: [issue28046] Remove the concept of platform-specific directories In-Reply-To: <1473443913.59.0.936788039942.issue28046@psf.upfronthosting.co.za> Message-ID: <1511728078.51.0.213398074469.issue28046@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- resolution: -> fixed stage: commit review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 15:47:11 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 20:47:11 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511729231.49.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4500 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 15:48:30 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 20:48:30 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511729310.0.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 4572 removes the wrong check. ---------- type: -> behavior versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 16:17:04 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sun, 26 Nov 2017 21:17:04 +0000 Subject: [issue29879] typing.Text not available in python 3.5.1 In-Reply-To: <1490191885.24.0.466307693119.issue29879@psf.upfronthosting.co.za> Message-ID: <1511731024.51.0.213398074469.issue29879@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- keywords: +patch pull_requests: +4501 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 16:18:32 2017 From: report at bugs.python.org (Zachary Ware) Date: Sun, 26 Nov 2017 21:18:32 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511731112.48.0.213398074469.issue30487@psf.upfronthosting.co.za> Zachary Ware added the comment: New changeset d8d6b9122134f040cd5a4f15f40f6c9e3386db4d by Zachary Ware (Caleb Hattingh) in branch 'master': bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346) https://github.com/python/cpython/commit/d8d6b9122134f040cd5a4f15f40f6c9e3386db4d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 16:20:07 2017 From: report at bugs.python.org (Zachary Ware) Date: Sun, 26 Nov 2017 21:20:07 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511731207.11.0.213398074469.issue30487@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 16:48:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Sun, 26 Nov 2017 21:48:53 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1511718949.32.0.213398074469.issue30855@psf.upfronthosting.co.za> Message-ID: STINNER Victor added the comment: Cool, thanks Zach! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:09:03 2017 From: report at bugs.python.org (Martin Panter) Date: Sun, 26 Nov 2017 22:09:03 +0000 Subject: [issue32143] os.statvfs lacks f_fsid In-Reply-To: <1511713053.6.0.213398074469.issue32143@psf.upfronthosting.co.za> Message-ID: <1511734143.5.0.213398074469.issue32143@psf.upfronthosting.co.za> Martin Panter added the comment: The doc string for the result object, and the main Python 2 documentation, both say that the result is a 10-tuple. So perhaps any new field should only be an attribute, and the tuple should stay the same size, to maintain compatibility. This was done in other cases, e.g. struct_time and stat_result. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:23:04 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 26 Nov 2017 22:23:04 +0000 Subject: [issue29879] typing.Text not available in python 3.5.1 In-Reply-To: <1490191885.24.0.466307693119.issue29879@psf.upfronthosting.co.za> Message-ID: <1511734984.95.0.213398074469.issue29879@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset 0cd2e81bea639828d7c9a7afc61fb1da9699492c by Mariatta (Ivan Levkivskyi) in branch 'master': bpo-29879: Update typing documentation. (GH-4573) https://github.com/python/cpython/commit/0cd2e81bea639828d7c9a7afc61fb1da9699492c ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:23:17 2017 From: report at bugs.python.org (Roundup Robot) Date: Sun, 26 Nov 2017 22:23:17 +0000 Subject: [issue29879] typing.Text not available in python 3.5.1 In-Reply-To: <1490191885.24.0.466307693119.issue29879@psf.upfronthosting.co.za> Message-ID: <1511734997.68.0.213398074469.issue29879@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4502 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:27:46 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 26 Nov 2017 22:27:46 +0000 Subject: [issue29879] typing.Text not available in python 3.5.1 In-Reply-To: <1490191885.24.0.466307693119.issue29879@psf.upfronthosting.co.za> Message-ID: <1511735266.96.0.213398074469.issue29879@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset cceb0f8d7b3451fb8de03651c979f5ac639b68c0 by Mariatta (Miss Islington (bot)) in branch '3.6': bpo-29879: Update typing documentation. (GH-4573) (GH-4574) https://github.com/python/cpython/commit/cceb0f8d7b3451fb8de03651c979f5ac639b68c0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:30:30 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 26 Nov 2017 22:30:30 +0000 Subject: [issue29879] typing.Text not available in python 3.5.1 In-Reply-To: <1490191885.24.0.466307693119.issue29879@psf.upfronthosting.co.za> Message-ID: <1511735430.82.0.213398074469.issue29879@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: This has been fixed in the 3.7 and 3.6 branches. Thanks all! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:31:29 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 26 Nov 2017 22:31:29 +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: <1511735489.7.0.213398074469.issue23033@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: New changeset ede2ac913eba47131ee1bbc37a9aea344d678576 by Mariatta (Mandeep Singh) in branch 'master': bpo-23033: Improve SSL Certificate handling (GH-937) https://github.com/python/cpython/commit/ede2ac913eba47131ee1bbc37a9aea344d678576 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:33:13 2017 From: report at bugs.python.org (Mariatta Wijaya) Date: Sun, 26 Nov 2017 22:33:13 +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: <1511735593.74.0.213398074469.issue23033@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: I merged the PR, this is now in 3.7. Thanks all! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:36:44 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 26 Nov 2017 22:36:44 +0000 Subject: [issue32140] IDLE debugger fails with non-trivial __new__ super call In-Reply-To: <1511696773.06.0.213398074469.issue32140@psf.upfronthosting.co.za> Message-ID: <1511735804.71.0.213398074469.issue32140@psf.upfronthosting.co.za> Terry J. Reedy added the comment: This is not a crash because IDLE does not crash. It does not even exit with a traceback. Some crash and freeze bugs have been fixed since 3.4.2. I verified with 3.7.0a2 on Win10. The failing example can be simplified to the first two lines. Step over the import and into the Fraction call to get to fractions.Fraction.__new__, line 115 self = super(Fraction, cls).__new__(cls) (Step 8 in the report above has the wrong code.) Step 2 gives this simplified traceback: Traceback (most recent call last): File "F:\Python\a\tem2.py", line 3, in U=Fraction(1) File "C:\Programs\Python37\lib\fractions.py", line 117, in __new__ if denominator is None: File "C:\Programs\Python37\lib\fractions.py", line 117, in __new__ if denominator is None: File "C:\Programs\Python37\lib\bdb.py", line 86, in trace_dispatch return self.dispatch_line(frame) File "C:\Programs\Python37\lib\bdb.py", line 110, in dispatch_line self.user_line(frame) File "C:\Programs\Python37\lib\idlelib\debugger.py", line 24, in user_line self.gui.interaction(message, frame) AttributeError: _numerator If I replace the line above with new = super(Fraction, cls) # resolves to object.__new__ self = new(cls) stepping the first works. For the new call, hitting 'step' or 'over' gives essentially the same traceback as above. Hitting 'go' runs the code to completion. If I add 'print('xxxx') after the new call, the print call shows up in the traceback, twice, but is not executed. If I simplify the code to class C(): def __new__(cls): self = object.__new__(cls) return self c = C() and step into the C() code the the __new__ code, there is no problem. Hence the revised title. If I add slots make C, as with Fraction, there is still no problem. class C(): __slots__ = ('a',) def __new__(cls, a): self = object.__new__(cls) self.a = a return self c = C(1) Puzzles: 1. Why does the next line, 'if denominator...' show up in the traceback? It does not have a function call. Why is it printed twice? 2. Where does the _numerator error happen? It is only set, never accessed. Setting should work because _numerator is one of the two slots. 3. What extra feature of Fraction results in the failure. If I leave IDLE's debugger off and invoke pdb by adding import pdb; pbd.set_trace() as line 2, before the Fraction call, stepping with s works on the line where Debugger failed. Until a fix is released, use this (and/or print) as a workaround for code that makes debugger croak. I do not now know how to write a fully automated unittest for debugger. But it does not now even have a human-driven htest, and it should. ---------- stage: -> test needed title: Probable bug in all python3 / idle3 debugger -> IDLE debugger fails with non-trivial __new__ super call type: crash -> behavior versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 17:39:18 2017 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 26 Nov 2017 22:39:18 +0000 Subject: [issue31650] implement PEP 552 In-Reply-To: <1506801596.1.0.213398074469.issue31650@psf.upfronthosting.co.za> Message-ID: <1511735958.95.0.213398074469.issue31650@psf.upfronthosting.co.za> Change by Benjamin Peterson : ---------- keywords: +patch pull_requests: +4503 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 18:42:19 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 26 Nov 2017 23:42:19 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511739739.41.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- pull_requests: +4504 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 18:50:43 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 26 Nov 2017 23:50:43 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511729310.0.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <0A6CD66A-A547-4268-ACFE-933F1637AD39@python.org> Barry A. Warsaw added the comment: PR #4576 includes all related changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 19:03:08 2017 From: report at bugs.python.org (Abhilash Raj) Date: Mon, 27 Nov 2017 00:03:08 +0000 Subject: [issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value Message-ID: <1511740988.25.0.213398074469.issue32144@psf.upfronthosting.co.za> New submission from Abhilash Raj : According to the documentation, email.policy.SMTP and .SMTPUTF8 should have CRLF (`\r\n`) as line endings for text/plain parts. However, a new message parsed using message_from_binary_file with policy.SMTPUTF8 has `\n` as line endings for text/plain parts. This happens when I use get_content() on the new EmailMessage API. Just to mention, in Python 2.7, the old `get_payload(decode=True)` returns the body with CRLF as line endings. However, in Python 3, `get_payload()` also returns '\n' as line endings. Am I reading the documentation wrong? ---------- components: email messages: 307029 nosy: barry, maxking, r.david.murray priority: normal severity: normal status: open title: email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 20:18:37 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 27 Nov 2017 01:18:37 +0000 Subject: [issue32051] Possible issue in multiprocessing doc In-Reply-To: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> Message-ID: <1511745517.72.0.213398074469.issue32051@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset c172fc5031a4035986bef0b2fcef906706d7abf3 by Berker Peksag (Jason Yang) in branch 'master': bpo-32051: Fix name shadowing in multiprocessing docs (GH-4469) https://github.com/python/cpython/commit/c172fc5031a4035986bef0b2fcef906706d7abf3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 20:18:49 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 27 Nov 2017 01:18:49 +0000 Subject: [issue32051] Possible issue in multiprocessing doc In-Reply-To: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> Message-ID: <1511745529.36.0.213398074469.issue32051@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4505 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 20:22:53 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 27 Nov 2017 01:22:53 +0000 Subject: [issue32051] Possible issue in multiprocessing doc In-Reply-To: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> Message-ID: <1511745773.29.0.213398074469.issue32051@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 8a957534f5182022ee8ac2dbaac4b4900dc98159 by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-32051: Fix name shadowing in multiprocessing docs (GH-4469) https://github.com/python/cpython/commit/8a957534f5182022ee8ac2dbaac4b4900dc98159 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 20:23:18 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 27 Nov 2017 01:23:18 +0000 Subject: [issue32051] Possible issue in multiprocessing doc In-Reply-To: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> Message-ID: <1511745798.91.0.213398074469.issue32051@psf.upfronthosting.co.za> Berker Peksag added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 23:00:32 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 27 Nov 2017 04:00:32 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511755232.66.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: Cool, if you're OK with that behaviour, it actually makes this a lot easier, since it means: 1. Serhiy's patch is already sufficient for the final hard compatibility break 2. It can be readily adapted to emit either DeprecationWarning or SyntaxWarning for 3.7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 23:58:51 2017 From: report at bugs.python.org (Scott Queen) Date: Mon, 27 Nov 2017 04:58:51 +0000 Subject: [issue32142] heapq.heappop - documentation misleading or doesn't work In-Reply-To: <1511718684.79.0.213398074469.issue32142@psf.upfronthosting.co.za> Message-ID: Scott Queen added the comment: Fair statement. "Properly sorted" was a poor choice. Seems that "if the invariant is true as a precondition, it will be true as a postcondition" is accurate and descriptive - maybe with a caution that modifying the list (heap) values by means other than the heapq functions are likely to render the invariant false (the latter phrase being for somewhat newbies like me who wouldn't realize this truth without having to learn it in the debugger). On Sun, Nov 26, 2017 at 10:51 AM, abcdef wrote: > > abcdef added the comment: > > > Perhaps heappop could say that the heap invariant is maintained if the > heap is properly sorted before the heappop invocation. > > Honestly I like this wording less. "Properly sorted" would suggest sorted > in the sense of heap.sort() [as the docs refer to this earlier], but the > array doesn't have to be sorted; it's enough if it's a heap. The function > always maintains the invariant - this means that if the invariant is true > as a precondition, it will be true as a postcondition. Maybe you have a > different idea? > > ---------- > nosy: +abcdef > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 00:05:36 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 27 Nov 2017 05:05:36 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1511755232.66.0.213398074469.issue10544@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Great. It should be a DeprecationWarning, since we're planning to disallow it completely, right? IIRC SyntaxWarning is for syntax that we can't deprecate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 00:39:56 2017 From: report at bugs.python.org (Mark Sapiro) Date: Mon, 27 Nov 2017 05:39:56 +0000 Subject: [issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value In-Reply-To: <1511740988.25.0.213398074469.issue32144@psf.upfronthosting.co.za> Message-ID: <1511761196.5.0.213398074469.issue32144@psf.upfronthosting.co.za> Change by Mark Sapiro : ---------- nosy: +msapiro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 01:24:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 06:24:48 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511763888.01.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Currently PR 4576 combines a bug fix and a new feature. 1. Removes wrong check and adds a verbose clarifying comment. This part should be backported to maintained versions. 2. Adds multiple explicit "return None". This is a minor improvement the quality of the code. Too minor for separate PR. 3. Makes methods for getting the address of the real network card preferring universally administered addresses and falling back to locally administered address only if universally administered addresses are not found. This is a new feature. But are there computers that have both universally and locally administered addresses (and with locally administered addresses enumerated first)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 02:24:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 07:24:12 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511767452.01.0.213398074469.issue10544@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4506 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 03:34:13 2017 From: report at bugs.python.org (Maurizio Zucchelli) Date: Mon, 27 Nov 2017 08:34:13 +0000 Subject: [issue32145] Wrong ExitStack Callback recipe Message-ID: <1511771653.67.0.213398074469.issue32145@psf.upfronthosting.co.za> New submission from Maurizio Zucchelli : The documentation for contextlib.ExitStack (https://docs.python.org/3.7/library/contextlib.html#replacing-any-use-of-try-finally-and-flag-variables) shows an helper class (Callback) to perform cleanup using a callback. Problem is, Callback.cancel() calls ExitStack.pop_all(), which in turn calls type(self)(), this is not a valid constructor for Callback, since it always expects at least one element. (I have marked only Python 3.4 and 3.6 since those are the versions where I verified this, but it likely applies to every version.) ---------- assignee: docs at python components: Documentation messages: 307037 nosy: Denaun, docs at python priority: normal severity: normal status: open title: Wrong ExitStack Callback recipe type: crash versions: Python 3.4, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 03:56:13 2017 From: report at bugs.python.org (Marcin Kasperski) Date: Mon, 27 Nov 2017 08:56:13 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1511772973.03.0.213398074469.issue20891@psf.upfronthosting.co.za> Marcin Kasperski added the comment: Is this fix released? I can't find it in the changelog? (I faced this bug on 3.5.2, released a couple of months after this bug was closed?) ---------- nosy: +Mekk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 04:25:30 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 27 Nov 2017 09:25:30 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511774730.89.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: Guido, should we write this change up as a PEP, or are you happy to just cover it as a section in the What's New document for 3.7? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 04:44:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 09:44:40 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511775880.36.0.213398074469.issue32089@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4507 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 05:23:30 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 10:23:30 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511778210.47.0.213398074469.issue30855@psf.upfronthosting.co.za> STINNER Victor added the comment: Bad news: the problem is not gone. Fail at commit 180372c08a25332429f6175d6aa036c1ec643ca3 (the commit after Zach's commit be1faabeef0821f188a28dd7cc6b744b89e85e94 in the Python 2.7 branch): http://buildbot.python.org/all/#/builders/70/builds/28 test_use (test_tkinter.test_widgets.ToplevelTest) ... ERROR test_visual (test_tkinter.test_widgets.ToplevelTest) ... ok test test_tk failed -- Traceback (most recent call last): File "D:\buildarea\2.7.ware-win81-release\build\lib\lib-tk\test\test_tkinter\test_widgets.py", line 93, in test_use widget2 = self.create(use=wid) File "D:\buildarea\2.7.ware-win81-release\build\lib\lib-tk\test\test_tkinter\test_widgets.py", line 67, in create return tkinter.Toplevel(self.root, **kwargs) File "D:\buildarea\2.7.ware-win81-release\build\lib\lib-tk\Tkinter.py", line 2138, in __init__ BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra) File "D:\buildarea\2.7.ware-win81-release\build\lib\lib-tk\Tkinter.py", line 2095, in __init__ (widgetName, self._w) + extra + self._options(cnf)) TclError: integer value too large to represent test_width (test_tkinter.test_widgets.ToplevelTest) ... ok ====================================================================== ERROR: test_use (test_tkinter.test_widgets.ToplevelTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\2.7.ware-win81-release\build\lib\lib-tk\test\test_tkinter\test_widgets.py", line 93, in test_use widget2 = self.create(use=wid) File "D:\buildarea\2.7.ware-win81-release\build\lib\lib-tk\test\test_tkinter\test_widgets.py", line 67, in create return tkinter.Toplevel(self.root, **kwargs) File "D:\buildarea\2.7.ware-win81-release\build\lib\lib-tk\Tkinter.py", line 2138, in __init__ BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra) File "D:\buildarea\2.7.ware-win81-release\build\lib\lib-tk\Tkinter.py", line 2095, in __init__ (widgetName, self._w) + extra + self._options(cnf)) TclError: integer value too large to represent ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 05:25:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 10:25:52 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511778352.02.0.213398074469.issue32071@psf.upfronthosting.co.za> STINNER Victor added the comment: IMHO it's a big enhancement for the base unittest test runner and deserves to be documend in What's New in Python 3.7! Jonas: do you want to write a PR to patch Doc/whatsnew/3.7.rst? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 05:31:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 10:31:56 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511778716.57.0.213398074469.issue30855@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It still uses Tcl/Tk 8.5.15. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 05:33:55 2017 From: report at bugs.python.org (Daniel Colascione) Date: Mon, 27 Nov 2017 10:33:55 +0000 Subject: [issue32146] multiprocessing freeze_support needed outside win32 Message-ID: <1511778835.66.0.213398074469.issue32146@psf.upfronthosting.co.za> New submission from Daniel Colascione : multiprocessing's freeze_support makes freshly-launched subprocesses integrate correctly until the multiprocessing ecosystem even when the main executable is some application binary instead of a Python interpreter. The documentation and code assume that this support is needed only on win32, but it's equally applicable to POSIX systems using the spawn strategy in combination with systems like cx_freeze. In particular: 1) The special case in context.py's version of freeze_support() for win32 should be removed 2) The semaphore tracker should correctly tickle the freeze support 3) The documentation should be updated to be platform-neutral ---------- components: Library (Lib) messages: 307043 nosy: dancol priority: normal severity: normal status: open title: multiprocessing freeze_support needed outside win32 type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 05:54:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 10:54:22 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511780062.3.0.213398074469.issue30855@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: "It still uses Tcl/Tk 8.5.15." pythoninfo says: --- tkinter.TCL_VERSION: 8.5 tkinter.TK_VERSION: 8.5 tkinter.info_patchlevel: 8.5.15 --- The compilation says: --- Fetching external libraries... (...) tcl-8.5.19.0 already exists, skipping. tk-8.5.19.0 already exists, skipping. tix-8.4.3.5 already exists, skipping. (...) Project "D:\buildarea\2.7.ware-win81-release\build\PCbuild\_tkinter.vcxproj" (24) is building "D:\buildarea\2.7.ware-win81-release\build\PCbuild\tcl.vcxproj" (25) on node 1 (default targets). (...) cd /D "D:\buildarea\2.7.ware-win81-release\build\externals\tcl-8.5.19.0\win" nmake -f makefile.vc MACHINE=AMD64 OPTS= INSTALLDIR="D:\buildarea\2.7.ware-win81-release\build\externals\tcltk64" INSTALL_DIR="D:\buildarea\2.7.ware-win81-release\build\externals\tcltk64" core shell dlls nmake -f makefile.vc MACHINE=AMD64 OPTS= INSTALLDIR="D:\buildarea\2.7.ware-win81-release\build\externals\tcltk64" INSTALL_DIR="D:\buildarea\2.7.ware-win81-release\build\externals\tcltk64" --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 05:55:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 10:55:56 +0000 Subject: [issue32136] Move embedding tests to their own test module In-Reply-To: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> Message-ID: <1511780156.93.0.213398074469.issue32136@psf.upfronthosting.co.za> STINNER Victor added the comment: > Modules/_testcapi.c -> Lib/test/test_capi.py > Progams/_testembed.c -> Lib/test/test_embed.py I like it :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 05:56:40 2017 From: report at bugs.python.org (Jonas H.) Date: Mon, 27 Nov 2017 10:56:40 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511780200.24.0.213398074469.issue32071@psf.upfronthosting.co.za> Jonas H. added the comment: Sure! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 06:01:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 11:01:29 +0000 Subject: [issue32138] android: test_faulthandler fails also on API 24 In-Reply-To: <1511690339.03.0.213398074469.issue32138@psf.upfronthosting.co.za> Message-ID: <1511780489.34.0.213398074469.issue32138@psf.upfronthosting.co.za> STINNER Victor added the comment: > I propose to skip those tests whatever the value of the Android API level. Works for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 06:04:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 11:04:39 +0000 Subject: [issue31233] socketserver.ThreadingMixIn leaks running threads after server_close() In-Reply-To: <1503073499.39.0.93886151367.issue31233@psf.upfronthosting.co.za> Message-ID: <1511780679.41.0.213398074469.issue31233@psf.upfronthosting.co.za> STINNER Victor added the comment: Klon666 added https://github.com/python/cpython/commit/96a6cbc5b0aee267f47e5efb50fba183b52cd8c6 repository. But this URL is unrelated. It looks like a bot spamming the bug tracker and I don't see how to remove the URL... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 06:11:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 11:11:57 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511781117.7.0.213398074469.issue32089@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 21c7730761e2a768e33b89b063a095d007dcfd2c by Victor Stinner in branch 'master': bpo-32089: Use default action for ResourceWarning (#4584) https://github.com/python/cpython/commit/21c7730761e2a768e33b89b063a095d007dcfd2c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 06:14:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 11:14:41 +0000 Subject: [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers In-Reply-To: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> Message-ID: <1511781281.44.0.213398074469.issue32089@psf.upfronthosting.co.za> STINNER Victor added the comment: The "default warning filters" are documented, but only for Python compiled in release mode: https://docs.python.org/dev/library/warnings.html#default-warning-filters So I didn't touch this documentation. The initial issue is now fixed: the development mode (-X dev) now behaves as the debug mode (pydebug build) for the default warning filters. The second issue, Antoine's complain about the "always" action, was also fixed. I close the issue. At the end, we should get a better debug experience ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 06:20:19 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 11:20:19 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511781619.48.0.213398074469.issue10544@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Note that the DeprecationWarning exception is replaced with a SyntaxError to get a more accurate error report. $ cat yield-gen.py def f(): return ((yield x) for x in range(3)) $ ./python -Wd yield-gen.py yield-gen.py:2: DeprecationWarning: 'yield' inside generator expression return ((yield x) for x in range(3)) $ ./python -We yield-gen.py File "yield-gen.py", line 2 return ((yield x) for x in range(3)) ^ SyntaxError: 'yield' inside generator expression Without this replacement the result would be: $ ./python -We yield-gen.py DeprecationWarning: 'yield' inside generator expression ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 07:01:55 2017 From: report at bugs.python.org (Torsten Landschoff) Date: Mon, 27 Nov 2017 12:01:55 +0000 Subject: [issue27035] Cannot set exit code in atexit callback In-Reply-To: <1463385428.15.0.762354704325.issue27035@psf.upfronthosting.co.za> Message-ID: <1511784115.7.0.213398074469.issue27035@psf.upfronthosting.co.za> Torsten Landschoff added the comment: As this bug report clearly states this worked as documented in Python 2.7 and stopped working sometime in the Python 3 series. I just ran into this while porting some code to Python 3 which uses an atexit handler to wind down some resources on process exit. This sometimes gets stuck and instead of hanging indefinitely the cleanup is aborted if it takes longer than a few seconds. As this is actually an error, the registered exit function raises SystemExit to modify the exit code in this case. This used to work fine but does not anymore... Observe: ## Python 2.7 works fine $ sudo docker run python:2.7 python -c "import atexit,sys;atexit.register(sys.exit,124)"; echo $? 124 ## Python 3.2 (oldest Python 3 on docker hub) swallows the exit code (but prints it) $ sudo docker run python:3.2 python -c "import atexit,sys;atexit.register(sys.exit,124)"; echo $? Error in atexit._run_exitfuncs: SystemExit: 124 0 ## Same for 3.3 up to 3.6 $ sudo docker run python:3.3 python -c "import atexit,sys;atexit.register(sys.exit,124)"; echo $? Error in atexit._run_exitfuncs: SystemExit: 124 0 $ sudo docker run python:3.5 python -c "import atexit,sys;atexit.register(sys.exit,124)"; echo $? Error in atexit._run_exitfuncs: SystemExit: 124 0 $ sudo docker run python:3.6 python -c "import atexit,sys;atexit.register(sys.exit,124)"; echo $? Error in atexit._run_exitfuncs: SystemExit: 124 0 ## Python 3.7 swallows the exit code *and does not even print it*: $ /opt/python-dev/bin/python3.7 -c "import atexit,sys;atexit.register(sys.exit,124)"; echo $? 0 ---------- nosy: +torsten type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 07:14:29 2017 From: report at bugs.python.org (Sergey Fedoseev) Date: Mon, 27 Nov 2017 12:14:29 +0000 Subject: [issue32147] improve performance of binascii.unhexlify() by using conversion table Message-ID: <1511784869.56.0.213398074469.issue32147@psf.upfronthosting.co.za> New submission from Sergey Fedoseev : Before: $ ./python -m timeit -s "from binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)" 50 loops, best of 5: 5.68 msec per loop After: $ ./python -m timeit -s "from binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)" 100 loops, best of 5: 2.06 msec per loop ---------- messages: 307053 nosy: sir-sigurd priority: normal severity: normal status: open title: improve performance of binascii.unhexlify() by using conversion table type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 07:16:56 2017 From: report at bugs.python.org (Sergey Fedoseev) Date: Mon, 27 Nov 2017 12:16:56 +0000 Subject: [issue32147] improve performance of binascii.unhexlify() by using conversion table In-Reply-To: <1511784869.56.0.213398074469.issue32147@psf.upfronthosting.co.za> Message-ID: <1511785016.98.0.213398074469.issue32147@psf.upfronthosting.co.za> Change by Sergey Fedoseev : ---------- keywords: +patch pull_requests: +4508 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 07:21:52 2017 From: report at bugs.python.org (Sergey Fedoseev) Date: Mon, 27 Nov 2017 12:21:52 +0000 Subject: [issue32147] improve performance of binascii.unhexlify() by using conversion table In-Reply-To: <1511784869.56.0.213398074469.issue32147@psf.upfronthosting.co.za> Message-ID: <1511785312.92.0.213398074469.issue32147@psf.upfronthosting.co.za> Change by Sergey Fedoseev : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 09:42:29 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 14:42:29 +0000 Subject: [issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5 In-Reply-To: <1499257127.67.0.747001147165.issue30855@psf.upfronthosting.co.za> Message-ID: <1511793749.67.0.213398074469.issue30855@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: serhiy.storchaka -> zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 10:43:07 2017 From: report at bugs.python.org (Berker Peksag) Date: Mon, 27 Nov 2017 15:43:07 +0000 Subject: [issue31854] Add mmap.ACCESS_DEFAULT to namespace In-Reply-To: <1508790404.89.0.213398074469.issue31854@psf.upfronthosting.co.za> Message-ID: <1511797387.28.0.213398074469.issue31854@psf.upfronthosting.co.za> Berker Peksag added the comment: PR 4093 has been merged. Closing this as 'fixed'. Thank you for the PR, Justus. ---------- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 10:48:07 2017 From: report at bugs.python.org (Hasan Mahmood) Date: Mon, 27 Nov 2017 15:48:07 +0000 Subject: [issue32148] Python 2.7.14 has Tkinter with big T letter. Message-ID: <1511797687.13.0.213398074469.issue32148@psf.upfronthosting.co.za> New submission from Hasan Mahmood : Using python 2.7.14. Importing Dialogs Got problem in importing tkinter. In doccumentation of tkinter, it is stated the big letter T in Tkinter is used only used in python 3 but. It is expected that it is possible to use tkinter with small letter T beccause I use python 2.7.14 ---------- components: Tkinter files: Tkinter.PNG messages: 307055 nosy: HMahmood priority: normal severity: normal status: open title: Python 2.7.14 has Tkinter with big T letter. versions: Python 2.7 Added file: https://bugs.python.org/file47299/Tkinter.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 10:55:05 2017 From: report at bugs.python.org (Tim Graham) Date: Mon, 27 Nov 2017 15:55:05 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511798105.42.0.213398074469.issue32071@psf.upfronthosting.co.za> Tim Graham added the comment: This is appearing as a backwards incompatible change for Django because test case class attributes are now evaluated at load time before setUpClass runs (which initializes some things that those class attributes use). It's possible to adapt Django for this change, but it might affect other projects as well. Traceback from Django's tests: $ python -Wall tests/runtests.py Testing against Django installed in '/home/tim/code/django/django' with up to 3 processes Traceback (most recent call last): File "tests/runtests.py", line 477, in options.exclude_tags, File "tests/runtests.py", line 282, in django_tests extra_tests=extra_tests, File "/home/tim/code/django/django/test/runner.py", line 598, in run_tests suite = self.build_suite(test_labels, extra_tests) File "/home/tim/code/django/django/test/runner.py", line 513, in build_suite tests = self.test_loader.discover(start_dir=label, **kwargs) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 346, in discover tests = list(self._find_tests(start_dir, pattern)) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 403, in _find_tests full_path, pattern, namespace) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 457, in _find_test_path return self.loadTestsFromModule(module, pattern=pattern), False File "/home/tim/code/cpython/Lib/unittest/loader.py", line 124, in loadTestsFromModule tests.append(self.loadTestsFromTestCase(obj)) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 90, in loadTestsFromTestCase testCaseNames = self.getTestCaseNames(testCaseClass) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 234, in getTestCaseNames testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass))) File "/home/tim/code/cpython/Lib/unittest/loader.py", line 227, in shouldIncludeMethod testFunc = getattr(testCaseClass, attrname) File "/home/tim/code/django/django/utils/decorators.py", line 172, in __get__ return self.fget(cls) File "/home/tim/code/django/django/test/testcases.py", line 1269, in live_server_url return 'http://%s:%s' % (cls.host, cls.server_thread.port) AttributeError: type object 'AdminSeleniumTestCase' has no attribute 'server_thread' ---------- nosy: +Tim.Graham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 10:57:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 15:57:14 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511798234.57.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c9758784eb321fb9771e0bc7205b296e4d658045 by Victor Stinner in branch 'master': bpo-27535: Fix memory leak with warnings ignore (#4489) https://github.com/python/cpython/commit/c9758784eb321fb9771e0bc7205b296e4d658045 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:00:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 16:00:28 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511798428.32.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: https://github.com/python/cpython/pull/4489#issuecomment-346673704 Serhiy: "Could you please make a benchmark for warnings emitted in a tight loop in the C code. It would be nice to know what is the worst case. If it is less than 2x slower I will prefer this simpler PR." I merged my PR since it's not 2x slower. I also prefer the simple PR 4489, rather than the complex PR 4502. I rejected my PR 4502 since it's backward incompatible. I don't think that it's worth it, even if it's faster. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:04:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 16:04:05 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511798645.52.0.213398074469.issue27535@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Victor! ---------- assignee: serhiy.storchaka -> vstinner versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:04:29 2017 From: report at bugs.python.org (Roundup Robot) Date: Mon, 27 Nov 2017 16:04:29 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511798669.66.0.213398074469.issue27535@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4510 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:07:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 16:07:03 +0000 Subject: [issue32148] Python 2.7.14 has Tkinter with big T letter. In-Reply-To: <1511797687.13.0.213398074469.issue32148@psf.upfronthosting.co.za> Message-ID: <1511798823.33.0.213398074469.issue32148@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In Python 2 you should import the Tkinter module, with the big letter T. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:08:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 16:08:28 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511798908.47.0.213398074469.issue27535@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4511 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:09:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 16:09:32 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511798972.97.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: I consider that PR 4489 is a bugfix, so I proposed backports to Python 2.7 (PR 4588) and 3.6 (PR 4587). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:12:54 2017 From: report at bugs.python.org (Jonas H.) Date: Mon, 27 Nov 2017 16:12:54 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511799174.0.0.213398074469.issue32071@psf.upfronthosting.co.za> Jonas H. added the comment: Ah, the problem isn't that it's running getattr() on test methods, but that it runs getattr() on all methods. Former code: attrname.startswith(prefix) and \ callable(getattr(testCaseClass, attrname)) New code: testFunc = getattr(testCaseClass, attrname) isTestMethod = attrname.startswith(self.testMethodPrefix) and callable(testFunc) This is trivial to fix. @Core devs: Should I revert to original behaviour with the order of the prefix check and the getattr() call, and add a regression test that guarantees this behaviour? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:13:55 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 27 Nov 2017 16:13:55 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511799235.39.0.213398074469.issue32071@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > @Core devs: Should I revert to original behaviour with the order of the prefix check and the getattr() call, and add a regression test that guarantees this behaviour? Yes, that sounds reasonable to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:28:21 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Nov 2017 16:28:21 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511763888.01.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <32BC4929-4991-43FC-ACEC-DC1C7C4C47F3@python.org> Barry A. Warsaw added the comment: On Nov 27, 2017, at 01:24, Serhiy Storchaka wrote: > > 3. Makes methods for getting the address of the real network card preferring universally administered addresses and falling back to locally administered address only if universally administered addresses are not found. This is a new feature. But are there computers that have both universally and locally administered addresses (and with locally administered addresses enumerated first)? There are certainly computers that have both universal and local admin MAC addresses, as proven by the MBP+TouchBar case that triggered this. I don?t know whether we can assume anything about the order in which those are enumerated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:29:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 16:29:29 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found Message-ID: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> New submission from STINNER Victor : /bin/sh: line 1: blurb: command not found http://buildbot.python.org/all/#/builders/69/builds/51 Running make frameworkinstallextras (...) copy /Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/../Tools/unittestgui/README.txt /Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/dmg/_root/Library/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/unittestgui/README.txt copy /Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/../Tools/unittestgui/unittestgui.py /Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/dmg/_root/Library/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/unittestgui/unittestgui.py Copying required shared libraries Fix file modes Install python documentation rm -rf build/* ./venv/* make: `venv' is up to date. /bin/sh: line 1: blurb: command not found make: *** [build] Error 127 Traceback (most recent call last): mkdir -p build Building NEWS from Misc/NEWS.d with blurb File "/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py", line 1659, in main() File "/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py", line 1621, in main buildPythonDocs() File "/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py", line 1094, in buildPythonDocs runCommand('make html PYTHON=venv/bin/python') File "/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py", line 531, in runCommand raise RuntimeError("command failed: %s"%(commandline,)) RuntimeError: command failed: make html PYTHON=venv/bin/python program finished with exit code 1 elapsedTime=1288.975592 ---------- components: Build keywords: buildbot messages: 307065 nosy: vstinner priority: normal severity: normal status: open title: bolen-dmg-3.x: compiled failed with: blurb: command not found versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:29:58 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 16:29:58 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found In-Reply-To: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> Message-ID: <1511800198.9.0.213398074469.issue32149@psf.upfronthosting.co.za> STINNER Victor added the comment: @David Bolen: Would you mind to take a look? ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:30:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 16:30:17 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found In-Reply-To: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> Message-ID: <1511800217.91.0.213398074469.issue32149@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:31:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 16:31:14 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511800274.02.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:40:06 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 27 Nov 2017 16:40:06 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511800806.56.0.213398074469.issue10544@psf.upfronthosting.co.za> Guido van Rossum added the comment: After the tiresome debate I am happy to see this just as a "what's new" entry rather than soliciting more debate with a PEP. (However there may be some existing PEP that suggests it should work? That PEP should be amended with a note that this is being deprecated. But I don't know if there is such a PEP.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:40:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 16:40:18 +0000 Subject: [issue32150] Expand tabs to spaces in C files Message-ID: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : While most C files use spaces for indenting and aligning, there are few sites in which tabs are left. Sometimes mixed tabs and spaces are used in the same file. This adds a noise in the diff if the committer uses an editor which doesn't preserve tabs (see for example PR 4390). This can hide semantic changes in tab expansion changes. I reviewed many patches with accidentally expanded tabs to spaces. Usually I request removing unrelated changes from the patch. But this still happened, and tabs slowly are disappeared from the sources. There are less tabs in the current default branch than in any maintained branch. I think it is better to make the expansion in a single not so large commit that allow them be mixed with semantical changes. PR 4583 does this. The changes first were made automatically, and after that I have edited them manually for removing excessive indentations in some files (4 spaces are enough). Tabs have been kept only in generated file Modules/unicodedata_db.h and in imported files Modules/_ctypes/* and Modules/expat/siphash.h. ---------- components: Interpreter Core messages: 307068 nosy: gvanrossum, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Expand tabs to spaces in C files versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:40:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 16:40:51 +0000 Subject: [issue32150] Expand tabs to spaces in C files In-Reply-To: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> Message-ID: <1511800851.77.0.213398074469.issue32150@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4512 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 12:04:38 2017 From: report at bugs.python.org (Zachary Ware) Date: Mon, 27 Nov 2017 17:04:38 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found In-Reply-To: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> Message-ID: <1511802278.94.0.213398074469.issue32149@psf.upfronthosting.co.za> Zachary Ware added the comment: This is likely due to a change I merged yesterday. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 12:04:50 2017 From: report at bugs.python.org (Jonas H.) Date: Mon, 27 Nov 2017 17:04:50 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511802290.02.0.213398074469.issue32071@psf.upfronthosting.co.za> Change by Jonas H. : ---------- pull_requests: +4513 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 12:06:58 2017 From: report at bugs.python.org (Jonas H.) Date: Mon, 27 Nov 2017 17:06:58 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511802418.64.0.213398074469.issue32071@psf.upfronthosting.co.za> Jonas H. added the comment: https://github.com/python/cpython/pull/4589 - Add 3.7 What's New entry - Fix regression (thanks Tim for the report) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 12:33:05 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 27 Nov 2017 17:33:05 +0000 Subject: [issue32150] Expand tabs to spaces in C files In-Reply-To: <1511800851.81.0.912454111764.issue32150@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: I think I'm cool with this (even though it will make blame-finding on GitHub a tad harder -- what's the magic URL appendage again?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 12:46:19 2017 From: report at bugs.python.org (Ric Anderson) Date: Mon, 27 Nov 2017 17:46:19 +0000 Subject: [issue32151] -mvenv vs minor python version updates Message-ID: <1511804779.33.0.213398074469.issue32151@psf.upfronthosting.co.za> New submission from Ric Anderson : When a site updates python3 from 3.5 to 3.6 (based on https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work, this is would be a minor version update),pre-upgrade venv setups created with "python3 -menv ..." break because "python3" in the venv is really 3.5, and needs the system libpython3.5m.so.1.0, which is no longer in the library search list. Should "python -mvenv ..." copy the libpython3.5m.so.1.0 to the venv directory/lib, or add the system path to libpython3.5m.so.1.0 to LD_LIBRARY_PATH, or should the minor version number (.5 ,or .6) be excluded from the library name, so that minor version updates don't break existing venv setups or ??? ---------- components: Installation, Interpreter Core, Library (Lib) messages: 307072 nosy: Ric Anderson priority: normal severity: normal status: open title: -mvenv vs minor python version updates type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 12:57:55 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 27 Nov 2017 17:57:55 +0000 Subject: [issue32150] Expand tabs to spaces in C files In-Reply-To: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> Message-ID: <1511805475.47.0.213398074469.issue32150@psf.upfronthosting.co.za> Guido van Rossum added the comment: Maybe we also need (in a separate PR) a git pre-commit hook that prevents tabs in the source (except in the few exceptions you left alone). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 13:16:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 18:16:13 +0000 Subject: [issue32150] Expand tabs to spaces in C files In-Reply-To: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> Message-ID: <1511806573.39.0.213398074469.issue32150@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Tools/scripts/patchcheck.py does this check. It is used for .py and .rst files, and there is issue8912 for applying it to .c/.h files. patchcheck.py also checks trailing whitespaces. While I and other core developers constantly remove trailing whitespaces (the recent clean up is PR 4130), the new trailing whitespaces are constantly added (for example in PR 4150). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 14:09:28 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 27 Nov 2017 19:09:28 +0000 Subject: [issue32150] Expand tabs to spaces in C files In-Reply-To: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> Message-ID: <1511809768.64.0.213398074469.issue32150@psf.upfronthosting.co.za> Guido van Rossum added the comment: Yeah, some editors don't clean up trailing ws. Even with Emacs it occasionally happens to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 14:40:12 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Nov 2017 19:40:12 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511811612.83.0.213398074469.issue32107@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: New changeset 9522a218f7dff95c490ff359cc60e8c2af35f5c8 by Barry Warsaw in branch 'master': bpo-32107 - Better merge of #4494 (#4576) https://github.com/python/cpython/commit/9522a218f7dff95c490ff359cc60e8c2af35f5c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 15:18:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 20:18:38 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511813918.49.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: My apologies for my dim comment and my obliviousness that leaded to spending your time on trying to fix a wrong issue. Do you mind to fix the original issue (by removing the wrong check) in maintenance branches? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 15:21:29 2017 From: report at bugs.python.org (David Bolen) Date: Mon, 27 Nov 2017 20:21:29 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found In-Reply-To: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> Message-ID: <1511814089.1.0.213398074469.issue32149@psf.upfronthosting.co.za> David Bolen added the comment: Yeah, I'm not sure if I can do anything on my side. It looks like it's an issue with the build patch (issue30487, commit d8d6b91, assuming that's what Zachary is referring to). The blurb complaint is about something that appears should have been installed in a venv during the build process. If I need to upgrade or install something on the worker to support this change, I can certainly do that, but I don't immediately see what that should be. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 15:35:52 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Nov 2017 20:35:52 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511813918.49.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <3A78DE07-21DA-41A2-B4F2-AE9D3874DE6F@python.org> Barry A. Warsaw added the comment: On Nov 27, 2017, at 15:18, Serhiy Storchaka wrote: > > My apologies for my dim comment and my obliviousness that leaded to spending your time on trying to fix a wrong issue. No worries at all. Thanks for working with me to make the fix as good as it can be. > Do you mind to fix the original issue (by removing the wrong check) in maintenance branches? I don?t mind, but interestingly enough, test_uuid does not fail for me locally in either the 2.7 or 3.6 branches! I don?t know what?s different, since I?m running them on exactly the same machine, but that does seem to be the case. Still, I think it makes sense to backport the change in check, without backporting the feature change or code cleanups, so I?ll work on branches for those. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 15:51:54 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Nov 2017 20:51:54 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511815914.99.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- pull_requests: +4514 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 15:53:10 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Nov 2017 20:53:10 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511815990.22.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- pull_requests: +4515 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:08:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 21:08:45 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511816925.65.0.213398074469.issue32107@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: We shouldn't check the 42nd bit in maintenance releases. This check will fail on some computers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:11:58 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Nov 2017 21:11:58 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511816925.65.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <2FB6FE42-6756-42DC-B8D4-CEB90A7A9CBB@python.org> Barry A. Warsaw added the comment: On Nov 27, 2017, at 16:08, Serhiy Storchaka wrote: > > We shouldn't check the 42nd bit in maintenance releases. This check will fail on some computers. Oh, without the preferential return of the universally administered MAC, you?re right. So we should just remove the check for the 41st bit and not add the check for the 42nd bit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:12:46 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 21:12:46 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511817166.79.0.213398074469.issue30487@psf.upfronthosting.co.za> Ned Deily added the comment: I don't think this is a good idea. It has already caused problems with one buildbot (Issue32149) and will likely break other build scripts. As the Doc Makefile stood previous to this commit, the Doc builds could take advantage of either a system-installed or user-supplied Sphinx and blurb without having to use the venv step. Unless there are major objections, I am going to at least temporarily revert it. ---------- nosy: +ned.deily resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:14:35 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 21:14:35 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found In-Reply-To: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> Message-ID: <1511817275.28.0.213398074469.issue32149@psf.upfronthosting.co.za> Ned Deily added the comment: I think the new change in Issue30487 should be reverted. It will likely break other build scripts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:21:18 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 21:21:18 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511817678.88.0.213398074469.issue32107@psf.upfronthosting.co.za> Ned Deily added the comment: The latest checkin seems to have broken several buildbots: http://buildbot.python.org/all/#builders/47/builds/243 http://buildbot.python.org/all/#builders/88/builds/248 http://buildbot.python.org/all/#builders/13/builds/255 http://buildbot.python.org/all/#builders/16/builds/252 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:23:33 2017 From: report at bugs.python.org (Caleb Hattingh) Date: Mon, 27 Nov 2017 21:23:33 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1511817166.79.0.213398074469.issue30487@psf.upfronthosting.co.za> Message-ID: Caleb Hattingh added the comment: Hi Ned It's still supposed to allow both. It sounds like it's not working properly. I'll have a look. FYI, I worked on this for Zach Ware who is the primary stakeholder for this feature. Rgds Caleb > On 28 Nov 2017, at 7:12 AM, Ned Deily wrote: > > > Ned Deily added the comment: > > I don't think this is a good idea. It has already caused problems with one buildbot (Issue32149) and will likely break other build scripts. As the Doc Makefile stood previous to this commit, the Doc builds could take advantage of either a system-installed or user-supplied Sphinx and blurb without having to use the venv step. Unless there are major objections, I am going to at least temporarily revert it. > > ---------- > nosy: +ned.deily > resolution: fixed -> > stage: resolved -> needs patch > status: closed -> open > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:26:50 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 21:26:50 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511818010.69.0.213398074469.issue30487@psf.upfronthosting.co.za> Ned Deily added the comment: One problem is that the venv can't always be automatically built in all environments, as a recent Python 3 needs to be available in the right location. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:40:29 2017 From: report at bugs.python.org (Zachary Ware) Date: Mon, 27 Nov 2017 21:40:29 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511818829.56.0.213398074469.issue30487@psf.upfronthosting.co.za> Zachary Ware added the comment: Go ahead with the revert, Ned. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:50:18 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 21:50:18 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511819418.17.0.213398074469.issue30487@psf.upfronthosting.co.za> Change by Ned Deily : ---------- pull_requests: +4516 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:50:18 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 21:50:18 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found In-Reply-To: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> Message-ID: <1511819418.27.0.00913614298617.issue32149@psf.upfronthosting.co.za> Change by Ned Deily : ---------- keywords: +patch pull_requests: +4517 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:52:16 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Nov 2017 21:52:16 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511817678.88.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: Barry A. Warsaw added the comment: On Nov 27, 2017, at 16:21, Ned Deily wrote: > > The latest checkin seems to have broken several buildbots: > > http://buildbot.python.org/all/#builders/47/builds/243 > http://buildbot.python.org/all/#builders/88/builds/248 > http://buildbot.python.org/all/#builders/13/builds/255 > http://buildbot.python.org/all/#builders/16/builds/252 Those are all locally administered MAC addresses. Does that mean some of the buildbot machines also have no universally administered MAC address, like Travis? Or is something wrong with our logic? If it?s the former, then it might just make better sense to remove the 42nd bit test in all cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:54:53 2017 From: report at bugs.python.org (R. David Murray) Date: Mon, 27 Nov 2017 21:54:53 +0000 Subject: [issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value In-Reply-To: <1511740988.25.0.213398074469.issue32144@psf.upfronthosting.co.za> Message-ID: <1511819693.64.0.213398074469.issue32144@psf.upfronthosting.co.za> R. David Murray added the comment: Your are reading the documentation wrong. For linesep, it says "The string to be used to terminate lines in serialized output." The key word there is "output". email operates in "universal newline mode" when parsing messages, turning all line endings into python's internal \n format. What the linesep policy controls is the *output* line separator. Note that the python2 behavior for decode=True is arguably a bug, but not one we are going to fix for backward compatibility reasons. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 16:58:15 2017 From: report at bugs.python.org (Caleb Hattingh) Date: Mon, 27 Nov 2017 21:58:15 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511819895.86.0.213398074469.issue30487@psf.upfronthosting.co.za> Caleb Hattingh added the comment: It looks like the check for an existing sphinx-build passes, and so no new venv is made, but this also means that blurb doesn't get installed. I was concerned about this, but figured that at least the buildbots would create new envs each time, and this would only be an issue that a user with an odd configuration might have. Sorry for the trouble. The feature was simpler when it was only sphinx. Now that blurb is there too, the logic for checking what is and isn't already present becomes a bit complex to reason through. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:01:47 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 27 Nov 2017 22:01:47 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1511820107.83.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: As far as I'm aware, there's nothing that specifically promises these constructs will do anything in Py3 at all - the existing behaviour is just an accident of implementation arising from the way nested scopes and yield expressions interact in general. Tinkering with "await" in comprehensions and generator expressions would be different, since PEP 530 actually does make promises about how we expect that to work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:03:18 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 22:03:18 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511820198.75.0.213398074469.issue30487@psf.upfronthosting.co.za> Ned Deily added the comment: "Now that blurb is there too, the logic for checking what is and isn't already present becomes a bit complex to reason through." Yeah, it is a bit complicated. There's also the issue of trying to use a make recipe to ensure a "venv" exists and is up-to-date. I don't necessarily want to abandon the idea (and sorry I wasn't around to review the proposed change initially) but let's at least hold off until 370a3 is out the door. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:04:11 2017 From: report at bugs.python.org (Abhilash Raj) Date: Mon, 27 Nov 2017 22:04:11 +0000 Subject: [issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value In-Reply-To: <1511740988.25.0.213398074469.issue32144@psf.upfronthosting.co.za> Message-ID: <1511820251.46.0.213398074469.issue32144@psf.upfronthosting.co.za> Abhilash Raj added the comment: I understand that the line endings are meant for "outputs", but what constitutes as output in this case? I now see that `EmailMessage.as_string()` gives me `\r\n` as line endings and, which is probably what you mean by output and `get_content()` given me internal representation of the Email's content? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:04:19 2017 From: report at bugs.python.org (Caleb Hattingh) Date: Mon, 27 Nov 2017 22:04:19 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511820259.21.0.213398074469.issue30487@psf.upfronthosting.co.za> Caleb Hattingh added the comment: Yep, sounds good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:07:18 2017 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 27 Nov 2017 22:07:18 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1511820107.83.0.213398074469.issue10544@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: OK, great. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:07:34 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 22:07:34 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found In-Reply-To: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> Message-ID: <1511820454.62.0.213398074469.issue32149@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 122fc136b34e11906466851e77bb6959946467ee by Ned Deily in branch 'master': Revert "bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346)" (#4592) https://github.com/python/cpython/commit/122fc136b34e11906466851e77bb6959946467ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:07:34 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 22:07:34 +0000 Subject: [issue30487] DOC: automatically create a venv and install Sphinx when running make In-Reply-To: <1495817388.46.0.640927890572.issue30487@psf.upfronthosting.co.za> Message-ID: <1511820454.75.0.912454111764.issue30487@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 122fc136b34e11906466851e77bb6959946467ee by Ned Deily in branch 'master': Revert "bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346)" (#4592) https://github.com/python/cpython/commit/122fc136b34e11906466851e77bb6959946467ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:11:39 2017 From: report at bugs.python.org (Alexander Prokhorov) Date: Mon, 27 Nov 2017 22:11:39 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1511820699.51.0.213398074469.issue30256@psf.upfronthosting.co.za> Change by Alexander Prokhorov : ---------- nosy: +Alexander Prokhorov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:11:53 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 27 Nov 2017 22:11:53 +0000 Subject: [issue32136] Move embedding tests to their own test module In-Reply-To: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> Message-ID: <1511820713.23.0.213398074469.issue32136@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 39f0bb5ad0715dbfc0a2d5dd6d0ddea9e4c65ae2 by Nick Coghlan in branch 'master': bpo-32136: Separate embedding tests from C API tests (GH-4567) https://github.com/python/cpython/commit/39f0bb5ad0715dbfc0a2d5dd6d0ddea9e4c65ae2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:12:15 2017 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 27 Nov 2017 22:12:15 +0000 Subject: [issue32136] Move embedding tests to their own test module In-Reply-To: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> Message-ID: <1511820735.3.0.213398074469.issue32136@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:13:48 2017 From: report at bugs.python.org (Ned Deily) Date: Mon, 27 Nov 2017 22:13:48 +0000 Subject: [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found In-Reply-To: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> Message-ID: <1511820828.27.0.213398074469.issue32149@psf.upfronthosting.co.za> Ned Deily added the comment: Reverting the change should now have fixed the build failure. We'll see for sure next time the installer build runs. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:19:58 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 22:19:58 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511821198.5.0.213398074469.issue32107@psf.upfronthosting.co.za> STINNER Victor added the comment: http://buildbot.python.org/all/#/builders/16/builds/252 ====================================================================== FAIL: test_ifconfig_getnode (test.test_uuid.TestInternalsWithoutExtModule) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_uuid.py", line 538, in test_ifconfig_getnode self.check_node(node, 'ifconfig') File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_uuid.py", line 531, in check_node self.assertFalse(node & (1 << 41), '%012x' % node) AssertionError: 2199023255552 is not false : 020000000030 ====================================================================== FAIL: test_ip_getnode (test.test_uuid.TestInternalsWithoutExtModule) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_uuid.py", line 543, in test_ip_getnode self.check_node(node, 'ip') File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_uuid.py", line 531, in check_node self.assertFalse(node & (1 << 41), '%012x' % node) AssertionError: 2199023255552 is not false : 020000000030 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:24:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 22:24:10 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511821450.38.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4518 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 17:42:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 22:42:17 +0000 Subject: [issue31245] Asyncio UNIX socket and SOCK_DGRAM In-Reply-To: <1503324419.78.0.551838104662.issue31245@psf.upfronthosting.co.za> Message-ID: <1511822537.84.0.213398074469.issue31245@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4519 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 18:20:28 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 27 Nov 2017 23:20:28 +0000 Subject: [issue32142] heapq.heappop - documentation misleading or doesn't work In-Reply-To: <1511712348.11.0.213398074469.issue32142@psf.upfronthosting.co.za> Message-ID: <1511824828.54.0.213398074469.issue32142@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 18:22:38 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 27 Nov 2017 23:22:38 +0000 Subject: [issue32118] Doc for comparison of sequences with non-orderable elements In-Reply-To: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> Message-ID: <1511824958.5.0.213398074469.issue32118@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 18:30:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 23:30:23 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511825423.91.0.213398074469.issue32107@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c9409f7c4533f75b11a4c44e839d95a1403f8a0a by Victor Stinner in branch 'master': Revert "bpo-32107 - Better merge of #4494 (#4576)" (#4593) https://github.com/python/cpython/commit/c9409f7c4533f75b11a4c44e839d95a1403f8a0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 18:34:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 23:34:10 +0000 Subject: [issue31245] Asyncio UNIX socket and SOCK_DGRAM In-Reply-To: <1503324419.78.0.551838104662.issue31245@psf.upfronthosting.co.za> Message-ID: <1511825650.36.0.213398074469.issue31245@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 28e61650b23119b68cd7943ccc01b8b9af1b4103 by Victor Stinner in branch 'master': bpo-31245: asyncio: Fix typo, isistance => isinstance (#4594) https://github.com/python/cpython/commit/28e61650b23119b68cd7943ccc01b8b9af1b4103 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 18:38:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 23:38:02 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511825882.59.0.213398074469.issue32107@psf.upfronthosting.co.za> STINNER Victor added the comment: The commit 9522a218f7dff95c490ff359cc60e8c2af35f5c8 broke multiple buildbots. Since I don't how to fix it, I reverted it, to get more time to design, implement and test a proper fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 18:45:04 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 27 Nov 2017 23:45:04 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511825882.59.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <9183B06C-EB4F-4489-98F9-F3BE62B728AF@python.org> Barry A. Warsaw added the comment: On Nov 27, 2017, at 18:38, STINNER Victor wrote: > > STINNER Victor added the comment: > > The commit 9522a218f7dff95c490ff359cc60e8c2af35f5c8 broke multiple buildbots. Since I don't how to fix it, I reverted it, to get more time to design, implement and test a proper fix. Thanks. There was no way to predict the failures, but I thought that it could happen. I think at this point the only proper fix is to remove the bitmask test. I?ll work up a follow-on branch and port that back to 2.7 and 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 19:04:51 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 28 Nov 2017 00:04:51 +0000 Subject: [issue32107] test_uuid uses the incorrect bitmask In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511827491.47.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- pull_requests: +4520 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 20:47:09 2017 From: report at bugs.python.org (Ned Deily) Date: Tue, 28 Nov 2017 01:47:09 +0000 Subject: [issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS In-Reply-To: <1505317705.14.0.640405907228.issue31453@psf.upfronthosting.co.za> Message-ID: <1511833629.69.0.213398074469.issue31453@psf.upfronthosting.co.za> Ned Deily added the comment: FWIW, Debian seems to have re-enabled TLS 1.0 and 1.1 in "testing". As a result, test_ssl now passes again. openssl (1.1.0g-1) unstable; urgency=medium * New upstream version - Fixes CVE-2017-3735 - Fixes CVE-2017-3736 * Remove patches applied upstream * Temporary enable TLS 1.0 and 1.1 again (#875423) * Attempt to fix testsuite race condition * update no-symbolic.patch to apply -- Kurt Roeckx Thu, 02 Nov 2017 15:22:48 +0100 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 21:41:30 2017 From: report at bugs.python.org (Ned Deily) Date: Tue, 28 Nov 2017 02:41:30 +0000 Subject: [issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS In-Reply-To: <1504778309.6.0.433500701634.issue31380@psf.upfronthosting.co.za> Message-ID: <1511836890.45.0.213398074469.issue31380@psf.upfronthosting.co.za> Ned Deily added the comment: More background: APFS became available in macOS 10.12 although not used by default. But with the current macOS 10.13 (High Sierra), root file systems on certain devices, such as SSDs, are automatically migrated from HFS+ to APFS so are much more likely to be seen starting in 10.13 and, in general, there is no easy way of knowing what type of FS a particular file resides on. # TMPDIR on APFS volume $ ./bin/python3.7 -m test test_httpservers Run tests sequentially 0:00:00 load avg: 1.43 [1/1] test_httpservers test test_httpservers failed -- Traceback (most recent call last): File ".../lib/python3.7/test/support/__init__.py", line 598, in wrapper return func(*args, **kw) File ".../lib/python3.7/test/test_httpservers.py", line 395, in test_undecodable_filename with open(os.path.join(self.tempdir, filename), 'wb') as f: OSError: [Errno 92] Illegal byte sequence: '/var/folders/sn/0m4rnbyj2z1byjs68sz838300000gn/T/tmpqeg89k76/@test_64005_tmp\udce7w\udcf0.txt' test_httpservers failed 1 test failed: test_httpservers Total duration: 3 sec Tests result: FAILURE # TMPDIR redirected to HFS+ volume $ TMPDIR=/Volumes/euterpe/a ./bin/python3.7 -m test test_httpservers Run tests sequentially 0:00:00 load avg: 1.28 [1/1] test_httpservers 1 test OK. Total duration: 3 sec Tests result: SUCCESS @vstinner, as the expert in this area, what do you suggest as the best way to deal with this? In support.__init__.py? Or test_httpservers itself? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 23:08:36 2017 From: report at bugs.python.org (Dubslow) Date: Tue, 28 Nov 2017 04:08:36 +0000 Subject: [issue32118] Doc for comparison of sequences with non-orderable elements In-Reply-To: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> Message-ID: <1511842116.03.0.213398074469.issue32118@psf.upfronthosting.co.za> Dubslow added the comment: I like Terry's suggestion much better. I've closed my GitHub PR in favor of Terry's change. My only suggested tweak might be throwing in something like "(e.g." None)", perhaps e.g. "Instances of an unordered class (e.g. None) become ordered...", but even as is, is a major improvement over mine. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 02:14:39 2017 From: report at bugs.python.org (Abinaya) Date: Tue, 28 Nov 2017 07:14:39 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511853279.74.0.213398074469.issue32120@psf.upfronthosting.co.za> Abinaya added the comment: Sorry to re-open. Please anyone let me know why python 3.6.0 not supporting sqlite3. our customers request to give the clarification. i have tried a lot and spend more time on this but i couldn't get the exact reason. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 02:38:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 07:38:06 +0000 Subject: [issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS In-Reply-To: <1504778309.6.0.433500701634.issue31380@psf.upfronthosting.co.za> Message-ID: <1511854686.04.0.213398074469.issue31380@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I suggest to catch an error and skip the test if OSError with the specific errno has been raised. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 03:45:04 2017 From: report at bugs.python.org (Nikhil Hegde) Date: Tue, 28 Nov 2017 08:45:04 +0000 Subject: [issue32152] Add pid to .cover filename in lib/trace.py Message-ID: <1511858704.48.0.213398074469.issue32152@psf.upfronthosting.co.za> New submission from Nikhil Hegde : Adding pid to filenames will avoid file write error when multiple processes (specifically, multiple tests) are writing to the same .cover file ---------- components: Library (Lib) messages: 307110 nosy: nikhilh priority: normal severity: normal status: open title: Add pid to .cover filename in lib/trace.py type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 03:48:41 2017 From: report at bugs.python.org (Abinaya) Date: Tue, 28 Nov 2017 08:48:41 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511858921.98.0.213398074469.issue32120@psf.upfronthosting.co.za> Abinaya added the comment: *** WARNING: renaming "_sqlite3" since importing it failed: build/lib.linux-x86_64-3.6/_sqlite3.cpython-36m-x86_64-linux-gnu.so: undefined symbol: sqlite3_stmt_readonly Python build finished successfully! The necessary bits to build these optional modules were not found: _lzma To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: atexit pwd time Failed to build these modules: _hashlib _ssl Following modules built successfully but were removed because they could not be imported: _sqlite3 >> Above issue is the one which we could see while building the python 3.6.0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 03:51:37 2017 From: report at bugs.python.org (Nikhil Hegde) Date: Tue, 28 Nov 2017 08:51:37 +0000 Subject: [issue32152] Add pid to .cover filename in lib/trace.py In-Reply-To: <1511858704.48.0.213398074469.issue32152@psf.upfronthosting.co.za> Message-ID: <1511859097.72.0.213398074469.issue32152@psf.upfronthosting.co.za> Nikhil Hegde added the comment: In the trace_generic.py file that I've attached, the changes are on line 331 ---------- Added file: https://bugs.python.org/file47300/trace_generic.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 03:57:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 08:57:22 +0000 Subject: [issue32120] python 3.6.0 is not importing sqlite3 In-Reply-To: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> Message-ID: <1511859442.74.0.213398074469.issue32120@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This issue already has been fixed. Try Python 3.6.3. ---------- nosy: +serhiy.storchaka status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 04:54:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 09:54:15 +0000 Subject: [issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS In-Reply-To: <1504778309.6.0.433500701634.issue31380@psf.upfronthosting.co.za> Message-ID: <1511862855.81.0.213398074469.issue31380@psf.upfronthosting.co.za> STINNER Victor added the comment: > @vstinner, as the expert in this area, what do you suggest as the best way to deal with this? In support.__init__.py? Or test_httpservers itself? It's tricky when a filename is valid or not depending on the path, depending on the filesystem. The tempfile module checks if O_TMPFILE is supported: same issue, it depends on the path, and the user can configure the path. So we check each time if O_TMPFILE works or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:15:48 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 28 Nov 2017 10:15:48 +0000 Subject: [issue32138] android: test_faulthandler fails also on API 24 In-Reply-To: <1511690339.03.0.213398074469.issue32138@psf.upfronthosting.co.za> Message-ID: <1511864148.13.0.213398074469.issue32138@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +4521 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:23:15 2017 From: report at bugs.python.org (Claudiu Belu) Date: Tue, 28 Nov 2017 10:23:15 +0000 Subject: [issue32153] mock.create_autospec fails if an attribute is a partial function Message-ID: <1511864595.09.0.213398074469.issue32153@psf.upfronthosting.co.za> New submission from Claudiu Belu : If an object's attribute is a partial function, mock.create_autospec will fail while trying to copy the partial functions' details to the mocked function, as the partial function does not have the __name__ attribute. Example: import functools from unittest import mock class Proxy(object): def __init__(self, obj): self.obj def __getattr__(self, name): return functools.partial(self.__run_method, name) def __run_method(self, name, *args, **kwargs): return getattr(self.obj, name)(*args, **kwargs) a = mock.Mock() proxy = Proxy(a) mock.create_autospec(proxy) Output: Traceback (most recent call last): File "py3_mock_functools.py", line 20, in mock.create_autospec(proxy) File "/usr/lib/python3.5/unittest/mock.py", line 2156, in create_autospec _check_signature(spec, mock, is_type, instance) File "/usr/lib/python3.5/unittest/mock.py", line 112, in _check_signature _copy_func_details(func, checksig) File "/usr/lib/python3.5/unittest/mock.py", line 117, in _copy_func_details funcopy.__name__ = func.__name__ AttributeError: 'functools.partial' object has no attribute '__name__' ---------- components: Library (Lib) messages: 307115 nosy: cbelu priority: normal severity: normal status: open title: mock.create_autospec fails if an attribute is a partial function versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:25:37 2017 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 28 Nov 2017 10:25:37 +0000 Subject: [issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS In-Reply-To: <1504778309.6.0.433500701634.issue31380@psf.upfronthosting.co.za> Message-ID: <1511864736.99.0.213398074469.issue31380@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Another option is to skip this test unconditionally on macOS when using APFS, the test is already skipped on win32 and tests a generic codepath where only testing on Linux should be fine. BTW. It is fairly easy to detect if a path is on APFS: ``` import subprocess def is_apfs(path): lines = subprocess.check_output(['df', path]).decode('utf-8').splitlines() mountpoint = lines[1].split(None, 1)[0] lines = subprocess.check_output(['mount']).decode('utf-8').splitlines() for ln in lines: path = ln.split(None, 1)[0] if path == mountpoint: return '(apfs' in ln return False ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:26:01 2017 From: report at bugs.python.org (Claudiu Belu) Date: Tue, 28 Nov 2017 10:26:01 +0000 Subject: [issue32153] mock.create_autospec fails if an attribute is a partial function In-Reply-To: <1511864595.09.0.213398074469.issue32153@psf.upfronthosting.co.za> Message-ID: <1511864761.0.0.213398074469.issue32153@psf.upfronthosting.co.za> Change by Claudiu Belu : ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:29:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 10:29:10 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace Message-ID: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> New submission from STINNER Victor : For backward compatibility with Python 3.3, Lib/asyncio/__init__.py exports asyncio.selectors and asyncio._overlapped symbols. Python 3.3 reached it's end of line last september, it's time to move on: https://devguide.python.org/#status-of-python-branches This change is backward incompatible. Attached PR removes asyncio.selectors and asyncio._overlapped symbols, and use directly modules from the standard library. It documents the change in the "Porting to Python 3.7" section of the "What's New in Python 3.7" document. ---------- components: asyncio messages: 307117 nosy: vstinner, yselivanov priority: normal severity: normal status: open title: asyncio: Don't export selectors and _overlapped in asyncio namespace versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:34:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 10:34:45 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace In-Reply-To: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> Message-ID: <1511865285.3.0.213398074469.issue32154@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4522 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:54:36 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 28 Nov 2017 10:54:36 +0000 Subject: [issue32108] configparser bug: section is emptied if you assign a section to itself In-Reply-To: <1511286370.98.0.213398074469.issue32108@psf.upfronthosting.co.za> Message-ID: <1511866476.8.0.213398074469.issue32108@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +4523 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 06:01:03 2017 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 28 Nov 2017 11:01:03 +0000 Subject: [issue32108] configparser bug: section is emptied if you assign a section to itself In-Reply-To: <1511286370.98.0.213398074469.issue32108@psf.upfronthosting.co.za> Message-ID: <1511866863.33.0.213398074469.issue32108@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 06:11:08 2017 From: report at bugs.python.org (Josh Cullum) Date: Tue, 28 Nov 2017 11:11:08 +0000 Subject: [issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter In-Reply-To: <1508407674.96.0.213398074469.issue31817@psf.upfronthosting.co.za> Message-ID: <1511867468.64.0.213398074469.issue31817@psf.upfronthosting.co.za> Josh Cullum added the comment: Hi Ned, I've built a new machine, tried the build again using Tk and Tcl shared libraries, built Python-3.6.3 and it's still not worked. The Python/3.6.3-foss-2017b/lib/python3.6/tkinter folder gets created and populated with several files, but when you try and import tkinter in python, it fails to import with: >>> import tkinter Traceback (most recent call last): File "", line 1, in File "/tools/apps/Python/3.6.3-foss-2017b/lib/python3.6/tkinter/__init__.py", line 36, in import _tkinter # If this fails your Python may not be configured for Tk ModuleNotFoundError: No module named '_tkinter' Running __init__.py from the tkinter folder produces this output: Traceback (most recent call last): File "__init__.py", line 36, in import _tkinter # If this fails your Python may not be configured for Tk ModuleNotFoundError: No module named '_tkinter' I'm guessing something is failing to build correctly but it's not being logged. Both Tk and Tcl versions 8.6.6 and 8.6.7 are available and working on the system. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 08:59:52 2017 From: report at bugs.python.org (R. David Murray) Date: Tue, 28 Nov 2017 13:59:52 +0000 Subject: [issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value In-Reply-To: <1511740988.25.0.213398074469.issue32144@psf.upfronthosting.co.za> Message-ID: <1511877592.02.0.213398074469.issue32144@psf.upfronthosting.co.za> R. David Murray added the comment: OK, I should have used the term the docs actually use: "serialization". get_content() is, I hope, clearly not serialization, while as_string() is. Does that make it make more sense? Do you see a way to improve the docs in this regard? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:03:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 14:03:17 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used Message-ID: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> New submission from STINNER Victor : Using flake8, I found some bugs in the standard libraries and tools. I already fixed another flake8 error: --- commit 28e61650b23119b68cd7943ccc01b8b9af1b4103 Author: Victor Stinner Date: Tue Nov 28 00:34:08 2017 +0100 bpo-31245: asyncio: Fix typo, isistance => isinstance (#4594) --- Attached patch fix 3 bugs found by the flake8 F841 warning. Note: Python 2.7 is not impacted by the turtledemo bug, but it's impacted by the two other bugs. ---------- components: Library (Lib) messages: 307120 nosy: vstinner priority: normal severity: normal status: open title: Fix flake8 warning F841: local variable ... is assigned to but never used versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:05:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 14:05:23 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511877923.66.0.213398074469.issue32155@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4524 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:19:58 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 14:19:58 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace In-Reply-To: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> Message-ID: <1511878798.95.0.213398074469.issue32154@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4271dfd7815c05fd39b515c240050b3585bdfcd4 by Victor Stinner in branch 'master': bpo-32154: Remove asyncio.selectors (#4605) https://github.com/python/cpython/commit/4271dfd7815c05fd39b515c240050b3585bdfcd4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:29:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 14:29:15 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace In-Reply-To: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> Message-ID: <1511879355.12.0.213398074469.issue32154@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4525 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:30:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 14:30:02 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace In-Reply-To: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> Message-ID: <1511879402.24.0.213398074469.issue32154@psf.upfronthosting.co.za> STINNER Victor added the comment: I also proposed the PR 4609 to remove the old asyncio.windows_utils.socketpair alias. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:30:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 14:30:34 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511879434.78.0.213398074469.issue32155@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 696b501cd11dc429a0f661adeb598bfaf89e4112 by Victor Stinner in branch 'master': bpo-32155: Bugfixes found by flake8 F841 warnings (#4608) https://github.com/python/cpython/commit/696b501cd11dc429a0f661adeb598bfaf89e4112 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:31:43 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 28 Nov 2017 14:31:43 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511879503.0.0.213398074469.issue32155@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4526 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:37:54 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 28 Nov 2017 14:37:54 +0000 Subject: [issue32107] Improve MAC address calculation and fix test_uuid.py In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511879874.47.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- title: test_uuid uses the incorrect bitmask -> Improve MAC address calculation and fix test_uuid.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:40:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 14:40:58 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511880058.32.0.213398074469.issue32155@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If you have replaced self.DEFAULT_REALM with realm why not replace self.DEFAULT_REPOSITORY with repository? I don't know what is correct. Added distutils experts for review. ---------- nosy: +dstufft, eric.araujo, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:50:39 2017 From: report at bugs.python.org (Marcel Plch) Date: Tue, 28 Nov 2017 14:50:39 +0000 Subject: [issue31901] atexit callbacks should be run at subinterpreter shutdown In-Reply-To: <1509378283.18.0.213398074469.issue31901@psf.upfronthosting.co.za> Message-ID: <1511880639.0.0.213398074469.issue31901@psf.upfronthosting.co.za> Change by Marcel Plch : ---------- keywords: +patch pull_requests: +4527 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:04:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 15:04:34 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511881474.25.0.213398074469.issue32155@psf.upfronthosting.co.za> STINNER Victor added the comment: > If you have replaced self.DEFAULT_REALM with realm why not replace self.DEFAULT_REPOSITORY with repository? Oh, I didn't notice that there is also a repository variable which is not used in all code paths. > I don't know what is correct. Added distutils experts for review. Now I'm not sure that my realm change is correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:07:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 15:07:16 +0000 Subject: [issue32156] Fix flake8 warning F401: ... imported but unused Message-ID: <1511881636.03.0.213398074469.issue32156@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached PR removes unused imports. ---------- components: Library (Lib) messages: 307126 nosy: vstinner priority: normal severity: normal status: open title: Fix flake8 warning F401: ... imported but unused versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:16:33 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 28 Nov 2017 15:16:33 +0000 Subject: [issue31440] wrong default module search path in help message In-Reply-To: <1505289671.44.0.835447541181.issue31440@psf.upfronthosting.co.za> Message-ID: <1511882193.09.0.213398074469.issue31440@psf.upfronthosting.co.za> Christian Heimes added the comment: New changeset 08d2b86a1058b733bb7f1ae2b55818dd9687d21c by Christian Heimes (gauravbackback) in branch 'master': bpo-31440: Changed default module search path for windows https://github.com/python/cpython/commit/08d2b86a1058b733bb7f1ae2b55818dd9687d21c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:17:42 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 28 Nov 2017 15:17:42 +0000 Subject: [issue31440] wrong default module search path in help message In-Reply-To: <1505289671.44.0.835447541181.issue31440@psf.upfronthosting.co.za> Message-ID: <1511882262.63.0.213398074469.issue31440@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4528 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:19:31 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 15:19:31 +0000 Subject: [issue32156] Fix flake8 warning F401: ... imported but unused In-Reply-To: <1511881636.03.0.213398074469.issue32156@psf.upfronthosting.co.za> Message-ID: <1511882371.36.0.213398074469.issue32156@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4529 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:23:29 2017 From: report at bugs.python.org (Berker Peksag) Date: Tue, 28 Nov 2017 15:23:29 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511882609.02.0.213398074469.issue32155@psf.upfronthosting.co.za> Berker Peksag added the comment: I don't think distutils changes are correct. ('realm', self.DEFAULT_REALM) 'realm' is the config name and 'self.DEFAULT_REALM' is its default value. In the 'for key, default in ...:' loop, 1. It checks if it's already set in the config file 2. Sets its value to 'current' if it does 3. If it doesn't, uses self.DEFAULT_REALM distutils sets default values for undefined options via 'finalize_options' methods and there is the following command in 'PyPIRCCommand.finalize_options()' method: if self.realm is None: self.realm = self.DEFAULT_REALM So unless there is a user set value for the 'realm' option (see the 'upload' and 'register' commands), 'self.realm' equals to 'self.DEFAULT_REALM'. I'd remove the following code instead: realm = self.realm or self.DEFAULT_REALM ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:27:57 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 15:27:57 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace In-Reply-To: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> Message-ID: <1511882877.71.0.213398074469.issue32154@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is this function publicly documented? If this is true, it should first be deprecated. It is left in the __all__ list. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:40:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 15:40:40 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace In-Reply-To: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> Message-ID: <1511883640.04.0.213398074469.issue32154@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy Storchaka: "Is this function publicly documented? If this is true, it should first be deprecated." It's not documented, but I found a reference in the documentation: --- try: from socket import socketpair except ImportError: from asyncio.windows_utils import socketpair --- This code continues to work on Python 3.5 and newer, the "except" block will just never be taken. > It is left in the __all__ list. Oops, fixed in my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:43:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 15:43:05 +0000 Subject: [issue32108] configparser bug: section is emptied if you assign a section to itself In-Reply-To: <1511286370.98.0.213398074469.issue32108@psf.upfronthosting.co.za> Message-ID: <1511883785.86.0.213398074469.issue32108@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 4607 doesn't look a correct solution to me. I don't know a precedence of calling deepcopy() for a value in __setitem__(). deepcopy() is too heavy, calling it can slow down normal cases. Using deepcopy likely means a bad design. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:45:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 15:45:17 +0000 Subject: [issue31440] wrong default module search path in help message In-Reply-To: <1505289671.44.0.835447541181.issue31440@psf.upfronthosting.co.za> Message-ID: <1511883917.0.0.213398074469.issue31440@psf.upfronthosting.co.za> STINNER Victor added the comment: I confirm that Python 2.7 is affected and should also be fixed. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:45:59 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 15:45:59 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511883959.52.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: Victor: "I consider that PR 4489 is a bugfix, so I proposed backports to Python 2.7 (PR 4588) and 3.6 (PR 4587)." Serhiy: Are you ok to backport the change to stable branches? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:51:06 2017 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 28 Nov 2017 15:51:06 +0000 Subject: [issue32150] Expand tabs to spaces in C files In-Reply-To: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> Message-ID: <1511884266.14.0.213398074469.issue32150@psf.upfronthosting.co.za> Guido van Rossum added the comment: OK, so I think you can go ahead with this. I was fine with the state of the patch yesterday, so whatever you added today is also fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:54:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 15:54:51 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511884491.45.0.213398074469.issue27535@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm not sure. Ask the RM for 3.6. As for 2.7, does this problem exist in 2.7? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:56:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 15:56:12 +0000 Subject: [issue32150] Expand tabs to spaces in C files In-Reply-To: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> Message-ID: <1511884572.57.0.213398074469.issue32150@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 598ceae876ff4a23072e59945597e945583de4ab by Serhiy Storchaka in branch 'master': bpo-32150: Expand tabs to spaces in C files. (#4583) https://github.com/python/cpython/commit/598ceae876ff4a23072e59945597e945583de4ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:56:48 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 15:56:48 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511884608.87.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: "As for 2.7, does this problem exist in 2.7?" Yes, see my PR 4588. If you run the test without the fix, the test fails. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:59:51 2017 From: report at bugs.python.org (Leo kirotawa silva) Date: Tue, 28 Nov 2017 15:59:51 +0000 Subject: [issue30657] Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511884791.63.0.213398074469.issue30657@psf.upfronthosting.co.za> Leo kirotawa silva added the comment: I re-did the build here for python3.4 and couldn't reach the same test fail. So I'm assuming it was a false alarm. Said that, I believe the same patch that applies to py2.7 also applies to 3.4 and 3.5. I've build them using the patch and did some regression tests and it was ok. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 11:01:56 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 16:01:56 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511884916.04.0.213398074469.issue27535@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I meant the original issue. AFAIK ResourceWarningis not raised in 2.7. And other warnings less likely have unique messages. Seems the problem is less critical in 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 11:02:59 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 16:02:59 +0000 Subject: [issue32150] Expand tabs to spaces in C files In-Reply-To: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> Message-ID: <1511884979.48.0.213398074469.issue32150@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Guido! I think now we can revive issue8912. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 11:18:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 16:18:49 +0000 Subject: [issue32156] Fix flake8 warning F401: ... imported but unused In-Reply-To: <1511881636.03.0.213398074469.issue32156@psf.upfronthosting.co.za> Message-ID: <1511885929.47.0.213398074469.issue32156@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I suggest to split your patch on several PR for different domains, and let the domain experts review changes separately. IDLE changes look mostly harmless to me. But changes in distutils should be made with a large care. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 11:27:00 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 28 Nov 2017 16:27:00 +0000 Subject: [issue32046] 2to3 fix for operator.isCallable() In-Reply-To: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> Message-ID: <1511886420.72.0.213398074469.issue32046@psf.upfronthosting.co.za> ?ric Araujo added the comment: New changeset a489599793f9b00ddc2c68e2ce3bce9cbb2c09a2 by ?ric Araujo (Dong-hee Na) in branch 'master': bpo-32046: Update 2to3 when converts operator.isCallable(obj). (#4417) https://github.com/python/cpython/commit/a489599793f9b00ddc2c68e2ce3bce9cbb2c09a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 11:29:21 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 28 Nov 2017 16:29:21 +0000 Subject: [issue32046] 2to3 fix for operator.isCallable() In-Reply-To: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> Message-ID: <1511886561.56.0.213398074469.issue32046@psf.upfronthosting.co.za> ?ric Araujo added the comment: Merged in master, I suppose stable branches should be left alone? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 11:33:11 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 28 Nov 2017 16:33:11 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511886791.43.0.213398074469.issue32155@psf.upfronthosting.co.za> ?ric Araujo added the comment: The best course of action would be to revert the distutils changes. There are a handful of tickets related to register/upload commands, which are funky commands with their own config file not 100% in line with other distutils commands. Changes in that code need tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:09:37 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 17:09:37 +0000 Subject: [issue32072] Issues with binary plists In-Reply-To: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> Message-ID: <1511888977.43.0.213398074469.issue32072@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Ronald, could you please make a review? I want to merge this before 3.7.0a3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:17:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 17:17:54 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} Message-ID: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : It is common to use quotes around %s. If the formatted argument is a string this will produce a string in qoutes, that look as a string literal in Python and other programming languages or just as a quoted string in English. But if quotes surround %r this looks like error. If the argument is a string this will lead to doubling qoutes. If its repr is in the form <...>, the angular parenthesis serve a role of qoutes, and additional qoutes are not needed. PR 4582 removes qoutes around %r and {!r} in format strings. ---------- components: Library (Lib) messages: 307146 nosy: barry, davin, pitrou, r.david.murray, serhiy.storchaka, yselivanov priority: normal severity: normal stage: patch review status: open title: Remove explicit quotes around %r and {!r} versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:18:05 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 28 Nov 2017 17:18:05 +0000 Subject: [issue31440] wrong default module search path in help message In-Reply-To: <1505289671.44.0.835447541181.issue31440@psf.upfronthosting.co.za> Message-ID: <1511889485.64.0.213398074469.issue31440@psf.upfronthosting.co.za> Christian Heimes added the comment: I'll do a backport tomorrow. ---------- assignee: -> christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:18:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 17:18:13 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511889493.13.0.213398074469.issue32157@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +4530 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:18:31 2017 From: report at bugs.python.org (Christian Heimes) Date: Tue, 28 Nov 2017 17:18:31 +0000 Subject: [issue31440] wrong default module search path in help message In-Reply-To: <1505289671.44.0.835447541181.issue31440@psf.upfronthosting.co.za> Message-ID: <1511889511.39.0.213398074469.issue31440@psf.upfronthosting.co.za> Christian Heimes added the comment: New changeset cb79c2203953bd465f2c53b7a09a51071717575f by Christian Heimes (Miss Islington (bot)) in branch '3.6': bpo-31440: Changed default module search path for windows (#4613) https://github.com/python/cpython/commit/cb79c2203953bd465f2c53b7a09a51071717575f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:27:40 2017 From: report at bugs.python.org (Ethan Furman) Date: Tue, 28 Nov 2017 17:27:40 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511890060.76.0.213398074469.issue32157@psf.upfronthosting.co.za> Ethan Furman added the comment: I make sure to use %r in error-reporting and debugging messages precisely because it's output is (usually) valid python. If I see a 1 without quotes I know it's a number, and with quotes I know it's a string. -1 ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:27:57 2017 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 28 Nov 2017 17:27:57 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511890077.06.0.213398074469.issue32157@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- nosy: -yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:28:48 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 28 Nov 2017 17:28:48 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511890128.19.0.213398074469.issue32157@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ethan, I think you misunderstood Serhiy's proposal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:35:53 2017 From: report at bugs.python.org (Ethan Furman) Date: Tue, 28 Nov 2017 17:35:53 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511890553.92.0.213398074469.issue32157@psf.upfronthosting.co.za> Ethan Furman added the comment: Yup, I sure did. :/ Looks like a good change to me. Are these the only instances of quotes used with %r? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:36:34 2017 From: report at bugs.python.org (Ethan Furman) Date: Tue, 28 Nov 2017 17:36:34 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511890594.75.0.213398074469.issue32157@psf.upfronthosting.co.za> Change by Ethan Furman : ---------- Removed message: https://bugs.python.org/msg307149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:40:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 17:40:05 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511890805.2.0.213398074469.issue32157@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, these are the only instances of quotes used with %r or {!r}. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:48:56 2017 From: report at bugs.python.org (Jan-Philip Gehrcke) Date: Tue, 28 Nov 2017 17:48:56 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1511891336.88.0.213398074469.issue16487@psf.upfronthosting.co.za> Jan-Philip Gehrcke added the comment: Hello! I would very much appreciate if we can find a way for us to get another review for the last patch. I did most of the work in August 2016 and got a review from Senthil and Christian which I processed. When I got back to the patch for converting it to the GitHub workflow about a year later I realized that the details faded from my mind. 4 months later, after re-digging into the details, I went into the patch again and resolved the merge conflicts that accumulated over time. Antoine kindly left another round of comments which I replied to. Now, 2 months after that last effort I'd like to not forget about the details again, but instead be able to respond to review feedback while still being on top of the matter. So, any kind and level of feedback would be greatly appreciated. Thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 13:07:02 2017 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 28 Nov 2017 18:07:02 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1511892422.17.0.213398074469.issue16487@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Hello JP, I had been little inactive for a while (>2 years). However, I think, I can take now some load in CPython world and I will take this ticket/feature forward this Sunday (1-Dec-2017). If Christian (or currently active committers) don't get to it before, then expect from me to move this forward. Thank you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 14:39:46 2017 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 28 Nov 2017 19:39:46 +0000 Subject: [issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate) Message-ID: <1511897986.14.0.213398074469.issue32158@psf.upfronthosting.co.za> New submission from Jason R. Coombs : The contextlib docs explain why a decorator is nice: > It makes it clear that the cm applies to the whole function, rather than just a piece of it (and saving an indentation level is nice, too). However, the built-in context managers that could readily supply this interface don't derive from DecoratorContext. In jaraco.context, I [added decorator support by simply deriving from the two base classes](https://github.com/jaraco/jaraco.context/commit/5aa7b0bb222cff5009a2f0dc3ea49db9e7a6b71a#diff-efbedfbbcb7f61268cfeff04a32fa59d). But it got me thinking - couldn't suppress (and possibly other) contextlib decorators support this usage out of the box? If there's interest, I'll put together a patch with test. ---------- components: Library (Lib) messages: 307155 nosy: jason.coombs priority: normal severity: normal status: open title: Suppress (and other contextlib context managers) should work as decorators (where appropriate) versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 14:40:51 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 28 Nov 2017 19:40:51 +0000 Subject: [issue32071] Add py.test-like "-k" test selection to unittest In-Reply-To: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> Message-ID: <1511898051.44.0.213398074469.issue32071@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 4d193bcc2560b824389e4d98d9d8b9b34e33dbaf by Antoine Pitrou (Jonas Haag) in branch 'master': bpo-32071: Fix regression and add What's New entry (#4589) https://github.com/python/cpython/commit/4d193bcc2560b824389e4d98d9d8b9b34e33dbaf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 14:50:20 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 28 Nov 2017 19:50:20 +0000 Subject: [issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate) In-Reply-To: <1511897986.14.0.213398074469.issue32158@psf.upfronthosting.co.za> Message-ID: <1511898620.24.0.213398074469.issue32158@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > But it got me thinking - couldn't suppress (and possibly other) > contextlib decorators support this usage out of the box? They possibly could but probably shouldn't. My experience is that giving them a dual role makes them more complicated and harder to understand. For suppress() in particular, wrapping a whole function is likely an anti-pattern. Usually we advise people to put as little as possible in the try-block to avoid catching unexpected exceptions. Also, I think it would be inevitable that people would try to apply these to generators or awaitables and find that they don't mix well. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 14:58:59 2017 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 28 Nov 2017 19:58:59 +0000 Subject: [issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate) In-Reply-To: <1511897986.14.0.213398074469.issue32158@psf.upfronthosting.co.za> Message-ID: <1511899139.94.0.213398074469.issue32158@psf.upfronthosting.co.za> Jason R. Coombs added the comment: Fair enough. For an example, here's the case where I wanted to use the decorator to avoid excess indentation and keep the most meaningful part of the function at the base of the body: @suppress(KeyError) def v12_to_13(manager, case): case['sample_id'] = case.pop('caseid') In my opinion, it's nominally nicer and clearer than: def v12_to_13(manager, case): with suppress(KeyError): case['sample_id'] = case.pop('caseid') But I see your points about encouraging overly-broad catching of exceptions... so it's better to have the indentation as something of a wart to dissuade excess wrapping. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:02:25 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 28 Nov 2017 20:02:25 +0000 Subject: [issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate) In-Reply-To: <1511897986.14.0.213398074469.issue32158@psf.upfronthosting.co.za> Message-ID: <1511899345.8.0.213398074469.issue32158@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:22:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 20:22:20 +0000 Subject: [issue32159] Remove tools for CVS and Subversion Message-ID: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> New submission from STINNER Victor : CPython migrated from CVS to Subversion, to Mercurial, and then to Git. CVS and Subversion are no more used to develop CPython. Changes of attached PR: * platform module: drop support for sys.subversion. The sys.subversion attribute has been removed in Python 3.3. * Remove Misc/svnmap.txt * Remove Tools/scripts/svneol.py * Remove Tools/scripts/treesync.py ---------- components: Build messages: 307159 nosy: vstinner priority: normal severity: normal status: open title: Remove tools for CVS and Subversion versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:26:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 20:26:15 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511900775.14.0.213398074469.issue32159@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4531 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:33:22 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 20:33:22 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace In-Reply-To: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> Message-ID: <1511901202.54.0.213398074469.issue32154@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ac577d7d0bd27a69921ced14c09172235ceebab5 by Victor Stinner in branch 'master': bpo-32154: Remove asyncio.windows_utils.socketpair (#4609) https://github.com/python/cpython/commit/ac577d7d0bd27a69921ced14c09172235ceebab5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:33:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 20:33:43 +0000 Subject: [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace In-Reply-To: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> Message-ID: <1511901223.88.0.213398074469.issue32154@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:38:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 20:38:18 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511901498.83.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: "I meant the original issue. AFAIK ResourceWarningis not raised in 2.7. And other warnings less likely have unique messages. Seems the problem is less critical in 2.7." Oh yes, sorry, I forgot your comment and I forgot that Python 2.7 doesn't have ResourceWarning. I closed my PR for Python 2.7: https://github.com/python/cpython/pull/4588 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:39:31 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 28 Nov 2017 20:39:31 +0000 Subject: [issue31732] Add TRACE level to the logging module In-Reply-To: <1507552161.59.0.213398074469.issue31732@psf.upfronthosting.co.za> Message-ID: <1511901571.92.0.213398074469.issue31732@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Perhaps a recipe should be published to explain how to add your own levels? e.g.: >>> import logging >>> logging.NOTE = logging.INFO + 5 >>> logging.addLevelName(logging.INFO + 5, 'NOTE') >>> class MyLogger(logging.Logger): ...: def note(self, msg, *args, **kwargs): ...: self.log(logging.NOTE, msg, *args, **kwargs) ...: >>> logging.setLoggerClass(MyLogger) >>> logging.basicConfig(level=logging.INFO) >>> logger.note("hello %s", "Guido") Level 25:foo:hello Guido ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:40:14 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 28 Nov 2017 20:40:14 +0000 Subject: [issue31732] Add TRACE level to the logging module In-Reply-To: <1507552161.59.0.213398074469.issue31732@psf.upfronthosting.co.za> Message-ID: <1511901614.78.0.213398074469.issue31732@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- Removed message: https://bugs.python.org/msg307162 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:41:15 2017 From: report at bugs.python.org (Daniel Himmelstein) Date: Tue, 28 Nov 2017 20:41:15 +0000 Subject: [issue32160] lzma documentation: example to XZ compress file on disk Message-ID: <1511901675.08.0.213398074469.issue32160@psf.upfronthosting.co.za> New submission from Daniel Himmelstein : The documentation for the lzma module currently contains 6 examples (https://docs.python.org/3.6/library/lzma.html#examples). However, it does not include an example to XZ compress a file on disk. The functionality I'm envisioning would be similar to the command: ```sh xz --compress --keep path ``` I believe this is possible in python with: ```python with open(in_path) as in_file, lzma.open(out_path, 'w') as out_file: shutil.copyfileobj(in_path, out_file) ``` Note gzip has a similar example (https://docs.python.org/3.6/library/gzip.html#examples-of-usage). Compressing an existing file on disk is a use case I commonly encounter. Python is ideal for the task because it provides a cross-platform solution that doesn't require installing additional command line utilities. Before finding shutil.copyfileobj, I assumed memory-efficient on-disk XZ compression was not possible in Python, due to its omission from the docs. I'm happy to propose example code for the documentation. Alternatively, if this feature is considered useful, we could consider an API addition to provide a one-line command for on-disk compressing/decompressing files. Since this would be a major addition that should be consistent across compression modules, perhaps we should just start with a lzma doc example? ---------- components: IO messages: 307163 nosy: dhimmel priority: normal severity: normal status: open title: lzma documentation: example to XZ compress file on disk versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:41:25 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 28 Nov 2017 20:41:25 +0000 Subject: [issue31732] Add TRACE level to the logging module In-Reply-To: <1507552161.59.0.213398074469.issue31732@psf.upfronthosting.co.za> Message-ID: <1511901685.76.0.213398074469.issue31732@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Perhaps a recipe should be published to explain how to add your own levels? >>> import logging >>> logging.NOTE = logging.INFO + 5 >>> logging.addLevelName(logging.INFO + 5, 'NOTE') >>> class MyLogger(logging.getLoggerClass()): ...: def note(self, msg, *args, **kwargs): ...: self.log(logging.NOTE, msg, *args, **kwargs) ...: >>> logging.setLoggerClass(MyLogger) >>> logging.basicConfig(level=logging.INFO) >>> logger.note("hello %s", "Guido") NOTE:foo:hello Guido ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:43:43 2017 From: report at bugs.python.org (Daniel Himmelstein) Date: Tue, 28 Nov 2017 20:43:43 +0000 Subject: [issue32160] lzma documentation: example to XZ compress file on disk In-Reply-To: <1511901675.08.0.213398074469.issue32160@psf.upfronthosting.co.za> Message-ID: <1511901823.92.0.213398074469.issue32160@psf.upfronthosting.co.za> Change by Daniel Himmelstein : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:48:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 20:48:10 +0000 Subject: [issue27535] Ignored ResourceWarning warnings leak memory in warnings registries In-Reply-To: <1468720423.06.0.361257976034.issue27535@psf.upfronthosting.co.za> Message-ID: <1511902090.67.0.213398074469.issue27535@psf.upfronthosting.co.za> STINNER Victor added the comment: I ran a quick benchmark on Python 3.6: current code (3.6 branch, ref) => PR 4587 (patch): vstinner at apu$ python3 -m perf compare_to ref.json patch.json Mean +- std dev: [ref] 597 ns +- 10 ns -> [patch] 830 ns +- 15 ns: 1.39x slower (+39%) I don't want to backport an optimization to a stable branch, so I prefer to not backport the warnings change on the ignore action to Python 3.6. I rejected my PR 4587. The bug was fixed in master. I don't want to backport the change to 2.7 nor 3.6, so I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:50:26 2017 From: report at bugs.python.org (Daniel Himmelstein) Date: Tue, 28 Nov 2017 20:50:26 +0000 Subject: [issue32160] lzma documentation: example to XZ compress file on disk In-Reply-To: <1511901675.08.0.213398074469.issue32160@psf.upfronthosting.co.za> Message-ID: <1511902226.0.0.213398074469.issue32160@psf.upfronthosting.co.za> Daniel Himmelstein added the comment: > we could consider an API addition Just brainstorming here... perhaps an API addition would be most appropriate in the shutil module (https://docs.python.org/3.6/library/shutil.html) which already contains shutil.make_archive and shutil.unpack_archive. One could imagine shutil.compress and shutil.decompress that took a format argument to specify the compression type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:54:44 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 20:54:44 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511902484.39.0.213398074469.issue32157@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a4a3020abc065d40f57069d6c69d02222ddc85d6 by Serhiy Storchaka in branch 'master': bpo-32157: Removed explicit quotes around %r and {!r}. (#4582) https://github.com/python/cpython/commit/a4a3020abc065d40f57069d6c69d02222ddc85d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:58:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 20:58:34 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511902714.7.0.213398074469.issue32155@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4532 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:00:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 21:00:34 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511902834.46.0.213398074469.issue32155@psf.upfronthosting.co.za> STINNER Victor added the comment: I proposed PR 4618 to revert the distutils.config changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:04:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 21:04:24 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511903064.61.0.213398074469.issue32155@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4533 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:23:06 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 21:23:06 +0000 Subject: [issue32157] Remove explicit quotes around %r and {!r} In-Reply-To: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> Message-ID: <1511904186.1.0.213398074469.issue32157@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:29:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 21:29:34 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511904574.64.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset fe2d5babba5d26de2093b6518316b268488187be by Victor Stinner in branch 'master': bpo-32159: Remove tools for CVS and Subversion (#4615) https://github.com/python/cpython/commit/fe2d5babba5d26de2093b6518316b268488187be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:32:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 21:32:33 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511904753.73.0.213398074469.issue32159@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Are you sure that these scripts are not used outside of CPython? They were here when CPython used Subversion, they were here when CPython used Mercurial, what is wrong with Git? The support of the svn:eol property is a thing I really lacked in Mercurial. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:33:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 21:33:33 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511904813.62.0.213398074469.issue32159@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Oh, you are VERY fast in committing Victor. Please restore these scripts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:40:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 21:40:46 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511905246.47.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: > Are you sure that these scripts are not used outside of CPython? How would someone use it? There are only part of the code base, they are not installed on the system (by "make install"). If someone uses these scripts on another project which is not CPython, well, they can copy an old version from Python 3.6 and maintain their fork, no? Why would Python still maintain a tool if we don't use it or test it ourself? > The support of the svn:eol property is a thing I really lacked in Mercurial. We are using .gitattributes to specify the end of lines of some files. A few examples: --- *.gif binary *.bat text eol=crlf PC/readme.txt text eol=crlf --- I understand that Git does handle end of line, and it's configurable by .gitattributes. Sorry, I don't know much more about that, and I'm not sure that this issue is the right place to ask questions about Git ;-) Maybe ask on python-dev if you are aware of an issue with Git? > They were here when CPython used Subversion, they were here when CPython used Mercurial, what is wrong with Git? The scripts are very specific to CVS and Subversion. They are useful with Mercurial or Git. I wrote that we already changed the SCM twice since Subversion, to justify that I don't think that anyone still works on a CVS or Subversion fork of CPython. Well, if someone really does that, I don't expect that they work on the master branch, and so likely have a copy of these scripts :-) > Oh, you are VERY fast in committing Victor. The PR was approved by Brett Cannon and Ned Deily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:41:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 21:41:21 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511905281.36.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: > The PR was approved by Brett Cannon and Ned Deily. Oh, and Mariatta after I added a NEWS entry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:52:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 21:52:05 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511905925.11.0.213398074469.issue32159@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is svnmap.txt used for mapping Subversion references to Mercurial references on the tracker? r88752 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:54:30 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 21:54:30 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511906070.05.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: "Is svnmap.txt used for mapping Subversion references to Mercurial references on the tracker? r88752" Brett, David, Ezio: any idea for Serhiy's question? ---------- nosy: +brett.cannon, ezio.melotti, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:59:43 2017 From: report at bugs.python.org (Rahul) Date: Tue, 28 Nov 2017 21:59:43 +0000 Subject: [issue32161] Python 2.7.14 installation on Ubuntu 16.04/GCC 5.4 throws "internal compiler error" in "PyFloat_GetMax" function Message-ID: <1511906382.07.0.213398074469.issue32161@psf.upfronthosting.co.za> New submission from Rahul : Attempt to `make` Python 2.7.14 on Ubuntu 16.04/GCC 5.4 throws the following error: Objects/floatobject.c: In function ?PyFloat_GetMax?: Objects/floatobject.c:59:5: internal compiler error: Illegal instruction return DBL_MAX; ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Makefile:1359: recipe for target 'Objects/floatobject.o' failed make: *** [Objects/floatobject.o] Error 1 ---------- components: Installation files: python_2_7_14__configure_output messages: 307176 nosy: rahulrajaram priority: normal severity: normal status: open title: Python 2.7.14 installation on Ubuntu 16.04/GCC 5.4 throws "internal compiler error" in "PyFloat_GetMax" function versions: Python 2.7 Added file: https://bugs.python.org/file47301/python_2_7_14__configure_output _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:04:14 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 22:04:14 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511906654.94.0.213398074469.issue32155@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 6979fcdc91114b1ccb16345e26734d6df4cccbc3 by Victor Stinner in branch '3.6': bpo-32155: Bugfixes found by flake8 F841 warnings (#4619) https://github.com/python/cpython/commit/6979fcdc91114b1ccb16345e26734d6df4cccbc3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:14:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 22:14:08 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511907248.2.0.213398074469.issue32159@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: svnmap.txt was added in a single revision and was not changed anymore. commit 533c79dc67824d95b0aff5a252f9415d3bc80716 Author: Antoine Pitrou Date: Sat Mar 5 17:46:03 2011 +0100 Add the map of SVN revision numbers to changeset ids. This is mostly to help history-digging, especially when focussing on feature branches. Note that not all changesets are in the main repository, but they are all in the full history repository. It is needed for history. Old commit messages and discussion on mailing lists refer to Subversion revisions. Without svnmap.txt you will lost these references unless you have a clone of Subversion repository. I hope you are not going to get rid of Misc/HISTORY? It would be better to create a mapping from Subversion revisions to Git hashes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:19:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 22:19:28 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511907568.29.0.213398074469.issue32155@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 71bd588646b282c9eebc390b31184a5bdb54e712 by Victor Stinner in branch 'master': bpo-32155: Revert distutils.config change (#4618) https://github.com/python/cpython/commit/71bd588646b282c9eebc390b31184a5bdb54e712 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:23:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 22:23:18 +0000 Subject: [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used In-Reply-To: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> Message-ID: <1511907798.04.0.213398074469.issue32155@psf.upfronthosting.co.za> STINNER Victor added the comment: The main bugs have been fixed in Python 3.6 and 3.7 (master). Python 2.7 only has the bug in Tools/scripts/treesync.py, but I don't think that it's worth it to fix this old script in the stable 2.7 branch. I just removed this script from the master branch (bpo-32159). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:26:08 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 28 Nov 2017 22:26:08 +0000 Subject: [issue32107] Improve MAC address calculation and fix test_uuid.py In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511907968.01.0.213398074469.issue32107@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: New changeset 23df2d1304ece169d7e0dfc843dfb8026b413d9f by Barry Warsaw in branch 'master': bpo-32107 - Improve MAC address calculation and fix test_uuid.py (#4600) https://github.com/python/cpython/commit/23df2d1304ece169d7e0dfc843dfb8026b413d9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:27:43 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Tue, 28 Nov 2017 22:27:43 +0000 Subject: [issue32162] typing.Generic breaks __init_subclass__ Message-ID: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> New submission from Ilya Kulakov : When superclass inherits from Generic, attributes set for a subclass are incorrectly propagated to its superclass. Without Generic attribute access raises an exception: class X: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) cls.attr = 42 class Y(X): pass Y.attr # 42 X.attr # AttributeError With Generic it does not: import typing T = typing.TypeVar('T') class X(typing.Generic[T]): def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) cls.attr = 42 class Y(X): pass Y.attr # 42 X.attr # 42 ---------- messages: 307182 nosy: Ilya.Kulakov priority: normal severity: normal status: open title: typing.Generic breaks __init_subclass__ type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:41:06 2017 From: report at bugs.python.org (Ned Deily) Date: Tue, 28 Nov 2017 22:41:06 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511908866.01.0.213398074469.issue32159@psf.upfronthosting.co.za> Ned Deily added the comment: Sorry, I didn't see that the change included the deletion of svnmap.txt. However, I don't know where or by what that file might still be used, particularly by the lookup function used by the bug tracker. Presumably someone (Ezio, RDM, or Brett) knows. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:48:12 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 22:48:12 +0000 Subject: [issue32161] Python 2.7.14 installation on Ubuntu 16.04/GCC 5.4 throws "internal compiler error" in "PyFloat_GetMax" function In-Reply-To: <1511906382.07.0.213398074469.issue32161@psf.upfronthosting.co.za> Message-ID: <1511909292.97.0.213398074469.issue32161@psf.upfronthosting.co.za> STINNER Victor added the comment: "internal compiler error" is a bug in GCC, not in Python. Please follow instructions in the error message: Please submit a full bug report, with preprocessed source if appropriate. See for instructions. See https://gcc.gnu.org/bugs/ and https://gcc.gnu.org/ It would help if you can simplify the code to reproduce the bug without Python. I close the issue since it's a bug in GCC, not in Python. ---------- nosy: +vstinner resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:48:14 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Tue, 28 Nov 2017 22:48:14 +0000 Subject: [issue32162] typing.Generic breaks __init_subclass__ In-Reply-To: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> Message-ID: <1511909294.46.0.213398074469.issue32162@psf.upfronthosting.co.za> Ilya Kulakov added the comment: This issue is more server that I expected: it doesn't just propagate value to superclasses, but overrides them. The last subclass created by Python runtime will overwrite value for the whole chain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:48:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 22:48:34 +0000 Subject: [issue32161] Python 2.7.14 installation on Ubuntu 16.04/GCC 5.4 throws "internal compiler error" in "PyFloat_GetMax" function In-Reply-To: <1511906382.07.0.213398074469.issue32161@psf.upfronthosting.co.za> Message-ID: <1511909314.81.0.213398074469.issue32161@psf.upfronthosting.co.za> STINNER Victor added the comment: Once you reported the bug to GCC, please add a link to your bug report here, please ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:52:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 22:52:44 +0000 Subject: [issue32137] Stack overflow in repr of deeply nested dicts In-Reply-To: <1511686410.56.0.213398074469.issue32137@psf.upfronthosting.co.za> Message-ID: <1511909564.98.0.213398074469.issue32137@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:52:50 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Tue, 28 Nov 2017 22:52:50 +0000 Subject: [issue32162] typing.Generic breaks __init_subclass__ In-Reply-To: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> Message-ID: <1511909570.66.0.213398074469.issue32162@psf.upfronthosting.co.za> Ilya Kulakov added the comment: Current workaround is class X(typing.Generic[T] if typing.TYPE_CHECKING else object): ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:03:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 23:03:01 +0000 Subject: [issue30923] Add -Wimplicit-fallthrough=0 to Makefile ? In-Reply-To: <1499963760.78.0.849180274669.issue30923@psf.upfronthosting.co.za> Message-ID: <1511910181.03.0.213398074469.issue30923@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4534 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:03:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 23:03:01 +0000 Subject: [issue31279] Squash new gcc warning (-Wstringop-overflow) In-Reply-To: <1503682737.47.0.43054197609.issue31279@psf.upfronthosting.co.za> Message-ID: <1511910181.15.0.00913614298617.issue31279@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4535 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:04:25 2017 From: report at bugs.python.org (Rahul) Date: Tue, 28 Nov 2017 23:04:25 +0000 Subject: [issue32161] Python 2.7.14 installation on Ubuntu 16.04/GCC 5.4 throws "internal compiler error" in "PyFloat_GetMax" function In-Reply-To: <1511909292.97.0.213398074469.issue32161@psf.upfronthosting.co.za> Message-ID: Rahul added the comment: Thanks for your response. I'll follow up with GCC. On Nov 28, 2017 14:48, "STINNER Victor" wrote: > > STINNER Victor added the comment: > > "internal compiler error" is a bug in GCC, not in Python. Please follow > instructions in the error message: > > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. > > See https://gcc.gnu.org/bugs/ and https://gcc.gnu.org/ > > It would help if you can simplify the code to reproduce the bug without > Python. > > I close the issue since it's a bug in GCC, not in Python. > > ---------- > nosy: +vstinner > resolution: -> third party > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:08:36 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Tue, 28 Nov 2017 23:08:36 +0000 Subject: [issue32162] typing.Generic breaks __init_subclass__ In-Reply-To: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> Message-ID: <1511910516.32.0.213398074469.issue32162@psf.upfronthosting.co.za> Ilya Kulakov added the comment: Nah, that's a bad one: you cannot use Generic classes as intended by specifying types. It looks like it happens because cls._grog is not yet set properly by the time __init_subclass__ is called. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:26:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 23:26:20 +0000 Subject: [issue32124] Document functions safe to be called before Py_Initialize() In-Reply-To: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> Message-ID: <1511911580.54.0.213398074469.issue32124@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4536 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:29:09 2017 From: report at bugs.python.org (Evan Driscoll) Date: Tue, 28 Nov 2017 23:29:09 +0000 Subject: [issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse) In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za> Message-ID: <1511911749.45.0.213398074469.issue9334@psf.upfronthosting.co.za> Change by Evan Driscoll : ---------- nosy: +evaned _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:29:35 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 23:29:35 +0000 Subject: [issue32122] Improve -x option documentation In-Reply-To: <1511504808.14.0.213398074469.issue32122@psf.upfronthosting.co.za> Message-ID: <1511911775.48.0.213398074469.issue32122@psf.upfronthosting.co.za> STINNER Victor added the comment: I don't know if "@path\to\python -x %0 %* & exit /b" and "@py -3 -x %0 %* & exit /b" are correct and well supported on all recent Windows versions. Apart of that, I like your new documentation :-) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:30:03 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 23:30:03 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: <1511911802.99.0.213398074469.issue32110@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 219c2de5ad0fdac825298bed1bb251f16956c04a by Serhiy Storchaka in branch 'master': bpo-32110: codecs.StreamReader.read(n) now returns not more than n (#4499) https://github.com/python/cpython/commit/219c2de5ad0fdac825298bed1bb251f16956c04a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:30:14 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 28 Nov 2017 23:30:14 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: <1511911814.33.0.213398074469.issue32110@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4537 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:31:10 2017 From: report at bugs.python.org (Roundup Robot) Date: Tue, 28 Nov 2017 23:31:10 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: <1511911870.46.0.213398074469.issue32110@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4538 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 18:54:31 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Tue, 28 Nov 2017 23:54:31 +0000 Subject: [issue32162] typing.Generic breaks __init_subclass__ In-Reply-To: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> Message-ID: <1511913271.33.0.213398074469.issue32162@psf.upfronthosting.co.za> Ilya Kulakov added the comment: That's a better workaround: class X(typing.Generic[T]): def __init_subclass__(cls, **kwargs): super(typing.GenericMeta, cls).__setattr__('_gorg', cls) super().__init_subclass__(**kwargs) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 19:06:11 2017 From: report at bugs.python.org (Evan Driscoll) Date: Wed, 29 Nov 2017 00:06:11 +0000 Subject: [issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse) In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za> Message-ID: <1511913971.0.0.213398074469.issue9334@psf.upfronthosting.co.za> Evan Driscoll added the comment: I ran into this issue today. (Or rather a couple weeks ago, and I just diagnosed it today.) Reading through the thread and from the bug's age it looks like a fix is probably not to promising, but Cherniavsky Beni's 2016-04-11 22:03 comment > Can I additional suggest a change to the error message, e.g.: > > $ prog --foo -bar > prog: error: argument --foo: expected one argument > (tip: use --foo=-bar to force interpretation as argument of --foo) > > This can be safely added in the current mode with no opt-in required, > and will relieve the immediate "but what can I do?" confusions of > users. The workaround is hard to discover otherwise, as `--foo=x` is > typically equivalent to `--foo x`. and found it intriguing. Messing around with the code, I was able to produce the attached patch, which, when run on the test case in the original comment, produces this output: >>> import argparse >>> parser = argparse.ArgumentParser(prog='a2x') >>> parser.add_argument('--asciidoc-opts', ... action='store', dest='asciidoc_opts', default='', ... metavar='ASCIIDOC_OPTS', help='asciidoc options') >>> parser.parse_args(['--asciidoc-opts', '--safe']) usage: a2x [-h] [--asciidoc-opts ASCIIDOC_OPTS] a2x: error: argument --asciidoc-opts: expected one argument (if you intended --safe to be the argument of --asciidoc-opts, pass --asciidoc-opts=--safe instead) Would a cleaned-up version of this patch be of interest? (There are a couple obvious problems, like the out-of-bounds access to the list, PEP8, etc.) Is there some other way you could suggest to achieve this aim if you don't like that approach? (I also think that nargs=## could maybe be special-cased to just ignore the A/O designation completely and only check there are enough, but I haven't tried this out. Does this seem like a viable approach? Would a patch that does that, subject to some flag, be of interest?) The patch is relative to, I believe, the distribution version of 2.7.8. (Sorry, it's what I had handy as a custom build. :-) Updating it to .14 and to 3.whatever would be part of the cleanup.) ---------- Added file: https://bugs.python.org/file47302/python-argparse-error.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 19:06:55 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 00:06:55 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: <1511914015.46.0.213398074469.issue32110@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 230ffeae0a3961b1769806bd722c26227c84e8da by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32110: codecs.StreamReader.read(n) now returns not more than n (GH-4499) (#4622) https://github.com/python/cpython/commit/230ffeae0a3961b1769806bd722c26227c84e8da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 19:07:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 00:07:18 +0000 Subject: [issue32101] Add PYTHONDEVMODE=1 to enable the developer mode In-Reply-To: <1511233137.85.0.213398074469.issue32101@psf.upfronthosting.co.za> Message-ID: <1511914038.1.0.213398074469.issue32101@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4539 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 19:09:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 00:09:04 +0000 Subject: [issue32101] Add PYTHONDEVMODE=1 to enable the developer mode In-Reply-To: <1511233137.85.0.213398074469.issue32101@psf.upfronthosting.co.za> Message-ID: <1511914144.57.0.213398074469.issue32101@psf.upfronthosting.co.za> STINNER Victor added the comment: While implementing a new PYTHONDEVMODE environment variable, I found that it would help to also add a new sys.flags.dev_mode flag. So I added it. So for example, asyncio uses sys.flags.dev_mode rather than checking for 'dev' in sys._xoptions *and* check if the environment variable is set or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 19:15:45 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 00:15:45 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: <1511914545.87.0.213398074469.issue32110@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset fc73c54dae46e6c47dcd4a535f7bc68a46b8e398 by Serhiy Storchaka (Miss Islington (bot)) in branch '2.7': bpo-32110: codecs.StreamReader.read(n) now returns not more than n (GH-4499) (#4623) https://github.com/python/cpython/commit/fc73c54dae46e6c47dcd4a535f7bc68a46b8e398 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 19:16:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 00:16:20 +0000 Subject: [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files In-Reply-To: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> Message-ID: <1511914580.41.0.213398074469.issue32110@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 19:54:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 00:54:21 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511916861.89.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4540 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:18:28 2017 From: report at bugs.python.org (darkdragon-001) Date: Wed, 29 Nov 2017 02:18:28 +0000 Subject: [issue32163] getattr() returns None even when default is given Message-ID: <1511921908.2.0.213398074469.issue32163@psf.upfronthosting.co.za> New submission from darkdragon-001 : # fail.py def main(): patch = './a' f = open(patch, 'r') a = getattr(f,'encoding','ascii') print(str(a)) if __name__ == "__main__": main() --- $ touch a $ python fail.py It still prints out 'None' instead of 'ascii'. This issue is fixed in python3. ---------- messages: 307197 nosy: darkdragon-001 priority: normal severity: normal status: open title: getattr() returns None even when default is given versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:21:34 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 02:21:34 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511922094.25.0.213398074469.issue32100@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- pull_requests: +4541 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:24:46 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 29 Nov 2017 02:24:46 +0000 Subject: [issue32163] getattr() returns None even when default is given In-Reply-To: <1511921908.2.0.213398074469.issue32163@psf.upfronthosting.co.za> Message-ID: <1511922286.24.0.213398074469.issue32163@psf.upfronthosting.co.za> Steven D'Aprano added the comment: That's not a bug. That's because the file object does have an encoding attribute, which is set to None. getattr only returns the default when the attribute doesn't exist, not if it exists but is None. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:32:43 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 02:32:43 +0000 Subject: [issue30781] IDLE: configdialog -- switch to ttk widgets. In-Reply-To: <1498517235.92.0.120194527847.issue30781@psf.upfronthosting.co.za> Message-ID: <1511922763.95.0.213398074469.issue30781@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- pull_requests: +4542 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:41:53 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 02:41:53 +0000 Subject: [issue32164] IDLE: delete tabbedpages.py Message-ID: <1511923313.57.0.213398074469.issue32164@psf.upfronthosting.co.za> New submission from Terry J. Reedy : idlelib.tabbedpages.TabbedPageSet is a custom widget only used for the tabbed config dialog. #30781 converted to using tkinter.ttk.Notebook. The latter has proven to be an improvement and the former has no other use, nor would I recommend its use. Time to delete the file. ---------- assignee: terry.reedy components: IDLE messages: 307199 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: delete tabbedpages.py type: resource usage versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:49:39 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 02:49:39 +0000 Subject: [issue32164] IDLE: delete tabbedpages.py In-Reply-To: <1511923313.57.0.213398074469.issue32164@psf.upfronthosting.co.za> Message-ID: <1511923779.91.0.213398074469.issue32164@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +4543 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:50:23 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 02:50:23 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511923823.73.0.213398074469.issue32100@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset fd6f8c56b9a757210e8ceaea9edc50e502dc2085 by Terry Jan Reedy in branch 'master': bpo-32100: Delete unneeded import in idlelib.pathbrowser. (#4626) https://github.com/python/cpython/commit/fd6f8c56b9a757210e8ceaea9edc50e502dc2085 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:51:30 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 29 Nov 2017 02:51:30 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511923890.27.0.213398074469.issue32100@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4544 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:52:34 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 02:52:34 +0000 Subject: [issue30781] IDLE: configdialog -- switch to ttk widgets. In-Reply-To: <1498517235.92.0.120194527847.issue30781@psf.upfronthosting.co.za> Message-ID: <1511923954.45.0.213398074469.issue30781@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset e8f7c78a868834bb53fa0ac903fc87785112f49e by Terry Jan Reedy in branch 'master': bpo-30781: Remove unused imports in idlelib.configdialog. (#4627) https://github.com/python/cpython/commit/e8f7c78a868834bb53fa0ac903fc87785112f49e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:53:40 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 29 Nov 2017 02:53:40 +0000 Subject: [issue30781] IDLE: configdialog -- switch to ttk widgets. In-Reply-To: <1498517235.92.0.120194527847.issue30781@psf.upfronthosting.co.za> Message-ID: <1511924020.18.0.213398074469.issue30781@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4545 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:56:08 2017 From: report at bugs.python.org (Kenta Murata) Date: Wed, 29 Nov 2017 02:56:08 +0000 Subject: [issue32165] PyEval_InitThreads is called before Py_Initialize in LoadPython in Modules/_ctypes/callbacks.c Message-ID: <1511924168.1.0.213398074469.issue32165@psf.upfronthosting.co.za> New submission from Kenta Murata : As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called before Py_Initialize() function. But in Modules/_ctypes/callbacks.c, PyEval_InitThreds() is called before Py_Initialize() in LoadPython function. ---------- components: ctypes messages: 307202 nosy: mrkn priority: normal pull_requests: 4546 severity: normal status: open title: PyEval_InitThreads is called before Py_Initialize in LoadPython in Modules/_ctypes/callbacks.c versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:58:01 2017 From: report at bugs.python.org (Steve Dower) Date: Wed, 29 Nov 2017 02:58:01 +0000 Subject: [issue32122] Improve -x option documentation In-Reply-To: <1511504808.14.0.213398074469.issue32122@psf.upfronthosting.co.za> Message-ID: <1511924281.55.0.213398074469.issue32122@psf.upfronthosting.co.za> Steve Dower added the comment: Those examples look fine to me ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 22:15:09 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 03:15:09 +0000 Subject: [issue32100] IDLE: PathBrowser isn't working In-Reply-To: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> Message-ID: <1511925309.1.0.213398074469.issue32100@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 38ecf57306ef25874ef7c44a9875771e90faee97 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6': bpo-32100: Delete unneeded import in idlelib.pathbrowser. (GH-4626) (#4629) https://github.com/python/cpython/commit/38ecf57306ef25874ef7c44a9875771e90faee97 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 22:18:12 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 03:18:12 +0000 Subject: [issue32156] Fix flake8 warning F401: ... imported but unused In-Reply-To: <1511881636.03.0.213398074469.issue32156@psf.upfronthosting.co.za> Message-ID: <1511925492.24.0.213398074469.issue32156@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Idlelib deletions done. pathbrowser, #32100, PR-4626 configdialog, #30781, PR-4627 ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 22:43:49 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 03:43:49 +0000 Subject: [issue30780] IDLE: configdialog - add tests for ConfigDialog GUI. In-Reply-To: <1498516711.25.0.892352273971.issue30780@psf.upfronthosting.co.za> Message-ID: <1511927028.99.0.213398074469.issue30780@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Review of overview: PR-2706 and PR-2613 fixed one line in test_configdialog for this issue. PR-2046, #30617 and PR-3238, #30781 are merged cross-references. PR-3222 was closed in favor of PR-3220, #31287, merged. PR-3592 completes highlights and keys coverage and needs my review after getting lost in the flurry of PRs. Dependency #31414 has merged PRs. I should review, close, or indicate what is left to do. Other dependencies are closed and I believe this should be after handling above 2 items. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 22:46:38 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 03:46:38 +0000 Subject: [issue30781] IDLE: configdialog -- switch to ttk widgets. In-Reply-To: <1498517235.92.0.120194527847.issue30781@psf.upfronthosting.co.za> Message-ID: <1511927198.28.0.213398074469.issue30781@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset a8de696dddd4ec46cdadb12cf2d45ebf1473659c by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6': bpo-30781: Remove unused imports in idlelib.configdialog. (GH-4627) (#4630) https://github.com/python/cpython/commit/a8de696dddd4ec46cdadb12cf2d45ebf1473659c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 00:08:33 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 05:08:33 +0000 Subject: [issue32164] IDLE: delete tabbedpages.py In-Reply-To: <1511923313.57.0.213398074469.issue32164@psf.upfronthosting.co.za> Message-ID: <1511932113.11.0.213398074469.issue32164@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 041efd292ebff46060fc1680b0608b1d4c876a48 by Terry Jan Reedy in branch 'master': bpo-32164: Delete unused file idlelib/tabbedpages.py (#4628) https://github.com/python/cpython/commit/041efd292ebff46060fc1680b0608b1d4c876a48 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 00:09:36 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 29 Nov 2017 05:09:36 +0000 Subject: [issue32164] IDLE: delete tabbedpages.py In-Reply-To: <1511923313.57.0.213398074469.issue32164@psf.upfronthosting.co.za> Message-ID: <1511932176.57.0.213398074469.issue32164@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4547 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 00:54:48 2017 From: report at bugs.python.org (Evan Driscoll) Date: Wed, 29 Nov 2017 05:54:48 +0000 Subject: [issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse) In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za> Message-ID: <1511934888.07.0.213398074469.issue9334@psf.upfronthosting.co.za> Evan Driscoll added the comment: > I also think that nargs=## could maybe be special-cased to just ignore > the A/O designation completely and only check there are enough, but I > haven't tried this out. Does this seem like a viable approach? Would a > patch that does that, subject to some flag, be of interest? I can't leave well enough alone, so, with the following additional patch: - def _match_argument(self, action, arg_strings_pattern): + def _match_argument(self, action, arg_strings_pattern, arg_strings, start_index): + import numbers + nargs = action.nargs if action.nargs is not None else 1 + if isinstance(nargs, numbers.Number) and len(arg_strings_pattern) >= nargs: + return nargs + # match the pattern for this action to the arg strings nargs_pattern = self._get_nargs_pattern(action) match = _re.match(nargs_pattern, arg_strings_pattern) ... Then I get this: >>> import argparse >>> parser = argparse.ArgumentParser(prog='a2x') >>> parser.add_argument('--asciidoc-opts', ... action='store', dest='asciidoc_opts', default='', ... metavar='ASCIIDOC_OPTS', help='asciidoc options') >>> parser.parse_args(['--asciidoc-opts', '--safe']) Namespace(asciidoc_opts='--safe') Comments on this approach? (Again, I haven't run tests, it'd need to be controlled by a flag per your desire to not change existing behavior, etc.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 01:01:42 2017 From: report at bugs.python.org (Evan Driscoll) Date: Wed, 29 Nov 2017 06:01:42 +0000 Subject: [issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse) In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za> Message-ID: <1511935302.44.0.213398074469.issue9334@psf.upfronthosting.co.za> Evan Driscoll added the comment: One last comment for the time being. I actually think *both* changes are valuable. Fixing the bug, well, fixes the bug if you can set the appropriate flag. The improved error message still helps for existing code and new code that *doesn't* set the flag. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 01:07:25 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 06:07:25 +0000 Subject: [issue32164] IDLE: delete tabbedpages.py In-Reply-To: <1511923313.57.0.213398074469.issue32164@psf.upfronthosting.co.za> Message-ID: <1511935645.88.0.213398074469.issue32164@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 957aef7c41ccae8a60d3dbbe8863401bd270dc86 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6': bpo-32164: Delete unused file idlelib/tabbedpages.py (GH-4628) (#4631) https://github.com/python/cpython/commit/957aef7c41ccae8a60d3dbbe8863401bd270dc86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 01:08:03 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 06:08:03 +0000 Subject: [issue32164] IDLE: delete tabbedpages.py In-Reply-To: <1511923313.57.0.213398074469.issue32164@psf.upfronthosting.co.za> Message-ID: <1511935683.06.0.213398074469.issue32164@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 03:07:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 08:07:51 +0000 Subject: [issue32122] Improve -x option documentation In-Reply-To: <1511504808.14.0.213398074469.issue32122@psf.upfronthosting.co.za> Message-ID: <1511942871.09.0.213398074469.issue32122@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: AFAIK this should work in Windows XP. And maybe even in Windows 2000. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 03:24:07 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 29 Nov 2017 08:24:07 +0000 Subject: [issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse) In-Reply-To: <1279836939.11.0.811316280273.issue9334@psf.upfronthosting.co.za> Message-ID: <1511943847.81.0.213398074469.issue9334@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Steven, do you care to put this to rest? ---------- assignee: -> bethard nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 04:46:45 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 09:46:45 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines Message-ID: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> New submission from Andrew Svetlov : Dropped lines are never executed by supported Python versions. The code exists for sake of keeping the same code base for stdlib asyncio and third-party library with the same name. Since Python 3.4 asyncio is a part of stdlib, asyncio on PyPI is not supported/updated for 2.5 years. Removing is safe. The change keeps backward compatibility with old libraries written for `yield from` syntax, both awaiting old-styled coroutines and yielding from new styles async functions are supported. async def f(): ... yield from f() @asyncio.coroutine def g(): ... await g() Thus no regressions/deprecations, just removing non-public never executed implementation details. ---------- assignee: asvetlov components: Library (Lib), asyncio messages: 307214 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Drop python 3.4 code from asyncio.coroutines versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 04:50:22 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 09:50:22 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511949022.02.0.213398074469.issue32166@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +4548 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:17:12 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 10:17:12 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511950632.28.0.213398074469.issue32166@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I support getting rid of outdated code. But what is relation between asyncio in the stdlib and the version outside of the stdlib? Shouldn't the code support old Python versions for easier synchronization? I remember in the past this prevented modernizing it. The support of 3.4 is important, since this is a version shipped with Ubuntu 16.04 LTS. This will be a main version for enterprise at least yet a year. ---------- nosy: +giampaolo.rodola, gvanrossum, serhiy.storchaka, vstinner type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:18:48 2017 From: report at bugs.python.org (Du Phan) Date: Wed, 29 Nov 2017 10:18:48 +0000 Subject: [issue32167] "Improve" random.choice function for FiFa purpose Message-ID: <1511950728.05.0.213398074469.issue32167@psf.upfronthosting.co.za> Change by Du Phan : ---------- components: Build nosy: duphan priority: normal severity: normal status: open title: "Improve" random.choice function for FiFa purpose type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:20:20 2017 From: report at bugs.python.org (Du Phan) Date: Wed, 29 Nov 2017 10:20:20 +0000 Subject: [issue32167] Improve random.choice function for FiFa purpose Message-ID: <1511950820.11.0.213398074469.issue32167@psf.upfronthosting.co.za> Change by Du Phan : ---------- title: "Improve" random.choice function for FiFa purpose -> Improve random.choice function for FiFa purpose _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:25:43 2017 From: report at bugs.python.org (Du Phan) Date: Wed, 29 Nov 2017 10:25:43 +0000 Subject: [issue32167] Improve random.choice function for FiFa purpose Message-ID: <1511951143.89.0.213398074469.issue32167@psf.upfronthosting.co.za> Change by Du Phan : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:28:47 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 10:28:47 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511951327.23.0.213398074469.issue32166@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If it is good to drop 3.4 support in the stdlib asyncio, then there is other outdated code. There is a 3.3 specific workaround in unix_events.py. There is a 3.4 code or comments in futures.py, sslproto.py, unix_events.py. Maybe comments are related to optional code which can now be used unconditionally. Note that not all 3.4 code is marked with "Python 3.4". It can be marked with "Python < 3.5". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:36:50 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 29 Nov 2017 10:36:50 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511951810.75.0.213398074469.issue32139@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d by xdegaye in branch 'master': bpo-32139: test_strftime does not anymore modify the locale (GH-4569) https://github.com/python/cpython/commit/cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:38:02 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 29 Nov 2017 10:38:02 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511951882.36.0.213398074469.issue32139@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:43:25 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 29 Nov 2017 10:43:25 +0000 Subject: [issue32138] android: test_faulthandler fails also on API 24 In-Reply-To: <1511690339.03.0.213398074469.issue32138@psf.upfronthosting.co.za> Message-ID: <1511952205.87.0.213398074469.issue32138@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset ef83806f5ec01f34f6cbf4ebb5752875b5961f7e by xdegaye in branch 'master': bpo-32138: Skip on Android test_faulthandler tests that raise SIGSEGV (GH-4604) https://github.com/python/cpython/commit/ef83806f5ec01f34f6cbf4ebb5752875b5961f7e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:45:17 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 29 Nov 2017 10:45:17 +0000 Subject: [issue32138] android: test_faulthandler fails also on API 24 In-Reply-To: <1511690339.03.0.213398074469.issue32138@psf.upfronthosting.co.za> Message-ID: <1511952317.17.0.213398074469.issue32138@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 06:15:04 2017 From: report at bugs.python.org (=?utf-8?q?Ertu=C4=9Frul_Karademir?=) Date: Wed, 29 Nov 2017 11:15:04 +0000 Subject: [issue32168] Mutable instance variables don't get new references with args. Message-ID: <1511954104.7.0.213398074469.issue32168@psf.upfronthosting.co.za> New submission from Ertu?rul Karademir : Hello, I've searched all over Google and this bug tracker with all combinations of keywords that I can associate with this issue, but I couldn't find an explanation that makes sense or fits the issue. I know that when dealing with mutable variables, class variables share the same reference with all instances, so to assign separate attributes for instances, mutable variables should be instance level variables. However when I create a class like the following, class Base: def __init__(self, props=list(), foo='foo base'): self.props = props self.foo = foo def insert_prop(self, i): self.props.append(i) and run this: if __name__ == '__main__': base = Base() base.insert_prop(1) base.insert_prop(2) print('base props before base2, 3 creation:', base.props) base2 = Base() base3 = Base([41, 42]) print('base props after base2, 3 creation:', base.props) print('base2 props after base2, 3 creation:', base2.props) print('base3 props after base2, 3 creation:', base3.props) base2.insert_prop(51) base3.insert_prop(61) print('base props after insertion:', base.props) print('base2 props after insertion:', base2.props) print('base3 props after insertion:', base3.props) the output is this: base props before base2, 3 creation: [1, 2] base props after base2, 3 creation: [1, 2] base2 props after base2, 3 creation: [1, 2] base3 props after base2, 3 creation: [41, 42] base props after insertion: [1, 2, 51] base2 props after insertion: [1, 2, 51] base3 props after insertion: [41, 42, 61] So initiating base3 with explicit args gives it a new reference to the props variable but base and base2 share the same reference. So suddenly props is hoisted to class level. I actually encountered this behaviour when trying to do the same thing with child classes with no __init__ method like: class Sub1(Base): pass The whole code is attached. Is this an expected behaviour? If so I couldn't find a gotcha anywhere. Regards, Ertugrul ---------- components: Interpreter Core files: bug.py messages: 307219 nosy: ekarademir priority: normal severity: normal status: open title: Mutable instance variables don't get new references with args. type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47303/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 06:28:00 2017 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 29 Nov 2017 11:28:00 +0000 Subject: [issue32168] Mutable instance variables don't get new references with args. In-Reply-To: <1511954104.7.0.213398074469.issue32168@psf.upfronthosting.co.za> Message-ID: <1511954880.62.0.213398074469.issue32168@psf.upfronthosting.co.za> Eric V. Smith added the comment: This is defined behavior. Try searching for "mutable default parameter". For example, here's an old post on it: http://www.effbot.org/zone/default-values.htm This isn't related to class vs. instance attributes, but rather the default parameter 'props' being modified. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 06:32:25 2017 From: report at bugs.python.org (=?utf-8?q?Ertu=C4=9Frul_Karademir?=) Date: Wed, 29 Nov 2017 11:32:25 +0000 Subject: [issue32168] Mutable instance variables don't get new references with args. In-Reply-To: <1511954880.62.0.213398074469.issue32168@psf.upfronthosting.co.za> Message-ID: Ertu?rul Karademir added the comment: Thank you Ertu?rul Karademir On Wed, Nov 29, 2017 at 11:28 AM, Eric V. Smith wrote: > > Eric V. Smith added the comment: > > This is defined behavior. Try searching for "mutable default parameter". > For example, here's an old post on it: > > http://www.effbot.org/zone/default-values.htm > > This isn't related to class vs. instance attributes, but rather the > default parameter 'props' being modified. > > ---------- > nosy: +eric.smith > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 06:33:40 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 11:33:40 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511955220.71.0.213398074469.issue32166@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Separate PyPI package is for Python 3.3 only. Python 3.4 is shipped with asyncio in standard batteries. https://github.com/python/asyncio development is stopped, no new PyPI release is expected. Thank you for pointing on 3.4 specific code in other files. Victor Stinner did some cleanup in last weeks, I've picked up his initiative. Will review other files as well. Please let me create a new issue to keep changes small and modular. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:03:48 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:03:48 +0000 Subject: [issue32169] Drop python 3.4 code from asyncio.unix_events Message-ID: <1511957028.4.0.213398074469.issue32169@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- assignee: asvetlov components: Library (Lib), asyncio nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Drop python 3.4 code from asyncio.unix_events versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:05:07 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:05:07 +0000 Subject: [issue32169] Drop python 3.4-3.5 code from asyncio.unix_events Message-ID: <1511957107.12.0.213398074469.issue32169@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- title: Drop python 3.4 code from asyncio.unix_events -> Drop python 3.4-3.5 code from asyncio.unix_events _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:10:10 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:10:10 +0000 Subject: [issue32169] Drop python 3.4-3.5 code from asyncio.unix_events Message-ID: <1511957410.16.0.213398074469.issue32169@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- keywords: +patch pull_requests: +4549 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:24:41 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:24:41 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511958281.16.0.213398074469.issue32166@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:35:31 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 12:35:31 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511958931.05.0.213398074469.issue32166@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I would prefer to do all trivial changes with one commit. There may be also non-trivial changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:52:09 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:52:09 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511959929.4.0.213398074469.issue32166@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Ok, will do everything in single PR ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:55:03 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:55:03 +0000 Subject: [issue32169] Drop python 3.4-3.5 code from asyncio.unix_events Message-ID: <1511960103.48.0.213398074469.issue32169@psf.upfronthosting.co.za> New submission from Andrew Svetlov : The work will be done in https://bugs.python.org/issue32166 ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Drop python 3.4 code from asyncio.coroutines _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:57:42 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:57:42 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511960262.68.0.213398074469.issue32166@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Ok, will do everything in single PR ---------- title: Drop python 3.4 code from asyncio.coroutines -> Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:58:29 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:58:29 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511960309.62.0.213398074469.issue32166@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- Removed message: https://bugs.python.org/msg307226 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:59:29 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:59:29 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511960369.32.0.213398074469.issue32166@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Fixed unix_events.py but see no legacy code in futures.py and sslproto.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 08:28:41 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 29 Nov 2017 13:28:41 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511962121.2.0.213398074469.issue32159@psf.upfronthosting.co.za> R. David Murray added the comment: I think Serhiy's point is that it doesn't matter whether or not it is used by a tool, it is useful for humans. I don't know if it is used by the tracker; Ezio worked on that code, I think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 09:31:28 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 14:31:28 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511965888.63.0.213398074469.issue32139@psf.upfronthosting.co.za> STINNER Victor added the comment: Python 3.6 and 2.7 are also affected and should be fixed. I requested automated backports. ---------- nosy: +vstinner resolution: fixed -> status: closed -> open versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 09:31:54 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 29 Nov 2017 14:31:54 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511965914.61.0.213398074469.issue32139@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4550 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 09:32:54 2017 From: report at bugs.python.org (Roundup Robot) Date: Wed, 29 Nov 2017 14:32:54 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511965974.3.0.213398074469.issue32139@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4551 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 09:46:19 2017 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 29 Nov 2017 14:46:19 +0000 Subject: [issue31900] localeconv() should decode numeric fields from LC_NUMERIC encoding, not from LC_CTYPE encoding In-Reply-To: <1509370865.74.0.213398074469.issue31900@psf.upfronthosting.co.za> Message-ID: <1511966779.89.0.213398074469.issue31900@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: Pinging here. Is there some way I can help to move the issue forward? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 09:47:00 2017 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 29 Nov 2017 14:47:00 +0000 Subject: [issue1294959] Problems with /usr/lib64 builds. Message-ID: <1511966820.83.0.213398074469.issue1294959@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: Pinging here. Is there some way to push the issue forward? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 10:18:24 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 29 Nov 2017 15:18:24 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511968704.53.0.213398074469.issue32139@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset b0df786258c99f98295b82ec62daea1f49912c33 by xdegaye (Miss Islington (bot)) in branch '3.6': bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4635) https://github.com/python/cpython/commit/b0df786258c99f98295b82ec62daea1f49912c33 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 10:18:30 2017 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 29 Nov 2017 15:18:30 +0000 Subject: [issue32151] -mvenv vs minor python version updates In-Reply-To: <1511804779.33.0.213398074469.issue32151@psf.upfronthosting.co.za> Message-ID: <1511968710.08.0.213398074469.issue32151@psf.upfronthosting.co.za> Ronald Oussoren added the comment: This is the expected behavior, the upgrade from 3.5 to 3.6 is a feature update that is (in general) not expected to be binary compatible with the previous release. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 10:29:56 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 29 Nov 2017 15:29:56 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511969396.32.0.213398074469.issue32139@psf.upfronthosting.co.za> Xavier de Gaye added the comment: New changeset bc19cf57a8f061bbb1961aa069ed54e8361023ae by xdegaye (Miss Islington (bot)) in branch '2.7': bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4636) https://github.com/python/cpython/commit/bc19cf57a8f061bbb1961aa069ed54e8361023ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 10:31:36 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 29 Nov 2017 15:31:36 +0000 Subject: [issue32139] android: locale is modified by test_strftime In-Reply-To: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> Message-ID: <1511969496.26.0.213398074469.issue32139@psf.upfronthosting.co.za> Xavier de Gaye added the comment: Closing now. Thanks Victor :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 10:34:42 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 29 Nov 2017 15:34:42 +0000 Subject: [issue32107] Improve MAC address calculation and fix test_uuid.py In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511969682.62.0.213398074469.issue32107@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: New changeset 56e444f8df34cd502d6e3b110c90aed086883a72 by Barry Warsaw in branch '2.7': [2.7] bpo-32107 - Backport bitmask check fix (GH-4576) (#4590) https://github.com/python/cpython/commit/56e444f8df34cd502d6e3b110c90aed086883a72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 10:35:04 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 29 Nov 2017 15:35:04 +0000 Subject: [issue32107] Improve MAC address calculation and fix test_uuid.py In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511969704.51.0.213398074469.issue32107@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: New changeset 23cc8c0f9ece32f1f96133b9db2cb30c64f23a0e by Barry Warsaw in branch '3.6': [3.6] bpo-32107 - Backport bitmask check fix (GH-4576) (#4591) https://github.com/python/cpython/commit/23cc8c0f9ece32f1f96133b9db2cb30c64f23a0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 10:43:06 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 29 Nov 2017 15:43:06 +0000 Subject: [issue32107] Improve MAC address calculation and fix test_uuid.py In-Reply-To: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> Message-ID: <1511970186.12.0.213398074469.issue32107@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 11:05:39 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 16:05:39 +0000 Subject: [issue30657] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511971539.92.0.213398074469.issue30657@psf.upfronthosting.co.za> STINNER Victor added the comment: Leo kirotawa silva: "I re-did the build here for python3.4 and couldn't reach the same test fail. So I'm assuming it was a false alarm." Python 3.4 and 3.5 seem to be also vulnerable: --- PyObject *PyBytes_DecodeEscape(const char *s, Py_ssize_t len, const char *errors, Py_ssize_t unicode, const char *recode_encoding) { ... Py_ssize_t newlen = recode_encoding ? 4*len:len; v = PyBytes_FromStringAndSize((char *)NULL, newlen); --- I don't think that Python 3.6 and 3.7 are vulnerable, the code was rewritten with the _PyBytesWriter API. The code got a new _PyBytes_DecodeEscapeRecode() helper function which calls _PyBytesWriter_WriteBytes(), and this function detects properly integer overflows. ---------- nosy: +vstinner resolution: fixed -> status: closed -> open title: Unsafe arithmetic in PyString_DecodeEscape -> CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape versions: +Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 11:19:18 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 16:19:18 +0000 Subject: [issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511972358.07.0.213398074469.issue30657@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- title: CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape -> [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 11:20:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 16:20:41 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511972441.08.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 5d39e0429029324cae90bba2f19fb689b007c7d6 by Victor Stinner in branch 'master': bpo-32030: Rework memory allocators (#4625) https://github.com/python/cpython/commit/5d39e0429029324cae90bba2f19fb689b007c7d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 11:21:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 16:21:23 +0000 Subject: [issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511972482.99.0.213398074469.issue30657@psf.upfronthosting.co.za> STINNER Victor added the comment: I added this vulnerability to the python-security website: http://python-security.readthedocs.io/vuln/cve-2017-1000158_pystring_decodeescape_integer_overflow.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 11:23:45 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 16:23:45 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1511972625.47.0.213398074469.issue32166@psf.upfronthosting.co.za> Andrew Svetlov added the comment: New changeset cc83920ad267c992bc421987829da04d88ae816b by Andrew Svetlov in branch 'master': bpo-32166: Drop Python 3.4 code from asyncio (#4612) https://github.com/python/cpython/commit/cc83920ad267c992bc421987829da04d88ae816b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 11:30:13 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 16:30:13 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511973013.39.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4552 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 11:51:28 2017 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 29 Nov 2017 16:51:28 +0000 Subject: [issue32163] getattr() returns None even when default is given In-Reply-To: <1511921908.2.0.213398074469.issue32163@psf.upfronthosting.co.za> Message-ID: <1511974288.21.0.213398074469.issue32163@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 11:59:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 16:59:17 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511974757.95.0.213398074469.issue32159@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4553 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:00:15 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 17:00:15 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511974815.41.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: When I wrote PR 4615, I misunderstood the usage of Misc/svnmap.txt. I understood that it was used by removed files. I wrote PR 4639 to revert the file and clarify its usage in Misc/README. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:03:20 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 17:03:20 +0000 Subject: [issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511975000.37.0.213398074469.issue30657@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't think it is worth to add this vulnerability to the python-security website. You need to compile a 1 GiB Python file on 32-bit system for reproducing it. It is very unlikely that this can happen by accident, and it is hard to used it in security attack. If you can make the attacked program compiling a 1 GiB Python file, you perhaps have easier ways to make a harm. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:08:04 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 17:08:04 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511975284.5.0.213398074469.issue32159@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Wouldn't this add two 4 MiB patched in the git repository? Wouldn't this break the history of this file? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:09:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 17:09:27 +0000 Subject: [issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511975367.47.0.213398074469.issue30657@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: "I don't think it is worth to add this vulnerability to the python-security website. You need to compile a 1 GiB Python file on 32-bit system for reproducing it. It is very unlikely that this can happen by accident, and it is hard to used it in security attack. If you can make the attacked program compiling a 1 GiB Python file, you perhaps have easier ways to make a harm." I'm trying to keep track of all CVEs. People are scared by CVE numbers :-( But it seems like any bug can get a CVE number, without any real evalution of the severity of the bug. I completed the description on python-security with your paragraph. FYI I wrote python-security to make sure that vulnerabilities are fixed in supported Python branches. Here it seems like we forgot to fix Python 3.4 and 3.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:11:48 2017 From: report at bugs.python.org (Larry Hastings) Date: Wed, 29 Nov 2017 17:11:48 +0000 Subject: [issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape In-Reply-To: <1497368129.36.0.20181989843.issue30657@psf.upfronthosting.co.za> Message-ID: <1511975508.9.0.213398074469.issue30657@psf.upfronthosting.co.za> Larry Hastings added the comment: Resetting to "needs patch", because we still need PRs for 3.4 and 3.5 (please!). ---------- stage: resolved -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:23:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 17:23:29 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511976209.21.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: Serhiy: "Wouldn't this add two 4 MiB patched in the git repository? Wouldn't this break the history of this file?" No idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:41:51 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 17:41:51 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511977311.78.0.213398074469.issue32159@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: How have you created PR 4639? What git commands were used? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:51:04 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 17:51:04 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511977864.76.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: > How have you created PR 4639? What git commands were used? "git revert fe2d5babba5d26de2093b6518316b268488187be", then I modified the commit to only revert svnmap (git commit --amend). Git internal storage is fully based on sha1. Identical objects should be merged naturally. My PR 4639 is made of a single commit: 58f0b38b4058bfaa45a9896aca2b07f02b2de486. You can inspect it using: $ git ls-tree 58f0b38b4058bfaa45a9896aca2b07f02b2de486 Misc/svnmap.txt 100644 blob 142be7fc206e9d06d5cf62f6500ef987c0441087 Misc/svnmap.txt Compare it with the svnmap.txt *before* my revert: $ git ls-tree fe2d5babba5d26de2093b6518316b268488187be^ Misc/svnmap.txt 100644 blob 142be7fc206e9d06d5cf62f6500ef987c0441087 Misc/svnmap.txt => *same* blob object (blob sha1: 142be7fc206e9d06d5cf62f6500ef987c0441087) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 12:58:36 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 17:58:36 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511978316.16.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 859f7ce7a49f8bd6309748c05e460c10f6a433ed by Victor Stinner in branch 'master': bpo-32159: Revert Misc/svnmap.txt (#4639) https://github.com/python/cpython/commit/859f7ce7a49f8bd6309748c05e460c10f6a433ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 13:00:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 18:00:02 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511978402.82.0.213398074469.issue32159@psf.upfronthosting.co.za> STINNER Victor added the comment: I reverted Misc/svnmap.txt. I understood that the removal of the two tools in Tools is now ok, and so I close the issue. If I misunderstood, please speak up and/or reopen the issue ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 13:18:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 18:18:21 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511979501.3.0.213398074469.issue32159@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks Victor! I'll open a topic on Python-Dev about file removals. ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 13:24:28 2017 From: report at bugs.python.org (Brett Cannon) Date: Wed, 29 Nov 2017 18:24:28 +0000 Subject: [issue27172] Undeprecate inspect.getfullargspec() In-Reply-To: <1464767888.9.0.788649321892.issue27172@psf.upfronthosting.co.za> Message-ID: <1511979868.54.0.213398074469.issue27172@psf.upfronthosting.co.za> Brett Cannon added the comment: Nick pointed me at this issue for the undeprecation of inspect.getfullargspec(). While I'm fine with the un-deprecation for compatibility reasons, I would rather the function not last beyond Python 3 un-deprecated. Nick says, though that: """ ... the undeprecation isn't a Python 2/3 issue, it's a "tuples, lists and dicts are really handy representations of things, and Python developers often prefer them to more structured objects" issue. The modern inspect.getfullargspec implementation is a relatively thin wrapper around inspect.signature, and the only lossy part of the output transformation is that you can't tell the difference between positional-only and positional-or-keyword parameters. """ My argument is TOOWDI and as of right now there's 3 for getting parameter information for functions (of which only one is currently deprecated). I would also argue that if people want a "signature to core data structure" translation then that can be covered by a package on PyPI since even now getfullargspec() is lossy and we don't need that kind of pragmatic support in the stdlib for this. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 13:33:15 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 29 Nov 2017 18:33:15 +0000 Subject: [issue32159] Remove tools for CVS and Subversion In-Reply-To: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> Message-ID: <1511980395.31.0.213398074469.issue32159@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 13:50:44 2017 From: report at bugs.python.org (Larry Hastings) Date: Wed, 29 Nov 2017 18:50:44 +0000 Subject: [issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer) In-Reply-To: <1502340505.45.0.797067466934.issue31170@psf.upfronthosting.co.za> Message-ID: <1511981444.9.0.213398074469.issue31170@psf.upfronthosting.co.za> Larry Hastings added the comment: New changeset 8b11e8de7aedacfbbcc8c780f3c4097396f1d1a3 by larryhastings (Victor Stinner) in branch '3.4': [3.4] bpo-31170: Fix inclusion of expat in Windows build projects (#3785) https://github.com/python/cpython/commit/8b11e8de7aedacfbbcc8c780f3c4097396f1d1a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 14:51:55 2017 From: report at bugs.python.org (Malcolm Smith) Date: Wed, 29 Nov 2017 19:51:55 +0000 Subject: [issue32170] Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata Message-ID: <1511985115.6.0.213398074469.issue32170@psf.upfronthosting.co.za> New submission from Malcolm Smith : The documentation explicitly says "file information is extracted as accurately as possible". But the `zipfile` module doesn't actually extract any metadata at all. I assume this text was copied and pasted from the `tarfile` module, which does implement this. Fixing the code is preferred to fixing the documentation. ---------- components: Library (Lib) messages: 307255 nosy: Malcolm Smith priority: normal severity: normal status: open title: Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata type: behavior versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 16:29:52 2017 From: report at bugs.python.org (Pierre Denis) Date: Wed, 29 Nov 2017 21:29:52 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity Message-ID: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> New submission from Pierre Denis : Python returns inconsistent results when negative infinity is raised to a non-integer power. This happens with the ** operator as well as with the pow and math.pow functions. The most blatant symptom occurs with power 0.5, which is expectedly equivalent to a square root: >>> float('-inf') ** 0.5 inf >>> pow(float('-inf'), 0.5) inf >>> import math >>> math.pow(float('-inf'), 0.5) inf Mathematically, these operations are invalid if we restrict to real numbers. Also, if we extend to complex numbers, the results are wrong since the result should be infj, which is the value returned by cmath.sqrt(float('-inf')). IMHO, there are three possible ways to fix this: 1) raise an exception ValueError 2) return nan 3) return (nan + nanj) Discussion: - Solution 1) is consistent with current handling of *finite* negative base with non-integer exponent; also, it is consistent with math.sqrt(float('-inf')), which raises ValueError. - I expected solution 2) to be more in line with IEEE754 ? until I read the following statement in this specification: "pow(x, y) signals the invalid operation exception for finite x<0 and finite non-integer y". I?m not an expert of this topic but I think that there is miss here since IEEE754 does not state what happens for *infinite* x<0 and finite non-integer y. - Solution 3) emphasizes the fact that, although the result is generally undefined, it belongs to complex type. - In any case, the solution should be consistent also with the case with negative fractional exponent? even if I would tend to accept that (float('-inf')**-0.5) == 0.0 is mathematically sensible! - The test assertions shall be updated in Python standard test suite (test_float.py). Note that Python 2.6 behaves consistently for all negative bases, finite or not finite: it raises ValueError exception with the message "negative number cannot be raised to a fractional power". The behavior described here seems to be introduced in this commit: https://github.com/python/cpython/commit/9ab44b509a935011beb8e9108a2271ee728e8ad4#diff-b7e3652f51768cec742ef07326413ad0 ---------- messages: 307256 nosy: pdenis priority: normal severity: normal status: open title: Inconsistent results for fractional power of -infinity type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 16:31:52 2017 From: report at bugs.python.org (Ned Deily) Date: Wed, 29 Nov 2017 21:31:52 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1511991112.4.0.213398074469.issue32171@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 16:44:55 2017 From: report at bugs.python.org (David Cuthbert) Date: Wed, 29 Nov 2017 21:44:55 +0000 Subject: [issue32117] Tuple unpacking in return and yield statements In-Reply-To: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> Message-ID: <1511991895.72.0.213398074469.issue32117@psf.upfronthosting.co.za> David Cuthbert added the comment: CLA processed, and BDFL has assented on python-dev. Serhiy, thoughts on next steps? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 16:45:32 2017 From: report at bugs.python.org (Tim Peters) Date: Wed, 29 Nov 2017 21:45:32 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1511991932.07.0.213398074469.issue32171@psf.upfronthosting.co.za> Tim Peters added the comment: As a comment in the referenced patch says, the intent of the patch was to make behavior match the C99 spec. Among other things, C99's annex F (section F.9.4.4 "The pow functions") says: """ ? pow(??, y) returns ?0 for y an odd integer < 0. ? pow(??, y) returns +0 for y < 0 and not an odd integer. ? pow(??, y) returns ?? for y an odd integer > 0. ? pow(??, y) returns +? for y > 0 and not an odd integer. """ So the case you show is doing what the standard specifies, under the last of those (y=0.5, which is > 0 and not an odd integer). ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 16:54:05 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 29 Nov 2017 21:54:05 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1511992445.73.0.213398074469.issue32171@psf.upfronthosting.co.za> Mark Dickinson added the comment: We follow C99 for this case, which says (C99 F 9.4.4): > pow(??, y) returns +? for y > 0 and not an odd integer. Oddly, this clause seems to be missing from section 9.2.1 of IEEE 754. Nevertheless, I believe it's the right thing to do. IEEE 754 _does_ say: > pow (x, y) signals the invalid operation exception for finite x < 0 and finite non-integer y. The omission of -inf here is notable, and suggests that it's _not_ intended that the pow(-inf, 0.5) case should be considered invalid. ---------- nosy: -tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 16:59:31 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 29 Nov 2017 21:59:31 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1511992771.27.0.213398074469.issue32171@psf.upfronthosting.co.za> Mark Dickinson added the comment: See also this posting [1], where the omission is discussed, and Vincent Lefevre suggests that the behaviour should be: > pow (?inf, y) is +inf with no exception for finite y > 0 and not an odd integer [1] http://grouper.ieee.org/groups/754/email/msg03969.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 17:03:03 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 29 Nov 2017 22:03:03 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1511992983.71.0.213398074469.issue32171@psf.upfronthosting.co.za> Mark Dickinson added the comment: Having read through the rest of that grouper.ieee.org, thread, there doesn't seem to be any disagreement with what Vincent suggests. So I believe that Python's behaviour is consistent with (a) C99, (b) MPFR, and (c) the spirit of IEEE 754. Closing here. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 17:04:01 2017 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 29 Nov 2017 22:04:01 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1511993041.66.0.213398074469.issue32171@psf.upfronthosting.co.za> Mark Dickinson added the comment: Sorry, Tim. It looks as though I un-nosied you (de-nosied you?) accidentally. Not sure how that happened. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 17:05:36 2017 From: report at bugs.python.org (Tim Peters) Date: Wed, 29 Nov 2017 22:05:36 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1511993136.56.0.213398074469.issue32171@psf.upfronthosting.co.za> Tim Peters added the comment: No worries, Mark :-) Odd things happen sometimes when people are editing near the same time. BTW, of course I agree with closing this! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 17:07:21 2017 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Wed, 29 Nov 2017 22:07:21 +0000 Subject: [issue32117] Tuple unpacking in return and yield statements In-Reply-To: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> Message-ID: <1511993241.13.0.213398074469.issue32117@psf.upfronthosting.co.za> Henk-Jaap Wagenaar added the comment: I think the language spec needs updating as well? In particular in https://docs.python.org/3/reference/simple_stmts.html#the-return-statement it seems expression_list should be replaced by starred_list. ---------- nosy: +Henk-Jaap Wagenaar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 17:15:51 2017 From: report at bugs.python.org (Pierre Denis) Date: Wed, 29 Nov 2017 22:15:51 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1511993751.76.0.213398074469.issue32171@psf.upfronthosting.co.za> Pierre Denis added the comment: Thanks, Tim & Mark. This indeed clarifies and gives a good rationale on Python implementation. Nevertheless, despite the authority arguments, I continue to wonder what is the rationale for these specifications. Probably the debate should move to the standards C99 and IEEE754 themselves. Agreed to close the ticket on Python... waiting a change to the standards! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 17:20:32 2017 From: report at bugs.python.org (David Cuthbert) Date: Wed, 29 Nov 2017 22:20:32 +0000 Subject: [issue32117] Tuple unpacking in return and yield statements In-Reply-To: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> Message-ID: <1511994032.16.0.213398074469.issue32117@psf.upfronthosting.co.za> David Cuthbert added the comment: Hm... that leaves the only production for expression_list as: subscription ::= primary "[" expression_list "]" And I'm not sure that this shouldn't also be replaced by starred_list. It's not accepted today, though: In [6]: a[1,*(4, 5, 6)] File "", line 1 a[1,*(4, 5, 6)] ^ SyntaxError: invalid syntax I will ask about this again on python-dev@ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 17:30:57 2017 From: report at bugs.python.org (David Cuthbert) Date: Wed, 29 Nov 2017 22:30:57 +0000 Subject: [issue32117] Tuple unpacking in return and yield statements In-Reply-To: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> Message-ID: <1511994657.18.0.213398074469.issue32117@psf.upfronthosting.co.za> David Cuthbert added the comment: Oops, I wasn't looking broadly enough. This is also used in the augmented assignment statements syntax, e.g. a += 1, 2, 3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 17:51:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 22:51:43 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1511995903.46.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a by Victor Stinner in branch '3.6': bpo-32030: Fix test_sys.test_getallocatedblocks() (#4637) https://github.com/python/cpython/commit/06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 18:00:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 23:00:37 +0000 Subject: [issue30923] Add -Wimplicit-fallthrough=0 to Makefile ? In-Reply-To: <1499963760.78.0.849180274669.issue30923@psf.upfronthosting.co.za> Message-ID: <1511996437.86.0.213398074469.issue30923@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset dedcbee04cd52790027ecfb46cb3aa33efebdc84 by Victor Stinner in branch '3.6': [3.6] bpo-30923, bpo-31279: Fix GCC warnings (#4620) https://github.com/python/cpython/commit/dedcbee04cd52790027ecfb46cb3aa33efebdc84 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 18:00:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 23:00:38 +0000 Subject: [issue31279] Squash new gcc warning (-Wstringop-overflow) In-Reply-To: <1503682737.47.0.43054197609.issue31279@psf.upfronthosting.co.za> Message-ID: <1511996438.02.0.912454111764.issue31279@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset dedcbee04cd52790027ecfb46cb3aa33efebdc84 by Victor Stinner in branch '3.6': [3.6] bpo-30923, bpo-31279: Fix GCC warnings (#4620) https://github.com/python/cpython/commit/dedcbee04cd52790027ecfb46cb3aa33efebdc84 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 18:00:53 2017 From: report at bugs.python.org (bugale bugale) Date: Wed, 29 Nov 2017 23:00:53 +0000 Subject: [issue32172] Add length counter for iterables Message-ID: <1511996453.35.0.213398074469.issue32172@psf.upfronthosting.co.za> New submission from bugale bugale : I have noticed that there is no convenient way in python to get the number of items in a generator. For example: my_iterable = iter(range(1000)) len(my_iterable) # Would not work Of course, something like this would ruin the generator, and it will no longer be usable, but in some use cases one would like to know only the count of something. It is possible to do it today using this line: sum(1 for x in my_iterable) but it seems odd to me that there is no function like: itertools.count_iterable(my_iterable) that does exactly this ---------- components: Demos and Tools messages: 307271 nosy: bugale bugale priority: normal severity: normal status: open title: Add length counter for iterables type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 18:05:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 23:05:09 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511996709.07.0.213398074469.issue32121@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 706e10b186992e086e661a62d2c8ec9588525b31 by Victor Stinner (Jesse-Bakker) in branch 'master': bpo-32121: Add most_recent_first parameter to tracemalloc.Traceback.format (#4534) https://github.com/python/cpython/commit/706e10b186992e086e661a62d2c8ec9588525b31 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 18:05:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 29 Nov 2017 23:05:52 +0000 Subject: [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback In-Reply-To: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> Message-ID: <1511996752.62.0.213398074469.issue32121@psf.upfronthosting.co.za> STINNER Victor added the comment: Jesse Bakker implemented all requested changes, I merged his PR. Well done, Jesse! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 18:11:36 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 29 Nov 2017 23:11:36 +0000 Subject: [issue32172] Add length counter for iterables In-Reply-To: <1511996453.35.0.213398074469.issue32172@psf.upfronthosting.co.za> Message-ID: <1511997096.32.0.213398074469.issue32172@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Not every trivial one-liner needs to be in the standard library. In this case, there are two easy (and obvious) ways to do it: sum(1 for x in iterator) len(list(iterator)) (The first probably saves memory; the second probably is faster.) Given how rare it is to care ONLY about the length of an iterator, I see no reason why this needs to be in the std lib. If you disagree, please take it to the Python-Ideas mailing list to get community support first before re-opening this ticket. ---------- nosy: +steven.daprano resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 19:02:51 2017 From: report at bugs.python.org (Malcolm Smith) Date: Thu, 30 Nov 2017 00:02:51 +0000 Subject: [issue32170] Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata In-Reply-To: <1511985115.6.0.213398074469.issue32170@psf.upfronthosting.co.za> Message-ID: <1512000171.98.0.213398074469.issue32170@psf.upfronthosting.co.za> Malcolm Smith added the comment: Related: Issue15795 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 21:57:02 2017 From: report at bugs.python.org (GanZiQim) Date: Thu, 30 Nov 2017 02:57:02 +0000 Subject: [issue32173] linecache.py add lazycache to __all__ and use dict.clear to clear the cache Message-ID: <1512010622.75.0.213398074469.issue32173@psf.upfronthosting.co.za> Change by GanZiQim : ---------- components: Library (Lib) nosy: ganziqim priority: normal pull_requests: 4554 severity: normal status: open title: linecache.py add lazycache to __all__ and use dict.clear to clear the cache type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 22:12:26 2017 From: report at bugs.python.org (GanZiQim) Date: Thu, 30 Nov 2017 03:12:26 +0000 Subject: [issue32173] linecache.py add lazycache to __all__ and use dict.clear to clear the cache Message-ID: <1512011546.49.0.213398074469.issue32173@psf.upfronthosting.co.za> Change by GanZiQim : ---------- keywords: +patch pull_requests: +4555 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 22:16:15 2017 From: report at bugs.python.org (Abhilash Raj) Date: Thu, 30 Nov 2017 03:16:15 +0000 Subject: [issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value In-Reply-To: <1511740988.25.0.213398074469.issue32144@psf.upfronthosting.co.za> Message-ID: <1512011775.41.0.213398074469.issue32144@psf.upfronthosting.co.za> Abhilash Raj added the comment: Well, I myself missed the "serialization" part, so it probably was my mistake. Maybe a :note: saying line endings are only added in serialized outputs like the one obtained from `as_string()` or `as_bytes()` but not for other methods that return the body like `get_content()` or `get_payload()` might be helpful. I stumbled upon it while porting some code from Python 2 to Python 3 and decided to use the new API. But, given the behavior of Python 2's get_content(decode=True), I would say it might just be clearer if docs mentioned this change in behavior (even though the new one is the "correct" one). I can send in a pull request with modifications if you'd like. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 22:45:30 2017 From: report at bugs.python.org (zaazbb) Date: Thu, 30 Nov 2017 03:45:30 +0000 Subject: [issue32174] nonASCII punctuation characters can not display in python363.chm. Message-ID: <1512013530.29.0.213398074469.issue32174@psf.upfronthosting.co.za> New submission from zaazbb : In chm(python363.chm) documents, some unicode chars (non ascii chars) can not display. for example: asyncio ? Asynchronous I/O, event loop, coroutines and tasks displayed as asyncio ? Asynchronous I/O, event loop, coroutines and tasks and Asynchronous programming is more complex than classical ?sequential? programming display as Asynchronous programming is more complex than classical ?equential? programming windows 10, simplified chinese language. python3.6.3, python363.chm. ---------- components: Windows files: 1512013191(1).jpg messages: 307277 nosy: paul.moore, steve.dower, tim.golden, zaazbb, zach.ware priority: normal severity: normal status: open title: nonASCII punctuation characters can not display in python363.chm. type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47304/1512013191(1).jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 00:39:15 2017 From: report at bugs.python.org (Brian Jarvis) Date: Thu, 30 Nov 2017 05:39:15 +0000 Subject: [issue32175] Add hash auto-randomization Message-ID: <1512020355.45.0.213398074469.issue32175@psf.upfronthosting.co.za> New submission from Brian Jarvis : Hash auto-randomization is a mechanism to detect when a collision attack is underway and switch to a randomized keying scheme at that point. This patch is for the 2.7 branch, where hash randomization is not on by default. Using collided strings from https://github.com/Storyyeller/fnv-collider/tree/master/collided_strings, 10 "attacks" of roughly 50,000 collided strings were launched against this. The unmodified Python had a median insert time of roughly 4.32 seconds and a median retrieve time of roughly 4.40 seconds. With the auto-randomized version of Python, the median insert time was roughly 3.99 seconds and median retrieve time was roughly 3.57 seconds. This is a 7.7% and 18.9% savings, respectively. ---------- files: auto_rand_2.7.patch keywords: patch messages: 307278 nosy: bjarvis priority: normal severity: normal status: open title: Add hash auto-randomization type: enhancement versions: Python 2.7 Added file: https://bugs.python.org/file47305/auto_rand_2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 02:39:35 2017 From: report at bugs.python.org (Dan Snider) Date: Thu, 30 Nov 2017 07:39:35 +0000 Subject: [issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell Message-ID: <1512027575.04.0.213398074469.issue32176@psf.upfronthosting.co.za> New submission from Dan Snider : The following code works in 3.3, 3.4, and 3.5, but in 3.6 it throws RuntimeError: super(): bad __class__ cell. from types import FunctionType, CodeType def create_closure(__class__): return (lambda: __class__).__closure__ def new_code(c_or_f): '''A new code object with a __class__ cell added to freevars''' c = c_or_f.__code__ if isinstance(c_or_f, FunctionType) else c_or_f return CodeType( c.co_argcount, c.co_kwonlyargcount, c.co_nlocals, c.co_stacksize, c.co_flags, c.co_code, c.co_consts, c.co_names, c.co_varnames, c.co_filename, c.co_name, c.co_firstlineno, c.co_lnotab, c.co_freevars + ('__class__',), c.co_cellvars) def add_foreign_method(cls, f): code = new_code(f.__code__) name = f.__name__ defaults = f.__defaults__ closure = (f.__closure__ or ()) + create_closure(cls) setattr(cls, name, FunctionType(code, globals(), name, defaults, closure)) class List(list): def append(self, elem): super().append(elem) def extend(self, elems): super().extend(elems) def __getitem__(self, i): print('foreign getitem') return super().__getitem__(i) add_foreign_method(List, __getitem__) self = List([1,2,3]) self[0] ---------- components: Interpreter Core messages: 307279 nosy: bup priority: normal severity: normal status: open title: Zero argument super is broken in 3.6 for methods with a hacked __class__ cell type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 03:00:17 2017 From: report at bugs.python.org (=?utf-8?q?J=C3=B6rn_Hees?=) Date: Thu, 30 Nov 2017 08:00:17 +0000 Subject: [issue32177] spammers mine emails from bugs.python.org Message-ID: <1512028817.25.0.213398074469.issue32177@psf.upfronthosting.co.za> New submission from J?rn Hees : On every platform that i create an account on, i use a new randomized email address. This allows me to track which platforms sell my account info to spammers. The one i used for bugs.python.org now receives astonishing amounts of spam (mostly bitcoin spam atm). I hope you don't sell the account information of your contributors to third parties, but instead believe in a design flaw of your bug tracking system and some way that spammers can currently harvest the email addresses of all of your contributors. Please investigate how this is possible and ways to protect your user's data. ---------- components: email messages: 307280 nosy: barry, joern, r.david.murray priority: normal severity: normal status: open title: spammers mine emails from bugs.python.org type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 04:02:40 2017 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 30 Nov 2017 09:02:40 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1512032560.68.0.213398074469.issue32171@psf.upfronthosting.co.za> Mark Dickinson added the comment: > I continue to wonder what is the rationale for these specifications So I can't speak with any authority: I'm only an interested bystander when it comes to IEEE 754, but I believe this particular behaviour stems from two desires: 1. The desire that for a general floating-point operation f, f(-0.0) should behave in much the same way as f(+0.0): if one is valid, the other should be too, and in the majority of cases they should give the same result (possibly modulo sign of zero again, and noting that in cases like atan2 there are good reasons to have 0.0 and -0.0 give different results). So this justifies things like `sqrt(-0.0)` giving a zero result (rather than being considered invalid) and `log(-0.0)` giving `-inf`. In the case of interest, this justifies the rule `pow(-0.0, y) = 0.0` for `y` positive and not an odd integer. Note the sign of the result there: what's really going on is that we can't assign a sensible sign to the result (except when `y` is an integer), and so it makes sense to return the more "standard" of the two zeros. 2. The desire to respect symmetries in pow (and other functions). In particular, we should have pow(1/x, y) = 1/pow(x, y). Now plug in x = -0.0 and y = 0.5, and we get: pow(-inf, 0.5) = 1/pow(-0.0, 0.5) = 1/0.0 = inf I guess also: historically, C99 Annex F got there first on specifying corner cases for the more interesting mathematical operations (IEEE 754-1985 only covered basic arithmetic operations; coverage of the transcendental functions and friends didn't happen until IEEE 754-2008), and without a good reason to do otherwise, it makes sense for IEEE 754-2008 to follow what C99 did. So perhaps we should really be asking the C standardisation folks for their rationale. Don't ask me about sqrt(-0.0) returning -0.0 rather than 0.0, though. I have no idea on that one. (Well, I have some ideas about _why_ that ended up being the IEEE 754 specification. I'm still not convinced that it was the right thing to do.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 04:31:19 2017 From: report at bugs.python.org (Fomalhaut Weisszwerg) Date: Thu, 30 Nov 2017 09:31:19 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512034279.23.0.213398074469.issue31705@psf.upfronthosting.co.za> Fomalhaut Weisszwerg added the comment: I've got the same error on CentOS 7.4 on x86_64. --- $ cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) $ uname -a Linux localhost.localdomain 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux $ strace -V strace -- version 4.20 Copyright (c) 1991-2017 The strace developers . This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Optional features enabled: (none) $ cd Python-3.7.0a2 $ strace -v -s 128 -e trace=%network -o strace_py3_7_0a2_test_sha256.log ./python -m test -v test_socket -m test_sha256 == CPython 3.7.0a2 (default, Nov 28 2017, 16:16:49) [GCC 6.4.0] == Linux-3.10.0-693.5.2.el7.x86_64-x86_64-with-centos-7.4.1708-Core little-endian == cwd: /home/vagrant/sources/Python-3.7.0a2/build/test_python_10627 == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 Run tests sequentially 0:00:00 load avg: 0.00 [1/1] test_socket test_sha256 (test.test_socket.LinuxKernelCryptoAPI) ... ERROR ====================================================================== ERROR: test_sha256 (test.test_socket.LinuxKernelCryptoAPI) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vagrant/sources/Python-3.7.0a2/Lib/test/test_socket.py", line 5580, in test_sha256 op.sendall(b"abc") OSError: [Errno 126] Required key not available ---------------------------------------------------------------------- Ran 1 test in 0.006s FAILED (errors=1) test test_socket failed test_socket failed 1 test failed: test_socket Total duration: 98 ms Tests result: FAILURE $ cat strace_py3_7_0a2_test_sha256.log socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 bind(3, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=10628, si_uid=501, si_status=0, si_utime=0, si_stime=0} --- socket(AF_CAN, SOCK_RAW|SOCK_CLOEXEC, 1) = 3 socket(AF_CAN, SOCK_DGRAM|SOCK_CLOEXEC, 6) = -1 EPROTONOSUPPORT (Protocol not supported) socket(AF_RDS, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = -1 EAFNOSUPPORT (Address family not supported by protocol) socket(AF_ALG, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_SCTP) = 3 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_SCTP) = 3 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_SCTP) = 3 socket(AF_ALG, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 3 bind(3, {sa_family=AF_ALG, sa_data="hash\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0sha256\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 88) = 0 accept4(3, NULL, NULL, SOCK_CLOEXEC) = 4 sendto(4, "abc", 3, 0, NULL, 0) = -1 ENOKEY (Required key not available) +++ exited with 2 +++ --- By contrast, I can get a expected result on Debian: --- $ uname -a Linux debian-server 4.13.0-1-amd64 #1 SMP Debian 4.13.13-1 (2017-11-16) x86_64 GNU/Linux $ cd Python-3.7.0a2 $ strace -v -s 128 -e trace=%network -o strace.log ./python -m test -v test_socket -m test_sha256 == CPython 3.7.0a2 (default, Nov 29 2017, 18:47:33) [GCC 7.2.0] == Linux-4.13.0-1-amd64-x86_64-with-debian-buster-sid little-endian == cwd: /home/working/Python-3.7.0a2/build/test_python_21000 == CPU count: 24 == encodings: locale=UTF-8, FS=utf-8 Run tests sequentially 0:00:00 load avg: 0.07 [1/1] test_socket test_sha256 (test.test_socket.LinuxKernelCryptoAPI) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK 1 test OK. Total duration: 43 ms Tests result: SUCCESS $ cat strace.log socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 bind(3, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=21041, si_uid=1000, si_status=0, si_utime=0, si_stime=0} --- socket(AF_CAN, SOCK_RAW|SOCK_CLOEXEC, 1) = 3 socket(AF_CAN, SOCK_DGRAM|SOCK_CLOEXEC, 6) = -1 EPROTONOSUPPORT (Protocol not supported) socket(AF_RDS, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = -1 EAFNOSUPPORT (Address family not supported by protocol) socket(AF_ALG, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_SCTP) = 3 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_SCTP) = 3 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_SCTP) = 3 socket(AF_ALG, SOCK_SEQPACKET|SOCK_CLOEXEC, 0) = 3 bind(3, {sa_family=AF_ALG, sa_data="hash\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0sha256\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 88) = 0 accept4(3, NULL, NULL, SOCK_CLOEXEC) = 4 sendto(4, "abc", 3, 0, NULL, 0) = 3 recvfrom(4, "\272x\26\277\217\1\317\352AA@\336]\256\"#\260\3a\243\226\27z\234\264\20\377a\362\0\25\255", 512, 0, NULL, NULL) = 32 accept4(3, NULL, NULL, SOCK_CLOEXEC) = 4 sendto(4, "a", 1, MSG_MORE, NULL, 0) = 1 sendto(4, "b", 1, MSG_MORE, NULL, 0) = 1 sendto(4, "c", 1, MSG_MORE, NULL, 0) = 1 sendto(4, "", 0, 0, NULL, 0) = 0 recvfrom(4, "\272x\26\277\217\1\317\352AA@\336]\256\"#\260\3a\243\226\27z\234\264\20\377a\362\0\25\255", 512, 0, NULL, NULL) = 32 +++ exited with 0 +++ --- ---------- nosy: +Fomalhaut Weisszwerg versions: -Python 3.6 Added file: https://bugs.python.org/file47306/strace_py3_7_0a2_test_sha256.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 04:45:54 2017 From: report at bugs.python.org (=?utf-8?q?J=C3=B6rn_Hees?=) Date: Thu, 30 Nov 2017 09:45:54 +0000 Subject: [issue32177] spammers mine emails from bugs.python.org In-Reply-To: <1512028817.25.0.213398074469.issue32177@psf.upfronthosting.co.za> Message-ID: <1512035154.15.0.213398074469.issue32177@psf.upfronthosting.co.za> J?rn Hees added the comment: oh, how convenient... as a logged in user i can just see every other user's email... but there's more, I can just go to https://bugs.python.org/user?@startwith=0&@pagesize=30000&@sort=username and see all "obfuscated" emails. A low hanging fruits approach very likely will return most of the real emails: '.'.join(s.split()[:-1]) + '@' + s.split()[-1] + '.com' Let me provide you with a preliminary free analysis of the 50 most frequent email domains of all 21803 users on bugs.python.org: 10554, "gmail" 3663, "sourceforge" 411, "yahoo" 179, "googlemail" 176, "co" # low hanging fruits as i said 167, "gmx" 98, "hotmail" 92, "com" # low hanging fruits as i said 81, "google" 69, "163" 62, "redhat" 57, "mail" 51, "ac" 51, "me" 50, "web" 43, "free" 41, "mit" 41, "qq" 40, "org" 33, "iki" 30, "yandex" 28, "python" 25, "comcast" 25, "edu" 25, "pobox" 23, "id" 22, "ibm" 21, "acm" 21, "fastmail" 20, "live" 19, "mac" 18, "mailinator" 18, "net" 17, "126" 17, "gentoo" 17, "seznam" 16, "protonmail" 15, "aol" 15, "intel" 14, "debian" 13, "canonical" 13, "email" 13, "laposte" 12, "inbox" 12, "ubuntu" 12, "verizon" 12, "xs4all" 11, "icloud" 11, "ieee" 11, "posteo" Please make this a bit harder! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 05:40:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 10:40:27 +0000 Subject: [issue32101] Add PYTHONDEVMODE=1 to enable the developer mode In-Reply-To: <1511233137.85.0.213398074469.issue32101@psf.upfronthosting.co.za> Message-ID: <1512038427.04.0.213398074469.issue32101@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 5e3806f8cfd84722fc55d4299dc018ad9b0f8401 by Victor Stinner in branch 'master': bpo-32101: Add PYTHONDEVMODE environment variable (#4624) https://github.com/python/cpython/commit/5e3806f8cfd84722fc55d4299dc018ad9b0f8401 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 05:40:34 2017 From: report at bugs.python.org (Massimiliano Torromeo) Date: Thu, 30 Nov 2017 10:40:34 +0000 Subject: [issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError Message-ID: <1512038434.94.0.213398074469.issue32178@psf.upfronthosting.co.za> New submission from Massimiliano Torromeo : With some malformed email address list, the parser for email groups raises an `IndexError` instead of the correct `HeaderParseError`. This results in a complete failure to parse the email while it is still preferable to just ignore the malformed header. An example of such a malformed list is this: `To: :Foo ` ---------- components: email messages: 307285 nosy: Massimiliano Torromeo, barry, r.david.murray priority: normal pull_requests: 4556 severity: normal status: open title: Some invalid email address groups cause an IndexError instead of a HeaderParseError type: behavior versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 05:49:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 10:49:45 +0000 Subject: [issue32101] Add PYTHONDEVMODE=1 to enable the developer mode In-Reply-To: <1511233137.85.0.213398074469.issue32101@psf.upfronthosting.co.za> Message-ID: <1512038985.13.0.213398074469.issue32101@psf.upfronthosting.co.za> STINNER Victor added the comment: Thanks Antoine and Nick for reviews and the feedback! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 05:53:24 2017 From: report at bugs.python.org (Oleg K) Date: Thu, 30 Nov 2017 10:53:24 +0000 Subject: [issue32104] add method throw() to asyncio.Task In-Reply-To: <1511275452.66.0.213398074469.issue32104@psf.upfronthosting.co.za> Message-ID: <1512039204.48.0.213398074469.issue32104@psf.upfronthosting.co.za> Oleg K added the comment: What is an "advanced" task? Why CancelledError is not enough? What's the actual use case? ---------------------- for instance, i want to create a task which is responsible for controlling a "slow resource" that should accessed carefully not to DOS it, that could be an long running api call, or report generation procedure, or slow sqlite query. that task may be interrupted when program needs to respond quickly for example UI is requesting another action with that slow resource, that should happen asap. if i could throw custom exception, that task would suspend or interrupt current action, then execute something new and urgent, and then continue where it left of. ----------------------------------------------------- also there is another case i have in mind, there is a task which monitors video stream with different means to see if that stream is alive an fine, it uses external calls to ffmpeg to check how the stream is doing, - that monitoring procedure is continuous always running task, sometimes there is a network problem or one of CDN servers go down, when that event is happening i need to throw custom exception to that "monitoring task" no matter at which stage it is at. when that task will get custom exception it will not exit but will switch to different operation mode, it should not exit because the monitoring is continuous process , it just hast to interpret its measurements differently, and use different ways to measure video state. --- I hope i made clear examples, lmk if you need more details. thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 05:56:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 10:56:44 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512039404.18.0.213398074469.issue31705@psf.upfronthosting.co.za> STINNER Victor added the comment: Charalampos Stratakis told me that the test pass on kernel 4.11. The bug comes from the kernel, there is nothing that Python can do to workarond this kernel bug. So I suggest to skip the test on kernel < 4.11, or at least skip it on ppc64 with kernel < 4.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:09:40 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 11:09:40 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512040180.6.0.213398074469.issue31705@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +4557 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:13:47 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 11:13:47 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512040427.84.0.213398074469.issue31705@psf.upfronthosting.co.za> STINNER Victor added the comment: Charalampos Stratakis, Ryan Decker, Fomalhaut Weisszwerg: * What is the value of os.uname().machine on ppc64le? 'ppc64le'? Is there a 'ppcbe' architecture? * Can you please try attached PR 4643 on a kernel 3.10 and confirms that the test is skipped, and maybe also test it on a kernel 4.11 and newer and confirms that the test pass? To test the PR, you can download the PR as a patch and apply it using "patch -p1 < 4643.patch": https://github.com/python/cpython/pull/4643.patch It would be nice to get the exact version in which sha256 was fixed on ppc64, but it's not a requirements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:23:03 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 11:23:03 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512040983.31.0.213398074469.issue31705@psf.upfronthosting.co.za> STINNER Victor added the comment: > It would be nice to get the exact version in which sha256 was fixed on ppc64, but it's not a requirements. Ah, I think that I found the bugfix (8 Jan 2016): https://github.com/torvalds/linux/commit/6de62f15b581 So it was fixed in the kernel 4.5. I found also https://access.redhat.com/errata/RHSA-2017:2437 : "The lrw_crypt() function in 'crypto/lrw.c' in the Linux kernel before 4.5 allows local users to cause a system crash and a denial of service by the NULL pointer dereference via accept(2) system call for AF_ALG socket without calling setkey() first to set a cipher key. (CVE-2015-8970, Moderate)" So I will simply skip test_sha256() on all architectures for kernel older than 4.5. You can now ignore my questions in my previous comment ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:25:27 2017 From: report at bugs.python.org (Massimiliano Torromeo) Date: Thu, 30 Nov 2017 11:25:27 +0000 Subject: [issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError In-Reply-To: <1512038434.94.0.213398074469.issue32178@psf.upfronthosting.co.za> Message-ID: <1512041127.96.0.213398074469.issue32178@psf.upfronthosting.co.za> Massimiliano Torromeo added the comment: In case an address email header contains and empty string, the tokenizer return a BareQuotedString which is also a TokenList, but this list is empty and the parser fails to check this and insteads raises an IndexError. For example an email with this header will trigger the IndexError: ReplyTo: "" ---------- keywords: +patch pull_requests: +4558 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:27:18 2017 From: report at bugs.python.org (Massimiliano Torromeo) Date: Thu, 30 Nov 2017 11:27:18 +0000 Subject: [issue32179] Empty email address in headers triggers an IndexError Message-ID: <1512041238.12.0.213398074469.issue32179@psf.upfronthosting.co.za> New submission from Massimiliano Torromeo : In case an address email header contains and empty string, the tokenizer return a BareQuotedString which is also a TokenList, but this list is empty and the parser fails to check this and insteads raises an IndexError. For example an email with this header will trigger the IndexError: ReplyTo: "" ---------- components: email messages: 307292 nosy: barry, mtorromeo, r.david.murray priority: normal pull_requests: 4559 severity: normal status: open title: Empty email address in headers triggers an IndexError type: behavior versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:28:17 2017 From: report at bugs.python.org (Massimiliano Torromeo) Date: Thu, 30 Nov 2017 11:28:17 +0000 Subject: [issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError In-Reply-To: <1512038434.94.0.213398074469.issue32178@psf.upfronthosting.co.za> Message-ID: <1512041297.51.0.213398074469.issue32178@psf.upfronthosting.co.za> Change by Massimiliano Torromeo : ---------- pull_requests: -4558 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:29:01 2017 From: report at bugs.python.org (Massimiliano Torromeo) Date: Thu, 30 Nov 2017 11:29:01 +0000 Subject: [issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError In-Reply-To: <1512038434.94.0.213398074469.issue32178@psf.upfronthosting.co.za> Message-ID: <1512041341.75.0.213398074469.issue32178@psf.upfronthosting.co.za> Massimiliano Torromeo added the comment: Disregard my last message, I posted it in the wrong bug report by mistake. Sorry about the noise ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:31:47 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Thu, 30 Nov 2017 11:31:47 +0000 Subject: [issue32180] bool() vs len() > 0 on lists Message-ID: <1512041507.48.0.213398074469.issue32180@psf.upfronthosting.co.za> New submission from ????? ???????? : Please make bool() on lists at least as fast as len() > 0 on lists is. The trivial approach would be to define __bool__ on lists, that do something like "True if self else False". python3 Python 3.6.3+ (heads/3.6-dirty:2b5cbbb13c, Nov 1 2017, 19:03:09) [GCC 6.4.1 20171025] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import timeit >>> timeit.timeit('len([]) > 0') 0.0983404889702797 >>> timeit.timeit('bool([])') 0.15502946823835373 >>> timeit.timeit('True if [] else False') 0.03108721226453781 >>> timeit.timeit('len([1]) > 0') 0.11656427383422852 >>> timeit.timeit('bool([1])') 0.19317257404327393 >>> timeit.timeit('True if [1] else False') 0.057590410113334656 ---------- messages: 307294 nosy: dilyan.palauzov priority: normal severity: normal status: open title: bool() vs len() > 0 on lists type: performance versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:35:35 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 30 Nov 2017 11:35:35 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1512041735.02.0.213398074469.issue32166@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:37:14 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 30 Nov 2017 11:37:14 +0000 Subject: [issue32175] Add hash auto-randomization In-Reply-To: <1512020355.45.0.213398074469.issue32175@psf.upfronthosting.co.za> Message-ID: <1512041834.39.0.213398074469.issue32175@psf.upfronthosting.co.za> Christian Heimes added the comment: Raymond, dicts are your area of expertise. I'm -0 on the patch. The check is going to slow down dicts and it's really easy to enable randomization with an env var or command line argument. ---------- assignee: -> rhettinger nosy: +christian.heimes, rhettinger, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:52:53 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 30 Nov 2017 11:52:53 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1512042773.25.0.213398074469.issue16487@psf.upfronthosting.co.za> Christian Heimes added the comment: I'm -1 on the patch. Any new feature and API shall follow https://www.python.org/dev/peps/pep-0543/. I have some code that adds a proper Certificate class that wraps OpenSSL's X509* type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:54:39 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 11:54:39 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1512042879.39.0.213398074469.issue32166@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Andrew! This have made the code cleaner. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:58:08 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 30 Nov 2017 11:58:08 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1512043088.83.0.213398074469.issue16487@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Christian, what is the status of PEP 543? Is someone actively working on it? Should we hope for a resolution (i.e. an implementation accepted in the stdlib) in the near future? I'm worried about such purity arguments. It reminds me of when we decided to freeze distutils because distutils2 was to become the future (and then distlib took that place, etc.). In the end "the future" hasn't really happened and distutils has rotten without a clear path forward for users (except the venerable setuptools, which has its own issues). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 07:03:39 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 30 Nov 2017 12:03:39 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1512043419.56.0.213398074469.issue16487@psf.upfronthosting.co.za> Christian Heimes added the comment: I'm working on a PEP that builds on top of PEP 543 and addresses some issues like IDNA #28414, OpenSSL/LibreSSL compatibility, hostname verification, verification chain, and TLS 1.3. As part of the PEP implementation, I'll add a certificate class. I don't to introduce yet another way to load a certificate. The C code is already complicated enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 07:10:17 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 12:10:17 +0000 Subject: [issue32180] bool() vs len() > 0 on lists In-Reply-To: <1512041507.48.0.213398074469.issue32180@psf.upfronthosting.co.za> Message-ID: <1512043817.71.0.213398074469.issue32180@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The cause of len() been faster than bool() is the same as why repr() is faster than str(). [1] len() and repr() are functions that just call corresponding slots, while bool() and str() are constructors. In most cases you shouldn't use `bool(obj)` or `len(obj) > 0`. Instead use just `obj` in conditions. If you can provide a patch that speeds up constructions of simple class instances, please open a pull request on GitHub. Otherwise this issue will be closed. [1] https://stackoverflow.com/questions/45376719/why-is-reprint-faster-than-strint ---------- nosy: +serhiy.storchaka status: open -> pending versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 07:39:25 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 30 Nov 2017 12:39:25 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1512045565.07.0.213398074469.issue32166@psf.upfronthosting.co.za> Andrew Svetlov added the comment: You are welcome! Thanks for review ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 07:41:27 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 30 Nov 2017 12:41:27 +0000 Subject: [issue27172] Undeprecate inspect.getfullargspec() In-Reply-To: <1464767888.9.0.788649321892.issue27172@psf.upfronthosting.co.za> Message-ID: <1512045687.86.0.213398074469.issue27172@psf.upfronthosting.co.za> Nick Coghlan added the comment: If there was a documented deprecation that said "Use instead", I'd be OK with that. The part I wasn't OK with is multiple projects each copying & pasting their own variant of the getfullargspec code and accessing private inspect module APIs in order to get the old behaviour back. So in order to move this to PyPI instead, we'd need to offer a completely public API that was equivalent to `_signature_from_callable(func, follow_wrapper_chains=False, skip_bound_arg=False, sigcls=Signature)` `inspect.Signature.from_callable(func, follow_wrapped=False)` comes very close, but misses a subtlety where "getfullargspec" will mention "self" for bound methods, even though it's implicitly supplied, and doesn't need to be supplied by the caller. That aspect could potentially just be deprecated outright though, with the PyPI replacement following inspect.signature's behaviour and reporting the actual call signature of the bound method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 07:53:45 2017 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 30 Nov 2017 12:53:45 +0000 Subject: [issue27172] Undeprecate inspect.getfullargspec() In-Reply-To: <1464767888.9.0.788649321892.issue27172@psf.upfronthosting.co.za> Message-ID: <1512046425.14.0.213398074469.issue27172@psf.upfronthosting.co.za> Nick Coghlan added the comment: I'll also note that one possible alternative would be to accept Ryan's original proposal, which was to make "skip_bound_arg=False" part of the public API for `inspect.Signature.from_callable`. Keeping `getfullargspec` around (but discouraged for new code), seems nicer to me than doing that, though, since the *only* use case we're aware of for that behaviour toggle is to be able to emulate inspect.getfullargspec() atop inspect.Signature(). TOOWTDI simply doesn't strike me as a good enough reason to break working code in this case - there *is* an obvious way for new code (inspect.signature), and there are plenty of other standard library APIs that we keep around primarily for backwards compatibility reasons, even though we don't necessarily recommend using them any more. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 07:58:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 12:58:50 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512046730.6.0.213398074469.issue31705@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 86afc1f2a7fb3afe00779c6426bc141bc795d9a3 by Victor Stinner in branch 'master': Skip test_socket.test_sha256() on linux < 4.5 (#4643) https://github.com/python/cpython/commit/86afc1f2a7fb3afe00779c6426bc141bc795d9a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 07:58:59 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 30 Nov 2017 12:58:59 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512046739.29.0.213398074469.issue31705@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4560 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:04:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 13:04:29 +0000 Subject: [issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events In-Reply-To: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> Message-ID: <1512047069.77.0.213398074469.issue32166@psf.upfronthosting.co.za> STINNER Victor added the comment: > Thank you Andrew! This have made the code cleaner. Yeah! I really love to see old these old crappy legacy stuff to go away. The asyncio code behave shorter, simpler and with less "#ifdef" ;-) I understand that the Python language and stdlib became better the last 2-3 years ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:28:31 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Thu, 30 Nov 2017 13:28:31 +0000 Subject: [issue32180] bool() vs len() > 0 on lists In-Reply-To: <1512041507.48.0.213398074469.issue32180@psf.upfronthosting.co.za> Message-ID: <1512048511.36.0.213398074469.issue32180@psf.upfronthosting.co.za> ????? ???????? added the comment: To my understanding this optimization (bool([]) faster than len([])) cannot be made until PyObject_Bool is introduced, similar to PyObject_Repr and PyObject_Length. Am I not going to provide a patch. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:29:19 2017 From: report at bugs.python.org (Oleg K) Date: Thu, 30 Nov 2017 13:29:19 +0000 Subject: [issue32181] runaway Tasks with Task.cancel() ignored. Message-ID: <1512048559.34.0.213398074469.issue32181@psf.upfronthosting.co.za> New submission from Oleg K : (tested in VM and in real linux) there is an issue with Task, in some cases task will ignore cancellation and will keep running for a while. there is some explanation needed regarding the python_task_cancel.py example. 1)there is a async Integer Generator (my_generator) it has sleep() inside, and produces integers. 2)there is async coro test(), which is consumer of integers , it has several while True: consume = yield 3) there are tasks "a_task()", the job task is doing: it reads from generator, and pushes integer to active "async coro test()" my_generator -iterated by-> a_task() -sends Int to-> test() 4) "async coro test()" is protected by lock, so only one task may push value to it at a time. 5) "task_context" is a context manager, a helper which starts tasks and cancels them __aenter__ -> loop.create_task(self.task) __aexit__ -> self.running_task.cancel() here is how is it used async with task_context( async-coro-to-be-started-as-a-task ): # task is created while True: consume = yield if consume > 10 :break # task is CANCELLED ------------------------------------------------------ The Case: the issue is there when there is sequential aenters and aexits async with task_context( async-coro-to-be-started-as-a-task ): # task #1 is created while True: consume = yield if consume > 10 :break # task #1 is CANCELLED async with task_context( async-coro-to-be-started-as-a-task ): # task #2 is created while True: consume = yield if consume > 20 :break # task #2 is CANCELLED async with task_context( async-coro-to-be-started-as-a-task ): # task #3 is created while True: consume = yield if consume > 10 :break # task #3 is CANCELLED what may go wrong here? - at the end there will be 3 live task reading from same generator! 2 tasks have clearly got cancel() call but, according to output they still there and working: there is part of output as a proof: my_generator: [0.3] PRODUCE VALUE 28 send done: 20 task id= 1 will send : 28 task id= 4 consume 3 28 my_generator: [0.3] PRODUCE VALUE 29 send done: 28 task id= 4 will send : 29 task id= 2 consume 3 29 send done: 29 task id= 2 my_generator: [0.4] PRODUCE VALUE 21 will send : 21 task id= 1 consume 3 21 send done: 21 task id= 1 my_generator: [0.3] PRODUCE VALUE 30 will send : 30 task id= 3 consume 3 30 send done: 30 task id= 3 my_generator: [0.3] PRODUCE VALUE 31 will send : 31 task id= 3 "task id= 3" "task id= 2" "task id= 4" that means that all tasks are there!, which should not happen. but, these tasks WILL GET cancellation call execute just after "async coro test()" will exit, that exit somehow will trigger pending exit of tasks, which should have happened long ago!. also, there is no reliable way to wait task termination, which is also major issue with real life asyncio usage, i need to have a mean to wait for task to complete wait until its "finally:" is done and all resources are free. ---------- components: asyncio files: python_task_cancel.py messages: 307307 nosy: Oleg K2, yselivanov priority: normal severity: normal status: open title: runaway Tasks with Task.cancel() ignored. type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47307/python_task_cancel.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:36:49 2017 From: report at bugs.python.org (Fomalhaut Weisszwerg) Date: Thu, 30 Nov 2017 13:36:49 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512049009.75.0.213398074469.issue31705@psf.upfronthosting.co.za> Fomalhaut Weisszwerg added the comment: STINNER Victor Thank you for your info. And this issue occurs not only ppc64le but also x86_64. `uname -a` on my CentOS returns following: Linux localhost.localdomain 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux I think that this issue does not depend on arch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:39:06 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Thu, 30 Nov 2017 13:39:06 +0000 Subject: [issue32180] bool() vs len() > 0 on lists In-Reply-To: <1512041507.48.0.213398074469.issue32180@psf.upfronthosting.co.za> Message-ID: <1512049146.85.0.213398074469.issue32180@psf.upfronthosting.co.za> ????? ???????? added the comment: Under these circumstances https://wiki.python.org/moin/PythonSpeed/PerformanceTips shall be updated to state that "len('a list') > 0" is slower than "True if 'a list' else False" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:43:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 13:43:45 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512049425.97.0.213398074469.issue31705@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 92a2c07b71aefc01f84ba4b0eda8e2a45c1a6b65 by Victor Stinner (Miss Islington (bot)) in branch '3.6': Skip test_socket.test_sha256() on linux < 4.5 (GH-4643) (#4645) https://github.com/python/cpython/commit/92a2c07b71aefc01f84ba4b0eda8e2a45c1a6b65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:45:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 13:45:08 +0000 Subject: [issue32180] bool() vs len() > 0 on lists In-Reply-To: <1512041507.48.0.213398074469.issue32180@psf.upfronthosting.co.za> Message-ID: <1512049508.99.0.213398074469.issue32180@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't know what should mean PyObject_Bool(), but in C code you should use PyObject_IsTrue() for getting the boolean value of the object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:45:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 13:45:43 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512049543.66.0.213398074469.issue31705@psf.upfronthosting.co.za> STINNER Victor added the comment: "And this issue occurs not only ppc64le but also x86_64. (...) I think that this issue does not depend on arch." Thanks for the confirmation. This is what I understood from the Red Hat report, but also the kernel bugfix. test_sha256() is now skipped on all architectures on kernel < 4.5. Thank you for the bug report Charalampos Stratakis! Sorry for the delay, I wasn't sure how to fix it. I didn't know which kernels were impacted, which architectures, and if it was a Python or a kernel bug. (It's definitively a kernel bug.) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 09:07:01 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Thu, 30 Nov 2017 14:07:01 +0000 Subject: [issue32180] bool() vs len() > 0 on lists In-Reply-To: <1512041507.48.0.213398074469.issue32180@psf.upfronthosting.co.za> Message-ID: <1512050821.0.0.213398074469.issue32180@psf.upfronthosting.co.za> ????? ???????? added the comment: Is the speedup a matter of adding "__bool__" to list_methods in object/listobject.c? In any case, I am not in the internals of cpython, so that I am not going to provide a patch. With PyObject_Bool I meant PyObject_IsTrue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 09:21:34 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 14:21:34 +0000 Subject: [issue32175] Add hash auto-randomization In-Reply-To: <1512020355.45.0.213398074469.issue32175@psf.upfronthosting.co.za> Message-ID: <1512051694.55.0.213398074469.issue32175@psf.upfronthosting.co.za> STINNER Victor added the comment: It was decided to leave the hash randomization disabled by default for backward compatibility. It's a deliberate choice. I don't think that we need to go further for Python 2.7. I never considered this denial of service attach as major, there are many other ways to trigger a DoS, and fixing the dict type is not the right way to prevent this class of attacks. HTTP clients and frameworks like http.client and Django implemented other countermeasures like limiting the number of HTTP headers. The problem was correctly fixed in Python 3: randomization enabled by default since Python 3.3, and Python 3.4 now uses SipHash which better hides the hash secret. More info at: * http://python-security.readthedocs.io/vuln/cve-2012-1150_hash_dos.html * http://python-security.readthedocs.io/vuln/cve-2013-7040_hash_not_properly_randomized.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 09:25:56 2017 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 30 Nov 2017 14:25:56 +0000 Subject: [issue31705] test_sha256 from test_socket fails on ppc64le arch In-Reply-To: <1507233504.45.0.213398074469.issue31705@psf.upfronthosting.co.za> Message-ID: <1512051956.59.0.213398074469.issue31705@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: Thanks for the fix Victor! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 09:26:26 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 30 Nov 2017 14:26:26 +0000 Subject: [issue27606] Android cross-built for armv5te with clang and '-mthumb' crashes with SIGSEGV or SIGILL In-Reply-To: <1469363263.55.0.186080490257.issue27606@psf.upfronthosting.co.za> Message-ID: <1512051986.0.0.213398074469.issue27606@psf.upfronthosting.co.za> Xavier de Gaye added the comment: ARMV5TE is deprecated in NDK r16 and will be removed in r17. See https://developer.android.com/ndk/guides/abis.html Closing as won't fix. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 09:29:09 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 14:29:09 +0000 Subject: [issue31851] test_subprocess hangs randomly on Windows with Python 3.x In-Reply-To: <1508781289.15.0.213398074469.issue31851@psf.upfronthosting.co.za> Message-ID: <1512052149.93.0.213398074469.issue31851@psf.upfronthosting.co.za> STINNER Victor added the comment: Bug occurred on AMD64 Windows8.1 Refleaks 3.6: http://buildbot.python.org/all/#/builders/64/builds/52 ... running: test_subprocess (134462 sec) running: test_subprocess (134492 sec) running: test_subprocess (134522 sec) running: test_subprocess (134552 sec) running: test_subprocess (134582 sec) running: test_subprocess (134612 sec) running: test_subprocess (134642 sec) program finished with exit code 1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 09:45:01 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 30 Nov 2017 14:45:01 +0000 Subject: [issue32142] heapq.heappop - documentation misleading or doesn't work In-Reply-To: <1511712348.11.0.213398074469.issue32142@psf.upfronthosting.co.za> Message-ID: <1512053101.37.0.213398074469.issue32142@psf.upfronthosting.co.za> R. David Murray added the comment: I would suggested following the statement "To create a heap, use a list initialized to [], or you can transform a populated list into a heap via function heapify()." with "Any mutation of the list thereafter must maintain the heap invariant in order for the list to remain a heap." ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 10:23:28 2017 From: report at bugs.python.org (=?utf-8?q?Kristj=C3=A1n_Valur_J=C3=B3nsson?=) Date: Thu, 30 Nov 2017 15:23:28 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1512043419.56.0.213398074469.issue16487@psf.upfronthosting.co.za> Message-ID: Kristj?n Valur J?nsson added the comment: OP here, lurking. The need to load server certificates from memory is quite real. Some seven years ago I wrote custom code to handle that for CCPs python branch, and contributed patches to that effect. It's always dismaying to see how peoples efforts get bogged down by one thing or another. So, now there is a pep that prohibits this change? Fun times. 2017-11-30 12:03 GMT+00:00 Christian Heimes : > > Christian Heimes added the comment: > > I'm working on a PEP that builds on top of PEP 543 and addresses some > issues like IDNA #28414, OpenSSL/LibreSSL compatibility, hostname > verification, verification chain, and TLS 1.3. As part of the PEP > implementation, I'll add a certificate class. > > I don't to introduce yet another way to load a certificate. The C code is > already complicated enough. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 10:33:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 15:33:32 +0000 Subject: [issue32183] Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR) Message-ID: <1512056012.34.0.213398074469.issue32183@psf.upfronthosting.co.za> New submission from STINNER Victor : I got a new report from Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR) ** CID 1423265: Insecure data handling (TAINTED_SCALAR) /Modules/main.c: 1393 in pymain_get_env_var_dup() ________________________________________________________________________________________________________ *** CID 1423265: Insecure data handling (TAINTED_SCALAR) /Modules/main.c: 1393 in pymain_get_env_var_dup() 1387 if (!var || var[0] == '\0') { 1388 *dest = NULL; 1389 return 0; 1390 } 1391 1392 size_t len; >>> CID 1423265: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted variable "var" to a tainted sink. [Note: The source code implementation of the function has been overridden by a user model.] 1393 wchar_t *wvar = Py_DecodeLocale(var, &len); 1394 if (!wvar) { 1395 if (len == (size_t)-2) { 1396 /* don't set pymain->err */ 1397 return -2; 1398 } ** CID 1423264: Insecure data handling (TAINTED_SCALAR) /Modules/getpath.c: 909 in calculate_init() ________________________________________________________________________________________________________ *** CID 1423264: Insecure data handling (TAINTED_SCALAR) /Modules/getpath.c: 909 in calculate_init() 903 return err; 904 } 905 906 size_t len; 907 char *path = getenv("PATH"); 908 if (path) { >>> CID 1423264: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted variable "path" to a tainted sink. [Note: The source code implementation of the function has been overridden by a user model.] 909 calculate->path_env = Py_DecodeLocale(path, &len); 910 if (!calculate->path_env) { 911 return DECODE_FAILED("PATH environment variable", len); 912 } 913 } 914 Christian Heimes told me on IRC that Coverity "thinks that all values from getenv are bad". Ok. __coverity_tainted_data_sink__() is supposed to say that we sanitized data, and this is what Py_DecodeLocale() model does: wchar_t *Py_DecodeLocale(const char* arg, size_t *size) { wchar_t *w; __coverity_tainted_data_sink__(arg); __coverity_tainted_data_sink__(size); return w; } I refactored recently Modules/main.c, Modules/getpath.c and PC/getpathp.c code, but the code isn't really new, I mostly "moved" code. Maybe these warnings were simply ignored previously? ---------- components: Interpreter Core messages: 307321 nosy: christian.heimes, vstinner priority: normal severity: normal status: open title: Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR) type: security versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 10:35:34 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 30 Nov 2017 15:35:34 +0000 Subject: [issue32183] Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR) In-Reply-To: <1512056012.34.0.213398074469.issue32183@psf.upfronthosting.co.za> Message-ID: <1512056134.97.0.213398074469.issue32183@psf.upfronthosting.co.za> Change by Christian Heimes : ---------- assignee: -> christian.heimes stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 10:55:02 2017 From: report at bugs.python.org (Martin Richard) Date: Thu, 30 Nov 2017 15:55:02 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1512057302.88.0.213398074469.issue16487@psf.upfronthosting.co.za> Martin Richard added the comment: FWIW, PyOpenSSL allows to load certificates and keys from a memory buffer and much more. It's also fairly easy to switch from ssl to PyOpenSSL. It's probably a viable alternative in many cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 11:03:30 2017 From: report at bugs.python.org (Mike Nerone) Date: Thu, 30 Nov 2017 16:03:30 +0000 Subject: [issue25394] CoroWrapper breaks gen.throw In-Reply-To: <1444757549.53.0.051433336619.issue25394@psf.upfronthosting.co.za> Message-ID: <1512057810.34.0.213398074469.issue25394@psf.upfronthosting.co.za> Mike Nerone added the comment: This was fixed in Python 3.6. See https://github.com/python/asyncio/issues/429 ---------- nosy: +Manganeez _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 11:08:11 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 30 Nov 2017 16:08:11 +0000 Subject: [issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value In-Reply-To: <1511740988.25.0.213398074469.issue32144@psf.upfronthosting.co.za> Message-ID: <1512058091.25.0.213398074469.issue32144@psf.upfronthosting.co.za> R. David Murray added the comment: A note would be too heavy handed. And get_content is a different function from get_payload, so there is no change in behavior, there is a new API with a more consistent behavior. Basically, Python programs in general use \n line endings internally, and email was an exception to that rule (and is no longer, in the new API). (There's a now closed issue about this somewhere in the tracker.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 11:19:27 2017 From: report at bugs.python.org (R. David Murray) Date: Thu, 30 Nov 2017 16:19:27 +0000 Subject: [issue32182] Infinite recursion in email.message.as_string() In-Reply-To: <1512053940.47.0.213398074469.issue32182@psf.upfronthosting.co.za> Message-ID: <1512058767.09.0.213398074469.issue32182@psf.upfronthosting.co.za> R. David Murray added the comment: This is almost certainly either a duplicate or will be fixed by a PR I have pending, that I don't have time to look for right now, that rewrites the folder. I'll try to get to merging that PR soonish, but it might not happen before the holidays ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 11:20:46 2017 From: report at bugs.python.org (Ric Anderson) Date: Thu, 30 Nov 2017 16:20:46 +0000 Subject: [issue32151] -mvenv vs minor python version updates In-Reply-To: <1511804779.33.0.213398074469.issue32151@psf.upfronthosting.co.za> Message-ID: <1512058846.06.0.213398074469.issue32151@psf.upfronthosting.co.za> Ric Anderson added the comment: Okay, are virtual env's expected to not be compatible as well? E.g., I built a venv under 3.5; venv copied in the 3.5 python executable, but not the needed library; should not -mvenv also copy libpython3.5 into the virutal setup or at least include the LD_LIBRARY_PATH to libpython3.5 in bin/activate, so that myenv/bin/python3.5 can find its needed library? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 11:24:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 16:24:57 +0000 Subject: [issue25394] CoroWrapper breaks gen.throw In-Reply-To: <1444757549.53.0.051433336619.issue25394@psf.upfronthosting.co.za> Message-ID: <1512059097.55.0.213398074469.issue25394@psf.upfronthosting.co.za> STINNER Victor added the comment: Sadly, Python 3.5 doesn't accept bugfixes anymore (only security fixes), so I close this issue. Happy to read that a bug was fixed in Python 3.6 ;-) FYI the fix was copied from the GitHub asyncio project to CPython in the commit e3c65a7a228a5808a7af48a47fdd77e982f95d00. ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 11:41:51 2017 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JLQvtC70LrQvtCy?=) Date: Thu, 30 Nov 2017 16:41:51 +0000 Subject: [issue27931] Email parse IndexError <""@wiarcom.com> In-Reply-To: <1472743779.07.0.918992764498.issue27931@psf.upfronthosting.co.za> Message-ID: <1512060111.01.0.213398074469.issue27931@psf.upfronthosting.co.za> ?????????? ?????? added the comment: ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 11:43:25 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 16:43:25 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1512060205.46.0.213398074469.issue32030@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4561 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 12:04:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 17:04:02 +0000 Subject: [issue32030] PEP 432: Rewrite Py_Main() In-Reply-To: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> Message-ID: <1512061442.17.0.213398074469.issue32030@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset bc8ac6b00efcb3c601224b73f64071281f434bcd by Victor Stinner in branch 'master': bpo-32030: Fix _Py_InitializeEx_Private() (#4649) https://github.com/python/cpython/commit/bc8ac6b00efcb3c601224b73f64071281f434bcd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 12:14:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 17:14:43 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512062083.98.0.213398074469.issue20891@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4562 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 12:20:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 17:20:05 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512062405.79.0.213398074469.issue20891@psf.upfronthosting.co.za> STINNER Victor added the comment: > Is this fix released? I can't find it in the changelog? Oops, I lost track of this issue, but it wasn't fixed, no. I just proposed my old fix as a pull requets: PR 4650. > (I faced this bug on 3.5.2, released a couple of months after this bug was closed?) The workaround is to call PyEval_InitThreads() before spawning your first non-Python thread. https://docs.python.org/dev/c-api/init.html#c.PyEval_InitThreads ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 12:20:45 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 17:20:45 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512062445.23.0.213398074469.issue20891@psf.upfronthosting.co.za> STINNER Victor added the comment: I have to check if Python 2.7 is impacted as well. ---------- versions: +Python 3.6, Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 12:55:13 2017 From: report at bugs.python.org (nartes) Date: Thu, 30 Nov 2017 17:55:13 +0000 Subject: [issue32184] pdb/ipdb is not usable on Linux (which works on Windows) from a single multiprocessing.Process when the main process is stuck at process.join() Message-ID: <1512064513.87.0.213398074469.issue32184@psf.upfronthosting.co.za> New submission from nartes : https://asciinema.org/a/Sl7BTmS4krLdrLb9c4YeMgAG1 ---------- components: Interpreter Core, Library (Lib) files: parallel_sandbox.py messages: 307332 nosy: nartes priority: normal severity: normal status: open title: pdb/ipdb is not usable on Linux (which works on Windows) from a single multiprocessing.Process when the main process is stuck at process.join() type: behavior versions: Python 2.7, Python 3.6 Added file: https://bugs.python.org/file47308/parallel_sandbox.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:05:09 2017 From: report at bugs.python.org (Matt Davis) Date: Thu, 30 Nov 2017 18:05:09 +0000 Subject: [issue32185] SSLContext.wrap_socket sends SNI Extension when server_hostname is IP Message-ID: <1512065109.64.0.213398074469.issue32185@psf.upfronthosting.co.za> New submission from Matt Davis : The current implementation of SSLContext.wrap_socket blindly sends whatever is passed in server_hostname in the SNI extension, assuming it's a DNS hostname. RFC6066 describes the SNI TLS extension, and specifically states that 'Literal IPv4 and IPv6 addresses are not permitted in "HostName".' The RFC makes no recommendation on how a server implementation that violates this requirement should behave; Microsoft's kernel HTTP listener (http.sys) chooses to abort the connection if SNI has been enabled. In the http.sys case, SNI is a global setting, currently off by default, but if any registered listener has SNI enabled, the connection abort behavior applies to all listeners. SSLContext.wrap_socket() should determine whether server_hostname is an IP address before including the SNI extension. I've submitted a PR to work around this issue in urllib3 (https://github.com/shazow/urllib3/pull/1287) in the meantime, but would be good to get this fixed, especially if Microsoft decides to enable SNI by default at some point. ---------- assignee: christian.heimes components: SSL messages: 307333 nosy: christian.heimes, nitzmahone priority: normal severity: normal status: open title: SSLContext.wrap_socket sends SNI Extension when server_hostname is IP versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:10:09 2017 From: report at bugs.python.org (Christian Heimes) Date: Thu, 30 Nov 2017 18:10:09 +0000 Subject: [issue32185] SSLContext.wrap_socket sends SNI Extension when server_hostname is IP In-Reply-To: <1512065109.64.0.213398074469.issue32185@psf.upfronthosting.co.za> Message-ID: <1512065409.68.0.213398074469.issue32185@psf.upfronthosting.co.za> Christian Heimes added the comment: Thanks! 3.4 and 3.5 are out of scope. They only receive security fixes. For 3.7 https://github.com/python/cpython/compare/master...tiran:openssl_check_hostname will take care of the issue 2.7 and 3.6 are a bit tricky. There is no platform-compatible way to detect if a string is an IP address. inet_pton() is not available on Windows. I cannot use the OpenSSL parser because it is only available in 1.0.2+. 2.7 and 3.6 still support 0.9.8. ---------- nosy: +alex, dstufft, janssen versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:23:26 2017 From: report at bugs.python.org (Nir Soffer) Date: Thu, 30 Nov 2017 18:23:26 +0000 Subject: [issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server Message-ID: <1512066205.79.0.213398074469.issue32186@psf.upfronthosting.co.za> New submission from Nir Soffer : Using io.FileIO can hang all threads when accessing an inaccessible NFS server. To reproduce this, you need to open the file like this: fd = os.open(filename, ...) fio = io.FileIO(fd, "r+", closefd=True) Inside fileio_init, there is a checkfd call, calling fstat without releasing the GIL. This will hang all threads. The expected behavior is blocking only the thread blocked on the system call, so a system stay responsive and can serve other tasks. Here is the log showing this issue, created with the attached reproducer script (fileio_nfs_test.py). # python fileio_nfs_test.py mnt/fileio.out dumbo.tlv.redhat.com 2017-11-30 18:41:49,159 - (MainThread) - pid=3436 2017-11-30 18:41:49,159 - (MainThread) - Opening mnt/fileio.out 2017-11-30 18:41:49,160 - (MainThread) - OK fd=3 2017-11-30 18:41:49,161 - (MainThread) - Starting canary thread 2017-11-30 18:41:49,161 - (Canary) - Blocking access to storage 2017-11-30 18:41:49,169 - (Canary) - If this test is hang, please run: iptables -D OUTPUT -p tcp -d dumbo.tlv.redhat.com --dport 2049 -j DROP 2017-11-30 18:41:49,169 - (Canary) - check 0 2017-11-30 18:41:49,169 - (MainThread) - Waiting until storage is blocked... 2017-11-30 18:41:50,170 - (Canary) - check 1 2017-11-30 18:41:51,170 - (Canary) - check 2 2017-11-30 18:41:52,171 - (Canary) - check 3 2017-11-30 18:41:53,171 - (Canary) - check 4 2017-11-30 18:41:54,172 - (Canary) - check 5 2017-11-30 18:41:55,172 - (Canary) - check 6 2017-11-30 18:41:56,172 - (Canary) - check 7 2017-11-30 18:41:57,173 - (Canary) - check 8 2017-11-30 18:41:58,173 - (Canary) - check 9 2017-11-30 18:41:59,174 - (MainThread) - Opening io.FileIO Everything is hang now! After some time I run this from another shell: iptables -D OUTPUT -p tcp -d dumbo.tlv.redhat.com --dport 2049 -j DROP And now the script is unblocked and finish. 2017-11-30 18:45:29,683 - (MainThread) - OK 2017-11-30 18:45:29,684 - (MainThread) - Creating mmap 2017-11-30 18:45:29,684 - (Canary) - check 10 2017-11-30 18:45:29,684 - (MainThread) - OK 2017-11-30 18:45:29,685 - (MainThread) - Filling mmap 2017-11-30 18:45:29,685 - (MainThread) - OK 2017-11-30 18:45:29,685 - (MainThread) - Writing mmap to storage 2017-11-30 18:45:29,719 - (MainThread) - OK 2017-11-30 18:45:29,719 - (MainThread) - Syncing 2017-11-30 18:45:29,719 - (MainThread) - OK 2017-11-30 18:45:29,720 - (MainThread) - Done We have a canary thread logging every second. Once we tried to open the FileIO, the canary thread stopped - this is possible only if the io extension module was holding the GIL during a blocking call. And here is the backtrace of the hang process in the kernel: # cat /proc/3436/stack [] rpc_wait_bit_killable+0x24/0xb0 [sunrpc] [] __rpc_execute+0x154/0x410 [sunrpc] [] rpc_execute+0x68/0xb0 [sunrpc] [] rpc_run_task+0xf6/0x150 [sunrpc] [] nfs4_call_sync_sequence+0x63/0xa0 [nfsv4] [] _nfs4_proc_getattr+0xcc/0xf0 [nfsv4] [] nfs4_proc_getattr+0x72/0xf0 [nfsv4] [] __nfs_revalidate_inode+0xbf/0x310 [nfs] [] nfs_getattr+0x95/0x250 [nfs] [] vfs_getattr+0x46/0x80 [] vfs_fstat+0x45/0x80 [] SYSC_newfstat+0x24/0x60 [] SyS_newfstat+0xe/0x10 [] system_call_fastpath+0x16/0x1b [] 0xffffffffffffffff You cannot attach to the process with gdb, since it is in D state, but once the process is unblocked, gbd takes control, and we see: Thread 2 (Thread 0x7f97a2ea5700 (LWP 4799)): #0 0x00007f97ab925a0b in do_futex_wait.constprop.1 () from /lib64/libpthread.so.0 #1 0x00007f97ab925a9f in __new_sem_wait_slow.constprop.0 () from /lib64/libpthread.so.0 #2 0x00007f97ab925b3b in sem_wait@@GLIBC_2.2.5 () from /lib64/libpthread.so.0 #3 0x00007f97abc455f5 in PyThread_acquire_lock () from /lib64/libpython2.7.so.1.0 #4 0x00007f97abc11156 in PyEval_RestoreThread () from /lib64/libpython2.7.so.1.0 #5 0x00007f97a44f9086 in time_sleep () from /usr/lib64/python2.7/lib-dynload/timemodule.so #6 0x00007f97abc18bb0 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #7 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 #8 0x00007f97abc183fc in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #9 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 #10 0x00007f97abc183fc in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #11 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 #12 0x00007f97abba494d in function_call () from /lib64/libpython2.7.so.1.0 #13 0x00007f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0 #14 0x00007f97abc135bd in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #15 0x00007f97abc1857d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #16 0x00007f97abc1857d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #17 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 #18 0x00007f97abba4858 in function_call () from /lib64/libpython2.7.so.1.0 #19 0x00007f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0 #20 0x00007f97abb8e995 in instancemethod_call () from /lib64/libpython2.7.so.1.0 #21 0x00007f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0 #22 0x00007f97abc117b7 in PyEval_CallObjectWithKeywords () from /lib64/libpython2.7.so.1.0 #23 0x00007f97abc496e2 in t_bootstrap () from /lib64/libpython2.7.so.1.0 #24 0x00007f97ab91fe25 in start_thread () from /lib64/libpthread.so.0 #25 0x00007f97aaf4434d in clone () from /lib64/libc.so.6 Thread 1 (Thread 0x7f97ac10d740 (LWP 4798)): #0 0x00007f97aaf35154 in _fxstat () from /lib64/libc.so.6 #1 0x00007f97a470ad32 in fileio_init () from /usr/lib64/python2.7/lib-dynload/_io.so #2 0x00007f97abbd565f in type_call () from /lib64/libpython2.7.so.1.0 #3 0x00007f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0 #4 0x00007f97abc140f6 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #5 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 Missing separate debuginfos, use: debuginfo-install python-2.7.5-58.el7.x86_64 ---Type to continue, or q to quit--- #6 0x00007f97abc1b002 in PyEval_EvalCode () from /lib64/libpython2.7.so.1.0 #7 0x00007f97abc3443f in run_mod () from /lib64/libpython2.7.so.1.0 #8 0x00007f97abc355fe in PyRun_FileExFlags () from /lib64/libpython2.7.so.1.0 #9 0x00007f97abc36889 in PyRun_SimpleFileExFlags () from /lib64/libpython2.7.so.1.0 #10 0x00007f97abc47a3f in Py_Main () from /lib64/libpython2.7.so.1.0 #11 0x00007f97aae6dc05 in __libc_start_main () from /lib64/libc.so.6 #12 0x000000000040071e in _start () Looking at python code - there are two helpers in fileio.c that call fstat without releasing the GIL during the call: - https://github.com/python/cpython/blob/2.7/Modules/_io/fileio.c#L145 - https://github.com/python/cpython/blob/2.7/Modules/_io/fileio.c#L161 And both helpers are called from fileio_init (the implementation of io.FileIO()) - https://github.com/python/cpython/blob/2.7/Modules/_io/fileio.c#L332 - https://github.com/python/cpython/blob/2.7/Modules/_io/fileio.c#L366 Reported by RHV user, see https://bugzilla.redhat.com/1518676 (the bug may be private, sorry if you cannot access it). ---------- components: Extension Modules files: fileio_nfs_test.py messages: 307335 nosy: nirs priority: normal severity: normal status: open title: io.FileIO hang all threads if fstat blocks on inaccessible NFS server versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47309/fileio_nfs_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:28:08 2017 From: report at bugs.python.org (Nir Soffer) Date: Thu, 30 Nov 2017 18:28:08 +0000 Subject: [issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server In-Reply-To: <1512066205.79.0.213398074469.issue32186@psf.upfronthosting.co.za> Message-ID: <1512066488.31.0.213398074469.issue32186@psf.upfronthosting.co.za> Nir Soffer added the comment: Forgot to mention - reproducible with python 2.7. Similar issues exists in python 3, but I did not try to reproduce since we are using python 2.7. I posted patches for both 2.7 and master: - https://github.com/python/cpython/pull/4651 - https://github.com/python/cpython/pull/4652 ---------- nosy: +benjamin.peterson, stutzbach, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:29:37 2017 From: report at bugs.python.org (Nir Soffer) Date: Thu, 30 Nov 2017 18:29:37 +0000 Subject: [issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server In-Reply-To: <1512066205.79.0.213398074469.issue32186@psf.upfronthosting.co.za> Message-ID: <1512066577.35.0.213398074469.issue32186@psf.upfronthosting.co.za> Change by Nir Soffer : ---------- keywords: +patch pull_requests: +4563 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:29:45 2017 From: report at bugs.python.org (Nir Soffer) Date: Thu, 30 Nov 2017 18:29:45 +0000 Subject: [issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server In-Reply-To: <1512066205.79.0.213398074469.issue32186@psf.upfronthosting.co.za> Message-ID: <1512066585.24.0.213398074469.issue32186@psf.upfronthosting.co.za> Change by Nir Soffer : ---------- pull_requests: +4564 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:39:31 2017 From: report at bugs.python.org (Brett Cannon) Date: Thu, 30 Nov 2017 18:39:31 +0000 Subject: [issue27172] Undeprecate inspect.getfullargspec() In-Reply-To: <1464767888.9.0.788649321892.issue27172@psf.upfronthosting.co.za> Message-ID: <1512067171.17.0.213398074469.issue27172@psf.upfronthosting.co.za> Brett Cannon added the comment: I'm not saying we remove getfullargspec() **right now**, just that we don't keep it around long-term as it simply can't evolve to keep up with how rich our parameter support is today and might become in the future. And that's why, for me, the deprecation was enough to signal, "this code is here for now and you can use it, but you really need to be aware of some issues that are leading to it being removed". Now obviously you prefer the doc approach for this, Nick, and that's fine since this is quickly devolving into "agree to disagree" as while "there are plenty of other standard library APIs that we keep around primarily for backwards compatibility reasons", I personally would say we should be prepared to deprecate them for Python 4 (which is what I'm talking about here, not e.g. 3.8). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 14:25:46 2017 From: report at bugs.python.org (Tim Peters) Date: Thu, 30 Nov 2017 19:25:46 +0000 Subject: [issue32171] Inconsistent results for fractional power of -infinity In-Reply-To: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> Message-ID: <1512069946.61.0.213398074469.issue32171@psf.upfronthosting.co.za> Tim Peters added the comment: Mark, indeed, in the email from Vincent Lefevre you linked to, his entire argument was: (a) we already specified what happens when the base is a zero; so, (b) for each of the six pow(a_zero, y) cases we specified, derive a matching rule for an inf base via: pow(an_inf, y) = 1/pow(1/an_inf, y) = 1/pow(the_same_sign_zero, y) Looking at the other msgs in that thread, everyone found that instantly compelling. Pierre, give up ;-) These standards are years old already, so it's exceedingly unlikely any specified behavior will ever change again, for "backward compatibility" reasons alone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 09:59:00 2017 From: report at bugs.python.org (Silla Rizzoli) Date: Thu, 30 Nov 2017 14:59:00 +0000 Subject: [issue32182] Infinite recursion in email.message.as_string() Message-ID: <1512053940.47.0.213398074469.issue32182@psf.upfronthosting.co.za> New submission from Silla Rizzoli : Sometimes RFC-correct email headers do not get folded correctly; the example code below results in an infinite recursion exception. import sys import mailbox from email.message import EmailMessage from email.headerregistry import Address from email import policy ePol = policy.SMTP.clone(refold_source='long',max_line_length=78) msg = EmailMessage(ePol) msg['From'] = Address("abcdefgh ijklnopq","a.ijklnopq","antani.com") msg['To'] = (Address("abcdef.ghijklmno at pqrstuvwxyz12345678.it","abcdef.ghijklmnop","pqrstuvwxyz12345678.it"), Address("Jane Doe", "jane", "doe.com")) msg['Subject'] = "Test" msg.set_content("Body") finalMail = msg.as_string() Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/email/message.py", line 968, in as_string return super().as_string(maxheaderlen=maxheaderlen, policy=policy) File "/usr/lib/python3.6/email/message.py", line 158, in as_string g.flatten(self, unixfrom=unixfrom) File "/usr/lib/python3.6/email/generator.py", line 116, in flatten self._write(msg) File "/usr/lib/python3.6/email/generator.py", line 195, in _write self._write_headers(msg) File "/usr/lib/python3.6/email/generator.py", line 222, in _write_headers self.write(self.policy.fold(h, v)) File "/usr/lib/python3.6/email/policy.py", line 183, in fold return self._fold(name, value, refold_binary=True) File "/usr/lib/python3.6/email/policy.py", line 205, in _fold return value.fold(policy=self) File "/usr/lib/python3.6/email/headerregistry.py", line 255, in fold return header.fold(policy=policy) File "/usr/lib/python3.6/email/_header_value_parser.py", line 300, in fold self._fold(folded) File "/usr/lib/python3.6/email/_header_value_parser.py", line 1226, in _fold rest._fold(folded) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 325, in _fold tstr = str(part) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) RecursionError: maximum recursion depth exceeded while calling a Python object ---------- components: email messages: 307319 nosy: Silla Rizzoli, barry, r.david.murray priority: normal severity: normal status: open title: Infinite recursion in email.message.as_string() type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 15:06:47 2017 From: report at bugs.python.org (nartes) Date: Thu, 30 Nov 2017 20:06:47 +0000 Subject: [issue32187] tab completion fails in pdb/ipdb/ipython for python3.8 Message-ID: <1512072407.44.0.213398074469.issue32187@psf.upfronthosting.co.za> New submission from nartes : Python 3.7.0a2+ (heads/master:bc8ac6b00e, Nov 30 2017, 22:14:00) Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: import multiException in thread Thread-38: Traceback (most recent call last): File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py", line 265, in load_grammar return _loaded_grammars[path] KeyError: '/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/python/grammar37.txt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py", line 268, in load_grammar with open(path) as f: FileNotFoundError: [Errno 2] No such file or directory: '/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/python/grammar37.txt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/prompt_toolkit/interface.py", line 865, in run completions = list(buffer.completer.get_completions(document, complete_event)) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/terminal/ptutils.py", line 84, in get_completions yield from self._get_completions(body, offset, cursor_position, self.ipy_completer) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/terminal/ptutils.py", line 94, in _get_completions for c in completions: File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 438, in _deduplicate_completions completions = list(completions) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 1791, in completions for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000): File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 1831, in _completions full_text=full_text, cursor_line=cursor_line, cursor_pos=cursor_column) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 1998, in _complete cursor_pos, cursor_line, full_text) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 1348, in _jedi_matches text, namespaces, column=cursor_column, line=cursor_line + 1) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/jedi/api/__init__.py", line 386, in __init__ super(Interpreter, self).__init__(source, **kwds) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/jedi/api/__init__.py", line 110, in __init__ self._grammar = parso.load_grammar() File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py", line 283, in load_grammar return load_grammar(**kwargs) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py", line 275, in load_grammar raise NotImplementedError(message) NotImplementedError: Python version None is currently not supported. ---------- files: Screenshot from 2017-11-30 23-04-28.png messages: 307339 nosy: nartes priority: normal severity: normal status: open title: tab completion fails in pdb/ipdb/ipython for python3.8 type: crash versions: Python 3.7 Added file: https://bugs.python.org/file47310/Screenshot from 2017-11-30 23-04-28.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 15:07:02 2017 From: report at bugs.python.org (nartes) Date: Thu, 30 Nov 2017 20:07:02 +0000 Subject: [issue32187] tab completion fails in pdb/ipdb/ipython for python3.7 In-Reply-To: <1512072407.44.0.213398074469.issue32187@psf.upfronthosting.co.za> Message-ID: <1512072422.09.0.213398074469.issue32187@psf.upfronthosting.co.za> Change by nartes : ---------- title: tab completion fails in pdb/ipdb/ipython for python3.8 -> tab completion fails in pdb/ipdb/ipython for python3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 15:32:36 2017 From: report at bugs.python.org (nartes) Date: Thu, 30 Nov 2017 20:32:36 +0000 Subject: [issue32187] tab completion fails in pdb/ipdb/ipython for python3.7 In-Reply-To: <1512072407.44.0.213398074469.issue32187@psf.upfronthosting.co.za> Message-ID: <1512073956.37.0.213398074469.issue32187@psf.upfronthosting.co.za> nartes added the comment: installing parse 0.1.1 solves the issue ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 15:48:33 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 20:48:33 +0000 Subject: [issue28416] defining persistent_id in _pickle.Pickler subclass causes reference cycle In-Reply-To: <1476202451.78.0.408768500752.issue28416@psf.upfronthosting.co.za> Message-ID: <1512074913.46.0.213398074469.issue28416@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 986375ebde0dd5ff2b7349e445a06bd28a3a8ee2 by Serhiy Storchaka in branch 'master': bpo-28416: Break reference cycles in Pickler and Unpickler subclasses (#4080) https://github.com/python/cpython/commit/986375ebde0dd5ff2b7349e445a06bd28a3a8ee2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 15:48:42 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 30 Nov 2017 20:48:42 +0000 Subject: [issue28416] defining persistent_id in _pickle.Pickler subclass causes reference cycle In-Reply-To: <1476202451.78.0.408768500752.issue28416@psf.upfronthosting.co.za> Message-ID: <1512074922.27.0.213398074469.issue28416@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4565 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:05:02 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 21:05:02 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512075902.82.0.213398074469.issue20891@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset b4d1e1f7c1af6ae33f0e371576c8bcafedb099db by Victor Stinner in branch 'master': bpo-20891: Fix PyGILState_Ensure() (#4650) https://github.com/python/cpython/commit/b4d1e1f7c1af6ae33f0e371576c8bcafedb099db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:05:40 2017 From: report at bugs.python.org (nartes) Date: Thu, 30 Nov 2017 21:05:40 +0000 Subject: [issue32184] pdb/ipdb is not usable on Linux (which works on Windows) from a single multiprocessing.Process when the main process is stuck at process.join() In-Reply-To: <1512064513.87.0.213398074469.issue32184@psf.upfronthosting.co.za> Message-ID: <1512075940.35.0.213398074469.issue32184@psf.upfronthosting.co.za> nartes added the comment: https://gist.github.com/efe828a7bbac97e02a7d83d2a2d78540 import io import os import sys import multiprocessing class B(multiprocessing.Process): @classmethod def _my_thread(self, a, b): print("Class method as a separate process entry point. (%s, %s)" % (a, b)) def __init__(self, glock, *args, **kwargs): multiprocessing.Process.__init__(self, *args, **kwargs) self.glock = glock def run(self): try: sys.stdin = os.fdopen(0, 'r') sys.stdout = os.fdopen(1, 'w') self._run() except Exception as e: raise e finally: print("Sort of a process destructor, PID = %s" % os.getpid()) for s in [sys.stdin, sys.stdout]: if s is not None and\ hasattr(s, 'close'): s.close() def _run(self): print("Hello, World!") class A: def __init__(self): self.glock = multiprocessing.Lock() def run(self): jobs = [] for k in range(3): jobs.append(B(self.glock)) #jobs.append(B(self.glock, None, None, None)) jobs.append(multiprocessing.Process( target=B._my_thread, args=("one", "two"))) for j in jobs: j.start() for j in jobs: j.join() if __name__ == '__main__': A().run() ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:26:13 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 21:26:13 +0000 Subject: [issue32072] Issues with binary plists In-Reply-To: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> Message-ID: <1512077173.73.0.213398074469.issue32072@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a897aeeef647259a938a36cb5eb6680c86021c6a by Serhiy Storchaka in branch 'master': bpo-32072: Fix issues with binary plists. (#4455) https://github.com/python/cpython/commit/a897aeeef647259a938a36cb5eb6680c86021c6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:26:20 2017 From: report at bugs.python.org (Roundup Robot) Date: Thu, 30 Nov 2017 21:26:20 +0000 Subject: [issue32072] Issues with binary plists In-Reply-To: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> Message-ID: <1512077180.98.0.213398074469.issue32072@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4566 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:28:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 21:28:49 +0000 Subject: [issue32072] Issues with binary plists In-Reply-To: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> Message-ID: <1512077329.39.0.213398074469.issue32072@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:30:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 21:30:41 +0000 Subject: [issue28416] defining persistent_id in _pickle.Pickler subclass causes reference cycle In-Reply-To: <1476202451.78.0.408768500752.issue28416@psf.upfronthosting.co.za> Message-ID: <1512077441.2.0.213398074469.issue28416@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset c91bf742e542dceaf71042a44b5a04fb08bdda70 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-28416: Break reference cycles in Pickler and Unpickler subclasses (GH-4080) (#4653) https://github.com/python/cpython/commit/c91bf742e542dceaf71042a44b5a04fb08bdda70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:38:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 21:38:43 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512077923.96.0.213398074469.issue20891@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4567 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:43:52 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 21:43:52 +0000 Subject: [issue32072] Issues with binary plists In-Reply-To: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> Message-ID: <1512078232.46.0.213398074469.issue32072@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4568 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:48:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 21:48:38 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512078518.36.0.213398074469.issue20891@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +4569 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 16:50:34 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 21:50:34 +0000 Subject: [issue32072] Issues with binary plists In-Reply-To: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> Message-ID: <1512078634.87.0.213398074469.issue32072@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +4570 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 17:14:56 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 22:14:56 +0000 Subject: [issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server In-Reply-To: <1512066205.79.0.213398074469.issue32186@psf.upfronthosting.co.za> Message-ID: <1512080096.08.0.213398074469.issue32186@psf.upfronthosting.co.za> STINNER Victor added the comment: We already release the GIL when calling lseek() in fileio.c, in the portable_lseek() function. So it makes sense to also do it in _io_FileIO_readall_impl() in the same file. os.lseek() also releases the GIL. I found another functions which calls lseek() without releasing the GIL: * the Windows implementation of new_mmap_object() * _Py_DisplaySourceLine() * fp_setreadl() of Parser/tokenizer.c I'm not sure that these 3 functions should be modified. In case of doubt, I prefer to not touch the code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 17:15:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 30 Nov 2017 22:15:35 +0000 Subject: [issue32072] Issues with binary plists In-Reply-To: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> Message-ID: <1512080135.93.0.213398074469.issue32072@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 8cd31082fba88cf0064590fd3d55b6c1c964f11c by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32072: Fix issues with binary plists. (GH-4455) (#4654) https://github.com/python/cpython/commit/8cd31082fba88cf0064590fd3d55b6c1c964f11c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 17:25:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 22:25:26 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for AIX - all versions In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1512080726.52.0.213398074469.issue28009@psf.upfronthosting.co.za> STINNER Victor added the comment: "LGTM. Do you want to write this a pull request?" Michael? You didn't answer to my question. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 17:35:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 22:35:16 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512081316.79.0.213398074469.issue20891@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset be6b74c0795b709c7a04e2187a7e32d08f5155f6 by Victor Stinner in branch '2.7': bpo-20891: Fix PyGILState_Ensure() (#4650) (#4657) https://github.com/python/cpython/commit/be6b74c0795b709c7a04e2187a7e32d08f5155f6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 17:36:51 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 22:36:51 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512081411.52.0.213398074469.issue20891@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset e10c9de9d74fd4c26b32e6719d96f04a5be6987d by Victor Stinner in branch '3.6': bpo-20891: Fix PyGILState_Ensure() (#4650) (#4655) https://github.com/python/cpython/commit/e10c9de9d74fd4c26b32e6719d96f04a5be6987d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 17:46:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 22:46:57 +0000 Subject: [issue20891] PyGILState_Ensure on non-Python thread causes fatal error In-Reply-To: <1394563213.18.0.508100602451.issue20891@psf.upfronthosting.co.za> Message-ID: <1512082017.58.0.213398074469.issue20891@psf.upfronthosting.co.za> STINNER Victor added the comment: Ok, the bug is now fixed in Python 2.7, 3.6 and master (future 3.7). On 3.6 and master, the fix comes with an unit test. Thanks Steve Dower for the bug report, sorry for the long delay, I completely forgot this old bug! Marcin Kasperski: Thanks for the reminder. Sadly, we will have to wait for the next release to get the fix. In the meanwhile, you can workaround the bug by calling PyEval_InitThreads() after Py_Initialize() but before running actual code. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 18:17:52 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 30 Nov 2017 23:17:52 +0000 Subject: [issue32145] Wrong ExitStack Callback recipe In-Reply-To: <1511771653.67.0.213398074469.issue32145@psf.upfronthosting.co.za> Message-ID: <1512083872.21.0.213398074469.issue32145@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- nosy: +ncoghlan type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 18:21:07 2017 From: report at bugs.python.org (Berker Peksag) Date: Thu, 30 Nov 2017 23:21:07 +0000 Subject: [issue32132] Android5 In-Reply-To: <1511620519.25.0.213398074469.issue32132@psf.upfronthosting.co.za> Message-ID: <1512084067.82.0.213398074469.issue32132@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 18:55:37 2017 From: report at bugs.python.org (Dan Snider) Date: Thu, 30 Nov 2017 23:55:37 +0000 Subject: [issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell In-Reply-To: <1512027575.04.0.213398074469.issue32176@psf.upfronthosting.co.za> Message-ID: <1512086137.53.0.213398074469.issue32176@psf.upfronthosting.co.za> Dan Snider added the comment: The hacked cell object using this method appears to be changed to NULL when accessed by frame.f_localsplus. I don't know C well enough to find out what's happening because nothing looks different to me in PyFrame_FastToLocalsWithError. Also creating a closure with: from ctypes import pythonapi, py_object new_cell = pythonapi.PyCell_New new_cell.argtypes = (py_object, ) new_cell.restype = py_object doesn't solve this either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 19:10:50 2017 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Fri, 01 Dec 2017 00:10:50 +0000 Subject: [issue32188] ImpImporter.find_modules removes symlinks in paths Message-ID: <1512087050.24.0.213398074469.issue32188@psf.upfronthosting.co.za> New submission from Henk-Jaap Wagenaar : ImpImporter.find_modules calls os.path.real on the path used: https://github.com/python/cpython/blob/be6b74c0795b709c7a04e2187a7e32d08f5155f6/Lib/pkgutil.py#L181 This means if there is a submodule (foo.bar) which first appears on the path involving a symlink that pkgutil.find_loader('foo').get_filename() has the path with the symlinks removed whereas import foo foo.__file__ does have the symlinks. Note that is in the absence of any PEP302 import hooks. This behaviour comes up in pytest test/plugin collection in virtual environments in Py2.7 on linux where they have a symlinked venv/local/lib before venv/lib on the path and creates problems. There might very well be a good reason the path is made absolute here, however the test suite passes when it is reverted to path = [self.path]. ---------- components: Library (Lib) messages: 307353 nosy: Henk-Jaap Wagenaar priority: normal severity: normal status: open title: ImpImporter.find_modules removes symlinks in paths type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 20:19:01 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Dec 2017 01:19:01 +0000 Subject: [issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server In-Reply-To: <1512066205.79.0.213398074469.issue32186@psf.upfronthosting.co.za> Message-ID: <1512091141.7.0.213398074469.issue32186@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 6a89481680b921e7b317c29877bdda9a6031e5ad by Victor Stinner (Nir Soffer) in branch 'master': bpo-32186: Release the GIL during lseek and fstat (#4652) https://github.com/python/cpython/commit/6a89481680b921e7b317c29877bdda9a6031e5ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 20:19:21 2017 From: report at bugs.python.org (Roundup Robot) Date: Fri, 01 Dec 2017 01:19:21 +0000 Subject: [issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server In-Reply-To: <1512066205.79.0.213398074469.issue32186@psf.upfronthosting.co.za> Message-ID: <1512091161.86.0.213398074469.issue32186@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- pull_requests: +4571 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 20:21:37 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Dec 2017 01:21:37 +0000 Subject: [issue31687] test_semaphore_tracker() of test_multiprocessing_spawn fails randomly (race condition?) In-Reply-To: <1507109795.91.0.213398074469.issue31687@psf.upfronthosting.co.za> Message-ID: <1512091297.13.0.213398074469.issue31687@psf.upfronthosting.co.za> STINNER Victor added the comment: x86 Tiger 3.x: http://buildbot.python.org/all/#/builders/30/builds/260 ====================================================================== FAIL: test_semaphore_tracker (test.test_multiprocessing_forkserver.TestSemaphoreTracker) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 4380, in test_semaphore_tracker _multiprocessing.sem_unlink(name2) AssertionError: OSError not raised ====================================================================== FAIL: test_forkserver_sigkill (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 653, in test_forkserver_sigkill self.check_forkserver_death(signal.SIGKILL) File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 643, in check_forkserver_death self.assertTrue(evt.is_set()) AssertionError: False is not true ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 21:38:08 2017 From: report at bugs.python.org (stevezh) Date: Fri, 01 Dec 2017 02:38:08 +0000 Subject: [issue31687] test_semaphore_tracker() of test_multiprocessing_spawn fails randomly (race condition?) In-Reply-To: <1507109795.91.0.213398074469.issue31687@psf.upfronthosting.co.za> Message-ID: <1512095888.4.0.213398074469.issue31687@psf.upfronthosting.co.za> stevezh added the comment: It maybe the semaphore tracker process doesn't unlink the semaphore as soon as possible when child process exit when the system is slow. Increase test case's time in the child and before assertRaises will help. ---------- nosy: +stevezh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 23:34:24 2017 From: report at bugs.python.org (Nathaniel Smith) Date: Fri, 01 Dec 2017 04:34:24 +0000 Subject: [issue16487] Allow ssl certificates to be specified from memory rather than files. In-Reply-To: <1353078615.85.0.973290481578.issue16487@psf.upfronthosting.co.za> Message-ID: <1512102864.92.0.213398074469.issue16487@psf.upfronthosting.co.za> Nathaniel Smith added the comment: My impression was that progress on PEP 543 is temporarily stalled and not going to be finished for 3.7. Is that wrong? There's going to need to be a significant amount of shimming to implement the PEP 543 interfaces on top of ssl no matter what you do. Maybe it would be best to merge a simple load_cert_chain_from_buffer method now for 3.7, and worry about redesigning the world later? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 23:34:54 2017 From: report at bugs.python.org (Tzu-ping Chung) Date: Fri, 01 Dec 2017 04:34:54 +0000 Subject: [issue32151] -mvenv vs minor python version updates In-Reply-To: <1511804779.33.0.213398074469.issue32151@psf.upfronthosting.co.za> Message-ID: <1512102894.67.0.213398074469.issue32151@psf.upfronthosting.co.za> Tzu-ping Chung added the comment: Not sure if it?s the same thing, but I want to plug in that this can happen when you do a micro upgrade (e.g. 3.5.1 ? 3.5.2) as well. This is because micro updates sometimes bump versions of dependencies (e.g. OpenSSL, Tk), and that breaks theirs links in the venv. Should this also be expected? ---------- nosy: +uranusjr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 23:54:24 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 01 Dec 2017 04:54:24 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1512104064.57.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 73a7e9b10b2ec9636e3c6396cf7b3695f8ed1856 by Nick Coghlan (Serhiy Storchaka) in branch 'master': bpo-10544: Deprecate "yield" in comprehensions and generator expressions. (GH-4579) https://github.com/python/cpython/commit/73a7e9b10b2ec9636e3c6396cf7b3695f8ed1856 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 23:57:38 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 01 Dec 2017 04:57:38 +0000 Subject: [issue32189] SyntaxError for yield expressions inside comprehensions & genexps Message-ID: <1512104258.87.0.213398074469.issue32189@psf.upfronthosting.co.za> New submission from Nick Coghlan : This is the Python 3.8 follow-up to turn the DeprecationWarning from https://bugs.python.org/issue10544 into an unconditional SyntaxError. ---------- messages: 307360 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: SyntaxError for yield expressions inside comprehensions & genexps type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 23:58:26 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 01 Dec 2017 04:58:26 +0000 Subject: [issue10544] yield expression inside generator expression does nothing In-Reply-To: <1290799279.15.0.89740732651.issue10544@psf.upfronthosting.co.za> Message-ID: <1512104306.93.0.213398074469.issue10544@psf.upfronthosting.co.za> Nick Coghlan added the comment: With Serhiy's patch merged, I'm marking this as resolved. Thanks all! https://bugs.python.org/issue32189 is the follow-up issue to turn the warning into an unconditional SyntaxError in 3.8. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________